pyEDITH 1.7.2__tar.gz → 1.8.0__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.
- {pyedith-1.7.2/src/pyEDITH.egg-info → pyedith-1.8.0}/PKG-INFO +25 -71
- {pyedith-1.7.2 → pyedith-1.8.0}/README.md +22 -69
- {pyedith-1.7.2 → pyedith-1.8.0}/pyproject.toml +12 -3
- {pyedith-1.7.2 → pyedith-1.8.0}/src/pyEDITH/__init__.py +16 -10
- {pyedith-1.7.2 → pyedith-1.8.0}/src/pyEDITH/astrophysical_scene.py +16 -5
- pyedith-1.8.0/src/pyEDITH/cli.py +391 -0
- {pyedith-1.7.2/src/pyEDITH/components → pyedith-1.8.0/src/pyEDITH}/coronagraphs.py +48 -52
- {pyedith-1.7.2/src/pyEDITH/components → pyedith-1.8.0/src/pyEDITH}/detectors.py +12 -16
- {pyedith-1.7.2 → pyedith-1.8.0}/src/pyEDITH/exposure_time_calculator.py +20 -69
- pyedith-1.8.0/src/pyEDITH/filters.py +180 -0
- pyedith-1.8.0/src/pyEDITH/observation.py +129 -0
- {pyedith-1.7.2 → pyedith-1.8.0}/src/pyEDITH/observatory.py +14 -6
- pyedith-1.8.0/src/pyEDITH/parse_input.py +1055 -0
- {pyedith-1.7.2/src/pyEDITH/components → pyedith-1.8.0/src/pyEDITH}/telescopes.py +7 -15
- {pyedith-1.7.2 → pyedith-1.8.0}/src/pyEDITH/utils.py +28 -157
- {pyedith-1.7.2 → pyedith-1.8.0/src/pyEDITH.egg-info}/PKG-INFO +25 -71
- {pyedith-1.7.2 → pyedith-1.8.0}/src/pyEDITH.egg-info/SOURCES.txt +5 -3
- {pyedith-1.7.2 → pyedith-1.8.0}/src/pyEDITH.egg-info/requires.txt +2 -1
- {pyedith-1.7.2 → pyedith-1.8.0}/tests/test_astrophysical_scene.py +134 -62
- pyedith-1.8.0/tests/test_cli.py +802 -0
- {pyedith-1.7.2 → pyedith-1.8.0}/tests/test_coronagraphs.py +160 -85
- {pyedith-1.7.2 → pyedith-1.8.0}/tests/test_detectors.py +8 -5
- {pyedith-1.7.2 → pyedith-1.8.0}/tests/test_exposure_time_calculator.py +26 -37
- pyedith-1.8.0/tests/test_filters.py +324 -0
- {pyedith-1.7.2 → pyedith-1.8.0}/tests/test_init.py +54 -6
- pyedith-1.8.0/tests/test_observation.py +200 -0
- {pyedith-1.7.2 → pyedith-1.8.0}/tests/test_observatory.py +125 -112
- pyedith-1.8.0/tests/test_parse_input.py +2903 -0
- {pyedith-1.7.2 → pyedith-1.8.0}/tests/test_telescopes.py +11 -19
- {pyedith-1.7.2 → pyedith-1.8.0}/tests/test_utils.py +111 -186
- pyedith-1.7.2/src/pyEDITH/cli.py +0 -275
- pyedith-1.7.2/src/pyEDITH/observation.py +0 -201
- pyedith-1.7.2/src/pyEDITH/parse_input.py +0 -630
- pyedith-1.7.2/tests/test_cli.py +0 -515
- pyedith-1.7.2/tests/test_observation.py +0 -288
- pyedith-1.7.2/tests/test_parse_input.py +0 -1784
- {pyedith-1.7.2 → pyedith-1.8.0}/LICENSE +0 -0
- {pyedith-1.7.2 → pyedith-1.8.0}/setup.cfg +0 -0
- {pyedith-1.7.2 → pyedith-1.8.0}/src/pyEDITH/units.py +0 -0
- {pyedith-1.7.2 → pyedith-1.8.0}/src/pyEDITH.egg-info/dependency_links.txt +0 -0
- {pyedith-1.7.2 → pyedith-1.8.0}/src/pyEDITH.egg-info/entry_points.txt +0 -0
- {pyedith-1.7.2 → pyedith-1.8.0}/src/pyEDITH.egg-info/top_level.txt +0 -0
- {pyedith-1.7.2 → pyedith-1.8.0}/tests/test_units.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyEDITH
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.0
|
|
4
4
|
Summary: Exposure Direct Imaging Timer for HWO (Python Version)
|
|
5
5
|
Author-email: Eleonora Alei <eleonora.alei@nasa.gov>, Miles Currie <miles.h.currie@nasa.gov>, Corey Spohn <corey.a.spohn@nasa.gov>
|
|
6
6
|
Project-URL: Homepage, https://github.com/HabitableWorldsObservatory/pyEDITH/
|
|
@@ -15,7 +15,8 @@ Requires-Dist: numpy
|
|
|
15
15
|
Requires-Dist: scipy
|
|
16
16
|
Requires-Dist: astropy
|
|
17
17
|
Requires-Dist: pandas
|
|
18
|
-
Requires-Dist: yippy
|
|
18
|
+
Requires-Dist: yippy<3,>=2.10.2
|
|
19
|
+
Requires-Dist: hwoutils<2
|
|
19
20
|
Requires-Dist: openpyxl
|
|
20
21
|
Requires-Dist: synphot
|
|
21
22
|
Requires-Dist: eacy
|
|
@@ -117,73 +118,27 @@ This mode offers much more flexibility to run the ETC. We refer to our tutorials
|
|
|
117
118
|
|
|
118
119
|
# Glossary
|
|
119
120
|
|
|
120
|
-
|
|
121
|
-
| Variable Name
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
| toverhead_multi | Dimensionless | Scalar | Multiplicative overhead time | |
|
|
142
|
-
| telescope_optical_throughput | Dimensionless | [nlambda] | Optical throughput of telescope | |
|
|
143
|
-
| temperature | Temperature | Scalar | Temperature of the warm optics | |
|
|
144
|
-
| T_contamination | Dimensionless | Scalar | Effective throughput factor for contamination | |
|
|
145
|
-
| pixscale_mas | Milliarcsecond | Scalar | Detector pixel scale | |
|
|
146
|
-
| npix_multiplier | Dimensionless | Scalar | Number of detector pixels per image plane "pixel" | |
|
|
147
|
-
| DC | Electron / (Pixel * Second) | [nlambda] | Dark current | |
|
|
148
|
-
| RN | Electron / (Pixel * Read) | [nlambda] | Read noise | |
|
|
149
|
-
| tread | Second | [nlambda] | Read time | |
|
|
150
|
-
| CIC | Electron / (Pixel * Photon) | [nlambda] | Clock-induced charge | |
|
|
151
|
-
| QE | Electron / Photon | [nlambda] | Quantum efficiency of detector | |
|
|
152
|
-
| dQE | Dimensionless | [nlambda] | Effective QE due to degradation | |
|
|
153
|
-
| wavelength | Length | [nlambda] | Observation wavelengths | |
|
|
154
|
-
| SNR | Dimensionless | [nlambda] | Signal-to-noise ratio | |
|
|
155
|
-
| photometric_aperture_radius | λ/D | Scalar | Photometric aperture radius | |
|
|
156
|
-
| psf_trunc_ratio | Dimensionless | Scalar | PSF truncation ratio | |
|
|
157
|
-
| CRb_multiplier | Dimensionless | Scalar | Factor to multiply to remove background | |
|
|
158
|
-
| td_limit | Time | Scalar | Limit placed on exposure times | |
|
|
159
|
-
| nooptimize | Integer | Scalar | Flag to disable exposure time optimization | |
|
|
160
|
-
| optimize_phase | Integer | Scalar | Flag to optimize planet phase (non-functional) | |
|
|
161
|
-
| ntot | Integer | Scalar | Meaning not explicitly defined in code | |
|
|
162
|
-
| nmeananom | Integer | Scalar | Number of mean anomalies | |
|
|
163
|
-
| norbits | Integer | Scalar | Number of orbits | | | |
|
|
164
|
-
| dist | Length | Scalar | Distance to star | |
|
|
165
|
-
| vmag | Magnitude | Scalar | Stellar magnitude at V band | |
|
|
166
|
-
| mag | Magnitude | [nlambda] | Stellar magnitude at desired wavelengths | |
|
|
167
|
-
| stellar_angular_diameter_arcsec | Arcsecond | Scalar | Angular diameter of star | |
|
|
168
|
-
| nzodis | Zodi | Scalar | Amount of exozodi around target star | |
|
|
169
|
-
| ra | Degree | Scalar | Right ascension of target star | |
|
|
170
|
-
| dec | Degree | Scalar | Declination of target star | |
|
|
171
|
-
| semimajor_axis | Astronomical Units | Scalar | Semimajor axis of the planet's orbit (used to calculate separation; assumes face-on orbit) | |
|
|
172
|
-
|
|
173
|
-
| separation | Arcsecond | Scalar | Separation of planet | |
|
|
174
|
-
| deltamag | Magnitude | Scalar | Magnitude difference between planet and host star | |
|
|
175
|
-
| min_deltamag | Magnitude | Scalar | Brightest planet to resolve at the IWA | |
|
|
176
|
-
| F0V | Photon / (Second * cm² * nm) | Scalar | Flux zero point for V band | |
|
|
177
|
-
| F0 | Photon / (Second * cm² * nm) | [nlambda] | Flux zero points for prescribed wavelengths | |
|
|
178
|
-
| M_V | Magnitude | Scalar | Absolute V band magnitude of target star | |
|
|
179
|
-
| Fzodi_list | Dimensionless | [nlambda] | Zodiacal light fluxes | |
|
|
180
|
-
| Fexozodi_list | Dimensionless | [nlambda] | Exozodiacal light fluxes | |
|
|
181
|
-
| Fbinary_list | Dimensionless | [nlambda] | Binary star fluxes | |
|
|
182
|
-
| Fp_over_Fs | Dimensionless | Scalar | Flux of planet relative to star | |
|
|
183
|
-
| | | | | |
|
|
184
|
-
| | | | | |
|
|
185
|
-
| | | | | |
|
|
186
|
-
-->
|
|
121
|
+
## Within `filters.py`
|
|
122
|
+
| Variable Name | Length | Unit | Meaning | User Editable |
|
|
123
|
+
| ------------------ | --------- | ------------- | ------------------------------------------------- | ------------- |
|
|
124
|
+
| name | Scalar | String | Filter identifier (e.g., "UV", "500nm") | Yes |
|
|
125
|
+
| type | Scalar | String | Type of filter ("IFS" or "IMAGER") | Yes |
|
|
126
|
+
| low | Scalar | μm | Lower wavelength bound of the filter | Yes |
|
|
127
|
+
| high | Scalar | μm | Upper wavelength bound of the filter | Yes |
|
|
128
|
+
| center | Scalar | μm | Center wavelength of the filter | Yes |
|
|
129
|
+
| bandwidth | Scalar | Dimensionless | Fractional bandwidth (e.g., 0.2 for 20%) | Yes |
|
|
130
|
+
| width | Scalar | μm | Wavelength width of the filter (high - low) | No |
|
|
131
|
+
| resolution | Scalar | Dimensionless | Spectral resolution R = λ/Δλ | Yes |
|
|
132
|
+
| wavelength | [nlambda] | μm | Array of wavelengths in the filter | No |
|
|
133
|
+
| delta_wavelength | [nlambda] | μm | Wavelength bin widths (None for IMAGER type) | No |
|
|
134
|
+
|
|
135
|
+
### Notes:
|
|
136
|
+
|
|
137
|
+
- For IMAGER type filters, wavelength contains a single element (the center wavelength) and `delta_wavelength` is None
|
|
138
|
+
- For IFS type filters, `wavelength` is an array generated based on the spectral resolution, and `delta_wavelength` contains the - corresponding bin widths
|
|
139
|
+
- The filter can be initialized using either (`low`, `high`) or (`center`, `bandwidth`) - both define the same wavelength bounds
|
|
140
|
+
If `name` is not provided, an auto-generated numeric identifier is assigned.
|
|
141
|
+
|
|
187
142
|
|
|
188
143
|
## Within `coronagraphs.py`
|
|
189
144
|
| Variable Name | Length | Unit | Meaning | User Editable |
|
|
@@ -199,12 +154,11 @@ This mode offers much more flexibility to run the ETC. We refer to our tutorials
|
|
|
199
154
|
| npix | Scalar | Dimensionless | length of one side of the coronagraph model images (assuming a square) | No |
|
|
200
155
|
| xcenter | Scalar | Pixel | X-coordinate of the image center | No |
|
|
201
156
|
| ycenter | Scalar | Pixel | Y-coordinate of the image center | No |
|
|
202
|
-
|
|
|
157
|
+
| coronagraph_bandwidth | Scalar | Dimensionless | Fractional bandwidth of coronagraph | Yes |
|
|
203
158
|
| stellar_radius | Scalar | R_sun | stellar radius in solar radii | Yes |
|
|
204
159
|
| stellar_angular_diameter_arcsec | Scalar | arcsec | angular diameter of the star | No |
|
|
205
160
|
| npsfratios | Scalar | Dimensionless | Number of PSF truncation ratios (default 1) | No |
|
|
206
161
|
| nrolls | Scalar | Dimensionless | Number of roll angles performed | Yes |
|
|
207
|
-
| nchannels | Scalar | Dimensionless | Number of channels in coronagraph | Yes |
|
|
208
162
|
| coronagraph_optical_throughput | [nlambda] | Dimensionless | Throughput for all coronagraph optics | Yes |
|
|
209
163
|
| coronagraph_spectral_resolution | Scalar | Dimensionless | Spectral resolution of the coronagraph | Yes |
|
|
210
164
|
| contrast | Scalar | Dimensionless | Noise floor contrast of coronagraph | Yes (ToyModel only) |
|
|
@@ -89,73 +89,27 @@ This mode offers much more flexibility to run the ETC. We refer to our tutorials
|
|
|
89
89
|
|
|
90
90
|
# Glossary
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
| Variable Name
|
|
94
|
-
|
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
102
|
-
|
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
| toverhead_multi | Dimensionless | Scalar | Multiplicative overhead time | |
|
|
114
|
-
| telescope_optical_throughput | Dimensionless | [nlambda] | Optical throughput of telescope | |
|
|
115
|
-
| temperature | Temperature | Scalar | Temperature of the warm optics | |
|
|
116
|
-
| T_contamination | Dimensionless | Scalar | Effective throughput factor for contamination | |
|
|
117
|
-
| pixscale_mas | Milliarcsecond | Scalar | Detector pixel scale | |
|
|
118
|
-
| npix_multiplier | Dimensionless | Scalar | Number of detector pixels per image plane "pixel" | |
|
|
119
|
-
| DC | Electron / (Pixel * Second) | [nlambda] | Dark current | |
|
|
120
|
-
| RN | Electron / (Pixel * Read) | [nlambda] | Read noise | |
|
|
121
|
-
| tread | Second | [nlambda] | Read time | |
|
|
122
|
-
| CIC | Electron / (Pixel * Photon) | [nlambda] | Clock-induced charge | |
|
|
123
|
-
| QE | Electron / Photon | [nlambda] | Quantum efficiency of detector | |
|
|
124
|
-
| dQE | Dimensionless | [nlambda] | Effective QE due to degradation | |
|
|
125
|
-
| wavelength | Length | [nlambda] | Observation wavelengths | |
|
|
126
|
-
| SNR | Dimensionless | [nlambda] | Signal-to-noise ratio | |
|
|
127
|
-
| photometric_aperture_radius | λ/D | Scalar | Photometric aperture radius | |
|
|
128
|
-
| psf_trunc_ratio | Dimensionless | Scalar | PSF truncation ratio | |
|
|
129
|
-
| CRb_multiplier | Dimensionless | Scalar | Factor to multiply to remove background | |
|
|
130
|
-
| td_limit | Time | Scalar | Limit placed on exposure times | |
|
|
131
|
-
| nooptimize | Integer | Scalar | Flag to disable exposure time optimization | |
|
|
132
|
-
| optimize_phase | Integer | Scalar | Flag to optimize planet phase (non-functional) | |
|
|
133
|
-
| ntot | Integer | Scalar | Meaning not explicitly defined in code | |
|
|
134
|
-
| nmeananom | Integer | Scalar | Number of mean anomalies | |
|
|
135
|
-
| norbits | Integer | Scalar | Number of orbits | | | |
|
|
136
|
-
| dist | Length | Scalar | Distance to star | |
|
|
137
|
-
| vmag | Magnitude | Scalar | Stellar magnitude at V band | |
|
|
138
|
-
| mag | Magnitude | [nlambda] | Stellar magnitude at desired wavelengths | |
|
|
139
|
-
| stellar_angular_diameter_arcsec | Arcsecond | Scalar | Angular diameter of star | |
|
|
140
|
-
| nzodis | Zodi | Scalar | Amount of exozodi around target star | |
|
|
141
|
-
| ra | Degree | Scalar | Right ascension of target star | |
|
|
142
|
-
| dec | Degree | Scalar | Declination of target star | |
|
|
143
|
-
| semimajor_axis | Astronomical Units | Scalar | Semimajor axis of the planet's orbit (used to calculate separation; assumes face-on orbit) | |
|
|
144
|
-
|
|
145
|
-
| separation | Arcsecond | Scalar | Separation of planet | |
|
|
146
|
-
| deltamag | Magnitude | Scalar | Magnitude difference between planet and host star | |
|
|
147
|
-
| min_deltamag | Magnitude | Scalar | Brightest planet to resolve at the IWA | |
|
|
148
|
-
| F0V | Photon / (Second * cm² * nm) | Scalar | Flux zero point for V band | |
|
|
149
|
-
| F0 | Photon / (Second * cm² * nm) | [nlambda] | Flux zero points for prescribed wavelengths | |
|
|
150
|
-
| M_V | Magnitude | Scalar | Absolute V band magnitude of target star | |
|
|
151
|
-
| Fzodi_list | Dimensionless | [nlambda] | Zodiacal light fluxes | |
|
|
152
|
-
| Fexozodi_list | Dimensionless | [nlambda] | Exozodiacal light fluxes | |
|
|
153
|
-
| Fbinary_list | Dimensionless | [nlambda] | Binary star fluxes | |
|
|
154
|
-
| Fp_over_Fs | Dimensionless | Scalar | Flux of planet relative to star | |
|
|
155
|
-
| | | | | |
|
|
156
|
-
| | | | | |
|
|
157
|
-
| | | | | |
|
|
158
|
-
-->
|
|
92
|
+
## Within `filters.py`
|
|
93
|
+
| Variable Name | Length | Unit | Meaning | User Editable |
|
|
94
|
+
| ------------------ | --------- | ------------- | ------------------------------------------------- | ------------- |
|
|
95
|
+
| name | Scalar | String | Filter identifier (e.g., "UV", "500nm") | Yes |
|
|
96
|
+
| type | Scalar | String | Type of filter ("IFS" or "IMAGER") | Yes |
|
|
97
|
+
| low | Scalar | μm | Lower wavelength bound of the filter | Yes |
|
|
98
|
+
| high | Scalar | μm | Upper wavelength bound of the filter | Yes |
|
|
99
|
+
| center | Scalar | μm | Center wavelength of the filter | Yes |
|
|
100
|
+
| bandwidth | Scalar | Dimensionless | Fractional bandwidth (e.g., 0.2 for 20%) | Yes |
|
|
101
|
+
| width | Scalar | μm | Wavelength width of the filter (high - low) | No |
|
|
102
|
+
| resolution | Scalar | Dimensionless | Spectral resolution R = λ/Δλ | Yes |
|
|
103
|
+
| wavelength | [nlambda] | μm | Array of wavelengths in the filter | No |
|
|
104
|
+
| delta_wavelength | [nlambda] | μm | Wavelength bin widths (None for IMAGER type) | No |
|
|
105
|
+
|
|
106
|
+
### Notes:
|
|
107
|
+
|
|
108
|
+
- For IMAGER type filters, wavelength contains a single element (the center wavelength) and `delta_wavelength` is None
|
|
109
|
+
- For IFS type filters, `wavelength` is an array generated based on the spectral resolution, and `delta_wavelength` contains the - corresponding bin widths
|
|
110
|
+
- The filter can be initialized using either (`low`, `high`) or (`center`, `bandwidth`) - both define the same wavelength bounds
|
|
111
|
+
If `name` is not provided, an auto-generated numeric identifier is assigned.
|
|
112
|
+
|
|
159
113
|
|
|
160
114
|
## Within `coronagraphs.py`
|
|
161
115
|
| Variable Name | Length | Unit | Meaning | User Editable |
|
|
@@ -171,12 +125,11 @@ This mode offers much more flexibility to run the ETC. We refer to our tutorials
|
|
|
171
125
|
| npix | Scalar | Dimensionless | length of one side of the coronagraph model images (assuming a square) | No |
|
|
172
126
|
| xcenter | Scalar | Pixel | X-coordinate of the image center | No |
|
|
173
127
|
| ycenter | Scalar | Pixel | Y-coordinate of the image center | No |
|
|
174
|
-
|
|
|
128
|
+
| coronagraph_bandwidth | Scalar | Dimensionless | Fractional bandwidth of coronagraph | Yes |
|
|
175
129
|
| stellar_radius | Scalar | R_sun | stellar radius in solar radii | Yes |
|
|
176
130
|
| stellar_angular_diameter_arcsec | Scalar | arcsec | angular diameter of the star | No |
|
|
177
131
|
| npsfratios | Scalar | Dimensionless | Number of PSF truncation ratios (default 1) | No |
|
|
178
132
|
| nrolls | Scalar | Dimensionless | Number of roll angles performed | Yes |
|
|
179
|
-
| nchannels | Scalar | Dimensionless | Number of channels in coronagraph | Yes |
|
|
180
133
|
| coronagraph_optical_throughput | [nlambda] | Dimensionless | Throughput for all coronagraph optics | Yes |
|
|
181
134
|
| coronagraph_spectral_resolution | Scalar | Dimensionless | Spectral resolution of the coronagraph | Yes |
|
|
182
135
|
| contrast | Scalar | Dimensionless | Noise floor contrast of coronagraph | Yes (ToyModel only) |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pyEDITH"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.8.0"
|
|
4
4
|
authors = [
|
|
5
5
|
{ name = "Eleonora Alei", email = "eleonora.alei@nasa.gov" },
|
|
6
6
|
{ name = "Miles Currie", email = "miles.h.currie@nasa.gov" },
|
|
@@ -19,7 +19,8 @@ dependencies = [
|
|
|
19
19
|
"scipy",
|
|
20
20
|
"astropy",
|
|
21
21
|
"pandas",
|
|
22
|
-
"yippy>=2.
|
|
22
|
+
"yippy>=2.10.2,<3",
|
|
23
|
+
"hwoutils<2", # yippy 2.x imports APIs that hwoutils 2 removed
|
|
23
24
|
"openpyxl",
|
|
24
25
|
"synphot",
|
|
25
26
|
"eacy",
|
|
@@ -40,9 +41,17 @@ build-backend = "setuptools.build_meta"
|
|
|
40
41
|
|
|
41
42
|
[tool.setuptools]
|
|
42
43
|
package-dir = { "" = "src" }
|
|
43
|
-
packages = ["pyEDITH"
|
|
44
|
+
packages = ["pyEDITH"]
|
|
44
45
|
include-package-data = true
|
|
45
46
|
|
|
46
47
|
|
|
47
48
|
[project.scripts]
|
|
48
49
|
pyedith = "pyEDITH.cli:main"
|
|
50
|
+
|
|
51
|
+
[tool.pytest.ini_options]
|
|
52
|
+
python_files = ["test_*.py", "*_test.py", "integration_tests*.py"]
|
|
53
|
+
|
|
54
|
+
addopts = "-ra --cov=pyEDITH --cov-report=html --cov-report=term-missing --cov-branch"
|
|
55
|
+
markers = [
|
|
56
|
+
"integration: full-pipeline smoke/integration tests that load real EAC data (slow; deselect with -m 'not integration')",
|
|
57
|
+
]
|
|
@@ -3,10 +3,6 @@ import sys
|
|
|
3
3
|
import logging
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
import logging
|
|
7
|
-
import sys
|
|
8
|
-
|
|
9
|
-
|
|
10
6
|
# ANSI color codes for your palette
|
|
11
7
|
class ColorCodes:
|
|
12
8
|
WARNING = "\033[38;2;226;147;0m" # #E29300 - Orange for warnings
|
|
@@ -107,22 +103,30 @@ def set_verbosity(level="warning"):
|
|
|
107
103
|
h.setLevel(log_level)
|
|
108
104
|
|
|
109
105
|
|
|
106
|
+
if not logging.getLogger().handlers:
|
|
107
|
+
logging.getLogger().addHandler(logging.NullHandler())
|
|
108
|
+
|
|
110
109
|
from .astrophysical_scene import AstrophysicalScene
|
|
111
110
|
from .observation import Observation
|
|
112
111
|
from .observatory import Observatory
|
|
113
|
-
from .
|
|
114
|
-
from .
|
|
115
|
-
from .
|
|
112
|
+
from .coronagraphs import Coronagraph
|
|
113
|
+
from .telescopes import Telescope
|
|
114
|
+
from .detectors import Detector
|
|
115
|
+
from .filters import Filter
|
|
116
116
|
|
|
117
117
|
# Import main functions
|
|
118
118
|
from .exposure_time_calculator import calculate_exposure_time_or_snr
|
|
119
|
-
from .components.coronagraphs import generate_radii
|
|
120
119
|
from . import parse_input
|
|
121
120
|
from .utils import *
|
|
122
121
|
from .units import *
|
|
123
122
|
|
|
124
123
|
# Import CLI functions
|
|
125
|
-
from .cli import
|
|
124
|
+
from .cli import (
|
|
125
|
+
main,
|
|
126
|
+
calculate_texp,
|
|
127
|
+
calculate_snr,
|
|
128
|
+
calculate_snr_from_reference_lambda,
|
|
129
|
+
)
|
|
126
130
|
|
|
127
131
|
# Set a __all__ variable to control what gets imported with "from pyEDITH import *"
|
|
128
132
|
__all__ = [
|
|
@@ -132,15 +136,17 @@ __all__ = [
|
|
|
132
136
|
"Telescope",
|
|
133
137
|
"Coronagraph",
|
|
134
138
|
"Detector",
|
|
139
|
+
"Filter",
|
|
135
140
|
"calculate_exposure_time_or_snr",
|
|
136
141
|
"main",
|
|
137
142
|
"calculate_texp",
|
|
138
143
|
"calculate_snr",
|
|
144
|
+
"calculate_snr_from_reference_lambda",
|
|
139
145
|
"parse_input",
|
|
140
|
-
"generate_radii",
|
|
141
146
|
"average_over_bandpass",
|
|
142
147
|
"interpolate_over_bandpass",
|
|
143
148
|
"validate_attributes",
|
|
149
|
+
"set_verbosity",
|
|
144
150
|
]
|
|
145
151
|
|
|
146
152
|
set_verbosity(level="warning")
|
|
@@ -158,7 +158,7 @@ def calc_flux_zero_point(
|
|
|
158
158
|
SPECTRAL_FLUX_DENSITY_CGS_WAVELENGTH,
|
|
159
159
|
equivalencies=u.spectral_density(lambd),
|
|
160
160
|
)
|
|
161
|
-
|
|
161
|
+
else: # can either be cgs or pcgs in the perlambd case (Jy and perlambd are incompatible)
|
|
162
162
|
f0 = f0.to(
|
|
163
163
|
PHOTON_FLUX_DENSITY_CGS_WAVELENGTH,
|
|
164
164
|
equivalencies=u.spectral_density(lambd),
|
|
@@ -490,6 +490,8 @@ class AstrophysicalScene:
|
|
|
490
490
|
Brightest planet to resolve at the IWA
|
|
491
491
|
F0V : float
|
|
492
492
|
Flux zero point for V band
|
|
493
|
+
wavelength:
|
|
494
|
+
Wavelength array
|
|
493
495
|
F0 : ndarray
|
|
494
496
|
Flux zero points for prescribed wavelengths
|
|
495
497
|
M_V : float
|
|
@@ -546,6 +548,9 @@ class AstrophysicalScene:
|
|
|
546
548
|
|
|
547
549
|
# -------- INPUTS ---------
|
|
548
550
|
|
|
551
|
+
# Input wavelength
|
|
552
|
+
self._input_wavelength = np.asarray(parameters["wavelength"], dtype=np.float64)
|
|
553
|
+
|
|
549
554
|
# distance to star (pc) # used to be (ntargs array) now scalar
|
|
550
555
|
self.dist = parameters["distance"] * DISTANCE
|
|
551
556
|
|
|
@@ -840,12 +845,18 @@ class AstrophysicalScene:
|
|
|
840
845
|
setattr(
|
|
841
846
|
self,
|
|
842
847
|
attr_name,
|
|
843
|
-
utils.
|
|
848
|
+
utils.resample_to_wavelength_grid(
|
|
844
849
|
getattr(self, attr_name),
|
|
845
|
-
|
|
850
|
+
self._input_wavelength,
|
|
846
851
|
observation.wavelength.value,
|
|
847
|
-
|
|
852
|
+
(
|
|
853
|
+
observation.delta_wavelength.value
|
|
854
|
+
if observation.delta_wavelength is not None
|
|
855
|
+
else None
|
|
856
|
+
),
|
|
848
857
|
name=attr_name,
|
|
849
|
-
interpolation=
|
|
858
|
+
interpolation=(
|
|
859
|
+
"Gaussian" if observation.delta_wavelength is not None else "1d"
|
|
860
|
+
),
|
|
850
861
|
),
|
|
851
862
|
)
|