LSSTDESC / descwl_coadd

Tools for coadding using the LSST DM software stack
GNU General Public License v3.0
2 stars 2 forks source link

Keep track of BRIGHT in final coadd mask, keep ormask #54

Closed esheldon closed 3 years ago

esheldon commented 3 years ago
keep track of BRIGHT in the coadd_exp.mask

This coadding mask is currently only being set for EDGE and if it is set
it is considered a bug and raises an exception.  Also add in BRIGHT and
SAT anywhere BRIGHT was set in the warps.  The SAT will prevent
detection in those areas

Updated interp flags to include BRIGHT as it is now required to be added
to the mask plane by the caller.  No longer setting SAT for BRIGHT
at that stage

added verification that EDGE and NO_DATA are not set in the warps

added verification that EDGE is not in the coadd

corrected some typos
esheldon commented 3 years ago

I'm currently setting the observation ormask to the exposure mask, and leaving bmask as zeros

I don't think this is actually used downstream, only the exp.mask is used, but might want to be consistent with DES here.

@beckermr what do you recommend?

beckermr commented 3 years ago

My recommendation is the following:

  1. Compute an OR of all of the flags from the SE input images and put this in the ormask.
  2. For the bit mask of the coadd, send in a mask that has flags for interpolated pixels and bright pixels.
esheldon commented 3 years ago

Then the mask in the exposure would not map to either the obs.bmask or obs.ormask which could be confusing

beckermr commented 3 years ago

Indeed it could be, but I think these masks are the most sensible. The OR mask has data about the inputs to the coadd. The bmask has data about how the coadd was processed in each pixel.

esheldon commented 3 years ago

now I'm not sure why we want 2 separate from 1 since it is a subset

beckermr commented 3 years ago

That's true. We could store them in the same set of bits.

esheldon commented 3 years ago

How about this:

Do 1. as you said for ormask, but make bmask a copy of the mask in the exposure

beckermr commented 3 years ago

Yep. We should keep ormask flags for which pixels got inteprolated too.

esheldon commented 3 years ago

Do you mean define a new mask plane to propagate?

esheldon commented 3 years ago

We could re-use INTERP

but then we would not be able to distinguish between things we interpolated and the stack interpolated, which may be useful especially since with real images both may be happening

esheldon commented 3 years ago

But this would in any case be redundant with the ormask, which is propagating whatever we would have labeled as interpolated

esheldon commented 3 years ago

is this ok to merge?

beckermr commented 3 years ago

Did you want to add the CATSIM download the CI job? Happy to do that in another PR too.

esheldon commented 3 years ago

thanks, let's do it in a different PR