Trace finder

This piece of code identifies the location of all the traces on the detector. The traces are identified via sextractor. For each trace store the bounding box, the ridgeline of the trace (Chebyshev polynomial),

Input

  • dome.fits – bias subtracted flat field field (float).

  • seg_dome.fits – segmentation map of flat field file (int).

Output

dome.fits_segments.npy – contains a list (length the number of segments) of dictionaries. Each dictionary contains information about the location of each segment.

  • ok (boolean) – The segment has more than 50 illuminated pixels

  • mean_ys ([float]) – The mean Y location of each pixel in the trace. It’s length is usually between 200 to 270 pixels long.

  • xs ([float]) – The X location of each pixel. It’s length is the same as means. The ridgeline of the trace is constructed from the points in (xs, means).

  • trace_sigma (float) – The 1 \(\sigma\) width of the trace. An in focus image should have a FWHM of about 2.5 pixels and thus sigma should be about 1.06.

  • coeffs_y ([float]) – A list of polynomial coefficients of order len(poly)-1 that is the best fit line to (xs, means). The bulk of this step’s work is to derive poly.