Exemplo n.º 1
0
    def trace_tilts(self, arcimg, lines_spec, lines_spat, thismask, slit_cen):
        """
        Trace the tilts

        Args:
            arcimg (ndarray): (nspec, nspat) Arc image
            lines_spec (ndarray): (nlines) Array containing the spectral pixel location of each line found for this slit
            lines_spat (ndarray): (nlines)
               Array containing the spatial pixel location of each line, which is the slitcen evaluate at the spectral position position
               of the line stored in lines_spec
            thismask (ndarray): (nspec, nspat), type=bool
               Image indicating which pixels lie on the slit in equation. True = on the slit. False = not on slit
            slit (int): Integer index indicating the slit in question


        Returns:
            dict: Dictionary containing informatin on the traced tilts required to fit the filts.

        """

        trace_dict = tracewave.trace_tilts(
            arcimg, lines_spec, lines_spat, thismask, slit_cen, inmask=self.inmask, fwhm=self.wavepar['fwhm'],
            spat_order=self.par['spat_order'], maxdev_tracefit=self.par['maxdev_tracefit'],
            sigrej_trace=self.par['sigrej_trace'])

        # Load up
        #self.all_trace_dict[slit] = copy.deepcopy(trace_dict)
        # Step
        self.steps.append(inspect.stack()[0][3])
        # Return
        return trace_dict
Exemplo n.º 2
0
    def trace_tilts(self,
                    arcimg,
                    lines_spec,
                    lines_spat,
                    thismask,
                    slit_cen,
                    debug_pca=False,
                    show_tracefits=False):
        """
        Trace the tilts

        Args:

            arcimg (`numpy.ndarray`_):
                Arc image.  Shape is (nspec, nspat).
            lines_spec (`numpy.ndarray`_):
                Array containing the spectral pixel location of each
                line found for this slit.  Shape is (nlines,).
            lines_spat (`numpy.ndarray`_):
               Array containing the spatial pixel location of each line,
               which is the slitcen evaluate at the spectral position
               position of the line stored in lines_spec. Shape is
               (nlines,).
            thismask (`numpy.ndarray`_):
               Image indicating which pixels lie on the slit in
               equation. True = on the slit. False = not on slit.  Shape
               is (nspec, nspat) with dtype=bool.
            slit_cen (:obj:`int`):
                Integer index indicating the slit in question.

        Returns:
            dict: Dictionary containing information on the traced tilts required to fit the filts.

        """
        trace_dict = tracewave.trace_tilts(
            arcimg,
            lines_spec,
            lines_spat,
            thismask,
            slit_cen,
            inmask=self.gpm,
            fwhm=self.wavepar['fwhm'],
            spat_order=self.par['spat_order'],
            maxdev_tracefit=self.par['maxdev_tracefit'],
            sigrej_trace=self.par['sigrej_trace'],
            debug_pca=debug_pca,
            show_tracefits=show_tracefits)

        # Return
        self.steps.append(inspect.stack()[0][3])
        return trace_dict