You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When creating a Scene object using the fci_l1c_nc reader, I've noticed that the calibration="radiance" channel attribute labeled radiance_unit_conversion_coefficient is missing from scn[channel].attrs when the Scene object is instantiated with more than one file. @ameraner was kind enough to point me in the right direction to locate this bug.
When a Scene object is instantiated with only one file, the channel attribute radiance_unit_conversion_coefficient is present in scn[channel].attrs. It'd be nice to have these values for full disk imagery, so I don't have to use radiance measured in wavenumber, and instead can use radiance measured in wavelength.
To Reproduce
"""Simple python script depicting fci_l1c_reader bug.Demonstrates that attribute 'radiance_unit_conversion_coefficient' is missing froma loaded radiance channel when that Scene was instantiated with more than one file."""fromglobimportglobfromsatpyimportScene# One chunk of the full disksingle_path="/home/erose/geoips/geoips_packages/test_data/test_data_geocolor/data/mtg/20240924.1500/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-FDHSI-FD--CHK-BODY---NC4E_C_EUMT_20240924151005_IDPFI_OPE_20240924150755_20240924150835_N__C_0091_0034.nc"# Directory which contains all BODY chunks as well as the TRAIL chunk.# 41 files in total.all_paths=sorted(
glob(
"/home/erose/geoips/geoips_packages/test_data/test_data_geocolor/data/mtg/20240924.1500/*.nc"
)
)
single_file_scn=Scene(filenames=[single_path], reader="fci_l1c_nc")
multi_file_scn=Scene(filenames=all_paths, reader="fci_l1c_nc")
single_file_scn.load(["vis_04"], calibration="radiance")
print(single_file_scn["vis_04"].attrs["radiance_unit_conversion_coefficient"])
# KeyError will occur heremulti_file_scn.load(["vis_04"], calibration="radiance")
print(multi_file_scn["vis_04"].attrs["radiance_unit_conversion_coefficient"])
Expected behavior
Per @ameraner and my own tests, I'd expect loading in all chunks of full disk imagery would behave the same way as loading in one chunk of the imagery. Something like this:
scn = Scene(filenames=['/tcenas/fbf/mtg/RollingBuffer/OPE/idpfi/FCI-L1/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-FDHSI-FD--CHK-BODY---NC4E_C_EUMT_20250219075028_IDPFI_OPE_20250219074755_20250219074835_N__O_0047_0034.nc'], reader='fci_l1c_nc')
scn.load(['ir_105'], calibration='radiance')
scn['ir_105'].attrs['radiance_unit_conversion_coefficient']
Out[9]:
<xarray.DataArray 'radiance_unit_conversion_coefficient' ()> Size: 4B
array(0.08997274, dtype=float32)
Attributes:
_FillValue: 9.96921e+36
long_name: Conversion coefficients to convert radiance units from mW.m^...
Actual results
Instead, when loading in all 41 chunks (or 40, if not including the TRAIL file), I get this error:
fromglobimportglobfromsatpyimportScenefromsatpy.utilsimportdebug_ondebug_on()
# Directory which contains all BODY chunks as well as the TRAIL chunk.# 41 files in total.all_paths=sorted(
glob(
"/home/erose/geoips/geoips_packages/test_data/test_data_geocolor/data/mtg/20240924.1500/*.nc"
)
)
multi_file_scn=Scene(filenames=all_paths, reader="fci_l1c_nc")
# Key error will occur heremulti_file_scn.load(["vis_04"], calibration="radiance")
print(multi_file_scn["vis_04"].attrs["radiance_unit_conversion_coefficient"])
"""Results in:Traceback (most recent call last): File "/home/erose/geoips/geoips_packages/geoips/geoips/plugins/modules/readers/bug.py", line 32, in <module> print(multi_file_scn["vis_04"].attrs["radiance_unit_conversion_coefficient"])KeyError: 'radiance_unit_conversion_coefficient'"""
Describe the bug
When creating a
Scene
object using thefci_l1c_nc
reader, I've noticed that thecalibration="radiance"
channel attribute labeledradiance_unit_conversion_coefficient
is missing fromscn[channel].attrs
when theScene
object is instantiated with more than one file. @ameraner was kind enough to point me in the right direction to locate this bug.When a
Scene
object is instantiated with only one file, the channel attributeradiance_unit_conversion_coefficient
is present inscn[channel].attrs
. It'd be nice to have these values for full disk imagery, so I don't have to use radiance measured in wavenumber, and instead can use radiance measured in wavelength.To Reproduce
Expected behavior
Per @ameraner and my own tests, I'd expect loading in all chunks of full disk imagery would behave the same way as loading in one chunk of the imagery. Something like this:
Actual results
Instead, when loading in all 41 chunks (or 40, if not including the TRAIL file), I get this error:
satpy debug output
Environment Info:
fci_l1c_nc
satpy reader.The text was updated successfully, but these errors were encountered: