-
Notifications
You must be signed in to change notification settings - Fork 0
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 some routines to get background subtracted images #174
Conversation
@javierggt and @taldcroft this could use feedback on organization and names of methods etc. |
Actually it looks like I had some more changes in my local version, so I'll re-request review when those are up. |
2092874
to
c5cca8e
Compare
It's one of those days where I felt like spending too much time making some little code nicer. The hope is to take advantage of the power of
For example:
|
@jeanconn - big picture comment about API. What about sticking with the For existing code I have that grabs ACA images from MAUDE, I'd like an easy way to use this new code to do the dark subtraction on my existing table of images. So that might mean passing in a table of images and having the function return a new table which is matched to the input and contains relevant outputs, most importantly the dark-subtracted image. |
It also occurs to me that we might want to upstream the 3-hr chunking and time limit here to |
It looks like your concept of "get_chunk_times" is pretty general - where should that function live? |
With regard to " What about sticking with the maude_decom.get_aca_images standard of a single Table of images and related columns." - sure - when I wanted the data by slot I figured a compromise between the maude_decom.get_aca_images standard (has one table but a column for slot) and the mica.archive.aca_l0.get_slot_data standard (underlying data is in files by slot so the fetch works by slot) made sense, but if you prefer to use a table with slot as a column that's fine. |
Regarding "I'd like an easy way to use this new code to do the dark subtraction on my existing table of times." - is that a table of times or a table of aca images? I'm a little confused about which piece you want to plug in and where - do you want to point me to which code you had in mind? |
I meant "table of images from The point of a more atomic API (accepting a single table of images) is that if your application is working with a dict of tables, it is trivial to do this in your app:
Whereas if I have a single table with multiple slots included then that can also work with the same functions. If the functions required a dict of table then that wouldn't work. |
Hmm, your guess is as good as mine. |
Right, but wouldn't it make just as much sense to replace the call to |
Regarding "get_chunk_times" I was thinking cxotime first though I suppose it isn't specific to cxotimes. |
1489787
to
b3f58b1
Compare
@jeanconn - I added a few commits. Most importantly I fixed a problem in the tests, and then chose a new time range which causes the tests to now fail (a real bug I believe). Also a bunch of docstring updates for more consistency and a bit more concise. |
chandra_aca/tests/test_aca_image.py
Outdated
col8x8 = row["IMGCOL0_8X8"] | ||
|
||
# If row8x8 or col8x8 is < 0 just skip the test for now | ||
if row8x8 < 0 or col8x8 < 0: |
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.
And I just cheated a bit here as I didn't want to deal with negative indexes in the test.
# If row8x8 or col8x8 is < 0 just skip the test for now | ||
if row8x8 < 0 or col8x8 < 0: | ||
# If row8x8 or col8x8 is < -512 just skip the test for now | ||
if row8x8 < -512 or col8x8 < -512: |
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.
And I have an update to handle the "off the negative CCD edges", but I don't think that we can get real data like that at all, so maybe there is no point.
This improves performance substantially.
It turns out that having that numba function inline within the So I fixed that and then saw that the numba function could be cleaned up as well. |
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 think this is good to go!!
Description
Add some convenience routines to get dark-current background subtracted ACA images.
Interface impacts
Testing
This depends on sot/mica#301 and sot/mica#311 .
Unit tests
Independent check of unit tests by @taldcroft :
Functional tests