Skip to content
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

DM-16297: Changes for Gen3 support of LSST data #170

Merged
merged 8 commits into from Sep 19, 2019
Merged

Conversation

timj
Copy link
Member

@timj timj commented Sep 13, 2019

No description provided.

@timj
Copy link
Member Author

timj commented Sep 16, 2019

I'm not really sure what to do about the changes to ingest.py. On the one hand it's clearly a bug in our headers that INHERIT=T is not set. On the other hand without this fix obs_lsst breaks. We don't want obs_lsst to have a special gen3 ingest task so what's the alternative?

I could check observation type is "science" but it seemed
that checking for tracking RADec would be more reliable
and we can rely on the translator to complain if
RA/Dec is missing when it should be there.
Not all our LSST data includes INHERIT=T so they fail.
We might need an alternative approach here so advice welcomed.
There is no reason to use the pex_exceptions version here.
The warnings are expected for simulation data from the future.
@timj
Copy link
Member Author

timj commented Sep 18, 2019

@czwa, @parejkoj this PR might be the most controversial bit of DM-16297. The problem is the forced merging of the primary header in ingest.py. I don't think we want to have special ingest code for gen3 instruments so this merging (which uses override mode so should be safe) is the general answer in the case where data has forgotten to set INHERIT=T (which is the case for some LSST data).

@TallJimbo
Copy link
Member

I don't have much of a problem with special code for different Gen3 instruments, though it's obviously best minimized. The DM-17023 version of ingest already requires you to provide the fully-qualified Instrument class name via config parameter, so we have a place to hang such hooks (the registration system we had before was always a lie, as you had to import the module that defines that Instrument manually to make it work).

All that said, could we use fix_headers to add INHERIT=T instead?

@timj
Copy link
Member Author

timj commented Sep 18, 2019

fix_headers runs after afwFits.readMetadata so that doesn't help. The code here to merge the headers doesn't actually harm anything since if INHERIT=T the merging would not change anything. The change is if INHERIT=F and that was deliberate.

If ingestion already has to know the Instrument class it is ingesting then I could add a new property to Instrument with a boolean indicating whether merging should happen or not (note that translate_header.py always merges because astropy.io.fits does not automatically follow INHERIT=T whereas afw does).

@TallJimbo
Copy link
Member

To clarify, the only danger here is that some other camera's data intentionally has INHERIT missing (or INHERIT=F?), and this situation is that we just don't think that this is likely?

I don't think I'm particularly worried about that case, especially if we do the merging such that the extension header cards win when there are conflicts with the primary. I guess I don't really have a problem with either approach.

@timj
Copy link
Member Author

timj commented Sep 18, 2019

Yes. The second header always overwrites the first header so what my change does is mean that we always merge even if INHERIT=F and that is only going to be a problem if the first header is completely unrelated to the first empty header. I'm okay with merging the headers now until we get to a point where an instrument turns up where that is bad.

Copy link
Member

@TallJimbo TallJimbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; only one minor comment beyond the (already converged) discussion above.

python/lsst/obs/base/fitsRawFormatterBase.py Show resolved Hide resolved
@timj timj merged commit b5d19ff into master Sep 19, 2019
@timj timj deleted the tickets/DM-16297 branch September 19, 2019 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants