-
Notifications
You must be signed in to change notification settings - Fork 28
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
Generate L3 exposure times from resampled exposure time images #959
Conversation
…mosaic exposure time values.
for more information, see https://pre-commit.ci
… into resample-exptime
Codecov ReportAttention:
📢 Thoughts on this report? Let us know!. |
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.
Besides my small nit it looks good.
total_exposure_time = 0.0 | ||
m = exptime_tot > 0 | ||
if np.any(m): | ||
total_exposure_time = np.median(exptime_tot[m]) |
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 we should label the median exposure time as the total exposure time.
Would is make sense to add an attribute median_exposure_time?
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.
Yeah, changing this is part of the L3 metadata updates; I was just filling up columns. OTOH, the exposure time being computed is the total exposure time for the median pixel with at least some exposure time, so it's not totally crazy---but I agree that we should update the metadata. Do you think that should be part of this PR?
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 think this is urgent.
I'm not too worried about that we can define it this way. I'm more concerned that some automated process will look for total_exposure_time and generate dubious results.
We should probably have a larger discussion with others, INS, SE?, archive?, before making a decision and finalizing the attributes.
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 would need a larger discussion with the other components, INS, SE?, Archive?
So I'd go ahead and merge this and write a follow up ticket.
Currently we generate L3 exposure times as sums of the times of the input exposures. This is awkward since one can imagine having two different level 3 images:
The current code gives an exposure time for both of these L3 images that is 4x the L2 image exposure time. But in case (1) each individual pixel only sees 1x exposure time, so it's weird to say that its exposure time is 4x nominal.
This PR changes that computation so that case (1) gets 1x and case (2) gets 4x, reflecting the actual times the typical pixel sees. It does this by generating a resampled exposure time image that reflects the amount of time each part of the output image sees from input images, and then computing some simple statistics on that exposure time image.
We could consider faster resampling modes to produce these images, but just reusing the existing resampling infrastructure was expedient. This does add another resampling step, though, and so makes things ~25% slower.
Resolves RCAL-696
Regression tests are failing. This is partially expected; the exposure time in the metadata changes intentionally because of this PR, and local runs of the regression test confirm that that change gets picked up and identified as a 'regression.' I also get complaints that the data, context, err, var_rnoise, var_poisson are different. That's also occurring on main, though, and isn't related to this PR. It bears further investigation.
Checklist
CHANGES.rst
under the corresponding subsection