pz-rail-astro-tools 0.1.3__py3-none-any.whl → 0.1.4__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.
- {pz_rail_astro_tools-0.1.3.dist-info → pz_rail_astro_tools-0.1.4.dist-info}/METADATA +2 -2
- pz_rail_astro_tools-0.1.4.dist-info/RECORD +21 -0
- rail/astro_tools/__init__.py +6 -6
- rail/astro_tools/_version.py +2 -2
- rail/creation/{degradation → degraders}/grid_selection.py +1 -1
- rail/creation/{degradation → degraders}/spectroscopic_selections.py +1 -1
- rail/tools/{util_photometry.py → photometry_tools.py} +6 -6
- pz_rail_astro_tools-0.1.3.dist-info/RECORD +0 -22
- rail/creation/degradation/photerr_demo.ipynb +0 -238
- {pz_rail_astro_tools-0.1.3.dist-info → pz_rail_astro_tools-0.1.4.dist-info}/LICENSE +0 -0
- {pz_rail_astro_tools-0.1.3.dist-info → pz_rail_astro_tools-0.1.4.dist-info}/WHEEL +0 -0
- {pz_rail_astro_tools-0.1.3.dist-info → pz_rail_astro_tools-0.1.4.dist-info}/top_level.txt +0 -0
- /rail/creation/{degradation → degraders}/lsst_error_model.py +0 -0
- /rail/creation/{degradation → degraders}/observing_condition_degrader.py +0 -0
- /rail/creation/{degradation → degraders}/photometric_errors.py +0 -0
- /rail/creation/{degradation → degraders}/spectroscopic_degraders.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pz-rail-astro-tools
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.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
|
|
|
@@ -65,7 +65,7 @@ in [RAIL](https://github.com/LSSTDESC/RAIL).
|
|
|
65
65
|
|
|
66
66
|
This code, while public on GitHub, has not yet been released by DESC and is
|
|
67
67
|
still under active development. Our release of v1.0 will be accompanied by a
|
|
68
|
-
journal paper describing the development and validation of RAIL.
|
|
68
|
+
journal paper describing the development and validation of RAIL.
|
|
69
69
|
|
|
70
70
|
If you make use of the ideas or software in RAIL, please cite the repository
|
|
71
71
|
<https://github.com/LSSTDESC/RAIL>. You are welcome to re-use the code, which
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
rail/astro_tools/__init__.py,sha256=c0yzN5jMhByii01h_mjOWipeProO8vludBsO09dJkmc,377
|
|
2
|
+
rail/astro_tools/_version.py,sha256=9GTNkADgEYZ6fEjCvZZUdKyqxiPIgtskLFZNJz7nq_U,411
|
|
3
|
+
rail/creation/degraders/grid_selection.py,sha256=QCs7ZpLJ_GdJnIIt0WF09mBLeqsrzQ2CiDo0h0Hd3dQ,12438
|
|
4
|
+
rail/creation/degraders/lsst_error_model.py,sha256=WWQxPO3w1S6sALQxl7x7_mUI1f3o1eOGpBk3Yzi-1Q0,1969
|
|
5
|
+
rail/creation/degraders/observing_condition_degrader.py,sha256=jelIfFHzrgmRmRARm5uC36ZohepfMHq5djWT5wGEaZI,19987
|
|
6
|
+
rail/creation/degraders/photometric_errors.py,sha256=HbQaEKHEcSo4ab2J3qZAiVFxlJpLAQFwjGKUnSUmG8U,3927
|
|
7
|
+
rail/creation/degraders/spectroscopic_degraders.py,sha256=zpCxK0jbKTKlU-eqe05pW-BM2O743_ocEQy2TQPP3EA,5038
|
|
8
|
+
rail/creation/degraders/spectroscopic_selections.py,sha256=1nWeWFN3nE5mw1W6fxAcSjp3eWcWbRuY6TsYvDlT7Zc,22182
|
|
9
|
+
rail/creation/engines/gcr_engine.py,sha256=MTzbV-FDRAoWfTpUzKCrdyOGK3hsSJ5atSLpwslBE5Y,2989
|
|
10
|
+
rail/examples_data/creation_data/data/HSC_grid_settings.pkl,sha256=zpJoSR9TSnDyL64DPXivIMam3fn6GOZoyoJoeBj2LAk,141
|
|
11
|
+
rail/examples_data/creation_data/data/hsc_ratios_and_specz.hdf5,sha256=liH54wuuuHxToqjoAwQ_fFmEefk3haNweVThMwdDKN4,13823712
|
|
12
|
+
rail/examples_data/creation_data/data/survey_conditions/DC2-dr6-galcounts-i20-i25.3-nside-128.fits,sha256=jHv3dwoLQSKcGUx29cnN9t9AWef4JlGsqSbITJfZI0o,1581120
|
|
13
|
+
rail/examples_data/creation_data/data/survey_conditions/DC2-mask-neg-nside-128.fits,sha256=79Kg4xRP4WHlOCcS-3SKqf9aP_LZRAq-izIM0DFL6bw,1581120
|
|
14
|
+
rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_airmass_i_and_nightlt1825_HEAL.fits,sha256=twvyce70G3h1MQnGGFQJG9wZc8UbuNqXc6mjtiuaL1s,1581120
|
|
15
|
+
rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_fiveSigmaDepth_i_and_nightlt1825_HEAL.fits,sha256=RbMMFSVJQxGhZnL4BnISE9VTNljfTZwV6Bax6NxverY,1581120
|
|
16
|
+
rail/tools/photometry_tools.py,sha256=aAIfD_CsYvJappbh6FR2GLt2eeQdMg59N5VuLD5QTjg,18419
|
|
17
|
+
pz_rail_astro_tools-0.1.4.dist-info/LICENSE,sha256=tLMEN21HbzvT-7umOVVvPjaJZbQxCa-2bAeYLwG5Q04,1102
|
|
18
|
+
pz_rail_astro_tools-0.1.4.dist-info/METADATA,sha256=CrJI-XlnSU9JMf941C61rFxUoQjoKstxAkWcRZzevUI,3947
|
|
19
|
+
pz_rail_astro_tools-0.1.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
20
|
+
pz_rail_astro_tools-0.1.4.dist-info/top_level.txt,sha256=6R6sqn-85I8YZTzmB9gv7sqckB2QaOTHbu-QLGTWBRE,5
|
|
21
|
+
pz_rail_astro_tools-0.1.4.dist-info/RECORD,,
|
rail/astro_tools/__init__.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from ._version import __version__
|
|
2
2
|
|
|
3
|
-
from rail.creation.
|
|
4
|
-
from rail.creation.
|
|
5
|
-
from rail.creation.
|
|
6
|
-
from rail.creation.
|
|
7
|
-
from rail.creation.
|
|
8
|
-
from rail.tools.
|
|
3
|
+
from rail.creation.degraders.grid_selection import *
|
|
4
|
+
from rail.creation.degraders.observing_condition_degrader import *
|
|
5
|
+
from rail.creation.degraders.spectroscopic_degraders import *
|
|
6
|
+
from rail.creation.degraders.spectroscopic_selections import *
|
|
7
|
+
from rail.creation.degraders.lsst_error_model import *
|
|
8
|
+
from rail.tools.photometry_tools import *
|
rail/astro_tools/_version.py
CHANGED
|
@@ -6,7 +6,7 @@ import numpy as np
|
|
|
6
6
|
from ceci.config import StageParameter as Param
|
|
7
7
|
from rail.creation.selector import Selector
|
|
8
8
|
from scipy.interpolate import interp1d
|
|
9
|
-
from rail.
|
|
9
|
+
from rail.utils.path_utils import RAILDIR
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class SpecSelection(Selector):
|
|
@@ -68,7 +68,7 @@ def _compute_flux_error(flux, magnitude_error):
|
|
|
68
68
|
return flux_error
|
|
69
69
|
|
|
70
70
|
|
|
71
|
-
class
|
|
71
|
+
class PhotometryManipulator(RailStage, ABC):
|
|
72
72
|
"""
|
|
73
73
|
Base class to perform opertations on magnitudes. A table with input magnitudes and errors is
|
|
74
74
|
processed and transformed into an output table with new magnitudes and errors.
|
|
@@ -76,7 +76,7 @@ class PhotormetryManipulator(RailStage, ABC):
|
|
|
76
76
|
Subclasses must implement the run() and compute() method.
|
|
77
77
|
"""
|
|
78
78
|
|
|
79
|
-
name = '
|
|
79
|
+
name = 'PhotometryManipulator'
|
|
80
80
|
config_options = RailStage.config_options.copy()
|
|
81
81
|
config_options.update(
|
|
82
82
|
value_columns=Param(
|
|
@@ -171,7 +171,7 @@ class PhotormetryManipulator(RailStage, ABC):
|
|
|
171
171
|
return self.get_handle('output')
|
|
172
172
|
|
|
173
173
|
|
|
174
|
-
class HyperbolicSmoothing(
|
|
174
|
+
class HyperbolicSmoothing(PhotometryManipulator):
|
|
175
175
|
"""
|
|
176
176
|
Initial stage to compute hyperbolic magnitudes (Lupton et al. 1999). Estimates the smoothing
|
|
177
177
|
parameter b that is used by the second stage (`HyperbolicMagnitudes`) to convert classical to
|
|
@@ -179,7 +179,7 @@ class HyperbolicSmoothing(PhotormetryManipulator):
|
|
|
179
179
|
"""
|
|
180
180
|
|
|
181
181
|
name = 'HyperbolicSmoothing'
|
|
182
|
-
config_options =
|
|
182
|
+
config_options = PhotometryManipulator.config_options.copy()
|
|
183
183
|
inputs = [('input', PqHandle)]
|
|
184
184
|
outputs = [('parameters', PqHandle)]
|
|
185
185
|
|
|
@@ -240,7 +240,7 @@ class HyperbolicSmoothing(PhotormetryManipulator):
|
|
|
240
240
|
return self.get_handle('parameters')
|
|
241
241
|
|
|
242
242
|
|
|
243
|
-
class HyperbolicMagnitudes(
|
|
243
|
+
class HyperbolicMagnitudes(PhotometryManipulator):
|
|
244
244
|
"""
|
|
245
245
|
Convert a set of classical magnitudes to hyperbolic magnitudes (Lupton et al. 1999). Requires
|
|
246
246
|
input from the initial stage (`HyperbolicSmoothing`) to supply optimal values for the smoothing
|
|
@@ -248,7 +248,7 @@ class HyperbolicMagnitudes(PhotormetryManipulator):
|
|
|
248
248
|
"""
|
|
249
249
|
|
|
250
250
|
name = 'HyperbolicMagnitudes'
|
|
251
|
-
config_options =
|
|
251
|
+
config_options = PhotometryManipulator.config_options.copy()
|
|
252
252
|
inputs = [('input', PqHandle),
|
|
253
253
|
('parameters', PqHandle)]
|
|
254
254
|
outputs = [('output', PqHandle)]
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
rail/astro_tools/__init__.py,sha256=CwIb_-fmJ0DTHnnxVNTwXYvof69yPcBxp6RiHGx6f4M,386
|
|
2
|
-
rail/astro_tools/_version.py,sha256=L5DCMp1QAlSqy-8bW7d51bLubTxNjZGYc5fMQkb752U,411
|
|
3
|
-
rail/creation/degradation/grid_selection.py,sha256=zUT75TuFLUzyPg9loSkGEO1HM35a5OtpbXRYSk1W9w8,12432
|
|
4
|
-
rail/creation/degradation/lsst_error_model.py,sha256=WWQxPO3w1S6sALQxl7x7_mUI1f3o1eOGpBk3Yzi-1Q0,1969
|
|
5
|
-
rail/creation/degradation/observing_condition_degrader.py,sha256=jelIfFHzrgmRmRARm5uC36ZohepfMHq5djWT5wGEaZI,19987
|
|
6
|
-
rail/creation/degradation/photerr_demo.ipynb,sha256=ZT_CX2v88Qqxq8OS8MEk2BT8qiZRXJ2xNB2EDYrf9cA,6650
|
|
7
|
-
rail/creation/degradation/photometric_errors.py,sha256=HbQaEKHEcSo4ab2J3qZAiVFxlJpLAQFwjGKUnSUmG8U,3927
|
|
8
|
-
rail/creation/degradation/spectroscopic_degraders.py,sha256=zpCxK0jbKTKlU-eqe05pW-BM2O743_ocEQy2TQPP3EA,5038
|
|
9
|
-
rail/creation/degradation/spectroscopic_selections.py,sha256=nzn8KSOEsQRX-FORu0VEUa303TpR6i4VvGf9vb3ip8Q,22176
|
|
10
|
-
rail/creation/engines/gcr_engine.py,sha256=MTzbV-FDRAoWfTpUzKCrdyOGK3hsSJ5atSLpwslBE5Y,2989
|
|
11
|
-
rail/examples_data/creation_data/data/HSC_grid_settings.pkl,sha256=zpJoSR9TSnDyL64DPXivIMam3fn6GOZoyoJoeBj2LAk,141
|
|
12
|
-
rail/examples_data/creation_data/data/hsc_ratios_and_specz.hdf5,sha256=liH54wuuuHxToqjoAwQ_fFmEefk3haNweVThMwdDKN4,13823712
|
|
13
|
-
rail/examples_data/creation_data/data/survey_conditions/DC2-dr6-galcounts-i20-i25.3-nside-128.fits,sha256=jHv3dwoLQSKcGUx29cnN9t9AWef4JlGsqSbITJfZI0o,1581120
|
|
14
|
-
rail/examples_data/creation_data/data/survey_conditions/DC2-mask-neg-nside-128.fits,sha256=79Kg4xRP4WHlOCcS-3SKqf9aP_LZRAq-izIM0DFL6bw,1581120
|
|
15
|
-
rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_airmass_i_and_nightlt1825_HEAL.fits,sha256=twvyce70G3h1MQnGGFQJG9wZc8UbuNqXc6mjtiuaL1s,1581120
|
|
16
|
-
rail/examples_data/creation_data/data/survey_conditions/minion_1016_dc2_Median_fiveSigmaDepth_i_and_nightlt1825_HEAL.fits,sha256=RbMMFSVJQxGhZnL4BnISE9VTNljfTZwV6Bax6NxverY,1581120
|
|
17
|
-
rail/tools/util_photometry.py,sha256=canY8t7rxX7ng_PfPEtfCsF1SCnv-BwGBRSGel97aPw,18425
|
|
18
|
-
pz_rail_astro_tools-0.1.3.dist-info/LICENSE,sha256=tLMEN21HbzvT-7umOVVvPjaJZbQxCa-2bAeYLwG5Q04,1102
|
|
19
|
-
pz_rail_astro_tools-0.1.3.dist-info/METADATA,sha256=1LT110NObmr7eEDKUiznHSuAtrP6pzQsobBTKedFY0M,3946
|
|
20
|
-
pz_rail_astro_tools-0.1.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
21
|
-
pz_rail_astro_tools-0.1.3.dist-info/top_level.txt,sha256=6R6sqn-85I8YZTzmB9gv7sqckB2QaOTHbu-QLGTWBRE,5
|
|
22
|
-
pz_rail_astro_tools-0.1.3.dist-info/RECORD,,
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"cells": [
|
|
3
|
-
{
|
|
4
|
-
"cell_type": "markdown",
|
|
5
|
-
"id": "2610a0f0-0c71-4401-896f-734442bcd66d",
|
|
6
|
-
"metadata": {},
|
|
7
|
-
"source": [
|
|
8
|
-
"## Photometric error stage demo\n",
|
|
9
|
-
"\n",
|
|
10
|
-
"author: Tianqing Zhang, John-Franklin Crenshaw\n",
|
|
11
|
-
"\n",
|
|
12
|
-
"This notebook demonstrate the use of `rail.creation.degradation.photometric_errors`, which adds column for the photometric noise to the catalog based on the package PhotErr developed by John-Franklin Crenshaw. The RAIL stage PhotoErrorModel inherit from the Noisifier base classes, and the LSST, Roman, Euclid child classes inherit from the PhotoErrorModel"
|
|
13
|
-
]
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"cell_type": "code",
|
|
17
|
-
"execution_count": null,
|
|
18
|
-
"id": "f7a6adc3-68e8-4a1d-842f-bfb0960a1c4a",
|
|
19
|
-
"metadata": {},
|
|
20
|
-
"outputs": [],
|
|
21
|
-
"source": [
|
|
22
|
-
"\n",
|
|
23
|
-
"from rail.creation.degradation.photometric_errors import LSSTErrorModel\n",
|
|
24
|
-
"from rail.creation.degradation.photometric_errors import RomanErrorModel\n",
|
|
25
|
-
"from rail.creation.degradation.photometric_errors import EuclidErrorModel\n",
|
|
26
|
-
"\n",
|
|
27
|
-
"from rail.core.data import PqHandle\n",
|
|
28
|
-
"from rail.core.stage import RailStage\n",
|
|
29
|
-
"\n",
|
|
30
|
-
"import matplotlib.pyplot as plt\n",
|
|
31
|
-
"import pandas as pd\n",
|
|
32
|
-
"import numpy as np\n",
|
|
33
|
-
"\n"
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"cell_type": "code",
|
|
38
|
-
"execution_count": null,
|
|
39
|
-
"id": "6912a740-31ea-4987-b06d-81ff17cd895a",
|
|
40
|
-
"metadata": {},
|
|
41
|
-
"outputs": [],
|
|
42
|
-
"source": [
|
|
43
|
-
"DS = RailStage.data_store\n",
|
|
44
|
-
"DS.__class__.allow_overwrite = True\n"
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"cell_type": "markdown",
|
|
49
|
-
"id": "a282c2ed-141b-4507-8254-dc8fbc9864dc",
|
|
50
|
-
"metadata": {},
|
|
51
|
-
"source": [
|
|
52
|
-
"### Create a random catalog with ugrizy+YJHF bands as the the true input"
|
|
53
|
-
]
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"cell_type": "code",
|
|
57
|
-
"execution_count": null,
|
|
58
|
-
"id": "1078bc2a-fc54-41c3-bd30-6c447bb971d4",
|
|
59
|
-
"metadata": {},
|
|
60
|
-
"outputs": [],
|
|
61
|
-
"source": [
|
|
62
|
-
"data = np.random.normal(23, 3, size = (1000,10))\n",
|
|
63
|
-
"\n",
|
|
64
|
-
"data_df = pd.DataFrame(data=data, # values\n",
|
|
65
|
-
" columns=['u', 'g', 'r', 'i', 'z', 'y', 'Y', 'J', 'H', 'F'])\n",
|
|
66
|
-
"data_truth = PqHandle('input')\n",
|
|
67
|
-
"data_truth.set_data(data_df)"
|
|
68
|
-
]
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"cell_type": "markdown",
|
|
72
|
-
"id": "1da27deb-d167-4f38-8c59-f270184d6ab3",
|
|
73
|
-
"metadata": {},
|
|
74
|
-
"source": [
|
|
75
|
-
"### The LSST error model adds noise to the optical bands"
|
|
76
|
-
]
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"cell_type": "code",
|
|
80
|
-
"execution_count": null,
|
|
81
|
-
"id": "e5f4862a-0621-46d4-8901-7e84b461c424",
|
|
82
|
-
"metadata": {},
|
|
83
|
-
"outputs": [],
|
|
84
|
-
"source": [
|
|
85
|
-
"errorModel_lsst = LSSTErrorModel.make_stage(name=\"error_model\")\n",
|
|
86
|
-
"\n",
|
|
87
|
-
"samples_w_errs = errorModel_lsst(data_truth)\n",
|
|
88
|
-
"samples_w_errs()\n"
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"cell_type": "code",
|
|
93
|
-
"execution_count": null,
|
|
94
|
-
"id": "6282c42e-1a6f-480a-aa2b-817bd30d372f",
|
|
95
|
-
"metadata": {},
|
|
96
|
-
"outputs": [],
|
|
97
|
-
"source": [
|
|
98
|
-
"fig, ax = plt.subplots(figsize=(5, 4), dpi=100)\n",
|
|
99
|
-
"\n",
|
|
100
|
-
"for band in \"ugrizy\":\n",
|
|
101
|
-
" # pull out the magnitudes and errors\n",
|
|
102
|
-
" mags = samples_w_errs.data[band].to_numpy()\n",
|
|
103
|
-
" errs = samples_w_errs.data[band + \"_err\"].to_numpy()\n",
|
|
104
|
-
"\n",
|
|
105
|
-
" # sort them by magnitude\n",
|
|
106
|
-
" mags, errs = mags[mags.argsort()], errs[mags.argsort()]\n",
|
|
107
|
-
"\n",
|
|
108
|
-
" # plot errs vs mags\n",
|
|
109
|
-
" ax.plot(mags, errs, label=band)\n",
|
|
110
|
-
"\n",
|
|
111
|
-
"ax.legend()\n",
|
|
112
|
-
"ax.set(xlabel=\"Magnitude (AB)\", ylabel=\"Error (mags)\")\n",
|
|
113
|
-
"plt.show()\n"
|
|
114
|
-
]
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"cell_type": "markdown",
|
|
118
|
-
"id": "50927ccb-4492-4bdd-a29b-0907704b2c59",
|
|
119
|
-
"metadata": {},
|
|
120
|
-
"source": [
|
|
121
|
-
"### The Roman error model adds noise to the infrared bands"
|
|
122
|
-
]
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"cell_type": "code",
|
|
126
|
-
"execution_count": null,
|
|
127
|
-
"id": "d484a34b-cf10-45bd-8571-b78dc1818180",
|
|
128
|
-
"metadata": {},
|
|
129
|
-
"outputs": [],
|
|
130
|
-
"source": [
|
|
131
|
-
"errorModel_Roman = RomanErrorModel.make_stage(name=\"error_model\")\n",
|
|
132
|
-
"\n",
|
|
133
|
-
"samples_w_errs_roman = errorModel_Roman(data_truth)\n",
|
|
134
|
-
"samples_w_errs_roman()"
|
|
135
|
-
]
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
"cell_type": "code",
|
|
139
|
-
"execution_count": null,
|
|
140
|
-
"id": "a12362dc-0689-43f3-b990-edff734010bb",
|
|
141
|
-
"metadata": {},
|
|
142
|
-
"outputs": [],
|
|
143
|
-
"source": [
|
|
144
|
-
"fig, ax = plt.subplots(figsize=(5, 4), dpi=100)\n",
|
|
145
|
-
"\n",
|
|
146
|
-
"for band in \"YJHF\":\n",
|
|
147
|
-
" # pull out the magnitudes and errors\n",
|
|
148
|
-
" mags = samples_w_errs_roman.data[band].to_numpy()\n",
|
|
149
|
-
" errs = samples_w_errs_roman.data[band + \"_err\"].to_numpy()\n",
|
|
150
|
-
"\n",
|
|
151
|
-
" # sort them by magnitude\n",
|
|
152
|
-
" mags, errs = mags[mags.argsort()], errs[mags.argsort()]\n",
|
|
153
|
-
"\n",
|
|
154
|
-
" # plot errs vs mags\n",
|
|
155
|
-
" ax.plot(mags, errs, label=band)\n",
|
|
156
|
-
"\n",
|
|
157
|
-
"ax.legend()\n",
|
|
158
|
-
"ax.set(xlabel=\"Magnitude (AB)\", ylabel=\"Error (mags)\")\n",
|
|
159
|
-
"plt.show()\n"
|
|
160
|
-
]
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"cell_type": "markdown",
|
|
164
|
-
"id": "359de4ad-a47c-4dc5-8c81-53aeb92bdf42",
|
|
165
|
-
"metadata": {},
|
|
166
|
-
"source": [
|
|
167
|
-
"### The Euclid error model adds noise to YJH bands"
|
|
168
|
-
]
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
"cell_type": "code",
|
|
172
|
-
"execution_count": null,
|
|
173
|
-
"id": "775d0a23-7435-4b01-83db-2234c3d24f57",
|
|
174
|
-
"metadata": {},
|
|
175
|
-
"outputs": [],
|
|
176
|
-
"source": [
|
|
177
|
-
"errorModel_Euclid = EuclidErrorModel.make_stage(name=\"error_model\")\n",
|
|
178
|
-
"\n",
|
|
179
|
-
"samples_w_errs_Euclid = errorModel_Euclid(data_truth)\n",
|
|
180
|
-
"samples_w_errs_Euclid()"
|
|
181
|
-
]
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
"cell_type": "code",
|
|
185
|
-
"execution_count": null,
|
|
186
|
-
"id": "7fcfe07a-5571-4dd3-8ad0-358964c1d493",
|
|
187
|
-
"metadata": {},
|
|
188
|
-
"outputs": [],
|
|
189
|
-
"source": [
|
|
190
|
-
"fig, ax = plt.subplots(figsize=(5, 4), dpi=100)\n",
|
|
191
|
-
"\n",
|
|
192
|
-
"for band in \"YJH\":\n",
|
|
193
|
-
" # pull out the magnitudes and errors\n",
|
|
194
|
-
" mags = samples_w_errs_Euclid.data[band].to_numpy()\n",
|
|
195
|
-
" errs = samples_w_errs_Euclid.data[band + \"_err\"].to_numpy()\n",
|
|
196
|
-
"\n",
|
|
197
|
-
" # sort them by magnitude\n",
|
|
198
|
-
" mags, errs = mags[mags.argsort()], errs[mags.argsort()]\n",
|
|
199
|
-
"\n",
|
|
200
|
-
" # plot errs vs mags\n",
|
|
201
|
-
" ax.plot(mags, errs, label=band)\n",
|
|
202
|
-
"\n",
|
|
203
|
-
"ax.legend()\n",
|
|
204
|
-
"ax.set(xlabel=\"Magnitude (AB)\", ylabel=\"Error (mags)\")\n",
|
|
205
|
-
"plt.show()\n"
|
|
206
|
-
]
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
"cell_type": "code",
|
|
210
|
-
"execution_count": null,
|
|
211
|
-
"id": "268b3d37-b7fd-4ac1-8457-2104a87c9e6d",
|
|
212
|
-
"metadata": {},
|
|
213
|
-
"outputs": [],
|
|
214
|
-
"source": []
|
|
215
|
-
}
|
|
216
|
-
],
|
|
217
|
-
"metadata": {
|
|
218
|
-
"kernelspec": {
|
|
219
|
-
"display_name": "rail_env",
|
|
220
|
-
"language": "python",
|
|
221
|
-
"name": "rail_env"
|
|
222
|
-
},
|
|
223
|
-
"language_info": {
|
|
224
|
-
"codemirror_mode": {
|
|
225
|
-
"name": "ipython",
|
|
226
|
-
"version": 3
|
|
227
|
-
},
|
|
228
|
-
"file_extension": ".py",
|
|
229
|
-
"mimetype": "text/x-python",
|
|
230
|
-
"name": "python",
|
|
231
|
-
"nbconvert_exporter": "python",
|
|
232
|
-
"pygments_lexer": "ipython3",
|
|
233
|
-
"version": "3.11.4"
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
"nbformat": 4,
|
|
237
|
-
"nbformat_minor": 5
|
|
238
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|