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.
Files changed (38) hide show
  1. {solarc_eclipse-0.6.1.4/solarc_eclipse.egg-info → solarc_eclipse-0.7.0}/PKG-INFO +89 -96
  2. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/README.md +88 -95
  3. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/__init__.py +3 -2
  4. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/analysis.py +147 -266
  5. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/config.py +11 -47
  6. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/data_processing.py +91 -0
  7. solarc_eclipse-0.7.0/euvst_response/main.py +611 -0
  8. solarc_eclipse-0.7.0/euvst_response/monte_carlo.py +299 -0
  9. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/radiometric.py +5 -5
  10. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/utils.py +160 -6
  11. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0/solarc_eclipse.egg-info}/PKG-INFO +89 -96
  12. solarc_eclipse-0.6.1.4/euvst_response/main.py +0 -566
  13. solarc_eclipse-0.6.1.4/euvst_response/monte_carlo.py +0 -213
  14. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/LICENSE +0 -0
  15. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/MANIFEST.in +0 -0
  16. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/cli.py +0 -0
  17. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/data/throughput/grating_reflection_efficiency.dat +0 -0
  18. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/data/throughput/primary_mirror_coating_reflectance.dat +0 -0
  19. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/data/throughput/source.txt +0 -0
  20. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/data/throughput/throughput_aluminium_1000_angstrom.dat +0 -0
  21. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/data/throughput/throughput_aluminium_oxide_1000_angstrom.dat +0 -0
  22. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/data/throughput/throughput_carbon_1000_angstrom.dat +0 -0
  23. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/extern/__init__.py +0 -0
  24. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/extern/mpfit.py +0 -0
  25. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/fitting.py +0 -0
  26. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/pinhole_diffraction.py +0 -0
  27. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/psf.py +0 -0
  28. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/synthesis.py +0 -0
  29. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/euvst_response/synthesis_cli.py +0 -0
  30. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/pyproject.toml +0 -0
  31. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/setup.cfg +0 -0
  32. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/setup.py +0 -0
  33. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/solarc_eclipse.egg-info/SOURCES.txt +0 -0
  34. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/solarc_eclipse.egg-info/dependency_links.txt +0 -0
  35. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/solarc_eclipse.egg-info/entry_points.txt +0 -0
  36. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/solarc_eclipse.egg-info/not-zip-safe +0 -0
  37. {solarc_eclipse-0.6.1.4 → solarc_eclipse-0.7.0}/solarc_eclipse.egg-info/requires.txt +0 -0
  38. {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.6.1.4
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 now available directly from the package:
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/my_results.pkl")
138
+ results = load_instrument_response_results("run/result/my_run.pkl")
138
139
 
139
- # Get results for a specific parameter combination:
140
- combo = get_results_for_combination(
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
- # Create SunPy maps
145
- maps = create_sunpy_maps_from_combo(combo, rest_wavelength=195.119*u.AA, data_type='dn')
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. You can specify single values or lists of values for parameter sweeps.
319
-
320
- **Key configuration options:**
321
- - `instrument`: Choose between SWC (EUVST-SW) or EIS (Hinode)
322
- - `synthesis_file`: Path to the synthesised spectra pickle file (default: `./run/input/synthesised_spectra.pkl`)
323
- - `reference_line`: Spectral line to use as reference for wavelength grid when combining all lines (default: `Fe12_195.1190`)
324
- - `expos`: Exposure time(s) for simulations
325
- - `n_iter`: Number of Monte Carlo iterations
326
- - Parameter sweeps for filters, detector settings, etc.
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
- # Instrument selection
332
- instrument: SWC # Options: SWC (EUVST Short Wavelength) or EIS (Hinode/EIS)
333
-
334
- # Synthesis file path - location of the synthesised spectra pickle file
335
- synthesis_file: ./run/input/synthesised_spectra.pkl # Default location
336
-
337
- # Reference line for wavelength grid and metadata when combining all spectral lines
338
- reference_line: Fe12_195.1190 # Default reference line (Fe XII 195.119 Angstrom)
339
-
340
- # Point Spread Function
341
- psf: False # Enable PSF convolution
342
- # Or test with and without PSF:
343
- # psf: [True, False] # Run simulations both with and without PSF
344
-
345
- # Exposure times - can be single value or list
346
- expos: [0.5 s, 1 s, 2 s, 5 s, 10 s, 20 s, 40 s, 80 s]
347
-
348
- # Monte Carlo simulation parameters
349
- n_iter: 1000 # Number of Monte Carlo iterations
350
- ncpu: -1 # Number of CPU cores (-1 = use all available)
351
-
352
- # Parameter sweeps - you can specify single values or lists for any parameter
353
- # The simulation will run all combinations of parameters
354
-
355
- # Slit width
356
- slit_width: 0.2 arcsec # Narrowest slit on EUVST
357
-
358
- # Filter parameters (SWC only)
359
- # Thickness of aluminum oxide layer on entrance filter
360
- oxide_thickness: 95 angstrom # Default (expected value)
361
-
362
- # Carbon contamination thickness on filter
363
- c_thickness: 0 angstrom # Default (ideal case, no contamination)
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
- Alternatively, you can specify paired slit width and off-chip binning values to only simulate specific combinations:
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
- # Paired slit width / off-chip binning
397
- # Only the listed (slit_width, offchip_bin_slit) pairs are simulated
398
- slit_bin_pairs:
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 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 (
@@ -86,15 +87,13 @@ from euvst_response import (
86
87
  )
87
88
 
88
89
  # Load results
89
- results = load_instrument_response_results("run/result/my_results.pkl")
90
+ results = load_instrument_response_results("run/result/my_run.pkl")
90
91
 
91
- # Get results for a specific parameter combination:
92
- combo = get_results_for_combination(
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
- # Create SunPy maps
97
- maps = create_sunpy_maps_from_combo(combo, rest_wavelength=195.119*u.AA, data_type='dn')
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. You can specify single values or lists of values for parameter sweeps.
271
-
272
- **Key configuration options:**
273
- - `instrument`: Choose between SWC (EUVST-SW) or EIS (Hinode)
274
- - `synthesis_file`: Path to the synthesised spectra pickle file (default: `./run/input/synthesised_spectra.pkl`)
275
- - `reference_line`: Spectral line to use as reference for wavelength grid when combining all lines (default: `Fe12_195.1190`)
276
- - `expos`: Exposure time(s) for simulations
277
- - `n_iter`: Number of Monte Carlo iterations
278
- - Parameter sweeps for filters, detector settings, etc.
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
- # Instrument selection
284
- instrument: SWC # Options: SWC (EUVST Short Wavelength) or EIS (Hinode/EIS)
285
-
286
- # Synthesis file path - location of the synthesised spectra pickle file
287
- synthesis_file: ./run/input/synthesised_spectra.pkl # Default location
288
-
289
- # Reference line for wavelength grid and metadata when combining all spectral lines
290
- reference_line: Fe12_195.1190 # Default reference line (Fe XII 195.119 Angstrom)
291
-
292
- # Point Spread Function
293
- psf: False # Enable PSF convolution
294
- # Or test with and without PSF:
295
- # psf: [True, False] # Run simulations both with and without PSF
296
-
297
- # Exposure times - can be single value or list
298
- expos: [0.5 s, 1 s, 2 s, 5 s, 10 s, 20 s, 40 s, 80 s]
299
-
300
- # Monte Carlo simulation parameters
301
- n_iter: 1000 # Number of Monte Carlo iterations
302
- ncpu: -1 # Number of CPU cores (-1 = use all available)
303
-
304
- # Parameter sweeps - you can specify single values or lists for any parameter
305
- # The simulation will run all combinations of parameters
306
-
307
- # Slit width
308
- slit_width: 0.2 arcsec # Narrowest slit on EUVST
309
-
310
- # Filter parameters (SWC only)
311
- # Thickness of aluminum oxide layer on entrance filter
312
- oxide_thickness: 95 angstrom # Default (expected value)
313
-
314
- # Carbon contamination thickness on filter
315
- c_thickness: 0 angstrom # Default (ideal case, no contamination)
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
- Alternatively, you can specify paired slit width and off-chip binning values to only simulate specific combinations:
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
- # Paired slit width / off-chip binning
349
- # Only the listed (slit_width, offchip_bin_slit) pairs are simulated
350
- slit_bin_pairs:
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.6.1.4"
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",