Basic functionality
The upper level functions trace_footprints and cut_footprints use all the necessary functionality to produce footprints cutouts.
The steps below is a summary of the trace_footprint functionality:
- Instantiate an EdgeDetector object using the AstroData object as input.
- The edge_detector_data() function sets up the mdf dictionary containing instrument specific parameters.
- The class method find_edges() produces a tuple (edges1_xy,edges2_xy) where edges1_xy is the list of (x_array,y_array) coordinates for all the left/bottom edges and edges2_xy is the list of all the corresponding right/top edges for each footprint. For more details please see find_edges.
- Loop through the list of (x_array,y_array) tuples and instantiate one Edge object. Call the fitfunction() Edge method as well.
- With the list of Edge objects for the (left/bottom) edges and the list of Edge objects for the (right/top) edges, instantiate as many a Footprint class objects as there are footprints represented by the (left/bottom),(right/top) Edge objects.
- Instantiate a FootprintTrace class using the list of Footprint objects as input calling the method FootprintTrace.as_bintable to build the TRACEFP table within an output AstroData object.
The steps below is a summary of the cut_footprints functionality:
- Open the FITS file containing the TRACEFP table extension.
- If you have a target spectrum with footprints that matches the ones created by trace_footprint then copy the TRACEFP extension to the AstroData object with target spectrum.
- Instantiate a CutFootprints object using the input AstroData object.
- Execute the method CutFootprints.cut_regions to read the input image and table creating a list of CutFootprint class objects.
- Execute the method CutList.as_astrodata to create as many image extension with one footprint as there are records in the table. Append each extension to the output AstroData object.