esheldon / medsdm

Code to create MEDS files from a dmstack interface
0 stars 1 forks source link

deal with flags #7

Open esheldon opened 7 years ago

esheldon commented 7 years ago
esheldon commented 7 years ago

we still need to figure out the flags, but I'm changing the strategy. Rather than null he weight image for certain flags, do this at read time. That way a mistake now does not propagate into all later analyses

esheldon commented 7 years ago

This is now I think the main issue for doing a meaningful run for any of the codes; we need to know what bits should be considered bad

esheldon commented 7 years ago

@TallJimbo Here is the flag map I think. Currently I am setting the weight map to zero (not using those pixels) except for the two indicated. do you agree with this approach?

HSC_BADPIX_MAP = {
    'BAD':                1,
    'SAT':                2,
    'INTRP':              4,
    'CR':                 8,
    'EDGE':              16, 

    'DETECTED':          32, # should not mask
    'DETECTED_NEGATIVE': 64, # should not mask 

    'SUSPECT':          128,
    'NO_DATA':          256,
    'BRIGHT_OBJECT':    512,
    'CLIPPED':         1024,
    'CROSSTALK':       2048,
    'NOT_DEBLENDED':   4096,
    'UNMASKEDNAN':     8192,
}
TallJimbo commented 7 years ago

Yup, I think that's fine. Some possible modifications to consider (not obviously better than what you have):

esheldon commented 7 years ago

OK, I'll run with what I have for now but leave this issue open so we can optimize later.