-
-
Notifications
You must be signed in to change notification settings - Fork 38
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 a function to measure cross-dispersion profile #214
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #214 +/- ##
==========================================
+ Coverage 82.16% 83.14% +0.98%
==========================================
Files 10 12 +2
Lines 1015 1086 +71
==========================================
+ Hits 834 903 +69
- Misses 181 183 +2 ☔ View full report in Codecov by Sentry. |
along the dispersion axis. | ||
|
||
If a single number is specified for `pixel`, then the profile at that pixel | ||
(i.e wavelength) will be returned. If several pixels are specified in a list or |
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.
If pixels are mapped to wavelength, can user input the wavelength directly? Does it need units?
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.
my take is that the core routine for this should work in pixel space. if we want to work in wavelength space, then we can wrap or decorate this to accept a WCS and input wavelengths to determine pixel
and pixel_range
.
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.
are you ok with that being a follow up effort?
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.
Do we want this as a method on any of the extraction steps, perhaps on trace itself? If there are other uses, it makes sense to have the general capability as a standalone function, but it might be convenient to be able to call trace.cross_dispersion_profile
and/or trace.plot_cross_dispersion_profile()
, etc.
@camipacifici @kecnry this is ready for a final review - i added some of the tests for a non-flat trace with and without aligning the image along the trace. the only outstanding item is the pixels vs wavelengths thing. right now, since its clear that the input is pixels, i personally think its OK to add wavelength as another parameter (that can't be set simultaneously with pixels) later on. what do you think? |
fb05298
to
f9176b4
Compare
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.
LGTM now, thanks!
Looks great, thank you! |
@@ -1,3 +1,5 @@ | |||
""" | |||
General purpose utilities for specreduce | |||
""" | |||
|
|||
from .utils import * # noqa |
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.
do we want relative imports here? i don't have strong feelings personally, but i've been chided in the past for using them...
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.
i'm not sure?
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.
I don't have an opinion either... we can always change this later if we come up with a policy/standard we want to follow, right?
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.
well, the PEP8 guide recommends absolute imports, fwiw: https://peps.python.org/pep-0008/#imports.
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.
good stuff! thanks for this. a couple minor comments, but otherwise is good to go as far as i'm concerned.
merging this - wavelength input can be addressed in a follow up |
This PR adds a function to measure the cross-dispersion profile at a single wavelength, or the average profile in a set/range of wavelengths. It takes in a 'width' for the window in the cross dispersion axis, which moves around the trace. A 1D array is returned with either the profile at that single wavelength/pixel or the mean or median profile across several wavelength/pixels.