Esempio n. 1
0
    def build_rn2img(self):
        """
        Generate the model read noise squared image

        Currently only used by ScienceImage.

        Wrapper to procimg.rn_frame

        Returns:
            `numpy.ndarray`_: Copy of the read noise squared image

        """
        # Check if we need to determine the read noise directly from the overscan region from any amplifier
        numamps = len(self.ronoise)
        for amp in range(numamps):
            if self.ronoise[amp] <= 0.0:
                biaspix = self.rawimage[self.oscansec_img == amp +
                                        1] * self.detector['gain'][amp]
                _, _, stddev = stats.sigma_clipped_stats(biaspix, sigma=5)
                self.ronoise[amp] = stddev
                msgs.info("Read noise of amplifier {0:d} = {1:.3f} e-".format(
                    amp + 1, self.ronoise[amp]))

        # Build it
        self.rn2img = procimg.rn_frame(self.datasec_img, self.detector['gain'],
                                       self.ronoise)
        # Return
        return self.rn2img.copy()
Esempio n. 2
0
    def build_rn2img(self, trim=True):
        """
        Generate the model read noise squared image

        Currently only used by ScienceImage.

        Wrapper to procimg.rn_frame

        Returns
        -------
        self.rn2img : ndarray

        """
        msgs.info(
            "Generating read noise image from detector properties and amplifier layout)"
        )
        datasec_img = self.spectrograph.get_datasec_img(self.files[0],
                                                        det=self.det)
        if trim:
            datasec_img = procimg.trim_frame(datasec_img, datasec_img < 1)
        detector = self.spectrograph.detector[self.det - 1]
        self.rn2img = procimg.rn_frame(datasec_img, detector['gain'],
                                       detector['ronoise'])

        self.steps.append(inspect.stack()[0][3])
        # Return
        return self.rn2img
Esempio n. 3
0
    def build_rn2img(self):
        """
        Generate the model read noise squared image

        Currently only used by ScienceImage.

        Wrapper to procimg.rn_frame

        Returns:
            np.ndarray: Copy of the read noise squared image

        """
        msgs.info(
            "Generating read noise image from detector properties and amplifier layout)"
        )
        # Convenience
        detector = self.spectrograph.detector[self.det - 1]
        datasec_img = self.spectrograph.get_datasec_img(filename=self.filename,
                                                        det=self.det)
        # Build it
        self.rn2img = procimg.rn_frame(datasec_img,
                                       detector['gain'],
                                       detector['ronoise'],
                                       numamplifiers=detector['numamplifiers'])
        # Return
        return self.rn2img.copy()
Esempio n. 4
0
    def build_rn2img(self):
        """
        Generate the model read noise squared image

        Currently only used by ScienceImage.

        Wrapper to procimg.rn_frame

        Returns:
            `numpy.ndarray`_: Copy of the read noise squared image

        """
        # Build it
        self.rn2img = procimg.rn_frame(self.datasec_img, self.detector['gain'],
                                       self.detector['ronoise'])
        # Return
        return self.rn2img.copy()