pz-rail-astro-tools 1.0.2__tar.gz → 1.0.3__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.
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.copier-answers.yml +1 -1
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.github/workflows/testing-and-coverage.yml +4 -2
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/PKG-INFO +4 -2
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/pyproject.toml +3 -1
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/pz_rail_astro_tools.egg-info/PKG-INFO +4 -2
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/pz_rail_astro_tools.egg-info/requires.txt +3 -1
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/astro_tools/_version.py +2 -2
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/creation/degraders/grid_selection.py +2 -2
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/creation/degraders/lsst_error_model.py +2 -2
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/creation/degraders/observing_condition_degrader.py +2 -2
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/creation/degraders/photometric_errors.py +6 -14
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/creation/degraders/spectroscopic_degraders.py +4 -4
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/creation/degraders/spectroscopic_selections.py +3 -3
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/creation/engines/gcr_engine.py +2 -2
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/tools/photometry_tools.py +2 -8
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/tests/astro_tools/test_degraders.py +20 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.github/ISSUE_TEMPLATE/0-general_issue.md +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.github/ISSUE_TEMPLATE/1-bug_report.md +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.github/ISSUE_TEMPLATE/2-feature_request.md +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.github/pull_request_template.md +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.github/workflows/add-issue-to-project-tracker.yml +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.github/workflows/linting.yml +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.github/workflows/publish-to-pypi.yml +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.github/workflows/smoke-test.yml +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.gitignore +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.pre-commit-config.yaml +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/LICENSE +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/README.md +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/environment.yml +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/setup.cfg +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/setup.py +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/pz_rail_astro_tools.egg-info/SOURCES.txt +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/pz_rail_astro_tools.egg-info/dependency_links.txt +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/pz_rail_astro_tools.egg-info/top_level.txt +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/astro_tools/__init__.py +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/examples_data/creation_data/data/HSC_grid_settings.pkl +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/examples_data/creation_data/data/hsc_ratios_and_specz.hdf5 +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/examples_data/creation_data/data/survey_conditions/DC2-dr6-galcounts-i20-i25.3-nside-128.fits +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/examples_data/creation_data/data/survey_conditions/DC2-mask-neg-nside-128.fits +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_airmass_i_and_nightlt1825_HEAL.fits +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_fiveSigmaDepth_i_and_nightlt1825_HEAL.fits +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/examples_data/testdata/rubin_dm_dc2_example2.pq +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/tests/astro_tools/gcr_test_data/schema.yaml +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/tests/astro_tools/gcr_test_data/test_object_tract_4850.hdf5 +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/tests/astro_tools/test_core.py +0 -0
- {pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/tests/astro_tools/test_gcr_engine.py +0 -0
{pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.github/workflows/testing-and-coverage.yml
RENAMED
|
@@ -15,7 +15,7 @@ jobs:
|
|
|
15
15
|
runs-on: ubuntu-latest
|
|
16
16
|
strategy:
|
|
17
17
|
matrix:
|
|
18
|
-
python-version: ['3.
|
|
18
|
+
python-version: ['3.10', '3.11']
|
|
19
19
|
|
|
20
20
|
steps:
|
|
21
21
|
- uses: actions/checkout@v3
|
|
@@ -35,4 +35,6 @@ jobs:
|
|
|
35
35
|
run: |
|
|
36
36
|
python -m pytest tests --cov=astro_tools --cov-report=xml
|
|
37
37
|
- name: Upload coverage report to codecov
|
|
38
|
-
uses: codecov/codecov-action@
|
|
38
|
+
uses: codecov/codecov-action@v4
|
|
39
|
+
with:
|
|
40
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pz-rail-astro-tools
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.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
|
|
|
@@ -34,7 +34,9 @@ Requires-Python: >=3.9
|
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
35
35
|
License-File: LICENSE
|
|
36
36
|
Requires-Dist: deprecated
|
|
37
|
-
Requires-Dist: pz-rail-base
|
|
37
|
+
Requires-Dist: pz-rail-base>=1.0.3
|
|
38
|
+
Requires-Dist: numpy
|
|
39
|
+
Requires-Dist: pandas>=2.2.2
|
|
38
40
|
Requires-Dist: astropy
|
|
39
41
|
Requires-Dist: healpy
|
|
40
42
|
Requires-Dist: photerr
|
{pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/pz_rail_astro_tools.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pz-rail-astro-tools
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.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
|
|
|
@@ -34,7 +34,9 @@ Requires-Python: >=3.9
|
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
35
35
|
License-File: LICENSE
|
|
36
36
|
Requires-Dist: deprecated
|
|
37
|
-
Requires-Dist: pz-rail-base
|
|
37
|
+
Requires-Dist: pz-rail-base>=1.0.3
|
|
38
|
+
Requires-Dist: numpy
|
|
39
|
+
Requires-Dist: pandas>=2.2.2
|
|
38
40
|
Requires-Dist: astropy
|
|
39
41
|
Requires-Dist: healpy
|
|
40
42
|
Requires-Dist: photerr
|
|
@@ -57,9 +57,9 @@ class GridSelection(Selector):
|
|
|
57
57
|
random_seed=Param(int, 12345, msg="random seed for reproducibility"),
|
|
58
58
|
scaling_factor=Param(float, 1.588, msg="multiplicative factor for ratios to adjust number of galaxies kept"))
|
|
59
59
|
|
|
60
|
-
def __init__(self, args,
|
|
60
|
+
def __init__(self, args, **kwargs):
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
super().__init__(args, **kwargs)
|
|
63
63
|
|
|
64
64
|
if self.config.redshift_cut < 0:
|
|
65
65
|
raise ValueError("redshift cut must be positive")
|
|
@@ -38,13 +38,13 @@ class LSSTErrorModel(Degrader):
|
|
|
38
38
|
required=False,
|
|
39
39
|
)
|
|
40
40
|
|
|
41
|
-
def __init__(self, args,
|
|
41
|
+
def __init__(self, args, **kwargs):
|
|
42
42
|
"""
|
|
43
43
|
Constructor
|
|
44
44
|
|
|
45
45
|
Does standard Degrader initialization and sets up the error model.
|
|
46
46
|
"""
|
|
47
|
-
|
|
47
|
+
super().__init__(args, **kwargs)
|
|
48
48
|
self.error_model = PhotErrErrorModel(
|
|
49
49
|
**{key: self.config[key] for key in self._photerr_params}
|
|
50
50
|
)
|
|
@@ -116,8 +116,8 @@ class ObsCondition(Noisifier):
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
|
|
119
|
-
def __init__(self, args,
|
|
120
|
-
|
|
119
|
+
def __init__(self, args, **kwargs):
|
|
120
|
+
super().__init__(args, **kwargs)
|
|
121
121
|
|
|
122
122
|
# store a list of keys relevant for
|
|
123
123
|
# survey conditions;
|
|
@@ -53,14 +53,6 @@ class PhotoErrorModel(Noisifier):
|
|
|
53
53
|
required=False,
|
|
54
54
|
)
|
|
55
55
|
|
|
56
|
-
def __init__(self, args, comm=None):
|
|
57
|
-
"""
|
|
58
|
-
Constructor
|
|
59
|
-
|
|
60
|
-
Does standard Degrader initialization and sets up the error model.
|
|
61
|
-
"""
|
|
62
|
-
Noisifier.__init__(self, args, comm=comm)
|
|
63
|
-
|
|
64
56
|
def _initNoiseModel(self):
|
|
65
57
|
"""
|
|
66
58
|
Initialize the noise model by the peNoiseModel
|
|
@@ -93,9 +85,9 @@ class LSSTErrorModel(PhotoErrorModel):
|
|
|
93
85
|
|
|
94
86
|
name = "LSSTErrorModel"
|
|
95
87
|
|
|
96
|
-
def __init__(self, args,
|
|
88
|
+
def __init__(self, args, **kwargs):
|
|
97
89
|
|
|
98
|
-
|
|
90
|
+
super().__init__(args, **kwargs)
|
|
99
91
|
|
|
100
92
|
self.set_params(peLsstErrorParams)
|
|
101
93
|
self.peNoiseModel = peLsstErrorModel
|
|
@@ -111,9 +103,9 @@ class RomanErrorModel(PhotoErrorModel):
|
|
|
111
103
|
|
|
112
104
|
name = "RomanErrorModel"
|
|
113
105
|
|
|
114
|
-
def __init__(self, args,
|
|
106
|
+
def __init__(self, args, **kwargs):
|
|
115
107
|
|
|
116
|
-
|
|
108
|
+
super().__init__(args, **kwargs)
|
|
117
109
|
|
|
118
110
|
self.set_params(peRomanErrorParams)
|
|
119
111
|
self.peNoiseModel = peRomanErrorModel
|
|
@@ -128,9 +120,9 @@ class EuclidErrorModel(PhotoErrorModel):
|
|
|
128
120
|
|
|
129
121
|
name = "EuclidErrorModel"
|
|
130
122
|
|
|
131
|
-
def __init__(self, args,
|
|
123
|
+
def __init__(self, args, **kwargs):
|
|
132
124
|
|
|
133
|
-
|
|
125
|
+
super().__init__(args, **kwargs)
|
|
134
126
|
|
|
135
127
|
self.set_params(peEuclidErrorParams)
|
|
136
128
|
self.peNoiseModel = peEuclidErrorModel
|
|
@@ -44,10 +44,10 @@ class LineConfusion(Noisifier):
|
|
|
44
44
|
wrong_wavelen=float,
|
|
45
45
|
frac_wrong=float)
|
|
46
46
|
|
|
47
|
-
def __init__(self, args,
|
|
47
|
+
def __init__(self, args, **kwargs):
|
|
48
48
|
"""
|
|
49
49
|
"""
|
|
50
|
-
|
|
50
|
+
super().__init__(args, **kwargs)
|
|
51
51
|
# validate parameters
|
|
52
52
|
if self.config.true_wavelen < 0:
|
|
53
53
|
raise ValueError("true_wavelen must be positive, not {self.config.true_wavelen}")
|
|
@@ -115,10 +115,10 @@ class InvRedshiftIncompleteness(Selector):
|
|
|
115
115
|
config_options = Selector.config_options.copy()
|
|
116
116
|
config_options.update(pivot_redshift=float)
|
|
117
117
|
|
|
118
|
-
def __init__(self, args,
|
|
118
|
+
def __init__(self, args, **kwargs):
|
|
119
119
|
"""
|
|
120
120
|
"""
|
|
121
|
-
|
|
121
|
+
super().__init__(args, **kwargs)
|
|
122
122
|
if self.config.pivot_redshift < 0:
|
|
123
123
|
raise ValueError("pivot redshift must be positive, not {self.config.pivot_redshift}")
|
|
124
124
|
|
|
@@ -67,8 +67,8 @@ class SpecSelection(Selector):
|
|
|
67
67
|
random_seed=Param(int, 42, msg="random seed for reproducibility"),
|
|
68
68
|
)
|
|
69
69
|
|
|
70
|
-
def __init__(self, args,
|
|
71
|
-
|
|
70
|
+
def __init__(self, args, **kwargs):
|
|
71
|
+
super().__init__(args, **kwargs)
|
|
72
72
|
self._validate_settings()
|
|
73
73
|
self.mask = None
|
|
74
74
|
self.rng = None
|
|
@@ -155,7 +155,7 @@ class SpecSelection(Selector):
|
|
|
155
155
|
# get the bands and bandNames present in the data
|
|
156
156
|
data = self.get_data("input", allow_missing=True)
|
|
157
157
|
self.validate_colnames(data)
|
|
158
|
-
self.mask = np.
|
|
158
|
+
self.mask = np.prod(~np.isnan(data.to_numpy()), axis=1)
|
|
159
159
|
self.invalid_cut(data)
|
|
160
160
|
self.selection(data)
|
|
161
161
|
if self.config.downsample is True:
|
{pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/rail/creation/engines/gcr_engine.py
RENAMED
|
@@ -52,8 +52,8 @@ class GCRCreator(Creator):
|
|
|
52
52
|
),
|
|
53
53
|
)
|
|
54
54
|
|
|
55
|
-
def __init__(self, args,
|
|
56
|
-
|
|
55
|
+
def __init__(self, args, **kwargs):
|
|
56
|
+
super().__init__(args, **kwargs)
|
|
57
57
|
|
|
58
58
|
# Provides override for unit test
|
|
59
59
|
self._catalog_override = None
|
|
@@ -95,8 +95,8 @@ class PhotometryManipulator(RailStage, ABC):
|
|
|
95
95
|
inputs = [('input', PqHandle)]
|
|
96
96
|
outputs = [('output', PqHandle)]
|
|
97
97
|
|
|
98
|
-
def __init__(self, args,
|
|
99
|
-
super().__init__(args,
|
|
98
|
+
def __init__(self, args, **kwargs):
|
|
99
|
+
super().__init__(args, **kwargs)
|
|
100
100
|
self._check_config()
|
|
101
101
|
# convenience remapping of parameters
|
|
102
102
|
self.value_columns = self.config.value_columns
|
|
@@ -371,9 +371,6 @@ class LSSTFluxToMagConverter(RailStage):
|
|
|
371
371
|
inputs = [('input', PqHandle)]
|
|
372
372
|
outputs = [('output', Hdf5Handle)]
|
|
373
373
|
|
|
374
|
-
def __init__(self, args, comm=None):
|
|
375
|
-
RailStage.__init__(self, args, comm=comm)
|
|
376
|
-
|
|
377
374
|
def _flux_to_mag(self, flux_vals):
|
|
378
375
|
return -2.5*np.log10(flux_vals) + self.config.mag_offset
|
|
379
376
|
|
|
@@ -452,9 +449,6 @@ class DustMapBase(RailStage):
|
|
|
452
449
|
fetch_func = dust_map_submod.fetch
|
|
453
450
|
fetch_func()
|
|
454
451
|
|
|
455
|
-
|
|
456
|
-
def __init__(self, args, comm=None):
|
|
457
|
-
RailStage.__init__(self, args, comm=comm)
|
|
458
452
|
|
|
459
453
|
def run(self):
|
|
460
454
|
data = self.get_data('input', allow_missing=True)
|
|
@@ -90,6 +90,26 @@ def test_InvRedshiftIncompleteness_returns_correct_shape(data):
|
|
|
90
90
|
assert degraded_data.shape[1] == data.data.shape[1]
|
|
91
91
|
os.remove(degrader.get_output(degrader.get_aliased_tag("output"), final_name=True))
|
|
92
92
|
|
|
93
|
+
|
|
94
|
+
def test_LineConfusion_returns_correct_shape(data):
|
|
95
|
+
"""Make sure returns same number of columns, fewer rows"""
|
|
96
|
+
OII = 3727
|
|
97
|
+
OIII = 5007
|
|
98
|
+
|
|
99
|
+
lc_2p_0II_0III = LineConfusion.make_stage(
|
|
100
|
+
name="lc_2p_0II_0III", true_wavelen=OII, wrong_wavelen=OIII, frac_wrong=0.02
|
|
101
|
+
)
|
|
102
|
+
lc_1p_0III_0II = LineConfusion.make_stage(
|
|
103
|
+
name="lc_1p_0III_0II", true_wavelen=OIII, wrong_wavelen=OII, frac_wrong=0.01
|
|
104
|
+
)
|
|
105
|
+
degraded_data = lc_1p_0III_0II(
|
|
106
|
+
lc_2p_0II_0III(data)
|
|
107
|
+
).data
|
|
108
|
+
assert degraded_data.shape[0] <= data.data.shape[0]
|
|
109
|
+
assert degraded_data.shape[1] == data.data.shape[1]
|
|
110
|
+
os.remove(lc_2p_0II_0III.get_output(lc_2p_0II_0III.get_aliased_tag("output"), final_name=True))
|
|
111
|
+
os.remove(lc_1p_0III_0II.get_output(lc_1p_0III_0II.get_aliased_tag("output"), final_name=True))
|
|
112
|
+
|
|
93
113
|
|
|
94
114
|
@pytest.mark.parametrize(
|
|
95
115
|
"percentile_cut,redshift_cut,errortype",
|
{pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.github/ISSUE_TEMPLATE/0-general_issue.md
RENAMED
|
File without changes
|
{pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.github/ISSUE_TEMPLATE/1-bug_report.md
RENAMED
|
File without changes
|
{pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.github/ISSUE_TEMPLATE/2-feature_request.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/.github/workflows/publish-to-pypi.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/src/pz_rail_astro_tools.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/tests/astro_tools/gcr_test_data/schema.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pz_rail_astro_tools-1.0.2 → pz_rail_astro_tools-1.0.3}/tests/astro_tools/test_gcr_engine.py
RENAMED
|
File without changes
|