-
-
Notifications
You must be signed in to change notification settings - Fork 573
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
Fix the way we set date on WCS #7606
base: main
Are you sure you want to change the base?
Conversation
52587ab
to
5f35885
Compare
d91c531
to
4626fd5
Compare
This comment was marked as outdated.
This comment was marked as outdated.
For I'm uneasy that this PR changes how Also, this PR doesn't fix the SPICE problem entirely. The motivation for overriding |
So I have a header which contains these keywords
created using the
I would expect that at least the three Lines 613 to 615 in 767cd79
to this
Incidentally do you need a For STIX we integrate images over 10 of seconds to minutes for the coordinate transforms we use the mean pointing and spacecraft position in this time range so I need to preserve at least |
if self.date_average is not None: | ||
w2.wcs.dateavg = self.date_average.isot | ||
else: | ||
w2.wcs.dateobs = self.date.isot |
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.
Is there a reason that we conditionally set dateobs
? Can we not always set this and then let the map source/.date
decide what actually gets propagated up here?
if self.date_average is not None: | |
w2.wcs.dateavg = self.date_average.isot | |
else: | |
w2.wcs.dateobs = self.date.isot | |
w2.wcs.dateobs = self.date.isot | |
if self.date_average is not None: | |
w2.wcs.dateavg = self.date_average.isot |
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.
The reason that @Cadair is doing this – and one reason for my discomfort with this PR – is because the SPICE map doesn't actually have a source subclass. So, he wants GenericMap
to put the "correct" time(s) in the WCS despite the .date
property returning the "incorrect" 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.
So would you rather we add a spice source map?
I wrote up a (counter-)proposal in #7673 |
Could we split this up two part one that propagates the |
We should be aware that backporting the first part would not be purely informational: because our WCS->frame mapping prioritizes |
I would rather not backport anything unless we really really have to. |
We got an in-person bug report from someone trying to reproject EUI/FSI to a SPICE map. SPICE headers (apparently all SolO data) have date-beg, date-avg and date-end in their header but to "support [...] older software" they also specify date-obs with the same value as date-beg.
All this is to setup the fact that we only set
dateobs
on the WCS we build in map from our date property which (in order) pulls from these sources:.date_average
.date_start
.date_end
This means that the WCS object we build for SPICE (which is a GenericMap) uses
DATE-OBS
which isn't the time corresponding to the observer location, and can in fact be out by hours.This fix priorities setting
wcs.dateavg
which is more correct and should fix the specific SPICE issue.