solarc-eclipse 0.6.1.4__tar.gz → 0.7.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.
- {solarc_eclipse-0.6.1.4/solarc_eclipse.egg-info → solarc_eclipse-0.7.0}/PKG-INFO +89 -96
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/README.md +88 -95
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/__init__.py +3 -2
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/analysis.py +147 -266
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/config.py +11 -47
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/data_processing.py +91 -0
- solarc_eclipse-0.7.0/euvst_response/main.py +611 -0
- solarc_eclipse-0.7.0/euvst_response/monte_carlo.py +299 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/radiometric.py +5 -5
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/utils.py +160 -6
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0/solarc_eclipse.egg-info}/PKG-INFO +89 -96
- solarc_eclipse-0.6.1.4/euvst_response/main.py +0 -566
- solarc_eclipse-0.6.1.4/euvst_response/monte_carlo.py +0 -213
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/LICENSE +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/MANIFEST.in +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/cli.py +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/data/throughput/grating_reflection_efficiency.dat +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/data/throughput/primary_mirror_coating_reflectance.dat +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/data/throughput/source.txt +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/data/throughput/throughput_aluminium_1000_angstrom.dat +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/data/throughput/throughput_aluminium_oxide_1000_angstrom.dat +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/data/throughput/throughput_carbon_1000_angstrom.dat +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/extern/__init__.py +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/extern/mpfit.py +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/fitting.py +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/pinhole_diffraction.py +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/psf.py +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/synthesis.py +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/synthesis_cli.py +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/pyproject.toml +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/setup.cfg +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/setup.py +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/solarc_eclipse.egg-info/SOURCES.txt +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/solarc_eclipse.egg-info/dependency_links.txt +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/solarc_eclipse.egg-info/entry_points.txt +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/solarc_eclipse.egg-info/not-zip-safe +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/solarc_eclipse.egg-info/requires.txt +0 -0
- {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/solarc_eclipse.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: solarc-eclipse
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: ECLIPSE: Emission Calculation and Line Prediction for SOLAR-C EUVST
|
|
5
5
|
Home-page: https://github.com/jamesmckevitt/eclipse
|
|
6
6
|
Author: James McKevitt
|
|
@@ -93,6 +93,7 @@ eclipse --help
|
|
|
93
93
|
You can also use ECLIPSE as a Python library:
|
|
94
94
|
|
|
95
95
|
```python
|
|
96
|
+
import astropy.units as u
|
|
96
97
|
import euvst_response
|
|
97
98
|
from euvst_response import AluminiumFilter, Detector_SWC, Telescope_EUVST
|
|
98
99
|
|
|
@@ -122,7 +123,7 @@ For analyzing simulation results, see the included Jupyter notebook `analysis_tu
|
|
|
122
123
|
- Analyze fit statistics and compute velocity/line width errors
|
|
123
124
|
- Create SunPy maps for visualization
|
|
124
125
|
|
|
125
|
-
The analysis functions are
|
|
126
|
+
The analysis functions are available directly from the package:
|
|
126
127
|
|
|
127
128
|
```python
|
|
128
129
|
from euvst_response import (
|
|
@@ -134,15 +135,13 @@ from euvst_response import (
|
|
|
134
135
|
)
|
|
135
136
|
|
|
136
137
|
# Load results
|
|
137
|
-
results = load_instrument_response_results("run/result/
|
|
138
|
+
results = load_instrument_response_results("run/result/my_run.pkl")
|
|
138
139
|
|
|
139
|
-
#
|
|
140
|
-
|
|
141
|
-
results, exposure=40*u.s, slit_width=0.4*u.arcsec, offchip_bin_slit=2
|
|
142
|
-
)
|
|
140
|
+
# Print a summary table (auto-discovers all parameters and shows git commit)
|
|
141
|
+
summary_table(results)
|
|
143
142
|
|
|
144
|
-
#
|
|
145
|
-
|
|
143
|
+
# Retrieve a specific combination using full section.attribute names
|
|
144
|
+
combo = get_results_for_combination(results, **{"simulation.expos": 40*u.s, "simulation.psf": True})
|
|
146
145
|
```
|
|
147
146
|
|
|
148
147
|
## Detailed instructions
|
|
@@ -305,105 +304,72 @@ print(f"Rest wavelength: {fe12_195.meta['rest_wav']}")
|
|
|
305
304
|
print(f"Available spectral lines: {list(data['line_cubes'].keys())}")
|
|
306
305
|
```
|
|
307
306
|
|
|
308
|
-
#### Pre-computed Atmospheres
|
|
309
|
-
|
|
310
|
-
This step can require a lot of memory at full resolution. A fully synthesised atmosphere using the Cheung et al. (2018) atmosphere (doi:10.1038/s41550-018-0629-3) for the Fe XII 195.119 and 195.179 lines, including 5 background lines from each side, can be downloaded here: https://liveuclac-my.sharepoint.com/:f:/g/personal/ucasjem_ucl_ac_uk/Es-ts6rwXIlInAweGI7hmdMB5BoGqv9uSpIXOvMkzhS3cw?e=54si7R
|
|
311
|
-
|
|
312
|
-
**Important:** You can place the synthesised atmosphere file anywhere and specify its location using the `synthesis_file` parameter in your YAML configuration file. The default location is `./run/input/synthesised_spectra.pkl`.
|
|
313
|
-
|
|
314
307
|
### 2. Simulate the instrument response
|
|
315
308
|
|
|
316
309
|
#### Configuration File
|
|
317
310
|
|
|
318
|
-
ECLIPSE uses YAML configuration files to specify simulation parameters.
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
-
|
|
325
|
-
- `
|
|
326
|
-
-
|
|
311
|
+
ECLIPSE uses YAML configuration files to specify simulation parameters.
|
|
312
|
+
Parameters are organised into four sections - `simulation`, `detector`, `telescope`, and `filter` - each corresponding directly to a configuration class in `config.py`.
|
|
313
|
+
Any field of those classes can be set here.
|
|
314
|
+
**Any parameter that is given as a list is automatically swept over** and the
|
|
315
|
+
simulation runs every combination (cartesian product).
|
|
316
|
+
|
|
317
|
+
**Top-level keys** (not sections):
|
|
318
|
+
- `instrument`: `SWC` (EUVST Short Wavelength) or `EIS` (Hinode/EIS)
|
|
319
|
+
- `synthesis_file`: path to the synthesised spectra pickle file
|
|
320
|
+
- `reference_line`: spectral line used as the wavelength-grid reference (default `Fe12_195.1190`)
|
|
321
|
+
- `n_iter`: number of Monte Carlo iterations
|
|
322
|
+
- `ncpu`: CPU cores to use (`-1` = all available)
|
|
323
|
+
- `offchip_bin_slit`: off-chip slit binning factor (default `1`)
|
|
324
|
+
- `pinhole_sizes`, `pinhole_positions`: fixed paired lists for pinhole diffraction tests (SWC only)
|
|
325
|
+
- `uniform_intensity`, `rest_wavelength`, `thermal_width`: uniform-intensity mode (alternative to synthesis file)
|
|
327
326
|
|
|
328
327
|
Here's a complete example configuration file:
|
|
329
328
|
|
|
330
329
|
```yaml
|
|
331
|
-
#
|
|
332
|
-
instrument: SWC
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
#
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
#
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
# Aluminum filter thickness
|
|
366
|
-
aluminium_thickness: 1485 angstrom # Default (expected value)
|
|
367
|
-
|
|
368
|
-
# CCD temperature for dark current calculation
|
|
369
|
-
ccd_temperature: -60 Celsius # Default (expected operating temperature)
|
|
370
|
-
|
|
371
|
-
# Visible stray light level
|
|
372
|
-
vis_sl: 0 photon / (s * cm**2) # Default, (ideal case, no stray light)
|
|
373
|
-
|
|
374
|
-
# Multi-component Gaussian fitting (optional, omit for single-Gaussian)
|
|
375
|
-
fitting:
|
|
376
|
-
primary_component: 0
|
|
377
|
-
constrain_positive_intensity: true
|
|
378
|
-
components:
|
|
379
|
-
- wavelength: 195.119 angstrom
|
|
380
|
-
amplitude_greater_than: 1 # must be brighter than component 1
|
|
381
|
-
- wavelength: 195.179 angstrom
|
|
382
|
-
tie_center: 0 # Centroid offset tied to component 0
|
|
383
|
-
tie_width: 0 # Same width as component 0
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
Off-chip binning in the slit direction can also be performed:
|
|
387
|
-
|
|
388
|
-
```yaml
|
|
389
|
-
offchip_bin_slit: 2 # Bin every 2 slit pixels
|
|
390
|
-
offchip_bin_slit: [1, 2, 4] # Sweep over multiple binning factors
|
|
330
|
+
# Input
|
|
331
|
+
instrument: SWC
|
|
332
|
+
synthesis_file: ./run/input/synthesised_spectra.pkl
|
|
333
|
+
reference_line: Fe12_195.1190
|
|
334
|
+
|
|
335
|
+
# Global settings (apply to all combinations)
|
|
336
|
+
n_iter: 500
|
|
337
|
+
ncpu: -1
|
|
338
|
+
offchip_bin_slit: [1, 2] # sweep no-binning and 2-pixel off-chip binning
|
|
339
|
+
|
|
340
|
+
# Simulation parameters
|
|
341
|
+
# Any field listed as a list is swept over; all combinations are run.
|
|
342
|
+
simulation:
|
|
343
|
+
slit_width: [0.2 arcsec, 0.4 arcsec] # sweep over two slit widths
|
|
344
|
+
expos: [5 s, 10 s, 20 s, 40 s, 80 s] # sweep over five exposure times
|
|
345
|
+
psf: True
|
|
346
|
+
vis_sl: 0 photon / (s * cm^2)
|
|
347
|
+
enable_pinholes: False
|
|
348
|
+
|
|
349
|
+
# Detector parameters
|
|
350
|
+
detector:
|
|
351
|
+
ccd_temperature: -60 Celsius # used to compute dark current via the CCD model
|
|
352
|
+
|
|
353
|
+
# Telescope parameters
|
|
354
|
+
telescope:
|
|
355
|
+
microroughness_sigma: 0.3 nm # RMS surface roughness
|
|
356
|
+
|
|
357
|
+
# Aluminium filter parameters (SWC only)
|
|
358
|
+
filter:
|
|
359
|
+
al_thickness: 1485 angstrom
|
|
360
|
+
oxide_thickness: 95 angstrom
|
|
361
|
+
c_thickness: 40 angstrom
|
|
362
|
+
mesh_throughput: 0.8
|
|
391
363
|
```
|
|
392
364
|
|
|
393
|
-
|
|
365
|
+
Any parameter from the `Detector_SWC`, `Telescope_EUVST`, or `AluminiumFilter`
|
|
366
|
+
dataclasses in `config.py` can be added to the corresponding section. For
|
|
367
|
+
example, to sweep over detector quantum efficiency:
|
|
394
368
|
|
|
395
369
|
```yaml
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
- slit_width: 0.2 arcsec
|
|
400
|
-
offchip_bin_slit: 1
|
|
401
|
-
- slit_width: 0.4 arcsec
|
|
402
|
-
offchip_bin_slit: 2
|
|
403
|
-
- slit_width: 0.8 arcsec
|
|
404
|
-
offchip_bin_slit: 5
|
|
405
|
-
- slit_width: 1.6 arcsec
|
|
406
|
-
offchip_bin_slit: 10
|
|
370
|
+
detector:
|
|
371
|
+
ccd_temperature: -60 Celsius
|
|
372
|
+
qe_euv: [0.5, 0.65, 0.76] # sweep over three QE values
|
|
407
373
|
```
|
|
408
374
|
|
|
409
375
|
For guidance on recommended values, see McKevitt et al. (2025) (in prep.).
|
|
@@ -416,6 +382,29 @@ fit_signals: photon # Fit only the photon signal
|
|
|
416
382
|
fit_signals: both # Fit both (default)
|
|
417
383
|
```
|
|
418
384
|
|
|
385
|
+
To fit blended spectral lines with multiple Gaussian components, add a `fitting` block:
|
|
386
|
+
|
|
387
|
+
```yaml
|
|
388
|
+
fitting:
|
|
389
|
+
primary_component: 0 # index of the component whose velocity is reported
|
|
390
|
+
constrain_positive_intensity: true # reject fits with negative amplitudes
|
|
391
|
+
backend: scipy # optimiser: "scipy" (default) or "mpfit"
|
|
392
|
+
components:
|
|
393
|
+
- wavelength: 195.119 angstrom # component 0: free centre, width, amplitude
|
|
394
|
+
- wavelength: 195.179 angstrom # component 1: centre & width tied to component 0
|
|
395
|
+
tie_center: 0
|
|
396
|
+
tie_width: 0
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
Each component requires a `wavelength` field giving its rest wavelength.
|
|
400
|
+
|
|
401
|
+
Each entry in `components` corresponds to one Gaussian. Optional per-component keys:
|
|
402
|
+
- `tie_center: <i>`: constrain this component's centre to match component *i*
|
|
403
|
+
- `tie_width: <i>`: constrain this component's line width to match component *i*
|
|
404
|
+
- `amplitude_greater_than: <i>`: constrain amplitude to exceed that of component *i*
|
|
405
|
+
|
|
406
|
+
Omitting the `fitting` block fits a single Gaussian (default behaviour).
|
|
407
|
+
|
|
419
408
|
If you synthesised data in dynamic mode, your configuration must specify:
|
|
420
409
|
- Exactly one slit width matching the synthesis slit width
|
|
421
410
|
- Exactly one exposure time matching the synthesis exposure time
|
|
@@ -444,6 +433,10 @@ Results are saved as pickle files in the `run/result/` directory with the same b
|
|
|
444
433
|
- Fitted spectral line parameters (intensity, velocity, width)
|
|
445
434
|
- Statistical analysis of velocity precision vs. exposure time
|
|
446
435
|
- Ground truth comparisons
|
|
436
|
+
- Full config objects (`Detector`, `Telescope`, `Simulation`) for each parameter combination
|
|
437
|
+
- The git commit ID and software version used to produce the results
|
|
438
|
+
|
|
439
|
+
Use `summary_table(results)` after loading to see all parameter combinations and the run metadata.
|
|
447
440
|
|
|
448
441
|
## Acknowledgements
|
|
449
442
|
|
|
@@ -45,6 +45,7 @@ eclipse --help
|
|
|
45
45
|
You can also use ECLIPSE as a Python library:
|
|
46
46
|
|
|
47
47
|
```python
|
|
48
|
+
import astropy.units as u
|
|
48
49
|
import euvst_response
|
|
49
50
|
from euvst_response import AluminiumFilter, Detector_SWC, Telescope_EUVST
|
|
50
51
|
|
|
@@ -74,7 +75,7 @@ For analyzing simulation results, see the included Jupyter notebook `analysis_tu
|
|
|
74
75
|
- Analyze fit statistics and compute velocity/line width errors
|
|
75
76
|
- Create SunPy maps for visualization
|
|
76
77
|
|
|
77
|
-
The analysis functions are
|
|
78
|
+
The analysis functions are available directly from the package:
|
|
78
79
|
|
|
79
80
|
```python
|
|
80
81
|
from euvst_response import (
|
|
@@ -86,15 +87,13 @@ from euvst_response import (
|
|
|
86
87
|
)
|
|
87
88
|
|
|
88
89
|
# Load results
|
|
89
|
-
results = load_instrument_response_results("run/result/
|
|
90
|
+
results = load_instrument_response_results("run/result/my_run.pkl")
|
|
90
91
|
|
|
91
|
-
#
|
|
92
|
-
|
|
93
|
-
results, exposure=40*u.s, slit_width=0.4*u.arcsec, offchip_bin_slit=2
|
|
94
|
-
)
|
|
92
|
+
# Print a summary table (auto-discovers all parameters and shows git commit)
|
|
93
|
+
summary_table(results)
|
|
95
94
|
|
|
96
|
-
#
|
|
97
|
-
|
|
95
|
+
# Retrieve a specific combination using full section.attribute names
|
|
96
|
+
combo = get_results_for_combination(results, **{"simulation.expos": 40*u.s, "simulation.psf": True})
|
|
98
97
|
```
|
|
99
98
|
|
|
100
99
|
## Detailed instructions
|
|
@@ -257,105 +256,72 @@ print(f"Rest wavelength: {fe12_195.meta['rest_wav']}")
|
|
|
257
256
|
print(f"Available spectral lines: {list(data['line_cubes'].keys())}")
|
|
258
257
|
```
|
|
259
258
|
|
|
260
|
-
#### Pre-computed Atmospheres
|
|
261
|
-
|
|
262
|
-
This step can require a lot of memory at full resolution. A fully synthesised atmosphere using the Cheung et al. (2018) atmosphere (doi:10.1038/s41550-018-0629-3) for the Fe XII 195.119 and 195.179 lines, including 5 background lines from each side, can be downloaded here: https://liveuclac-my.sharepoint.com/:f:/g/personal/ucasjem_ucl_ac_uk/Es-ts6rwXIlInAweGI7hmdMB5BoGqv9uSpIXOvMkzhS3cw?e=54si7R
|
|
263
|
-
|
|
264
|
-
**Important:** You can place the synthesised atmosphere file anywhere and specify its location using the `synthesis_file` parameter in your YAML configuration file. The default location is `./run/input/synthesised_spectra.pkl`.
|
|
265
|
-
|
|
266
259
|
### 2. Simulate the instrument response
|
|
267
260
|
|
|
268
261
|
#### Configuration File
|
|
269
262
|
|
|
270
|
-
ECLIPSE uses YAML configuration files to specify simulation parameters.
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
-
|
|
277
|
-
- `
|
|
278
|
-
-
|
|
263
|
+
ECLIPSE uses YAML configuration files to specify simulation parameters.
|
|
264
|
+
Parameters are organised into four sections - `simulation`, `detector`, `telescope`, and `filter` - each corresponding directly to a configuration class in `config.py`.
|
|
265
|
+
Any field of those classes can be set here.
|
|
266
|
+
**Any parameter that is given as a list is automatically swept over** and the
|
|
267
|
+
simulation runs every combination (cartesian product).
|
|
268
|
+
|
|
269
|
+
**Top-level keys** (not sections):
|
|
270
|
+
- `instrument`: `SWC` (EUVST Short Wavelength) or `EIS` (Hinode/EIS)
|
|
271
|
+
- `synthesis_file`: path to the synthesised spectra pickle file
|
|
272
|
+
- `reference_line`: spectral line used as the wavelength-grid reference (default `Fe12_195.1190`)
|
|
273
|
+
- `n_iter`: number of Monte Carlo iterations
|
|
274
|
+
- `ncpu`: CPU cores to use (`-1` = all available)
|
|
275
|
+
- `offchip_bin_slit`: off-chip slit binning factor (default `1`)
|
|
276
|
+
- `pinhole_sizes`, `pinhole_positions`: fixed paired lists for pinhole diffraction tests (SWC only)
|
|
277
|
+
- `uniform_intensity`, `rest_wavelength`, `thermal_width`: uniform-intensity mode (alternative to synthesis file)
|
|
279
278
|
|
|
280
279
|
Here's a complete example configuration file:
|
|
281
280
|
|
|
282
281
|
```yaml
|
|
283
|
-
#
|
|
284
|
-
instrument: SWC
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
#
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
#
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
# Aluminum filter thickness
|
|
318
|
-
aluminium_thickness: 1485 angstrom # Default (expected value)
|
|
319
|
-
|
|
320
|
-
# CCD temperature for dark current calculation
|
|
321
|
-
ccd_temperature: -60 Celsius # Default (expected operating temperature)
|
|
322
|
-
|
|
323
|
-
# Visible stray light level
|
|
324
|
-
vis_sl: 0 photon / (s * cm**2) # Default, (ideal case, no stray light)
|
|
325
|
-
|
|
326
|
-
# Multi-component Gaussian fitting (optional, omit for single-Gaussian)
|
|
327
|
-
fitting:
|
|
328
|
-
primary_component: 0
|
|
329
|
-
constrain_positive_intensity: true
|
|
330
|
-
components:
|
|
331
|
-
- wavelength: 195.119 angstrom
|
|
332
|
-
amplitude_greater_than: 1 # must be brighter than component 1
|
|
333
|
-
- wavelength: 195.179 angstrom
|
|
334
|
-
tie_center: 0 # Centroid offset tied to component 0
|
|
335
|
-
tie_width: 0 # Same width as component 0
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
Off-chip binning in the slit direction can also be performed:
|
|
339
|
-
|
|
340
|
-
```yaml
|
|
341
|
-
offchip_bin_slit: 2 # Bin every 2 slit pixels
|
|
342
|
-
offchip_bin_slit: [1, 2, 4] # Sweep over multiple binning factors
|
|
282
|
+
# Input
|
|
283
|
+
instrument: SWC
|
|
284
|
+
synthesis_file: ./run/input/synthesised_spectra.pkl
|
|
285
|
+
reference_line: Fe12_195.1190
|
|
286
|
+
|
|
287
|
+
# Global settings (apply to all combinations)
|
|
288
|
+
n_iter: 500
|
|
289
|
+
ncpu: -1
|
|
290
|
+
offchip_bin_slit: [1, 2] # sweep no-binning and 2-pixel off-chip binning
|
|
291
|
+
|
|
292
|
+
# Simulation parameters
|
|
293
|
+
# Any field listed as a list is swept over; all combinations are run.
|
|
294
|
+
simulation:
|
|
295
|
+
slit_width: [0.2 arcsec, 0.4 arcsec] # sweep over two slit widths
|
|
296
|
+
expos: [5 s, 10 s, 20 s, 40 s, 80 s] # sweep over five exposure times
|
|
297
|
+
psf: True
|
|
298
|
+
vis_sl: 0 photon / (s * cm^2)
|
|
299
|
+
enable_pinholes: False
|
|
300
|
+
|
|
301
|
+
# Detector parameters
|
|
302
|
+
detector:
|
|
303
|
+
ccd_temperature: -60 Celsius # used to compute dark current via the CCD model
|
|
304
|
+
|
|
305
|
+
# Telescope parameters
|
|
306
|
+
telescope:
|
|
307
|
+
microroughness_sigma: 0.3 nm # RMS surface roughness
|
|
308
|
+
|
|
309
|
+
# Aluminium filter parameters (SWC only)
|
|
310
|
+
filter:
|
|
311
|
+
al_thickness: 1485 angstrom
|
|
312
|
+
oxide_thickness: 95 angstrom
|
|
313
|
+
c_thickness: 40 angstrom
|
|
314
|
+
mesh_throughput: 0.8
|
|
343
315
|
```
|
|
344
316
|
|
|
345
|
-
|
|
317
|
+
Any parameter from the `Detector_SWC`, `Telescope_EUVST`, or `AluminiumFilter`
|
|
318
|
+
dataclasses in `config.py` can be added to the corresponding section. For
|
|
319
|
+
example, to sweep over detector quantum efficiency:
|
|
346
320
|
|
|
347
321
|
```yaml
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
- slit_width: 0.2 arcsec
|
|
352
|
-
offchip_bin_slit: 1
|
|
353
|
-
- slit_width: 0.4 arcsec
|
|
354
|
-
offchip_bin_slit: 2
|
|
355
|
-
- slit_width: 0.8 arcsec
|
|
356
|
-
offchip_bin_slit: 5
|
|
357
|
-
- slit_width: 1.6 arcsec
|
|
358
|
-
offchip_bin_slit: 10
|
|
322
|
+
detector:
|
|
323
|
+
ccd_temperature: -60 Celsius
|
|
324
|
+
qe_euv: [0.5, 0.65, 0.76] # sweep over three QE values
|
|
359
325
|
```
|
|
360
326
|
|
|
361
327
|
For guidance on recommended values, see McKevitt et al. (2025) (in prep.).
|
|
@@ -368,6 +334,29 @@ fit_signals: photon # Fit only the photon signal
|
|
|
368
334
|
fit_signals: both # Fit both (default)
|
|
369
335
|
```
|
|
370
336
|
|
|
337
|
+
To fit blended spectral lines with multiple Gaussian components, add a `fitting` block:
|
|
338
|
+
|
|
339
|
+
```yaml
|
|
340
|
+
fitting:
|
|
341
|
+
primary_component: 0 # index of the component whose velocity is reported
|
|
342
|
+
constrain_positive_intensity: true # reject fits with negative amplitudes
|
|
343
|
+
backend: scipy # optimiser: "scipy" (default) or "mpfit"
|
|
344
|
+
components:
|
|
345
|
+
- wavelength: 195.119 angstrom # component 0: free centre, width, amplitude
|
|
346
|
+
- wavelength: 195.179 angstrom # component 1: centre & width tied to component 0
|
|
347
|
+
tie_center: 0
|
|
348
|
+
tie_width: 0
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
Each component requires a `wavelength` field giving its rest wavelength.
|
|
352
|
+
|
|
353
|
+
Each entry in `components` corresponds to one Gaussian. Optional per-component keys:
|
|
354
|
+
- `tie_center: <i>`: constrain this component's centre to match component *i*
|
|
355
|
+
- `tie_width: <i>`: constrain this component's line width to match component *i*
|
|
356
|
+
- `amplitude_greater_than: <i>`: constrain amplitude to exceed that of component *i*
|
|
357
|
+
|
|
358
|
+
Omitting the `fitting` block fits a single Gaussian (default behaviour).
|
|
359
|
+
|
|
371
360
|
If you synthesised data in dynamic mode, your configuration must specify:
|
|
372
361
|
- Exactly one slit width matching the synthesis slit width
|
|
373
362
|
- Exactly one exposure time matching the synthesis exposure time
|
|
@@ -396,6 +385,10 @@ Results are saved as pickle files in the `run/result/` directory with the same b
|
|
|
396
385
|
- Fitted spectral line parameters (intensity, velocity, width)
|
|
397
386
|
- Statistical analysis of velocity precision vs. exposure time
|
|
398
387
|
- Ground truth comparisons
|
|
388
|
+
- Full config objects (`Detector`, `Telescope`, `Simulation`) for each parameter combination
|
|
389
|
+
- The git commit ID and software version used to produce the results
|
|
390
|
+
|
|
391
|
+
Use `summary_table(results)` after loading to see all parameter combinations and the run metadata.
|
|
399
392
|
|
|
400
393
|
## Acknowledgements
|
|
401
394
|
|
|
@@ -4,7 +4,7 @@ ECLIPSE: Emission Calculation and Line Prediction for SOLAR-C EUVST
|
|
|
4
4
|
This package provides tools for modeling the performance of the EUV spectrograph EUVST, on SOLAR-C.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
__version__ = "0.
|
|
7
|
+
__version__ = "0.7.0"
|
|
8
8
|
__author__ = "James McKevitt"
|
|
9
9
|
__email__ = "jm2@mssl.ucl.ac.uk"
|
|
10
10
|
|
|
@@ -20,7 +20,7 @@ from .pinhole_diffraction import apply_euv_pinhole_diffraction, airy_disk_patter
|
|
|
20
20
|
from .fitting import fit_cube_gauss, velocity_from_fit, width_from_fit, analyse, FitConfig, FitComponent
|
|
21
21
|
from .monte_carlo import simulate_once, monte_carlo
|
|
22
22
|
from .main import main
|
|
23
|
-
from .data_processing import load_atmosphere
|
|
23
|
+
from .data_processing import load_atmosphere, create_uniform_intensity_cube
|
|
24
24
|
from .analysis import (
|
|
25
25
|
load_instrument_response_results,
|
|
26
26
|
get_parameter_combinations,
|
|
@@ -43,6 +43,7 @@ __all__ = [
|
|
|
43
43
|
"simulate_once", "monte_carlo",
|
|
44
44
|
"main",
|
|
45
45
|
"load_atmosphere",
|
|
46
|
+
"create_uniform_intensity_cube",
|
|
46
47
|
"load_instrument_response_results",
|
|
47
48
|
"get_parameter_combinations",
|
|
48
49
|
"analyse_fit_statistics",
|