Describe the bug
The SpectrogramFactory parses the global attributes from CDF files and stores them in the metadata dictionary under the key "cdf_globals".
However, the RFSSpectrogram class properties (level and version) attempt to read from the key "cdf_meta".
This key mismatch causes a KeyError when attempting to access spec.level or spec.version on any spectrogram instantiated from a real PSP RFS CDF file. The existing unit tests pass because they skip the factory and mock the metadata with "cdf_meta" directly.
To Reproduce
import sunpy
from radiospectra.spectrogram import Spectrogram
# Assuming `file.cdf` is a valid Parker Solar Probe RFS file
spec = Spectrogram("file.cdf")
# This will raise a KeyError: 'cdf_meta'
print(spec.level)
print(spec.version)
Screenshots
No response
System Details
sunpy: 7.1.0
astropy: 7.2.0
matplotlib: 3.10.8
radiospectra: 0.1.dev519+ge9d493ba5
Python: 3.14.2
OS: Windows 11
Installation method
No response
Describe the bug
The
SpectrogramFactoryparses the global attributes from CDF files and stores them in the metadata dictionary under the key"cdf_globals".However, the
RFSSpectrogramclass properties (levelandversion) attempt to read from the key"cdf_meta".This key mismatch causes a
KeyErrorwhen attempting to accessspec.levelorspec.versionon any spectrogram instantiated from a real PSP RFS CDF file. The existing unit tests pass because they skip the factory and mock the metadata with"cdf_meta"directly.To Reproduce
Screenshots
No response
System Details
sunpy: 7.1.0
astropy: 7.2.0
matplotlib: 3.10.8
radiospectra: 0.1.dev519+ge9d493ba5
Python: 3.14.2
OS: Windows 11
Installation method
No response