Saturday, September 26, 2020

Creating Defect Maps

The ML50100 camera that we are using in our Namid observatory has quite a number of defect rows:





























As visible in this zoom, it's black and white defects:

Some of the defects span the entire column, some only go some way up.

Initially, I ignored these, but they are too many and too prevalent and cause artifacts in the stacked and processed images. So, I looked into DefectMap and CosmeticCorrection. I didn't have much luck with CosmeticCorrection - it didn't clean up my images. And it had A LOT of parameters - too much for my impatience. DefectMap on the other side is nice and simple. Clearly I might leave some data on the table. DefectMap just knows "Pixel Defect" vs. "Pixel OK". And if the pixel is defect it just gets replace by an interpolation based on the pixels around it.

I then tried to figure out how to create a defect map (an image where pixels are either 1 = OK, or are 0 = bad). I ended up creating them manually:

First, I would stack many images of the same binning (no alignment! can be different filters) - no pixel rejection!!!


Then I would zoom into the lower part of the image and slowly scan from one side to another:


Once I reach a defect column, I scroll up until I see the end (or all the way up if the entire column is defect). Now I can use Pixinsights readout to see which coordinates I am. I would do that for all defect columns. 

Finally, I put these coordinates into a PixelMath expression (iif(x)=="bad column", 0, 1) - see full expressions below. Select "Create New Image" under destination and apply this PixelMath process to the image that we created.

The DefectMap process doesn't have a file/view list. I.e. I create an Image Container with all the images that I want to fix and then apply the process to that container. Using the defect maps from below and stacking the same images as before results in this:

The vertical streaks are gone - yei!

Here are the exact expressions that I used. I put them here mostly as a reference for myself in case I need to change or regenerate my defect maps.

1x1: 
iif(x()==212 | 
x()==220 | 
(x()==308 & y()>=5457) | 
(x()==405 & y()>=5686) | 
(x()==419 & y()>=2404) | 
(x()==675 & y()>=5015) | 
(x()==855 & y()>=4662) | 
x()==954 | 
(x()==1444 & y()>=476) | 
(x()==1660 & y()>=594) | 
(x()==1999 & y()>=451) | 
(x()==2609 & y()>=316) | 
(x()==3042 & y()>=5611) | 
(x()==3162 & y()>=4475) | 
(x()==3216 & y()>=4798) | 
(x()==3231 & y()>=381) | 
(x()==3461 & y()>=3868) | 
(x()==3509 & y()>=5645) | 
(x()==3583 & y()>=2380) | 
(x()==3631 & y()>=4101) | 
(x()==4161 & y()>=1949) | 
(x()==4331 & y()>=5718) | 
(x()==4409 & y()>=2365) | 
(x()==4569 & y()>=450) | 
(x()==4778 & y()>=2613) | 
(x()==4992 & y()>=2957) | 
(x()==5461 & y()>=5106) | 
x()==5541 | 
(x()==5763 & y()>=3177) | 
(x()==5859 & y()>=534) | 
(x()==6058 & y()>=5447) | 
x()==6098 | 
(x()==6110 & y()>=3363) | 
(x()==6336 & y()>=4897) | 
x()==6393 | 
(x()==6866 & y()>=2828) | 
(x()==6877 & y()>=5863) | 
x()==7217 | 
(x()==7222 & y()>=1135) | 
(x()==7448 & y()>=3435) | 
x()==7703 | 
x()==7952 ,0,1) 

2x2: 
iif(x()==106 | 
x()==110 | 
x()==453 | 
x()==477 | 
x()==617 | 
x()==632 | 
x()==948 | 
x()==999 | 
x()==1608 | 
x()==1702 | 
x()==1791 | 
x()==2284 | 
x()==2477 | 
x()==2770 | 
x()==3049 | 
x()==3193 | 
x()==3196 | 
x()==3269 | 
x()==3433 | 
x()==3588 | 
x()==3608 | 
x()==3851 | 
x()==3974 | 
x()==3976 | 
x()==4058 | 
(x()==154 & y()>=2741) | 
(x()==202 & y()>=2843) | 
(x()==209 & y()>=1180) | 
(x()==427 & y()>=2341) | 
(x()==722 & y()>=239) | 
(x()==802 & y()>=1249) | 
(x()==830 & y()>=332) | 
(x()==915 & y()>=2321) | 
(x()==1457 & y()>=1887) | 
(x()==1521 & y()>=2807) | 
(x()==1581 & y()>=2237) | 
(x()==1615 & y()>=191) | 
(x()==1754 & y()>=2822) | 
(x()==1815 & y()>=2050) | 
(x()==2165 & y()>=2859) | 
(x()==2080 & y()>=974) | 
(x()==2389 & y()>=1209) | 
(x()==2399 & y()>=1244) | 
(x()==2496 & y()>=1482) | 
(x()==2637 & y()>=2688) | 
(x()==2730 & y()>=2553) | 
(x()==2881 & y()>=1585) | 
(x()==3027 & y()>=2351) | 
(x()==3055 & y()>=1681) | 
(x()==3168 & y()>=2448) | 
(x()==3438 & y()>=2932) | 
(x()==3531 & y()>=1832) | 
(x()==3611 & y()>=567) | 
(x()==3615 & y()>=2041) | 
(x()==3724 & y()>=1709) | 
(x()==3823 & y()>=863) ,0,1)

No comments:

Post a Comment