Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/178.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updating the maximum supported GOES satellite to GOES 19 for the temperature and emission measure calculation.
Binary file not shown.
4 changes: 2 additions & 2 deletions sunkit_instruments/goes_xrs/goes_chianti_tem.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

__all__ = ["calculate_temperature_em"]

MAX_SUPPORTED_SATELLITE = 17
MAX_SUPPORTED_SATELLITE = 19


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

allowed_abundances = ["photospheric", "coronal"]
Expand Down
15 changes: 15 additions & 0 deletions sunkit_instruments/goes_xrs/tests/test_goes_xrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
goes16_filepath_nc = get_test_filepath(
"sci_xrsf-l2-flx1s_g16_d20170910_v2-1-0_truncated.nc"
) # test the GOES-R data
goes18_filepath_nc = get_test_filepath(
"sci_xrsf-l2-flx1s_g18_d20250328_v2-2-0_truncated.nc"
) # test the GOES-18 data (following updated chianti file)



@pytest.mark.parametrize(
Expand All @@ -30,6 +34,7 @@
(goes15_fits_filepath, 11.9 * u.MK),
(goes15_filepath_nc, 21.6 * u.MK),
(goes16_filepath_nc, 21.9 * u.MK),
(goes18_filepath_nc, 14.0 * u.MK),
],
)
@pytest.mark.remote_data
Expand Down Expand Up @@ -90,6 +95,16 @@
goes.calculate_temperature_em(goeslc_removed_col)


@pytest.mark.remote_data
def test_satellite_number_supported():
goeslc = timeseries.TimeSeries(goes16_filepath_nc)

Check warning on line 100 in sunkit_instruments/goes_xrs/tests/test_goes_xrs.py

View check run for this annotation

Codecov / codecov/patch

sunkit_instruments/goes_xrs/tests/test_goes_xrs.py#L100

Added line #L100 was not covered by tests

# setting id to have a "fake" name with GOES satellite number of 21 (unsupported)
goeslc.meta.metas[0]["id"] = "sci_xrsf-l2-flx1s_g21_d20260101_v2-2-0.nc"
with pytest.raises(ValueError, match="GOES satellite number has to be between 1 and 19, 21 was found."):
goes.calculate_temperature_em(goeslc)

Check warning on line 105 in sunkit_instruments/goes_xrs/tests/test_goes_xrs.py

View check run for this annotation

Codecov / codecov/patch

sunkit_instruments/goes_xrs/tests/test_goes_xrs.py#L103-L105

Added lines #L103 - L105 were not covered by tests


# We also test against the IDL outputs for the GOES-15 and 16 test files
idl_chianti_tem_15 = get_test_filepath("goes_15_test_chianti_tem_idl.sav")
idl_chianti_tem_16 = get_test_filepath("goes_16_test_chianti_tem_idl.sav")
Expand Down