diff --git a/changelog/178.bugfix.rst b/changelog/178.bugfix.rst new file mode 100644 index 00000000..877dbed1 --- /dev/null +++ b/changelog/178.bugfix.rst @@ -0,0 +1 @@ +Updating the maximum supported GOES satellite to GOES 19 for the temperature and emission measure calculation. diff --git a/sunkit_instruments/data/test/sci_xrsf-l2-flx1s_g18_d20250328_v2-2-0_truncated.nc b/sunkit_instruments/data/test/sci_xrsf-l2-flx1s_g18_d20250328_v2-2-0_truncated.nc new file mode 100644 index 00000000..03e65300 Binary files /dev/null and b/sunkit_instruments/data/test/sci_xrsf-l2-flx1s_g18_d20250328_v2-2-0_truncated.nc differ diff --git a/sunkit_instruments/goes_xrs/goes_chianti_tem.py b/sunkit_instruments/goes_xrs/goes_chianti_tem.py index ddbb6c46..6c95fc37 100644 --- a/sunkit_instruments/goes_xrs/goes_chianti_tem.py +++ b/sunkit_instruments/goes_xrs/goes_chianti_tem.py @@ -13,7 +13,7 @@ __all__ = ["calculate_temperature_em"] -MAX_SUPPORTED_SATELLITE = 17 +MAX_SUPPORTED_SATELLITE = 19 def calculate_temperature_em(goes_ts, abundance="coronal"): @@ -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"] diff --git a/sunkit_instruments/goes_xrs/tests/test_goes_xrs.py b/sunkit_instruments/goes_xrs/tests/test_goes_xrs.py index 36366c45..186b8a74 100644 --- a/sunkit_instruments/goes_xrs/tests/test_goes_xrs.py +++ b/sunkit_instruments/goes_xrs/tests/test_goes_xrs.py @@ -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( @@ -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 @@ -90,6 +95,16 @@ def test_calculate_temperature_emiss_no_primary_detector_columns_GOESR(): goes.calculate_temperature_em(goeslc_removed_col) +@pytest.mark.remote_data +def test_satellite_number_supported(): + goeslc = timeseries.TimeSeries(goes16_filepath_nc) + + # 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) + + # 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")