pz-rail-astro-tools 1.0.3__tar.gz → 1.0.4__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 (49) hide show
  1. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/PKG-INFO +1 -1
  2. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/pz_rail_astro_tools.egg-info/PKG-INFO +1 -1
  3. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/pz_rail_astro_tools.egg-info/SOURCES.txt +3 -1
  4. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/astro_tools/__init__.py +0 -1
  5. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/astro_tools/_version.py +2 -2
  6. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/creation/degraders/photometric_errors.py +6 -1
  7. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/creation/degraders/spectroscopic_selections.py +11 -11
  8. pz_rail_astro_tools-1.0.4/src/rail/pipelines/utility/apply_phot_errors.py +71 -0
  9. pz_rail_astro_tools-1.0.4/src/rail/pipelines/utility/spectroscopic_selection_pipeline.py +75 -0
  10. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/tools/photometry_tools.py +4 -1
  11. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/tests/astro_tools/test_degraders.py +7 -1
  12. pz_rail_astro_tools-1.0.4/tests/astro_tools/test_pipline.py +15 -0
  13. pz_rail_astro_tools-1.0.3/src/rail/creation/degraders/lsst_error_model.py +0 -61
  14. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/.copier-answers.yml +0 -0
  15. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/.github/ISSUE_TEMPLATE/0-general_issue.md +0 -0
  16. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/.github/ISSUE_TEMPLATE/1-bug_report.md +0 -0
  17. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/.github/ISSUE_TEMPLATE/2-feature_request.md +0 -0
  18. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/.github/pull_request_template.md +0 -0
  19. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/.github/workflows/add-issue-to-project-tracker.yml +0 -0
  20. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/.github/workflows/linting.yml +0 -0
  21. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/.github/workflows/publish-to-pypi.yml +0 -0
  22. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/.github/workflows/smoke-test.yml +0 -0
  23. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/.github/workflows/testing-and-coverage.yml +0 -0
  24. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/.gitignore +0 -0
  25. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/.pre-commit-config.yaml +0 -0
  26. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/LICENSE +0 -0
  27. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/README.md +0 -0
  28. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/environment.yml +0 -0
  29. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/pyproject.toml +0 -0
  30. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/setup.cfg +0 -0
  31. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/setup.py +0 -0
  32. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/pz_rail_astro_tools.egg-info/dependency_links.txt +0 -0
  33. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/pz_rail_astro_tools.egg-info/requires.txt +0 -0
  34. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/pz_rail_astro_tools.egg-info/top_level.txt +0 -0
  35. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/creation/degraders/grid_selection.py +0 -0
  36. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/creation/degraders/observing_condition_degrader.py +0 -0
  37. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/creation/degraders/spectroscopic_degraders.py +0 -0
  38. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/creation/engines/gcr_engine.py +0 -0
  39. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/examples_data/creation_data/data/HSC_grid_settings.pkl +0 -0
  40. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/examples_data/creation_data/data/hsc_ratios_and_specz.hdf5 +0 -0
  41. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/examples_data/creation_data/data/survey_conditions/DC2-dr6-galcounts-i20-i25.3-nside-128.fits +0 -0
  42. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/examples_data/creation_data/data/survey_conditions/DC2-mask-neg-nside-128.fits +0 -0
  43. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_airmass_i_and_nightlt1825_HEAL.fits +0 -0
  44. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_fiveSigmaDepth_i_and_nightlt1825_HEAL.fits +0 -0
  45. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/src/rail/examples_data/testdata/rubin_dm_dc2_example2.pq +0 -0
  46. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/tests/astro_tools/gcr_test_data/schema.yaml +0 -0
  47. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/tests/astro_tools/gcr_test_data/test_object_tract_4850.hdf5 +0 -0
  48. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/tests/astro_tools/test_core.py +0 -0
  49. {pz_rail_astro_tools-1.0.3 → pz_rail_astro_tools-1.0.4}/tests/astro_tools/test_gcr_engine.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pz-rail-astro-tools
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Author-email: "LSST Dark Energy Science Collaboration (DESC)" <lsst-desc-rail-admin@slac.stanford.edu>
5
5
  License: MIT License
6
6
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pz-rail-astro-tools
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Author-email: "LSST Dark Energy Science Collaboration (DESC)" <lsst-desc-rail-admin@slac.stanford.edu>
5
5
  License: MIT License
6
6
 
@@ -23,7 +23,6 @@ src/pz_rail_astro_tools.egg-info/top_level.txt
23
23
  src/rail/astro_tools/__init__.py
24
24
  src/rail/astro_tools/_version.py
25
25
  src/rail/creation/degraders/grid_selection.py
26
- src/rail/creation/degraders/lsst_error_model.py
27
26
  src/rail/creation/degraders/observing_condition_degrader.py
28
27
  src/rail/creation/degraders/photometric_errors.py
29
28
  src/rail/creation/degraders/spectroscopic_degraders.py
@@ -36,9 +35,12 @@ src/rail/examples_data/creation_data/data/survey_conditions/DC2-mask-neg-nside-1
36
35
  src/rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_airmass_i_and_nightlt1825_HEAL.fits
37
36
  src/rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_fiveSigmaDepth_i_and_nightlt1825_HEAL.fits
38
37
  src/rail/examples_data/testdata/rubin_dm_dc2_example2.pq
38
+ src/rail/pipelines/utility/apply_phot_errors.py
39
+ src/rail/pipelines/utility/spectroscopic_selection_pipeline.py
39
40
  src/rail/tools/photometry_tools.py
40
41
  tests/astro_tools/test_core.py
41
42
  tests/astro_tools/test_degraders.py
42
43
  tests/astro_tools/test_gcr_engine.py
44
+ tests/astro_tools/test_pipline.py
43
45
  tests/astro_tools/gcr_test_data/schema.yaml
44
46
  tests/astro_tools/gcr_test_data/test_object_tract_4850.hdf5
@@ -4,5 +4,4 @@ from rail.creation.degraders.grid_selection import *
4
4
  from rail.creation.degraders.observing_condition_degrader import *
5
5
  from rail.creation.degraders.spectroscopic_degraders import *
6
6
  from rail.creation.degraders.spectroscopic_selections import *
7
- from rail.creation.degraders.lsst_error_model import *
8
7
  from rail.tools.photometry_tools import *
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '1.0.3'
16
- __version_tuple__ = version_tuple = (1, 0, 3)
15
+ __version__ = version = '1.0.4'
16
+ __version_tuple__ = version_tuple = (1, 0, 4)
@@ -4,6 +4,7 @@ error models defined in the package photerr
4
4
 
5
5
  Author: John Franklin Crenshaw, Tianqing Zhang
6
6
  """
7
+ import numpy as np
7
8
  from dataclasses import MISSING
8
9
 
9
10
  from ceci.config import StageParameter as Param
@@ -71,7 +72,11 @@ class PhotoErrorModel(Noisifier):
71
72
  data = self.get_data("input")
72
73
 
73
74
  # Add photometric errors
74
- obsData = self.noiseModel(data, random_state=self.config.seed)
75
+ if self.config.seed is not None: # pragma: no cover
76
+ seed = int(self.config.seed)
77
+ else:
78
+ seed = np.random.Generator(np.random.PCG64())
79
+ obsData = self.noiseModel(data, random_state=seed)
75
80
 
76
81
  # Return the new catalog
77
82
  self.add_data("output", obsData)
@@ -36,7 +36,7 @@ class SpecSelection(Selector):
36
36
  Random seed for reproducibility
37
37
  """
38
38
 
39
- name = "specselection"
39
+ name = "SpecSelection"
40
40
  config_options = Selector.config_options.copy()
41
41
  config_options.update(
42
42
  N_tot=Param(int, 10000, msg="Number of selected sources"),
@@ -121,9 +121,9 @@ class SpecSelection(Selector):
121
121
  if band not in self.config.colnames.keys():
122
122
  continue
123
123
  colname = self.config.colnames[band]
124
- self.mask &= (np.abs(data[colname]) < nondetect_val) & (
125
- ~np.isnan(data[colname])
126
- )
124
+ self.mask &= data[colname] != nondetect_val
125
+ self.mask &= ~np.isnan(data[colname])
126
+ self.mask &= np.isfinite(data[colname])
127
127
 
128
128
  def downsampling_N_tot(self):
129
129
  """Randomly sample down the objects to a given number of data objects.
@@ -180,7 +180,7 @@ class SpecSelection_GAMA(SpecSelection):
180
180
  The necessary column is r band.
181
181
  """
182
182
 
183
- name = "specselection_gama"
183
+ name = "SpecSelection_GAMA"
184
184
 
185
185
  def selection(self, data):
186
186
  """GAMA selection function. """
@@ -208,7 +208,7 @@ class SpecSelection_BOSS(SpecSelection):
208
208
  For BOSS selection, the data should at least include gri bands.
209
209
  """
210
210
 
211
- name = "specselection_boss"
211
+ name = "SpecSelection_BOSS"
212
212
 
213
213
  def selection(self, data):
214
214
  """The BOSS selection function."""
@@ -268,7 +268,7 @@ class SpecSelection_DEEP2(SpecSelection):
268
268
  conversion degrader is ready, this subclass will be updated accordingly.
269
269
  """
270
270
 
271
- name = "specselection_deep2"
271
+ name = "SpecSelection_DEEP2"
272
272
 
273
273
  def photometryCut(self, data):
274
274
  """Applies DEEP2 photometric cut based on Newman+13.
@@ -355,7 +355,7 @@ class SpecSelection_VVDSf02(SpecSelection):
355
355
  Necessary columns are i band magnitude and redshift.
356
356
  """
357
357
 
358
- name = "specselection_VVDSf02"
358
+ name = "SpecSelection_VVDSf02"
359
359
 
360
360
  def photometryCut(self, data):
361
361
  """Photometric cut of VVDS 2h-field based on LeFèvre+05.
@@ -466,7 +466,7 @@ class SpecSelection_zCOSMOS(SpecSelection):
466
466
  For zCOSMOS, the data should at least include i band and redshift.
467
467
  """
468
468
 
469
- name = "specselection_zCOSMOS"
469
+ name = "SpecSelection_zCOSMOS"
470
470
 
471
471
  def photometryCut(self, data):
472
472
  """Photometry cut for zCOSMOS based on Lilly+09.
@@ -527,7 +527,7 @@ class SpecSelection_HSC(SpecSelection):
527
527
  For HSC, the data should at least include giz bands and redshift.
528
528
  """
529
529
 
530
- name = "specselection_HSC"
530
+ name = "SpecSelection_HSC"
531
531
 
532
532
  def photometryCut(self, data):
533
533
  """HSC galaxies were binned in color magnitude space with i-band mag
@@ -604,4 +604,4 @@ class SpecSelection_HSC(SpecSelection):
604
604
  # start message
605
605
  printMsg = "Applying the HSC selection."
606
606
 
607
- return printMsg
607
+ return printMsg
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env python
2
+ # coding: utf-8
3
+
4
+ # Prerquisites, os, and numpy
5
+ import os
6
+ import numpy as np
7
+
8
+ # Various rail modules
9
+ from rail.tools.photometry_tools import Dereddener, Reddener
10
+
11
+ from rail.core.stage import RailStage, RailPipeline
12
+
13
+ import ceci
14
+
15
+ from rail.core.utils import RAILDIR
16
+
17
+ if 'PZ_DUSTMAP_DIR' not in os.environ:
18
+ os.environ['PZ_DUSTMAP_DIR'] = '.'
19
+
20
+ dustmap_dir = os.path.expandvars("${PZ_DUSTMAP_DIR}")
21
+
22
+
23
+ ERROR_MODELS = dict(
24
+ lsst = dict(
25
+ ErrorModel='LSSTErrorModel',
26
+ Module='rail.creation.degraders.photometric_errors',
27
+ ),
28
+ roman = dict(
29
+ ErrorModel='RomanErrorModel',
30
+ Module='rail.creation.degraders.photometric_errors',
31
+ ),
32
+ #euclid = dict(
33
+ # ErrorModel='EuclidErrorModel',
34
+ # Module='rail.creation.degraders.photometric_errors',
35
+ #),
36
+ )
37
+
38
+
39
+
40
+ class ApplyPhotErrorsPipeline(RailPipeline):
41
+
42
+ default_input_dict = dict(input='dummy.in')
43
+
44
+ def __init__(self, error_models=None):
45
+ RailPipeline.__init__(self)
46
+
47
+ DS = RailStage.data_store
48
+ DS.__class__.allow_overwrite = True
49
+
50
+ if error_models is None:
51
+ error_models = ERROR_MODELS
52
+
53
+ self.reddener = Reddener.build(
54
+ dustmap_dir=dustmap_dir,
55
+ )
56
+
57
+ previous_stage = self.reddener
58
+ for key, val in error_models.items():
59
+ error_model_class = ceci.PipelineStage.get_stage(val['ErrorModel'], val['Module'])
60
+ the_error_model = error_model_class.make_and_connect(
61
+ name=f'error_model_{key}',
62
+ connections=dict(input=previous_stage.io.output),
63
+ hdf5_groupname='',
64
+ )
65
+ self.add_stage(the_error_model)
66
+ previous_stage = the_error_model
67
+
68
+ self.dereddener_errors = Dereddener.build(
69
+ dustmap_dir=dustmap_dir,
70
+ connections=dict(input=previous_stage.io.output),
71
+ )
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env python
2
+ # coding: utf-8
3
+
4
+ # Prerquisites, os, and numpy
5
+ import os
6
+ import numpy as np
7
+
8
+ # Various rail modules
9
+
10
+ from rail.core.stage import RailStage, RailPipeline
11
+
12
+ import ceci
13
+
14
+ from rail.utils.catalog_utils import CatalogConfigBase
15
+ from rail.core.utils import RAILDIR
16
+
17
+ SELECTORS = dict(
18
+ GAMA = dict(
19
+ Selector='SpecSelection_GAMA',
20
+ Module='rail.creation.degraders.spectroscopic_selections',
21
+ ),
22
+ BOSS = dict(
23
+ Selector='SpecSelection_BOSS',
24
+ Module='rail.creation.degraders.spectroscopic_selections',
25
+ ),
26
+ VVDSf02 = dict(
27
+ Selector='SpecSelection_VVDSf02',
28
+ Module='rail.creation.degraders.spectroscopic_selections',
29
+ ),
30
+ zCOSMOS = dict(
31
+ Selector='SpecSelection_zCOSMOS',
32
+ Module='rail.creation.degraders.spectroscopic_selections',
33
+ ),
34
+ HSC = dict(
35
+ Selector='SpecSelection_HSC',
36
+ Module='rail.creation.degraders.spectroscopic_selections',
37
+ ),
38
+ )
39
+
40
+
41
+ CommonConfigParams = dict(
42
+ N_tot = 100_000,
43
+ nondetect_val = -np.inf,
44
+ downsample= False,
45
+ )
46
+
47
+
48
+ class SpectroscopicSelectionPipeline(RailPipeline):
49
+
50
+ default_input_dict = dict(input='dummy.in')
51
+
52
+ def __init__(self, selectors=None):
53
+ RailPipeline.__init__(self)
54
+
55
+ DS = RailStage.data_store
56
+ DS.__class__.allow_overwrite = True
57
+
58
+ if selectors is None:
59
+ selectors = SELECTORS.copy()
60
+
61
+ config_pars = CommonConfigParams.copy()
62
+ active_catalog = CatalogConfigBase.active_class()
63
+ if active_catalog:
64
+ colnames = active_catalog.band_name_dict()
65
+ colnames['redshift'] = active_catalog.redshift_col
66
+ config_pars['colnames'] = colnames
67
+
68
+ for key, val in selectors.items():
69
+ the_class = ceci.PipelineStage.get_stage(val['Selector'], val['Module'])
70
+ the_selector = the_class.make_and_connect(
71
+ name=f'select_{key}',
72
+ **config_pars,
73
+ )
74
+
75
+ self.add_stage(the_selector)
@@ -453,7 +453,10 @@ class DustMapBase(RailStage):
453
453
  def run(self):
454
454
  data = self.get_data('input', allow_missing=True)
455
455
  out_data = {}
456
- coords = SkyCoord(data[self.config.ra_name], data[self.config.dec_name], unit = 'deg',frame='fk5')
456
+ coords = SkyCoord(
457
+ np.array(data[self.config.ra_name]),
458
+ np.array(data[self.config.dec_name]),
459
+ unit = 'deg',frame='fk5')
457
460
  dust_map_dict = dict(sfd=dustmaps_sfd.SFDQuery)
458
461
  try:
459
462
  dust_map_class = dust_map_dict[self.config.dustmap_name]
@@ -13,7 +13,7 @@ from rail.creation.degraders.spectroscopic_degraders import InvRedshiftIncomplet
13
13
  from rail.creation.degraders.spectroscopic_selections import *
14
14
  from rail.creation.degraders.observing_condition_degrader import ObsCondition
15
15
  from rail.creation.degraders.grid_selection import GridSelection
16
- from rail.creation.degraders.lsst_error_model import LSSTErrorModel
16
+ from rail.creation.degraders.photometric_errors import EuclidErrorModel, LSSTErrorModel
17
17
 
18
18
 
19
19
  @pytest.fixture
@@ -391,3 +391,9 @@ def test_LSSTErrorModel_returns_correct_columns(data):
391
391
  assert f"{band}_err" in degraded_data.columns
392
392
  os.remove(degrader.get_output(degrader.get_aliased_tag("output"), final_name=True))
393
393
 
394
+
395
+ def test_EucliErrorModel(data):
396
+ # Setup the stage
397
+ degrader = EuclidErrorModel.make_stage()
398
+
399
+
@@ -0,0 +1,15 @@
1
+ import os
2
+ from rail.utils.testing_utils import build_and_read_pipeline
3
+
4
+ import pytest
5
+
6
+ @pytest.mark.parametrize(
7
+ "pipeline_class",
8
+ [
9
+ 'rail.pipelines.utility.apply_phot_errors.ApplyPhotErrorsPipeline',
10
+ 'rail.pipelines.utility.spectroscopic_selection_pipeline.SpectroscopicSelectionPipeline',
11
+ ]
12
+ )
13
+ def test_build_and_read_pipeline(pipeline_class):
14
+ build_and_read_pipeline(pipeline_class)
15
+
@@ -1,61 +0,0 @@
1
- """The LSST Model for photometric errors."""
2
- from dataclasses import MISSING
3
-
4
- from ceci.config import StageParameter as Param
5
- from photerr import LsstErrorModel as PhotErrErrorModel
6
- from photerr import LsstErrorParams as PhotErrErrorParams
7
- from rail.creation.degrader import Degrader
8
-
9
-
10
- class LSSTErrorModel(Degrader):
11
- """The LSST Model for photometric errors.
12
-
13
- This is a wrapper around the error model from PhotErr. The parameter
14
- docstring below is dynamically added by the installed version of PhotErr:
15
-
16
- """
17
-
18
- # Dynamically add the parameter docstring from PhotErr
19
- __doc__ += PhotErrErrorParams.__doc__
20
-
21
- name = "LSSTErrorModel"
22
- config_options = Degrader.config_options.copy()
23
-
24
- # Dynamically add all parameters from PhotErr
25
- _photerr_params = PhotErrErrorParams.__dataclass_fields__
26
- for key, val in _photerr_params.items():
27
- # Get the default value
28
- if val.default is MISSING:
29
- default = val.default_factory()
30
- else:
31
- default = val.default
32
-
33
- # Add this param to config_options
34
- config_options[key] = Param(
35
- None, # Let PhotErr handle type checking
36
- default,
37
- msg="See the main docstring for details about this parameter.",
38
- required=False,
39
- )
40
-
41
- def __init__(self, args, **kwargs):
42
- """
43
- Constructor
44
-
45
- Does standard Degrader initialization and sets up the error model.
46
- """
47
- super().__init__(args, **kwargs)
48
- self.error_model = PhotErrErrorModel(
49
- **{key: self.config[key] for key in self._photerr_params}
50
- )
51
-
52
- def run(self):
53
- """Return pandas DataFrame with photometric errors."""
54
- # Load the input catalog
55
- data = self.get_data("input")
56
-
57
- # Add photometric errors
58
- obsData = self.error_model(data, random_state=self.config.seed)
59
-
60
- # Return the new catalog
61
- self.add_data("output", obsData)