Ejemplo n.º 1
0
    def __call__(self, gmos_raw_object):
        """
        Preparing the Image

        Parameters
        ----------

        gmos_raw_object :

        fname :
            output filename

        write_steps :
            write out the individual steps to the individual fits files

        write_cut_image :
            fits file name to write out the cut_image to



        """

        fits_data = gmos_raw_object.fits.fits_data

        assert len(fits_data) - 1 == 3

        # subtract overscan, get useful part of detector, correct for gain,
        # and set read noise
        if self.read_noise is None:
            read_noise = [
                detector.readout_noise
                for detector in gmos_raw_object.instrument_setup.detectors
            ]
        else:
            read_noise = self.read_noise

        if self.gain is None:
            gain = [
                detector.gain
                for detector in gmos_raw_object.instrument_setup.detectors
            ]
        else:
            gain = self.gain

        fits_file = prepare_frame.prepare(
            fits_data,
            bias_subslice=self.bias_subslice,
            data_subslice=self.data_subslice,
            clip=self.bias_clip_sigma,
            gain=gain,
            read_noise=read_noise,
            combine=self.combine,
            overscan_std_threshold=self.overscan_std_threshold)
        # give each extension a name.  May later add error/mask extensions
        for i, extension in enumerate(fits_file):
            if i > 0:
                extension.name = 'chip{0:d}.data'.format(i)

        return fits_file
Ejemplo n.º 2
0
    def __call__(self, gmos_raw_object):
        """
        Preparing the Image

        Parameters
        ----------

        gmos_raw_object :

        fname :
            output filename

        write_steps :
            write out the individual steps to the individual fits files

        write_cut_image :
            fits file name to write out the cut_image to



        """


        fits_data = gmos_raw_object.fits.fits_data

        assert len(fits_data) - 1 == 3

        # subtract overscan, get useful part of detector, correct for gain,
        # and set read noise
        if self.read_noise is None:
            read_noise = [detector.readout_noise for detector in
                          gmos_raw_object.instrument_setup.detectors]
        else:
            read_noise = self.read_noise

        if self.gain is None:
            gain = [detector.gain for detector in
                    gmos_raw_object.instrument_setup.detectors]
        else:
            gain = self.gain


        fits_file = prepare_frame.prepare(fits_data,
                                    bias_subslice=self.bias_subslice,
                                    data_subslice=self.data_subslice,
                                    clip=self.bias_clip_sigma,
                                    gain=gain, read_noise=read_noise, combine=self.combine,
                                    overscan_std_threshold=self.overscan_std_threshold)
        # give each extension a name.  May later add error/mask extensions
        for i, extension in enumerate(fits_file):
            if i > 0:
                extension.name = 'chip{0:d}.data'.format(i)

        return fits_file
Ejemplo n.º 3
0
 def reduce(self):
     prepared_frame = prepare_frame.prepare(self.fits.fits_data)
     return qmosaic.qmosaic(*prepared_frame[1:4])