pz-rail-astro-tools 1.1.1__tar.gz → 1.1.2__tar.gz

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.

Files changed (51) hide show
  1. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/PKG-INFO +3 -2
  2. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/pz_rail_astro_tools.egg-info/PKG-INFO +3 -2
  3. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/astro_tools/_version.py +9 -4
  4. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/pipelines/degradation/apply_phot_errors.py +12 -5
  5. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/pipelines/degradation/truth_to_observed.py +10 -5
  6. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/tools/photometry_tools.py +4 -2
  7. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/.copier-answers.yml +0 -0
  8. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/.github/ISSUE_TEMPLATE/0-general_issue.md +0 -0
  9. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/.github/ISSUE_TEMPLATE/1-bug_report.md +0 -0
  10. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/.github/ISSUE_TEMPLATE/2-feature_request.md +0 -0
  11. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/.github/pull_request_template.md +0 -0
  12. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/.github/workflows/add-issue-to-project-tracker.yml +0 -0
  13. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/.github/workflows/linting.yml +0 -0
  14. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/.github/workflows/publish-to-pypi.yml +0 -0
  15. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/.github/workflows/smoke-test.yml +0 -0
  16. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/.github/workflows/testing-and-coverage.yml +0 -0
  17. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/.gitignore +0 -0
  18. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/.pre-commit-config.yaml +0 -0
  19. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/LICENSE +0 -0
  20. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/README.md +0 -0
  21. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/environment.yml +0 -0
  22. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/pyproject.toml +0 -0
  23. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/setup.cfg +0 -0
  24. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/setup.py +0 -0
  25. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/pz_rail_astro_tools.egg-info/SOURCES.txt +0 -0
  26. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/pz_rail_astro_tools.egg-info/dependency_links.txt +0 -0
  27. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/pz_rail_astro_tools.egg-info/requires.txt +0 -0
  28. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/pz_rail_astro_tools.egg-info/top_level.txt +0 -0
  29. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/astro_tools/__init__.py +0 -0
  30. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/creation/degraders/grid_selection.py +0 -0
  31. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/creation/degraders/observing_condition_degrader.py +0 -0
  32. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/creation/degraders/photometric_errors.py +0 -0
  33. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/creation/degraders/spectroscopic_degraders.py +0 -0
  34. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/creation/degraders/spectroscopic_selections.py +0 -0
  35. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/creation/degraders/unrec_bl_model.py +0 -0
  36. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/creation/engines/gcr_engine.py +0 -0
  37. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/examples_data/creation_data/data/HSC_grid_settings.pkl +0 -0
  38. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/examples_data/creation_data/data/hsc_ratios_and_specz.hdf5 +0 -0
  39. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/examples_data/creation_data/data/survey_conditions/DC2-dr6-galcounts-i20-i25.3-nside-128.fits +0 -0
  40. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/examples_data/creation_data/data/survey_conditions/DC2-mask-neg-nside-128.fits +0 -0
  41. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_airmass_i_and_nightlt1825_HEAL.fits +0 -0
  42. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_fiveSigmaDepth_i_and_nightlt1825_HEAL.fits +0 -0
  43. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/examples_data/testdata/rubin_dm_dc2_example2.pq +0 -0
  44. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/pipelines/degradation/blending.py +0 -0
  45. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/src/rail/pipelines/degradation/spectroscopic_selection_pipeline.py +0 -0
  46. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/tests/astro_tools/gcr_test_data/schema.yaml +0 -0
  47. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/tests/astro_tools/gcr_test_data/test_object_tract_4850.hdf5 +0 -0
  48. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/tests/astro_tools/test_core.py +0 -0
  49. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/tests/astro_tools/test_degraders.py +0 -0
  50. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/tests/astro_tools/test_gcr_engine.py +0 -0
  51. {pz_rail_astro_tools-1.1.1 → pz_rail_astro_tools-1.1.2}/tests/astro_tools/test_pipline.py +0 -0
@@ -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,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,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_)