Commit 2310a47d authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

update

parent dee9e0bb
Loading
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -2505,11 +2505,8 @@ class IFSsimulator():
        # zone 2
        self.image_r[1536:3072, 3072:6144] += self.information['exptime'] * \
            self.information['dark4_r']


# #############################################################################


    def applyPoissonNoise(self):

        """
@@ -3251,7 +3248,6 @@ class IFSsimulator():
        self.image_b = np.rint(self.image_b).astype(int)
        self.log.info('Maximum and total values of the image are %i and %i, respectively' % (np.max(self.image_b),
                                                                                             np.sum(self.image_b)))

        # avoid negative numbers in case bias level was not added
        self.image_r[self.image_r < 0.0] = 0.
        # cut of the values larger than max
@@ -3261,62 +3257,46 @@ class IFSsimulator():
        self.log.info('Maximum and total values of the image are %i and %i, respectively' % (np.max(self.image_r),
                                                                                             np.sum(self.image_r)))
# ############################################################################

    # def applyImageShift(self):
    #     """

    #     Returns
    #     -------
    #     None.

    #     """

    #     np.random.seed(9*self.simnumber)
    #     ud = np.random.random()   # Choose a random rotation
    #     dx = 2 * (ud-0.5) * self.information['shiftmax']

    #     np.random.seed(99*self.simnumber)
    #     ud = np.random.random()   # Choose a random rotation
    #     dy = 2 * (ud-0.5) * self.information['shiftmax']

    #     self.image_b = ndimage.shift(self.image_b.copy(), [
    #                                  dy+self.information['shift_b_y'], dx+self.information['shift_b_x']], order=0, mode='nearest')
    #     self.image_r = ndimage.shift(self.image_r.copy(), [
    #                                  dy+self.information['shift_r_y'], dx+self.information['shift_r_x']], order=0, mode='nearest')

    #     self.log.info('Applied image shifting to g r i channels.')
    #     self.information['ra'] = dx*self.information['pixel_size']
    #     self.information['dec'] = dy*self.information['pixel_size']


##############################################################################

    # def applyImageRotate(self):
    #     """

    #     Returns
    #     -------
    #     None.

    #     """
    #     np.random.seed(10*self.simnumber)
    #     ud = np.random.random()   # Choose a random rotation
    #     angle = 2 * (ud-0.5) * self.information['tel_rotmax']

    #     inputimg = self.image_b.copy()
    #     # here we choose reshape=False, the rotated image will
    #     rotimg = ndimage.rotate(
    #         inputimg, angle+self.information['rotate_b'], order=1, reshape=False)
    #     self.image_b = rotimg

    #     inputimg = self.image_r.copy()
    #     # here we choose reshape=False, the rotated image will
    #     rotimg = ndimage.rotate(
    #         inputimg, angle+self.information['rotate_r'], order=1, reshape=False)
    #     self.image_r = rotimg

    #     self.information['Tel_rot'] = angle

    #     self.log.info(
    #         'Applied telescope rotation with angle (in degree)= %f.', angle)
###############################################################################
@@ -3326,7 +3306,6 @@ class IFSsimulator():
        Returns
        -------
        None.

        """
        imgb = self.image_b.copy()
        prescan = int(self.information['prescan'])