solarc-eclipse 0.6.1__tar.gz → 0.6.2__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.
Files changed (36) hide show
  1. {solarc_eclipse-0.6.1/solarc_eclipse.egg-info → solarc_eclipse-0.6.2}/PKG-INFO +70 -51
  2. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/README.md +69 -50
  3. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/__init__.py +3 -2
  4. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/analysis.py +148 -226
  5. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/config.py +21 -53
  6. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/data_processing.py +144 -15
  7. solarc_eclipse-0.6.2/euvst_response/main.py +460 -0
  8. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/monte_carlo.py +74 -26
  9. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/radiometric.py +55 -53
  10. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/synthesis.py +1 -1
  11. solarc_eclipse-0.6.2/euvst_response/utils.py +360 -0
  12. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2/solarc_eclipse.egg-info}/PKG-INFO +70 -51
  13. solarc_eclipse-0.6.1/euvst_response/main.py +0 -468
  14. solarc_eclipse-0.6.1/euvst_response/utils.py +0 -176
  15. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/LICENSE +0 -0
  16. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/MANIFEST.in +0 -0
  17. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/cli.py +0 -0
  18. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/data/throughput/grating_reflection_efficiency.dat +0 -0
  19. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/data/throughput/primary_mirror_coating_reflectance.dat +0 -0
  20. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/data/throughput/source.txt +0 -0
  21. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/data/throughput/throughput_aluminium_1000_angstrom.dat +0 -0
  22. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/data/throughput/throughput_aluminium_oxide_1000_angstrom.dat +0 -0
  23. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/data/throughput/throughput_carbon_1000_angstrom.dat +0 -0
  24. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/fitting.py +0 -0
  25. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/pinhole_diffraction.py +0 -0
  26. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/psf.py +0 -0
  27. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/euvst_response/synthesis_cli.py +0 -0
  28. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/pyproject.toml +0 -0
  29. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/setup.cfg +0 -0
  30. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/setup.py +0 -0
  31. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/solarc_eclipse.egg-info/SOURCES.txt +0 -0
  32. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/solarc_eclipse.egg-info/dependency_links.txt +0 -0
  33. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/solarc_eclipse.egg-info/entry_points.txt +0 -0
  34. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/solarc_eclipse.egg-info/not-zip-safe +0 -0
  35. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/solarc_eclipse.egg-info/requires.txt +0 -0
  36. {solarc_eclipse-0.6.1 → solarc_eclipse-0.6.2}/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.6.1
3
+ Version: 0.6.2
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
@@ -88,6 +88,7 @@ eclipse --help
88
88
  You can also use ECLIPSE as a Python library:
89
89
 
90
90
  ```python
91
+ import astropy.units as u
91
92
  import euvst_response
92
93
  from euvst_response import AluminiumFilter, Detector_SWC, Telescope_EUVST
93
94
 
@@ -117,7 +118,7 @@ For analyzing simulation results, see the included Jupyter notebook `analysis_tu
117
118
  - Analyze fit statistics and compute velocity/line width errors
118
119
  - Create SunPy maps for visualization
119
120
 
120
- The analysis functions are now available directly from the package:
121
+ The analysis functions are available directly from the package:
121
122
 
122
123
  ```python
123
124
  from euvst_response import (
@@ -127,6 +128,15 @@ from euvst_response import (
127
128
  create_sunpy_maps_from_combo,
128
129
  summary_table
129
130
  )
131
+
132
+ # Load results
133
+ results = load_instrument_response_results("run/result/my_run.pkl")
134
+
135
+ # Print a summary table (auto-discovers all parameters and shows git commit)
136
+ summary_table(results)
137
+
138
+ # Retrieve a specific combination using full section.attribute names
139
+ combo = get_results_for_combination(results, **{"simulation.expos": 40*u.s, "simulation.psf": True})
130
140
  ```
131
141
 
132
142
  ## Detailed instructions
@@ -306,61 +316,66 @@ This step can require a lot of memory at full resolution. A fully synthesised at
306
316
 
307
317
  #### Configuration File
308
318
 
309
- ECLIPSE uses YAML configuration files to specify simulation parameters. You can specify single values or lists of values for parameter sweeps.
310
-
311
- **Key configuration options:**
312
- - `instrument`: Choose between SWC (EUVST-SW) or EIS (Hinode)
313
- - `synthesis_file`: Path to the synthesised spectra pickle file (default: `./run/input/synthesised_spectra.pkl`)
314
- - `reference_line`: Spectral line to use as reference for wavelength grid when combining all lines (default: `Fe12_195.1190`)
315
- - `expos`: Exposure time(s) for simulations
316
- - `n_iter`: Number of Monte Carlo iterations
317
- - Parameter sweeps for filters, detector settings, etc.
319
+ ECLIPSE uses YAML configuration files to specify simulation parameters.
320
+ Parameters are organised into four sections - `simulation`, `detector`, `telescope`, and `filter` - each corresponding directly to a configuration class in `config.py`.
321
+ Any field of those classes can be set here.
322
+ **Any parameter that is given as a list is automatically swept over** and the
323
+ simulation runs every combination (cartesian product).
324
+
325
+ **Top-level keys** (not sections):
326
+ - `instrument`: `SWC` (EUVST Short Wavelength) or `EIS` (Hinode/EIS)
327
+ - `synthesis_file`: path to the synthesised spectra pickle file
328
+ - `reference_line`: spectral line used as the wavelength-grid reference (default `Fe12_195.1190`)
329
+ - `n_iter`: number of Monte Carlo iterations
330
+ - `ncpu`: CPU cores to use (`-1` = all available)
331
+ - `pinhole_sizes`, `pinhole_positions`: fixed paired lists for pinhole diffraction tests (SWC only)
332
+ - `uniform_intensity`, `rest_wavelength`, `thermal_width`: uniform-intensity mode (alternative to synthesis file)
318
333
 
319
334
  Here's a complete example configuration file:
320
335
 
321
336
  ```yaml
322
- # Instrument selection
323
- instrument: SWC # Options: SWC (EUVST Short Wavelength) or EIS (Hinode/EIS)
324
-
325
- # Synthesis file path - location of the synthesised spectra pickle file
326
- synthesis_file: ./run/input/synthesised_spectra.pkl # Default location
327
-
328
- # Reference line for wavelength grid and metadata when combining all spectral lines
329
- reference_line: Fe12_195.1190 # Default reference line (Fe XII 195.119 Å)
330
-
331
- # Point Spread Function
332
- psf: False # Enable PSF convolution
333
- # Or test with and without PSF:
334
- # psf: [True, False] # Run simulations both with and without PSF
335
-
336
- # Exposure times - can be single value or list
337
- expos: [0.5 s, 1 s, 2 s, 5 s, 10 s, 20 s, 40 s, 80 s]
338
-
339
- # Monte Carlo simulation parameters
340
- n_iter: 1000 # Number of Monte Carlo iterations
341
- ncpu: -1 # Number of CPU cores (-1 = use all available)
342
-
343
- # Parameter sweeps - you can specify single values or lists for any parameter
344
- # The simulation will run all combinations of parameters
345
-
346
- # Slit width
347
- slit_width: 0.2 arcsec # Narrowest slit on EUVST
348
-
349
- # Filter parameters (SWC only)
350
- # Thickness of aluminum oxide layer on entrance filter
351
- oxide_thickness: 95 angstrom # Default (expected value)
352
-
353
- # Carbon contamination thickness on filter
354
- c_thickness: 0 angstrom # Default (ideal case, no contamination)
355
-
356
- # Aluminum filter thickness
357
- aluminium_thickness: 1485 angstrom # Default (expected value)
337
+ # Input
338
+ instrument: SWC
339
+ synthesis_file: ./run/input/synthesised_spectra.pkl
340
+ reference_line: Fe12_195.1190
341
+
342
+ # Global settings (apply to all combinations)
343
+ n_iter: 500
344
+ ncpu: -1
345
+
346
+ # Simulation parameters
347
+ # Any field listed as a list is swept over; all combinations are run.
348
+ simulation:
349
+ slit_width: [0.2 arcsec, 0.4 arcsec] # sweep over two slit widths
350
+ expos: [5 s, 10 s, 20 s, 40 s, 80 s] # sweep over five exposure times
351
+ psf: True
352
+ vis_sl: 0 photon / (s * cm^2)
353
+ enable_pinholes: False
354
+
355
+ # Detector parameters
356
+ detector:
357
+ ccd_temperature: -60 Celsius # used to compute dark current via the CCD model
358
+
359
+ # Telescope parameters
360
+ telescope:
361
+ microroughness_sigma: 0.3 nm # RMS surface roughness
362
+
363
+ # Aluminium filter parameters (SWC only)
364
+ filter:
365
+ al_thickness: 1485 angstrom
366
+ oxide_thickness: 95 angstrom
367
+ c_thickness: 40 angstrom
368
+ mesh_throughput: 0.8
369
+ ```
358
370
 
359
- # CCD temperature for dark current calculation
360
- ccd_temperature: -60 Celsius # Default (expected operating temperature)
371
+ Any parameter from the `Detector_SWC`, `Telescope_EUVST`, or `AluminiumFilter`
372
+ dataclasses in `config.py` can be added to the corresponding section. For
373
+ example, to sweep over detector quantum efficiency:
361
374
 
362
- # Visible stray light level
363
- vis_sl: 0 photon / (s * pixel) # Default, (ideal case, no stray light)
375
+ ```yaml
376
+ detector:
377
+ ccd_temperature: -60 Celsius
378
+ qe_euv: [0.5, 0.65, 0.76] # sweep over three QE values
364
379
  ```
365
380
 
366
381
  For guidance on recommended values, see McKevitt et al. (2025) (in prep.).
@@ -387,6 +402,10 @@ Results are saved as pickle files in the `run/result/` directory with the same b
387
402
  - Fitted spectral line parameters (intensity, velocity, width)
388
403
  - Statistical analysis of velocity precision vs. exposure time
389
404
  - Ground truth comparisons
405
+ - Full config objects (`Detector`, `Telescope`, `Simulation`) for each parameter combination
406
+ - The git commit ID and software version used to produce the results
407
+
408
+ Use `summary_table(results)` after loading to see all parameter combinations and the run metadata.
390
409
 
391
410
  ## Acknowledgements
392
411
 
@@ -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 now available directly from the package:
78
+ The analysis functions are available directly from the package:
78
79
 
79
80
  ```python
80
81
  from euvst_response import (
@@ -84,6 +85,15 @@ from euvst_response import (
84
85
  create_sunpy_maps_from_combo,
85
86
  summary_table
86
87
  )
88
+
89
+ # Load results
90
+ results = load_instrument_response_results("run/result/my_run.pkl")
91
+
92
+ # Print a summary table (auto-discovers all parameters and shows git commit)
93
+ summary_table(results)
94
+
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})
87
97
  ```
88
98
 
89
99
  ## Detailed instructions
@@ -263,61 +273,66 @@ This step can require a lot of memory at full resolution. A fully synthesised at
263
273
 
264
274
  #### Configuration File
265
275
 
266
- ECLIPSE uses YAML configuration files to specify simulation parameters. You can specify single values or lists of values for parameter sweeps.
267
-
268
- **Key configuration options:**
269
- - `instrument`: Choose between SWC (EUVST-SW) or EIS (Hinode)
270
- - `synthesis_file`: Path to the synthesised spectra pickle file (default: `./run/input/synthesised_spectra.pkl`)
271
- - `reference_line`: Spectral line to use as reference for wavelength grid when combining all lines (default: `Fe12_195.1190`)
272
- - `expos`: Exposure time(s) for simulations
273
- - `n_iter`: Number of Monte Carlo iterations
274
- - Parameter sweeps for filters, detector settings, etc.
276
+ ECLIPSE uses YAML configuration files to specify simulation parameters.
277
+ Parameters are organised into four sections - `simulation`, `detector`, `telescope`, and `filter` - each corresponding directly to a configuration class in `config.py`.
278
+ Any field of those classes can be set here.
279
+ **Any parameter that is given as a list is automatically swept over** and the
280
+ simulation runs every combination (cartesian product).
281
+
282
+ **Top-level keys** (not sections):
283
+ - `instrument`: `SWC` (EUVST Short Wavelength) or `EIS` (Hinode/EIS)
284
+ - `synthesis_file`: path to the synthesised spectra pickle file
285
+ - `reference_line`: spectral line used as the wavelength-grid reference (default `Fe12_195.1190`)
286
+ - `n_iter`: number of Monte Carlo iterations
287
+ - `ncpu`: CPU cores to use (`-1` = all available)
288
+ - `pinhole_sizes`, `pinhole_positions`: fixed paired lists for pinhole diffraction tests (SWC only)
289
+ - `uniform_intensity`, `rest_wavelength`, `thermal_width`: uniform-intensity mode (alternative to synthesis file)
275
290
 
276
291
  Here's a complete example configuration file:
277
292
 
278
293
  ```yaml
279
- # Instrument selection
280
- instrument: SWC # Options: SWC (EUVST Short Wavelength) or EIS (Hinode/EIS)
281
-
282
- # Synthesis file path - location of the synthesised spectra pickle file
283
- synthesis_file: ./run/input/synthesised_spectra.pkl # Default location
284
-
285
- # Reference line for wavelength grid and metadata when combining all spectral lines
286
- reference_line: Fe12_195.1190 # Default reference line (Fe XII 195.119 Å)
287
-
288
- # Point Spread Function
289
- psf: False # Enable PSF convolution
290
- # Or test with and without PSF:
291
- # psf: [True, False] # Run simulations both with and without PSF
292
-
293
- # Exposure times - can be single value or list
294
- expos: [0.5 s, 1 s, 2 s, 5 s, 10 s, 20 s, 40 s, 80 s]
295
-
296
- # Monte Carlo simulation parameters
297
- n_iter: 1000 # Number of Monte Carlo iterations
298
- ncpu: -1 # Number of CPU cores (-1 = use all available)
299
-
300
- # Parameter sweeps - you can specify single values or lists for any parameter
301
- # The simulation will run all combinations of parameters
302
-
303
- # Slit width
304
- slit_width: 0.2 arcsec # Narrowest slit on EUVST
305
-
306
- # Filter parameters (SWC only)
307
- # Thickness of aluminum oxide layer on entrance filter
308
- oxide_thickness: 95 angstrom # Default (expected value)
309
-
310
- # Carbon contamination thickness on filter
311
- c_thickness: 0 angstrom # Default (ideal case, no contamination)
312
-
313
- # Aluminum filter thickness
314
- aluminium_thickness: 1485 angstrom # Default (expected value)
294
+ # Input
295
+ instrument: SWC
296
+ synthesis_file: ./run/input/synthesised_spectra.pkl
297
+ reference_line: Fe12_195.1190
298
+
299
+ # Global settings (apply to all combinations)
300
+ n_iter: 500
301
+ ncpu: -1
302
+
303
+ # Simulation parameters
304
+ # Any field listed as a list is swept over; all combinations are run.
305
+ simulation:
306
+ slit_width: [0.2 arcsec, 0.4 arcsec] # sweep over two slit widths
307
+ expos: [5 s, 10 s, 20 s, 40 s, 80 s] # sweep over five exposure times
308
+ psf: True
309
+ vis_sl: 0 photon / (s * cm^2)
310
+ enable_pinholes: False
311
+
312
+ # Detector parameters
313
+ detector:
314
+ ccd_temperature: -60 Celsius # used to compute dark current via the CCD model
315
+
316
+ # Telescope parameters
317
+ telescope:
318
+ microroughness_sigma: 0.3 nm # RMS surface roughness
319
+
320
+ # Aluminium filter parameters (SWC only)
321
+ filter:
322
+ al_thickness: 1485 angstrom
323
+ oxide_thickness: 95 angstrom
324
+ c_thickness: 40 angstrom
325
+ mesh_throughput: 0.8
326
+ ```
315
327
 
316
- # CCD temperature for dark current calculation
317
- ccd_temperature: -60 Celsius # Default (expected operating temperature)
328
+ Any parameter from the `Detector_SWC`, `Telescope_EUVST`, or `AluminiumFilter`
329
+ dataclasses in `config.py` can be added to the corresponding section. For
330
+ example, to sweep over detector quantum efficiency:
318
331
 
319
- # Visible stray light level
320
- vis_sl: 0 photon / (s * pixel) # Default, (ideal case, no stray light)
332
+ ```yaml
333
+ detector:
334
+ ccd_temperature: -60 Celsius
335
+ qe_euv: [0.5, 0.65, 0.76] # sweep over three QE values
321
336
  ```
322
337
 
323
338
  For guidance on recommended values, see McKevitt et al. (2025) (in prep.).
@@ -344,6 +359,10 @@ Results are saved as pickle files in the `run/result/` directory with the same b
344
359
  - Fitted spectral line parameters (intensity, velocity, width)
345
360
  - Statistical analysis of velocity precision vs. exposure time
346
361
  - Ground truth comparisons
362
+ - Full config objects (`Detector`, `Telescope`, `Simulation`) for each parameter combination
363
+ - The git commit ID and software version used to produce the results
364
+
365
+ Use `summary_table(results)` after loading to see all parameter combinations and the run metadata.
347
366
 
348
367
  ## Acknowledgements
349
368
 
@@ -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.6.1"
7
+ __version__ = "0.6.2"
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
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,
@@ -42,6 +42,7 @@ __all__ = [
42
42
  "simulate_once", "monte_carlo",
43
43
  "main",
44
44
  "load_atmosphere",
45
+ "create_uniform_intensity_cube",
45
46
  "load_instrument_response_results",
46
47
  "get_parameter_combinations",
47
48
  "analyse_fit_statistics",