pz-rail-astro-tools 1.1.1__py3-none-any.whl → 1.1.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pz-rail-astro-tools might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: pz-rail-astro-tools
3
- Version: 1.1.1
3
+ Version: 1.1.3
4
4
  Author-email: "LSST Dark Energy Science Collaboration (DESC)" <lsst-desc-rail-admin@slac.stanford.edu>
5
5
  License: MIT License
6
6
 
@@ -39,7 +39,7 @@ Requires-Dist: numpy
39
39
  Requires-Dist: pandas>=2.2.2
40
40
  Requires-Dist: astropy
41
41
  Requires-Dist: healpy
42
- Requires-Dist: photerr
42
+ Requires-Dist: photerr>=1.4.0
43
43
  Requires-Dist: dustmaps
44
44
  Requires-Dist: pz-hyperbolic-temp
45
45
  Requires-Dist: lsstdesc-gcr-catalogs
@@ -50,6 +50,7 @@ Requires-Dist: pytest; extra == "dev"
50
50
  Requires-Dist: pytest-cov; extra == "dev"
51
51
  Requires-Dist: pre-commit; extra == "dev"
52
52
  Requires-Dist: pylint; extra == "dev"
53
+ Dynamic: license-file
53
54
 
54
55
  # pz-rail-astro-tools
55
56
 
@@ -1,8 +1,9 @@
1
+ pz_rail_astro_tools-1.1.3.dist-info/licenses/LICENSE,sha256=tLMEN21HbzvT-7umOVVvPjaJZbQxCa-2bAeYLwG5Q04,1102
1
2
  rail/astro_tools/__init__.py,sha256=4J-E0Ug0RP3Y38g8kJ6auAPDPEI4Osf19tuSOAACfxk,432
2
- rail/astro_tools/_version.py,sha256=EPoWF0em1tKJgBz5dbBF-r29860VBk-SsdiXh6E1aO0,411
3
+ rail/astro_tools/_version.py,sha256=NZq8o7CvDHjsuTdJBIlk-waJ8gpJ6NCKjeYt9lufMC4,511
3
4
  rail/creation/degraders/grid_selection.py,sha256=d42-7lvcCKhV6LlvCMwVV7Lp05Y0Q2xlMTwS99MeYRk,12506
4
5
  rail/creation/degraders/observing_condition_degrader.py,sha256=IflXSlcAyEMqNKDqGL78lSJSXH2rqB8mVDDVLI4loMM,19961
5
- rail/creation/degraders/photometric_errors.py,sha256=jx7JL5-lzKm6IbNTYwHqkEeGZduXC59Tad2UNwEJWlc,4703
6
+ rail/creation/degraders/photometric_errors.py,sha256=g4eP8wu-KB6SaySzOnIMMKDEUbAcfNKklgdMfETH5jE,8164
6
7
  rail/creation/degraders/spectroscopic_degraders.py,sha256=tsB9jvqEXCgDPw66A1kWjBQn_Nm743XOewEzDympBsI,4701
7
8
  rail/creation/degraders/spectroscopic_selections.py,sha256=U37m0uc7yFohYzAcxl6LM-oYK9ziD894Y0xwBSvEUhY,21207
8
9
  rail/creation/degraders/unrec_bl_model.py,sha256=E89DVV67FcHozCjtUz4ty3Ak3q8H9lnNnh5wNWi_R8M,7476
@@ -14,13 +15,12 @@ rail/examples_data/creation_data/data/survey_conditions/DC2-mask-neg-nside-128.f
14
15
  rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_airmass_i_and_nightlt1825_HEAL.fits,sha256=twvyce70G3h1MQnGGFQJG9wZc8UbuNqXc6mjtiuaL1s,1581120
15
16
  rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_fiveSigmaDepth_i_and_nightlt1825_HEAL.fits,sha256=RbMMFSVJQxGhZnL4BnISE9VTNljfTZwV6Bax6NxverY,1581120
16
17
  rail/examples_data/testdata/rubin_dm_dc2_example2.pq,sha256=_Iihbbcz1A332QAkaMiFacT4QAbBQBMTOwpfrS7AclE,25884
17
- rail/pipelines/degradation/apply_phot_errors.py,sha256=E6H1Qza1IkO9VWqqxeny6MYkw3gURWscwKxzgUHEOko,2087
18
+ rail/pipelines/degradation/apply_phot_errors.py,sha256=UIQ0eWq59RT1e2S2-1zPnhtfGKOxL1gai9h7crhoK0w,2530
18
19
  rail/pipelines/degradation/blending.py,sha256=oxZHy1Tai70wT4g4xnBr24z2LxmR1p_J6lMoTN0nFc8,564
19
20
  rail/pipelines/degradation/spectroscopic_selection_pipeline.py,sha256=D0sDi6nrasv5CvQkLXgmMp0QbDrhGFRXzt6sWjlbD68,2028
20
- rail/pipelines/degradation/truth_to_observed.py,sha256=nfzMKdZd69_P1HnHy56UcjMUpFdRHf6g55oNhlW5Gzg,2995
21
- rail/tools/photometry_tools.py,sha256=wfKAeMz5T_CYDPC661MHtU1aJXVqomvahZl87KuE7uY,19541
22
- pz_rail_astro_tools-1.1.1.dist-info/LICENSE,sha256=tLMEN21HbzvT-7umOVVvPjaJZbQxCa-2bAeYLwG5Q04,1102
23
- pz_rail_astro_tools-1.1.1.dist-info/METADATA,sha256=U1a5-4mu3t6ywblIHDKllC777jtmzEBRXeRXbIVDDs8,4033
24
- pz_rail_astro_tools-1.1.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
25
- pz_rail_astro_tools-1.1.1.dist-info/top_level.txt,sha256=6R6sqn-85I8YZTzmB9gv7sqckB2QaOTHbu-QLGTWBRE,5
26
- pz_rail_astro_tools-1.1.1.dist-info/RECORD,,
21
+ rail/pipelines/degradation/truth_to_observed.py,sha256=jJx8GOqO-0aWYedrq4h3zHHEn8w_steY0LQ6xzDdHiE,3178
22
+ rail/tools/photometry_tools.py,sha256=zszTH_8KEk0UiQywKSsL2ZImGQL6UCzFYMrqsWFGdrc,19597
23
+ pz_rail_astro_tools-1.1.3.dist-info/METADATA,sha256=2au1Llyaxox_vjiZov1BavKOeZiwCh0B7IrseMYfEG0,4062
24
+ pz_rail_astro_tools-1.1.3.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
25
+ pz_rail_astro_tools-1.1.3.dist-info/top_level.txt,sha256=6R6sqn-85I8YZTzmB9gv7sqckB2QaOTHbu-QLGTWBRE,5
26
+ pz_rail_astro_tools-1.1.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (80.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,8 +1,13 @@
1
- # file generated by setuptools_scm
1
+ # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
+
4
+ __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
+
3
6
  TYPE_CHECKING = False
4
7
  if TYPE_CHECKING:
5
- from typing import Tuple, Union
8
+ from typing import Tuple
9
+ from typing import Union
10
+
6
11
  VERSION_TUPLE = Tuple[Union[int, str], ...]
7
12
  else:
8
13
  VERSION_TUPLE = object
@@ -12,5 +17,5 @@ __version__: str
12
17
  __version_tuple__: VERSION_TUPLE
13
18
  version_tuple: VERSION_TUPLE
14
19
 
15
- __version__ = version = '1.1.1'
16
- __version_tuple__ = version_tuple = (1, 1, 1)
20
+ __version__ = version = '1.1.3'
21
+ __version_tuple__ = version_tuple = (1, 1, 3)
@@ -12,8 +12,23 @@ from photerr import LsstErrorModel as peLsstErrorModel
12
12
  from photerr import LsstErrorParams as peLsstErrorParams
13
13
  from photerr import RomanErrorModel as peRomanErrorModel
14
14
  from photerr import RomanErrorParams as peRomanErrorParams
15
+
16
+ from photerr import RomanWideErrorModel as peRomanWideErrorModel
17
+ from photerr import RomanWideErrorParams as peRomanWideErrorParams
18
+ from photerr import RomanMediumErrorModel as peRomanMediumErrorModel
19
+ from photerr import RomanMediumErrorParams as peRomanMediumErrorParams
20
+ from photerr import RomanDeepErrorModel as peRomanDeepErrorModel
21
+ from photerr import RomanDeepErrorParams as peRomanDeepErrorParams
22
+ from photerr import RomanUltraDeepErrorModel as peRomanUltraDeepErrorModel
23
+ from photerr import RomanUltraDeepErrorParams as peRomanUltraDeepErrorParams
24
+
15
25
  from photerr import EuclidErrorModel as peEuclidErrorModel
16
26
  from photerr import EuclidErrorParams as peEuclidErrorParams
27
+ from photerr import EuclidWideErrorModel as peEuclidWideErrorModel
28
+ from photerr import EuclidWideErrorParams as peEuclidWideErrorParams
29
+ from photerr import EuclidDeepErrorModel as peEuclidDeepErrorModel
30
+ from photerr import EuclidDeepErrorParams as peEuclidDeepErrorParams
31
+
17
32
  from rail.creation.noisifier import Noisifier
18
33
 
19
34
  class PhotoErrorModel(Noisifier):
@@ -132,12 +147,79 @@ class RomanErrorModel(PhotoErrorModel):
132
147
  self.reload_pars(args)
133
148
  self.peNoiseModel = peRomanErrorModel
134
149
 
135
-
150
+
151
+ class RomanWideErrorModel(PhotoErrorModel):
152
+
153
+ """
154
+ The Roman WideError model, defined by peRomanWideErrorParams and peRomanWideErrorModel
155
+ """
156
+
157
+ name = "RomanWideErrorModel"
158
+
159
+ def __init__(self, args, **kwargs):
160
+
161
+ super().__init__(args, **kwargs)
162
+
163
+ self.set_params(peRomanWideErrorParams)
164
+ self.reload_pars(args)
165
+ self.peNoiseModel = peRomanWideErrorModel
166
+
167
+
168
+ class RomanMediumErrorModel(PhotoErrorModel):
169
+
170
+ """
171
+ The Roman Medium Error model, defined by peRomanMediumErrorParams and peRomanMediumErrorModel
172
+ """
173
+
174
+ name = "RomanMediumErrorModel"
175
+
176
+ def __init__(self, args, **kwargs):
177
+
178
+ super().__init__(args, **kwargs)
179
+
180
+ self.set_params(peRomanMediumErrorParams)
181
+ self.reload_pars(args)
182
+ self.peNoiseModel = peRomanMediumErrorModel
183
+
184
+
185
+ class RomanDeepErrorModel(PhotoErrorModel):
186
+
187
+ """
188
+ The Roman Deep Error model, defined by peRomanDeepErrorParams and peRomanDeepErrorModel
189
+ """
190
+
191
+ name = "RomanDeepErrorModel"
192
+
193
+ def __init__(self, args, **kwargs):
194
+
195
+ super().__init__(args, **kwargs)
196
+
197
+ self.set_params(peRomanDeepErrorParams)
198
+ self.reload_pars(args)
199
+ self.peNoiseModel = peRomanDeepErrorModel
200
+
201
+
202
+ class RomanUltraDeepErrorModel(PhotoErrorModel):
203
+
204
+ """
205
+ The Roman UltraDeep Error model, defined by peRomanUltraDeepErrorParams and peRomanUltraDeepErrorModel
206
+ """
207
+
208
+ name = "RomanUltraDeepErrorModel"
209
+
210
+ def __init__(self, args, **kwargs):
211
+
212
+ super().__init__(args, **kwargs)
213
+
214
+ self.set_params(peRomanUltraDeepErrorParams)
215
+ self.reload_pars(args)
216
+ self.peNoiseModel = peRomanUltraDeepErrorModel
217
+
136
218
 
137
219
  class EuclidErrorModel(PhotoErrorModel):
138
220
 
139
221
  """
140
- The Roman Error model, defined by peRomanErrorParams and peRomanErrorModel
222
+ The Euclid Error model, defined by peEuclidErrorParams and peEuclidErrorModel
141
223
  """
142
224
 
143
225
  name = "EuclidErrorModel"
@@ -149,3 +231,39 @@ class EuclidErrorModel(PhotoErrorModel):
149
231
  self.set_params(peEuclidErrorParams)
150
232
  self.reload_pars(args)
151
233
  self.peNoiseModel = peEuclidErrorModel
234
+
235
+
236
+ class EuclidWideErrorModel(PhotoErrorModel):
237
+
238
+ """
239
+ The Euclid Wide Error model, defined by peEuclidWideErrorParams and peEuclidWideErrorModel
240
+ """
241
+
242
+ name = "EuclidWideErrorModel"
243
+
244
+ def __init__(self, args, **kwargs):
245
+
246
+ super().__init__(args, **kwargs)
247
+
248
+ self.set_params(peEuclidWideErrorParams)
249
+ self.reload_pars(args)
250
+ self.peNoiseModel = peEuclidWideErrorModel
251
+
252
+
253
+ class EuclidDeepErrorModel(PhotoErrorModel):
254
+
255
+ """
256
+ The Euclid Deep Error model, defined by peEuclidDeepErrorParams and peEuclidDeepErrorModel
257
+ """
258
+
259
+ name = "EuclidDeepErrorModel"
260
+
261
+ def __init__(self, args, **kwargs):
262
+
263
+ super().__init__(args, **kwargs)
264
+
265
+ self.set_params(peEuclidDeepErrorParams)
266
+ self.reload_pars(args)
267
+ self.peNoiseModel = peEuclidDeepErrorModel
268
+
269
+
@@ -25,11 +25,13 @@ ERROR_MODELS = dict(
25
25
  lsst = dict(
26
26
  ErrorModel='LSSTErrorModel',
27
27
  Module='rail.creation.degraders.photometric_errors',
28
+ Bands=['u', 'g', 'r', 'i', 'z', 'y'],
28
29
  ),
29
- roman = dict(
30
- ErrorModel='RomanErrorModel',
31
- Module='rail.creation.degraders.photometric_errors',
32
- ),
30
+ #roman = dict(
31
+ # ErrorModel='RomanErrorModel',
32
+ # Module='rail.creation.degraders.photometric_errors',
33
+ # Bands=['Y', 'J', 'H', 'F'],
34
+ #),
33
35
  #euclid = dict(
34
36
  # ErrorModel='EuclidErrorModel',
35
37
  # Module='rail.creation.degraders.photometric_errors',
@@ -54,16 +56,23 @@ class ApplyPhotErrorsPipeline(RailPipeline):
54
56
  self.reddener = Reddener.build(
55
57
  dustmap_dir=dustmap_dir,
56
58
  copy_all_cols=True,
57
- )
58
-
59
+ )
59
60
  previous_stage = self.reddener
61
+ full_rename_dict = catalog_utils.CatalogConfigBase.active_class().band_name_dict()
60
62
  for key, val in error_models.items():
61
63
  error_model_class = ceci.PipelineStage.get_stage(val['ErrorModel'], val['Module'])
64
+ if 'Bands' in val:
65
+ rename_dict = {band_: full_rename_dict[band_] for band_ in val['Bands']}
66
+ else: # pragma: no cover
67
+ rename_dict = full_rename_dict
62
68
  the_error_model = error_model_class.make_and_connect(
63
69
  name=f'error_model_{key}',
64
70
  connections=dict(input=previous_stage.io.output),
65
71
  hdf5_groupname='',
66
- renameDict=catalog_utils.CatalogConfigBase.active_class().band_name_dict(),
72
+ renameDict=rename_dict,
73
+ minorCol='minor',
74
+ majorCol='major',
75
+ extendedType='gaap',
67
76
  )
68
77
  self.add_stage(the_error_model)
69
78
  previous_stage = the_error_model
@@ -37,7 +37,7 @@ class TruthToObservedPipeline(RailPipeline):
37
37
  DS.__class__.allow_overwrite = True
38
38
 
39
39
  active_catalog_config = catalog_utils.CatalogConfigBase.active_class()
40
- band_name_dict = active_catalog_config.band_name_dict()
40
+ full_rename_dict = active_catalog_config.band_name_dict()
41
41
 
42
42
  if error_models is None:
43
43
  error_models = ERROR_MODELS.copy()
@@ -46,7 +46,7 @@ class TruthToObservedPipeline(RailPipeline):
46
46
  selectors = SELECTORS.copy()
47
47
 
48
48
  config_pars = CommonConfigParams.copy()
49
- config_pars['colnames'] = band_name_dict.copy()
49
+ config_pars['colnames'] = full_rename_dict.copy()
50
50
  config_pars['colnames']['redshift'] = active_catalog_config.redshift_col
51
51
 
52
52
  self.reddener = Reddener.build(
@@ -61,11 +61,16 @@ class TruthToObservedPipeline(RailPipeline):
61
61
 
62
62
  for key, val in error_models.items():
63
63
  error_model_class = ceci.PipelineStage.get_stage(val['ErrorModel'], val['Module'])
64
+ if 'Bands' in val:
65
+ rename_dict = {band_: full_rename_dict[band_] for band_ in val['Bands']}
66
+ else: # pragma: no cover
67
+ rename_dict = full_rename_dict
68
+
64
69
  the_error_model = error_model_class.make_and_connect(
65
70
  name=f'error_model_{key}',
66
71
  connections=dict(input=previous_stage.io.output),
67
72
  hdf5_groupname='',
68
- renameDict=band_name_dict,
73
+ renameDict=rename_dict,
69
74
  )
70
75
  self.add_stage(the_error_model)
71
76
  previous_stage = the_error_model
@@ -78,12 +83,12 @@ class TruthToObservedPipeline(RailPipeline):
78
83
  )
79
84
  self.add_stage(dereddener_errors)
80
85
  previous_stage = dereddener_errors
81
-
86
+
82
87
  for key2, val2 in selectors.items():
83
88
  the_class = ceci.PipelineStage.get_stage(val2['Select'], val2['Module'])
84
89
  the_selector = the_class.make_and_connect(
85
90
  name=f'select_{key}_{key2}',
86
91
  connections=dict(input=previous_stage.io.output),
87
92
  **config_pars,
88
- )
93
+ )
89
94
  self.add_stage(the_selector)
@@ -371,10 +371,11 @@ class LSSTFluxToMagConverter(RailStage):
371
371
  mag_conv = np.log(10)*0.4
372
372
 
373
373
  inputs = [('input', PqHandle)]
374
- outputs = [('output', Hdf5Handle)]
374
+ outputs = [('output', PqHandle)]
375
375
 
376
376
  def _flux_to_mag(self, flux_vals):
377
- return -2.5*np.log10(flux_vals) + self.config.mag_offset
377
+ vals = -2.5*np.log10(flux_vals) + self.config.mag_offset
378
+ return np.where(np.isfinite(vals), vals, np.nan)
378
379
 
379
380
  def _flux_err_to_mag_err(self, flux_vals, flux_err_vals):
380
381
  return flux_err_vals / (flux_vals*self.mag_conv)
@@ -383,6 +384,7 @@ class LSSTFluxToMagConverter(RailStage):
383
384
  data = self.get_data('input', allow_missing=True)
384
385
  out_data = {}
385
386
  const = np.log(10.)*0.4
387
+
386
388
  for band_ in self.config.bands:
387
389
  flux_col_name = self.config.flux_name.format(band=band_)
388
390
  flux_err_col_name = self.config.flux_err_name.format(band=band_)