def build_rawvarframe(self, trim=True): """ Generate the Raw Variance frame Currently only used by ScienceImage. Wrapper to procimg.variance_frame Returns ------- self.rawvarframe : ndarray """ msgs.info( "Generating raw variance frame (from detected counts [flat fielded])" ) 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.rawvarframe = procimg.variance_frame( datasec_img, self.stack, detector['gain'], detector['ronoise'], darkcurr=detector['darkcurr'], exptime=self.exptime) # Step self.steps.append(inspect.stack()[0][3]) # Return return self.rawvarframe
def build_ivar(self): """ Generate the Inverse Variance frame Uses procimg.variance_frame Returns: np.ndarray: Copy of self.ivar """ msgs.info( "Generating raw variance frame (from detected counts [flat fielded])" ) # Convenience detector = self.spectrograph.detector[self.det - 1] # Generate rawvarframe = procimg.variance_frame( self.datasec_img, self.image, detector['gain'], detector['ronoise'], numamplifiers=detector['numamplifiers'], darkcurr=detector['darkcurr'], exptime=self.exptime, rnoise=self.rn2img) # Ivar self.ivar = utils.inverse(rawvarframe) # Return return self.ivar.copy()
def build_ivar(self): """ Generate the Inverse Variance frame Uses procimg.variance_frame Returns: `numpy.ndarray`_: Copy of self.ivar """ # Generate rawvarframe = procimg.variance_frame( self.datasec_img, self.image, self.detector['gain'], self.detector['ronoise'], darkcurr=self.detector['darkcurr'], exptime=self.exptime, rnoise=self.rn2img) # Ivar self.ivar = utils.inverse(rawvarframe) # Return return self.ivar.copy()