Defects mask for DECam detecor N26 / 57

This seems related to: Gen3 ProcessCcd with DECam - #17 by Paula

I am wondering about the defects mask for DECam detector N26 / 57. It appears to contain a box that masks out a good portion of one amplifier:
image

This box corresponds to these entries in the defects dataset contained in DECam/calib:

x0 y0 width height
812 3069 176 1027
623 3069 188 1027
171 3069 451 1027

Looking at a raw image, there doesn’t appear to be any issue at this location:

Looking at a flat of the same detector, we find a real defect at the x0 location specified by the defects mask (orange circles represent corners of the masked region) but spanning one or a few rows instead of a large region:

I am wondering what the history/status of this defects mask is, as I can’t find reference to it elsewhere, say at Status of DECam CCDs | NOIRLab Science. Could this region have been masked as a box mistakenly when it should be a partial row?

Thanks,
Steven

CC @dinob @ColinOrionChandler

Hi @stevenstetzler – thanks for the question, and for digging quite deeply into this already.

It appears to me that the most recent defects file for DECam CCD N26 is from January 2015 (almost 10 years ago!), so I wouldn’t be surprised if something about DECam CCD performance or understanding of how to calibrate DECam data e.g., for certain CCDs has changed since then. In addition to being old, I believe the relevant defects files were inherited from DES, so questions about their history are probably better addressed to that collaboration than to Rubin/LSST. Setting that aside, are you able to customize the relevant ECSV file within $OBS_DECAM_DATA_DIR/decam/defects of your LSST Pipelines installation? That would seem like a fine solution to me.

Regarding that NOIRLab webpage, I would not necessarily expect it to track closely with LSST Pipelines development — NOIRLab has a different DECam data reduction pipeline (the Community Pipeline), which I would expect to have a series of versions more closely correlating with updates listed on that NOIRLab page.

Also, I believe that at least a couple of the top obs_decam contributors (@parejkoj and @mrawls) are at UW, so you might consider chatting with them as well. Thanks again.

2 Likes

Hi @ameisner, thanks for your help! I just chatted with @parejkoj and he suggested @lskelvin might know more or would at least want to know about this. I think the defects were inherited from DES, so yeah the answer might lie in that realm instead of in this group. I think modifying the ECSV would work for bespoke processing, and if the history of the defects mask is know and it is a confirmed a mistake the modification could be merged into a future release of the pipelines. Knowing what the right mask is seems out of scope for any of us to figure out though unless @lskelvin has worked on this before or we can get an updated mask from DES. @lskelvin do you know anything about this? Or would it be best to ask around in DES for an answer?

Having the right mask is not the highest priority for us right now anyway, but this seemed worth asking about.

Thanks,
Steven

1 Like

Hi @stevenstetzler – I’m not sure who the right person would be to ask within DES, but on the NOIRLab side I’d suggest emailing Frank Valdes, the author of the DECam Community Pipeline software, and ask him whether there’s ever been any major known issue with that big rectangular region of N26. If you’d like I could be the one to email Frank and copy you on that.

It’s hard for me to speculate as I’ve never been part of DES, but it’s a precision cosmology project so for all we know that detector area was flagged so as to be conservative about a subtle effect, rather than to get rid of catastrophically bad data. This also relates to the point that the optimal mask could be a function of the science application, in which case different groups customizing their defect files may be inevitable. Thanks again…

1 Like

Hi @stevenstetzler, I’ve been following this thread with great interest. We indeed are using DECam defects definitions that have their origins from a number of years ago. If there are updates to be made, I think we should aim to merge these into DECam main to support future DECam data reduction efforts with the Science Pipelines. @ameisner, if you are able to find our more information from Frank or others within DES, that would be fantastic, thank you.

1 Like

Thanks @lskelvin. @ameisner I’ve reached out to Frank and a collaborator has reached out to folks in DES about this. I’ll provide an update as we get more information.

1 Like

The result of initial sleuthing is that the DECam CP does mask out the row in question as BAD (see the bpm from DECam Calibration Files | NOIRLab Science) and that the DES folks likely interpret that row as BAD and the pixels that follow that row in readout as SUSPECT, not to be used in precision measurements . However the LSST Science Pipelines are applying a BAD mask to the entire region, causing masking and interpolation over that region e.g. in the top right portion of this difference image:

On GitHub - lsst/obs_decam_data: Repository to hold data related to the obs_decam package. it indicates the current defect mask is compiled from datasets/decam/_internal/calib/bpmDes which I’ve tracked down on the USDF at /sdf/group/rubin/datasets/decam/_internal/calib/bpmDes. I took a look at the mask for detector 57 (/sdf/group/rubin/datasets/decam/_internal/calib/bpmDes/2014-12-05/D_n20150105t0115_c57_r2134p01_bpm.fits) and indeed the mask has value 512 over the region of interest which corresponds to BPMDEF_SUSPECT per DES Image Processing Table 8:

.

The bad row appears in BPMDEF_FLAT_MAX and BPMDEF_WACKY_PIXEL planes as well


My best guess based on this is that the pipelines defects were generated by taking the pixel locations with non-zero values in the bpmDes images. This included the SUSPECT pixels which aren’t necessarily bad, but may mask out large regions like what is seen in detector 57.

@lskelvin if this seems right to you and we don’t want to mask the SUSPECT pixels as bad, it might make sense to rebuild the defect masks from the bpmDes directory excluding the SUSPECT pixels. And/or include information from the existing community pipeline bad pixel masks. What do you think?

1 Like

@stevenstetzler – wow, this was a seriously deep dive…

My best guess based on this is that the pipelines defects were generated by taking the pixel locations with non-zero values in the bpmDes images. This included the SUSPECT pixels which aren’t necessarily bad, but may mask out large regions like what is seen in detector 57.

The obs_decam_data repo’s README seems to say that this is indeed what happened?

These masks are turned in to LSST style mask images with the single BAD bad bit set. Any non-zero pixel in the BPM was assigned the BAD flag.

Thanks!