austingulliver / chiron_slicer

Processing data pipeline for CHIRON spectrograph.
0 stars 0 forks source link

Normalize the Flat #66

Open Edison1999 opened 4 months ago

Edison1999 commented 4 months ago

How is the pipeline normalizing the flats?

Edison1999 commented 4 months ago

It appears that the normalization procedure is controlled by the flatnorm variable in ctio.par. I was able to find that some of the normalization logic is executed in addflat.pro before trying to create the master flat.

If flatnorm == 3 or 4 following logic for normalization is executed

imswath = im[(sz[2]/2d - swidth):(sz[2]/2d + swidth),]
imswmed = median(imswath, dimen=1, /double)
normval = max(imswmed)
if normval ge redpar.minflatval then begin ctwf++ gdfltidx[j] = 1 ; Used to flag the GOOD FILES where the value used for normalization is greater the constant set as MINflatval normvalarr = [normvalarr, normval] im_arr1[
,,fspot] = im/normval
avgs.add, mean( im_arr1[
,*,fspot], /double)

If 0 or 1 then the flat is not normalized before creating master flat.