-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add abstract base class for channels #98
Conversation
This comment was marked as duplicate.
This comment was marked as duplicate.
@nabobalis also brought up the idea of Python 3.8+ protocol classes, which would require making this package Python 3.8+ instead of 3.7+. |
It looks like this package is now 3.8+ if you want to take this approach! |
I've made a first pass at a full implementation of the Additionally, I've mixed abstract properties/methods with concrete implementations of several of the methods. I'm not sure if this is the right way to go about doing this? Should this go in a separate I've also implemented a fairly simple Finally, I think this should not be merged until we've come to a consensus on #111. |
cfefa60
to
f51a009
Compare
This should wait on #98 to be merged such that the appropriate links can be added to the docstrings. This abstract base class should also be tested out in several of the existing instrument packages like |
This comment was marked as duplicate.
This comment was marked as duplicate.
4774c08
to
b1f5541
Compare
I'm not the biggest fan of having an Maybe we could have a |
I like this |
Now that you mention it, I agree!
Sounds great to me! Did you want to make that change? |
Yes, I'm happy to. I'm actively working on the branch at the moment anyway. |
This reverts commit 5620289.
44f99a5
to
bcfe9ab
Compare
The oldest deps build is failing because for some reason it is picking up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good!
Just a general comment - what about non-imaging instruments that could also use this type of implementation?
Also it would be good to have an example added here to on how to use this
""" | ||
Temperature response function for a given instrument channel. | ||
|
||
The temperature response function describes the sensitivity of an imaging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe just a general question - could this not be extended for non-imaging instruments? i.e. so not per pixel? how is this planned to deal with these cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great question. I would hope that yes it could be extended to non-imaging instruments as well. What would the units be in that case? Also, do you have an example of a non-imaging instrument that computes a temperature response? Is it common to compute temperature responses for GOES XRS?
Co-authored-by: Laura Hayes <[email protected]>
Co-authored-by: Laura Hayes <[email protected]>
Co-authored-by: Laura Hayes <[email protected]>
Co-authored-by: Laura Hayes <[email protected]>
Co-authored-by: Laura Hayes <[email protected]>
Co-authored-by: Stuart Mumford <[email protected]>
Yes, I think non-imaging instruments should be able to as well. This should presumably be applicable to any imaging instrument and in the context of just the wavelength-resolved effective area, may also be applicable to spectroscopically-resolved data as well. In the case of the temperature response, this should be applicable to any wavelength-integrated instrument primarily observing optically-thin emission.
We could create a semi-contrived example in the docs. We could also point to how this is done in external packages like aiapy or xrtpy (once that actually happens). I see this as primarily a developer tool rather than a user tool so maybe just a silly contrived example is sufficient. |
We had some discussion about this on the community call today (9/25/24). There is a feeling that this should probably go into the core package ( |
+1 to getting this into core, I think we could have a discussion about the xarray thing when that happens if needed. |
The plan is to merge this and get an alpha release out we can use to experiment on aiapy and xrtpy. |
This PR will add a subpackage tentatively called
abstractions
which will include an abstract base class tentatively calledAbstractChannel
. This PR is so we can iterate upon the design initiated by @wtbarnes.This PR comes after a discussion about how aiapy and xrtpy can have a common interface for calculating effective areas and temperature response functions. Having a common interface would be particularly useful for multi-instrument differential emission measures, and for cross-calibration between different instruments. This could potentially also be useful for other instrument packages like irispy.
This idea is a joint effort among @wtbarnes, @joyvelasquez, @nabobalis, @jslavin, and me.
@nabobalis & @wtbarnes: since you're package maintainers (I think), please feel free to edit this directly.
We can follow up on this with separate PRs for things like
AbstractSpectralModel
, or other things.TODOs before merging:
gain
should be part of the interfaceastropy.time
object? (I think we can do this, but that the parameters would essentially be suggestions and not requirements.) Should we include the spectral model as well?response
aiapy
RefactorChannel
on top ofsunkit_instruments.response.abstractions.AbstractChannel
LM-SAL/aiapy#344xrtpy