pz-rail-astro-tools 1.1.1__py3-none-any.whl → 1.1.2__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.2
4
4
  Author-email: "LSST Dark Energy Science Collaboration (DESC)" <lsst-desc-rail-admin@slac.stanford.edu>
5
5
  License: MIT License
6
6
 
@@ -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,5 +1,6 @@
1
+ pz_rail_astro_tools-1.1.2.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=QStVM5noK8GROKj7T8cnnU5tVxslcgtPvpkfiy_kn64,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
6
  rail/creation/degraders/photometric_errors.py,sha256=jx7JL5-lzKm6IbNTYwHqkEeGZduXC59Tad2UNwEJWlc,4703
@@ -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=TfytMANXYRPqnsZyBy9Ua5BTB5QxibQEzI10U_mi8zo,2418
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.2.dist-info/METADATA,sha256=ffoMbarTGRn_h6o4J89ce6E7zB-ExZ7Ts9aJr-_LWwA,4055
24
+ pz_rail_astro_tools-1.1.2.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
25
+ pz_rail_astro_tools-1.1.2.dist-info/top_level.txt,sha256=6R6sqn-85I8YZTzmB9gv7sqckB2QaOTHbu-QLGTWBRE,5
26
+ pz_rail_astro_tools-1.1.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (79.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.2'
21
+ __version_tuple__ = version_tuple = (1, 1, 2)
@@ -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',
@@ -57,13 +59,18 @@ class ApplyPhotErrorsPipeline(RailPipeline):
57
59
  )
58
60
 
59
61
  previous_stage = self.reddener
62
+ full_rename_dict = catalog_utils.CatalogConfigBase.active_class().band_name_dict()
60
63
  for key, val in error_models.items():
61
64
  error_model_class = ceci.PipelineStage.get_stage(val['ErrorModel'], val['Module'])
65
+ if 'Bands' in val:
66
+ rename_dict = {band_: full_rename_dict[band_] for band_ in val['Bands']}
67
+ else: # pragma: no cover
68
+ rename_dict = full_rename_dict
62
69
  the_error_model = error_model_class.make_and_connect(
63
70
  name=f'error_model_{key}',
64
71
  connections=dict(input=previous_stage.io.output),
65
72
  hdf5_groupname='',
66
- renameDict=catalog_utils.CatalogConfigBase.active_class().band_name_dict(),
73
+ renameDict=rename_dict,
67
74
  )
68
75
  self.add_stage(the_error_model)
69
76
  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_)