Skip to content

Commit 7c65d79

Browse files
hayeslanabobalispre-commit-ci[bot]
authored
Updating GOES 18 and 19 temperature and emission measure (#178)
Co-authored-by: Nabil Freij <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 58a2058 commit 7c65d79

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

changelog/178.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updating the maximum supported GOES satellite to GOES 19 for the temperature and emission measure calculation.
362 KB
Binary file not shown.

sunkit_instruments/goes_xrs/goes_chianti_tem.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
__all__ = ["calculate_temperature_em"]
1515

16-
MAX_SUPPORTED_SATELLITE = 17
16+
MAX_SUPPORTED_SATELLITE = 19
1717

1818

1919
def calculate_temperature_em(goes_ts, abundance="coronal"):
@@ -95,7 +95,7 @@ def calculate_temperature_em(goes_ts, abundance="coronal"):
9595
satellite_number = int(goes_ts.observatory.split("-")[-1])
9696
if (satellite_number < 1) or (satellite_number > MAX_SUPPORTED_SATELLITE):
9797
raise ValueError(
98-
f"GOES satellite number has to be between 1 and 17, {satellite_number} was found."
98+
f"GOES satellite number has to be between 1 and {MAX_SUPPORTED_SATELLITE}, {satellite_number} was found."
9999
)
100100

101101
allowed_abundances = ["photospheric", "coronal"]

sunkit_instruments/goes_xrs/tests/test_goes_xrs.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
goes16_filepath_nc = get_test_filepath(
2323
"sci_xrsf-l2-flx1s_g16_d20170910_v2-1-0_truncated.nc"
2424
) # test the GOES-R data
25+
goes18_filepath_nc = get_test_filepath(
26+
"sci_xrsf-l2-flx1s_g18_d20250328_v2-2-0_truncated.nc"
27+
) # test the GOES-18 data (following updated chianti file)
28+
2529

2630

2731
@pytest.mark.parametrize(
@@ -30,6 +34,7 @@
3034
(goes15_fits_filepath, 11.9 * u.MK),
3135
(goes15_filepath_nc, 21.6 * u.MK),
3236
(goes16_filepath_nc, 21.9 * u.MK),
37+
(goes18_filepath_nc, 14.0 * u.MK),
3338
],
3439
)
3540
@pytest.mark.remote_data
@@ -90,6 +95,16 @@ def test_calculate_temperature_emiss_no_primary_detector_columns_GOESR():
9095
goes.calculate_temperature_em(goeslc_removed_col)
9196

9297

98+
@pytest.mark.remote_data
99+
def test_satellite_number_supported():
100+
goeslc = timeseries.TimeSeries(goes16_filepath_nc)
101+
102+
# setting id to have a "fake" name with GOES satellite number of 21 (unsupported)
103+
goeslc.meta.metas[0]["id"] = "sci_xrsf-l2-flx1s_g21_d20260101_v2-2-0.nc"
104+
with pytest.raises(ValueError, match="GOES satellite number has to be between 1 and 19, 21 was found."):
105+
goes.calculate_temperature_em(goeslc)
106+
107+
93108
# We also test against the IDL outputs for the GOES-15 and 16 test files
94109
idl_chianti_tem_15 = get_test_filepath("goes_15_test_chianti_tem_idl.sav")
95110
idl_chianti_tem_16 = get_test_filepath("goes_16_test_chianti_tem_idl.sav")

0 commit comments

Comments
 (0)