Commit 3d2380f0 authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

update

parent 9dc4a371
Loading
Loading
Loading
Loading
+34 −34
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ class CDM03bidir():
     :param log: instance to Python logging
     :type log: logging instance
    """

    def __init__(self, settings, data, log=None):
        """
        Class constructor.
@@ -39,7 +40,8 @@ class CDM03bidir():
        :type log: logging instance
        """
        self.data = data
        self.values = dict(quads=(0,1,2,3), xsize=2048, ysize=2066, dob=0.0, rdose=8.0e9)
        self.values = dict(quads=(0, 1, 2, 3), xsize=2048,
                           ysize=2066, dob=0.0, rdose=8.0e9)
        self.values.update(settings)
        self.log = log
        self._setupLogger()
@@ -51,7 +53,8 @@ class CDM03bidir():
        self.params.update(self.values)

        # read in trap information
        trapdata = np.loadtxt(self.values['dir_path']+self.values['paralleltrapfile'])
        trapdata = np.loadtxt(
            self.values['dir_path']+self.values['paralleltrapfile'])
        if trapdata.ndim > 1:
            self.nt_p = trapdata[:, 0]
            self.sigma_p = trapdata[:, 1]
@@ -62,7 +65,8 @@ class CDM03bidir():
            self.sigma_p = [trapdata[1],]
            self.taur_p = [trapdata[2],]

        trapdata = np.loadtxt(self.values['dir_path']+self.values['serialtrapfile'])
        trapdata = np.loadtxt(
            self.values['dir_path']+self.values['serialtrapfile'])
        if trapdata.ndim > 1:
            self.nt_s = trapdata[:, 0]
            self.sigma_s = trapdata[:, 1]
@@ -81,7 +85,6 @@ class CDM03bidir():
            self.nt_s *= 0.576  # thibaut's values traps / pixel  #should be division?
            self.sigma_s *= 1.e4  # thibaut's values in m**2


    def _setupLogger(self):
        """
        Set up the logger.
@@ -90,7 +93,6 @@ class CDM03bidir():
        # if self.log is None:
        #     self.logger = False


    def applyRadiationDamage(self, data, iquadrant=0):
        """
        Apply radian damage based on FORTRAN CDM03 model. The method assumes that
@@ -127,8 +129,8 @@ class CDM03bidir():
                  array will be laid out in memory in C-style (row-major order).

        :return: image that has been run through the CDM03 model
        :rtype: ndarray   
        """""
        :rtype: ndarray """""
        
        # return data

        iflip = iquadrant / 2
@@ -154,7 +156,7 @@ class CDM03bidir():
            self.log.info('jflip=%i' % jflip)

#################################################################################
###modify
# modify
        # sys.path.append('../so')

        # from ifs_so.cdm03.cpython-38-x86_64-linux-gnu import cdm03bidir
@@ -169,9 +171,7 @@ class CDM03bidir():
                                 params,
                                 [data.shape[0], data.shape[1], len(self.nt_p), len(self.nt_s), len(self.params)])

        
        return np.asanyarray(CTIed)

#################################################################################################################
#################################################################################################################
      
+4099 −3264

File changed.

Preview size limit exceeded, changes collapsed.

+3 −3
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ class StrayLight(object):


###############################################################################
### test
# test
# path='/home/yan/MCI/'
# time_jd = 2460417.59979167
# x_sat = -4722.543136
+187 B

File added.

No diff preview for this file type.

+1 −1
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ class StrayLight(object):


###############################################################################
## test
# test
# path='/home/yan/MCI/'
# time_jd = 2460417.59979167
# x_sat = -4722.543136
Loading