@@ -138,22 +138,38 @@ class ComputeExposureSummaryStatsConfig(pexConfig.Config):
138138 doc = "Signal-to-noise ratio for computing the magnitude limit depth." ,
139139 default = 5.0
140140 )
141- psfTE1TreecorrConfig = pexConfig .ConfigField (
142- dtype = ComputeExPsfConfig ,
143- doc = "Treecorr config for computing scalar value of TE1." ,
141+ psfTE1Task = pexConfig .ConfigurableField (
142+ target = ComputeExPsfTask ,
143+ doc = "Use treecorr for computing scalar value of TE1." ,
144144 )
145- psfTE2TreecorrConfig = pexConfig .ConfigField (
146- dtype = ComputeExPsfConfig ,
147- doc = "Treecorr config for computing scalar value of TE2." ,
145+ psfTE2Task = pexConfig .ConfigurableField (
146+ target = ComputeExPsfTask ,
147+ doc = "Use treecorr for computing scalar value of TE2." ,
148148 )
149- psfTE3TreecorrConfig = pexConfig .ConfigField (
150- dtype = ComputeExPsfConfig ,
151- doc = "Treecorr config for computing scalar value of TE3." ,
149+ psfTE3Task = pexConfig .ConfigurableField (
150+ target = ComputeExPsfTask ,
151+ doc = "Use treecorr for computing scalar value of TE3." ,
152152 )
153- psfTE4TreecorrConfig = pexConfig .ConfigField (
154- dtype = ComputeExPsfConfig ,
155- doc = "Treecorr config for computing scalar value of TE4." ,
153+ psfTE4Task = pexConfig .ConfigurableField (
154+ target = ComputeExPsfTask ,
155+ doc = "Use treecorr for computing scalar value of TE4." ,
156156 )
157+ #psfTE1TreecorrConfig = pexConfig.ConfigField(
158+ # dtype=ComputeExPsfConfig,
159+ # doc="Treecorr config for computing scalar value of TE1.",
160+ #)
161+ #psfTE2TreecorrConfig = pexConfig.ConfigField(
162+ # dtype=ComputeExPsfConfig,
163+ # doc="Treecorr config for computing scalar value of TE2.",
164+ #)
165+ #psfTE3TreecorrConfig = pexConfig.ConfigField(
166+ # dtype=ComputeExPsfConfig,
167+ # doc="Treecorr config for computing scalar value of TE3.",
168+ #)
169+ #psfTE4TreecorrConfig = pexConfig.ConfigField(
170+ # dtype=ComputeExPsfConfig,
171+ # doc="Treecorr config for computing scalar value of TE4.",
172+ #)
157173
158174 def setDefaults (self ):
159175 super ().setDefaults ()
@@ -178,19 +194,36 @@ def setDefaults(self):
178194
179195 min_theta = [1e-6 , 5.0 , 1e-6 , 5.0 ]
180196 max_theta = [1.0 , 180.0 , 5.0 , 12.0 ]
181- TExTreecorrConfig = [
182- self .psfTE1TreecorrConfig ,
183- self .psfTE2TreecorrConfig ,
184- self .psfTE3TreecorrConfig ,
185- self .psfTE4TreecorrConfig ,
197+ psfTExTask = [
198+ self .psfTE1Task ,
199+ self .psfTE2Task ,
200+ self .psfTE3Task ,
201+ self .psfTE4Task ,
186202 ]
187203
188- for tex_config , mint , maxt in zip (TExTreecorrConfig , min_theta , max_theta ):
189- tex_config .treecorr .min_sep = mint / 60.0
190- tex_config .treecorr .max_sep = maxt / 60.0
191- tex_config .treecorr .nbins = 1
192- tex_config .treecorr .bin_type = "Linear"
193- tex_config .treecorr .sep_units = "degree"
204+ for tex_task , mint , maxt in zip (psfTExTask , min_theta , max_theta ):
205+ tex_task .config .setDefaults ()
206+ tex_task .config .treecorr .min_sep = mint / 60.0
207+ tex_task .config .treecorr .max_sep = maxt / 60.0
208+ tex_task .config .treecorr .nbins = 1
209+ tex_task .config .treecorr .bin_type = "Linear"
210+ tex_task .config .treecorr .sep_units = "degree"
211+
212+ #min_theta = [1e-6, 5.0, 1e-6, 5.0]
213+ #max_theta = [1.0, 180.0, 5.0, 12.0]
214+ #TExTreecorrConfig = [
215+ # self.psfTE1TreecorrConfig,
216+ # self.psfTE2TreecorrConfig,
217+ # self.psfTE3TreecorrConfig,
218+ # self.psfTE4TreecorrConfig,
219+ #]
220+
221+ #for tex_config, mint, maxt in zip(TExTreecorrConfig, min_theta, max_theta):
222+ # tex_config.treecorr.min_sep = mint / 60.0
223+ # tex_config.treecorr.max_sep = maxt / 60.0
224+ # tex_config.treecorr.nbins = 1
225+ # tex_config.treecorr.bin_type = "Linear"
226+ # tex_config.treecorr.sep_units = "degree"
194227
195228
196229class ComputeExposureSummaryStatsTask (pipeBase .Task ):
@@ -268,6 +301,10 @@ def __init__(self, **kwargs):
268301 super ().__init__ (** kwargs )
269302
270303 self .makeSubtask ("starSelector" )
304+ self .makeSubtask ("psfTE1Task" )
305+ self .makeSubtask ("psfTE2Task" )
306+ self .makeSubtask ("psfTE3Task" )
307+ self .makeSubtask ("psfTE4Task" )
271308 self ._isTEXComputationDone = False
272309
273310 @timeMethod
@@ -571,9 +608,9 @@ def comp_psf_TEX_visit_level(self, summary, sources, sources_is_astropy=False):
571608 ra = psf_cat ["coord_ra" ].to (units .deg )
572609 dec = psf_cat ["coord_dec" ].to (units .deg )
573610
574- TExTreecorrConfig = {
575- "TE1" : self .config . psfTE1TreecorrConfig ,
576- "TE2" : self .config . psfTE2TreecorrConfig ,
611+ psfTExTask = {
612+ "TE1" : self .psfTE1Task ,
613+ "TE2" : self .psfTE2Task ,
577614 }
578615
579616 gatherE12Stat = {
@@ -591,8 +628,7 @@ def comp_psf_TEX_visit_level(self, summary, sources, sources_is_astropy=False):
591628 # TE1 and TE2 computation, over visit.
592629 for TEX in ["TE1" , "TE2" ]:
593630
594- task = ComputeExPsfTask (TExTreecorrConfig [TEX ])
595- output = task .run (
631+ output = psfTExTask [TEX ].run (
596632 e1Residuals [isNotNan ], e2Residuals [isNotNan ],
597633 ra [isNotNan ], dec [isNotNan ],
598634 units = "degree" ,
@@ -604,9 +640,9 @@ def comp_psf_TEX_visit_level(self, summary, sources, sources_is_astropy=False):
604640
605641 # TE3 and TE4 loop over detector and then median on visit.
606642
607- TExTreecorrConfig = {
608- "TE3" : self .config . psfTE3TreecorrConfig ,
609- "TE4" : self .config . psfTE4TreecorrConfig ,
643+ psfTExTask = {
644+ "TE3" : self .psfTE3Task ,
645+ "TE4" : self .psfTE4Task ,
610646 }
611647
612648 gatherE34Stat = {
@@ -622,8 +658,7 @@ def comp_psf_TEX_visit_level(self, summary, sources, sources_is_astropy=False):
622658 isccdId = (ccdId == psf_cat ["detector" ])
623659 mask = (isccdId & isNotNan )
624660 if np .sum (mask ) >= 2 :
625- task = ComputeExPsfTask (TExTreecorrConfig [TEX ])
626- output = task .run (
661+ output = psfTExTask [TEX ].run (
627662 e1Residuals [mask ], e2Residuals [mask ],
628663 ra [mask ], dec [mask ],
629664 units = "degree" ,
0 commit comments