Commit 2a41df9074cd3eafc8d5650a1d58410c0e88670a
1 parent
1516d46a
Reorder code to reduce code duplication ;)
Showing
2 changed files
with
11 additions
and
11 deletions
cscripts/cslightcrv.py
| ... | ... | @@ -120,8 +120,8 @@ class cslightcrv(ctools.csobservation): |
| 120 | 120 | ctools.csobservation.__setstate__(self, state['base']) |
| 121 | 121 | self._srcname = state['srcname'] |
| 122 | 122 | self._tbins = state['tbins'] |
| 123 | - self._onoff = state['onoff'] | |
| 124 | 123 | self._stacked = state['stacked'] |
| 124 | + self._onoff = state['onoff'] | |
| 125 | 125 | self._fits = state['fits'] |
| 126 | 126 | self._nthreads = state['nthreads'] |
| 127 | 127 | self._excl_reg_map = state['excl_reg_map'] |
| ... | ... | @@ -145,15 +145,15 @@ class cslightcrv(ctools.csobservation): |
| 145 | 145 | if self.obs().models().size() == 0: |
| 146 | 146 | self.obs().models(self['inmodel'].filename()) |
| 147 | 147 | |
| 148 | - # Get source name | |
| 149 | - self._srcname = self['srcname'].string() | |
| 150 | - | |
| 151 | 148 | # Get time boundaries |
| 152 | 149 | self._tbins = self._create_tbounds() |
| 153 | 150 | |
| 154 | 151 | # Set On/Off analysis flag and query relevant user parameters |
| 155 | 152 | self._onoff = self._is_onoff() |
| 156 | 153 | |
| 154 | + # Get source name | |
| 155 | + self._srcname = self['srcname'].string() | |
| 156 | + | |
| 157 | 157 | # Set stacked analysis flag and query relevant user parameters |
| 158 | 158 | if not self._onoff: |
| 159 | 159 | self._stacked = self._is_stacked() | ... | ... |
cscripts/csphasecrv.py
| ... | ... | @@ -91,9 +91,9 @@ class csphasecrv(ctools.csobservation): |
| 91 | 91 | 'stacked' : self._stacked, |
| 92 | 92 | 'onoff' : self._onoff, |
| 93 | 93 | 'fits' : self._fits, |
| 94 | - 'fitmodels' : self._fitmodels, | |
| 95 | 94 | 'nthreads' : self._nthreads, |
| 96 | - 'excl_reg_map' : self._excl_reg_map} | |
| 95 | + 'excl_reg_map' : self._excl_reg_map, | |
| 96 | + 'fitmodels' : self._fitmodels} | |
| 97 | 97 | |
| 98 | 98 | # Return pickled dictionary |
| 99 | 99 | return state |
| ... | ... | @@ -110,12 +110,12 @@ class csphasecrv(ctools.csobservation): |
| 110 | 110 | ctools.csobservation.__setstate__(self, state['base']) |
| 111 | 111 | self._srcname = state['srcname'] |
| 112 | 112 | self._phbins = state['phbins'] |
| 113 | - self._onoff = state['onoff'] | |
| 114 | 113 | self._stacked = state['stacked'] |
| 114 | + self._onoff = state['onoff'] | |
| 115 | 115 | self._fits = state['fits'] |
| 116 | - self._fitmodels = state['fitmodels'] | |
| 117 | 116 | self._nthreads = state['nthreads'] |
| 118 | 117 | self._excl_reg_map = state['excl_reg_map'] |
| 118 | + self._fitmodels = state['fitmodels'] | |
| 119 | 119 | |
| 120 | 120 | # Return |
| 121 | 121 | return |
| ... | ... | @@ -136,15 +136,15 @@ class csphasecrv(ctools.csobservation): |
| 136 | 136 | if self.obs().models().size() == 0: |
| 137 | 137 | self.obs().models(self['inmodel'].filename()) |
| 138 | 138 | |
| 139 | - # Get source name | |
| 140 | - self._srcname = self['srcname'].string() | |
| 141 | - | |
| 142 | 139 | # Get phase boundaries |
| 143 | 140 | self._phbins = self._create_tbounds() |
| 144 | 141 | |
| 145 | 142 | # Set On/Off analysis flag and query relevant user parameters |
| 146 | 143 | self._onoff = self._is_onoff() |
| 147 | 144 | |
| 145 | + # Get source name | |
| 146 | + self._srcname = self['srcname'].string() | |
| 147 | + | |
| 148 | 148 | # If cube analysis is selected |
| 149 | 149 | # Set stacked analysis flag and query relevant user parameters |
| 150 | 150 | if not self._onoff: | ... | ... |