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
Hello, thank for the great work the package is very useful. I am quite new to working with remote storage.
I am currently working with Eumetsat's geostationary imagery, in particular the product : EO_EUM_DAT_MSG_HRSEVIRI.
I have data both in HRIT and native .nat file formats that I read from a remote azure blob storage.
Passing in URI for remote reading HRIT files is no issue, but I can't seem to open any .Nat files this way.
hrit_uri_path = [
'azureml://subscriptions/{...}/datastores/cmv_eumetsat/paths/eumetsat_hrit/H-000-MSG4__-MSG4________-IR_016___-000001___-202303201200-__/H-000-MSG4__-MSG4________-IR_016___-000001___-202303201200-__',
'azureml://subscriptions/{...}/datastores/cmv_eumetsat/paths/eumetsat_hrit/H-000-MSG4__-MSG4________-IR_016___-000001___-202303201200-__/H-000-MSG4__-MSG4________-IR_016___-000002___-202303201200-__',
'azureml://subscriptions/{...}/datastores/cmv_eumetsat/paths/eumetsat_hrit/H-000-MSG4__-MSG4________-IR_016___-000001___-202303201200-__/H-000-MSG4__-MSG4________-IR_016___-000003___-202303201200-__',
...
]
# Works perfectly
severi_scene = satpy.Scene(
reader='seviri_l1b_hrit',
filenames = hrit_uri_path
)
---------------
nat_uri_path = ['azureml://subscriptions/{...}/datastores/cmv_eumetsat/paths/eumetsat_nat/EO_EUM_DAT_MSG_HRSEVIRI/20230504074242/MSG3-SEVI-MSG15-0100-NA-20230504074242.069000000Z-NA.nat']
# Does not work, FileNotFoundError, full error below
severi_scene = satpy.Scene(
reader='seviri_l1b_native',
filenames = nat_uri_path
)
DEBUG:satpy.readers.yaml_reader:Reading ('/home/azureuser/anaconda3/envs/pyaml4/lib/python3.9/site-packages/satpy/etc/readers/seviri_l1b_native.yaml',)
[DEBUG: 2023-05-04 13:55:13 : satpy.readers.yaml_reader] Reading ('/home/azureuser/anaconda3/envs/pyaml4/lib/python3.9/site-packages/satpy/etc/readers/seviri_l1b_native.yaml',)
DEBUG:satpy.readers.yaml_reader:Assigning to seviri_l1b_native: [<FSFile "eumetsat_nat/EO_EUM_DAT_MSG_HRSEVIRI/20230504074242/MSG3-SEVI-MSG15-0100-NA-20230504074242.069000000Z-NA.nat">]
[DEBUG: 2023-05-04 13:55:13 : satpy.readers.yaml_reader] Assigning to seviri_l1b_native: [<FSFile "eumetsat_nat/EO_EUM_DAT_MSG_HRSEVIRI/20230504074242/MSG3-SEVI-MSG15-0100-NA-20230504074242.069000000Z-NA.nat">]
Output exceeds the [size limit](command:workbench.action.openSettings?%5B%22notebook.output.textLineLimit%22%5D). Open the full output data [in a text editor](command:workbench.action.openLargeOutput?e62a71c0-e202-4c4a-8015-00e7e8619337)---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In[14], line 1
----> 1 severi_scene = satpy.Scene(
2 reader='seviri_l1b_native',
3 filenames = naturi
4 )
File [~/anaconda3/envs/pyaml4/lib/python3.9/site-packages/satpy/scene.py:133](https://vscode-remote+amlext-002b2f737562736372697074696f6e732f65653931356665302d343936352d343961342d383238662d3735383266313833323361352f7265736f7572636547726f7570732f656d702d6465762f70726f7669646572732f4d6963726f736f66742e4d616368696e654c6561726e696e6753657276696365732f776f726b7370616365732f656d702d6465762d6d6c2f636f6d70757465732f73612d736f6c61722d636d76.vscode-resource.vscode-cdn.net/home/azureuser/cloudfiles/code/Users/Simon.Albergel/ds-solar-cmv-datascience/notebooks/~/anaconda3/envs/pyaml4/lib/python3.9/site-packages/satpy/scene.py:133), in Scene.__init__(self, filenames, reader, filter_parameters, reader_kwargs)
130 if filenames:
131 filenames = convert_remote_files_to_fsspec(filenames, storage_options)
--> 133 self._readers = self._create_reader_instances(filenames=filenames,
134 reader=reader,
135 reader_kwargs=cleaned_reader_kwargs)
136 self._datasets = DatasetDict()
137 self._wishlist = set()
File [~/anaconda3/envs/pyaml4/lib/python3.9/site-packages/satpy/scene.py:154](https://vscode-remote+amlext-002b2f737562736372697074696f6e732f65653931356665302d343936352d343961342d383238662d3735383266313833323361352f7265736f7572636547726f7570732f656d702d6465762f70726f7669646572732f4d6963726f736f66742e4d616368696e654c6561726e696e6753657276696365732f776f726b7370616365732f656d702d6465762d6d6c2f636f6d70757465732f73612d736f6c61722d636d76.vscode-resource.vscode-cdn.net/home/azureuser/cloudfiles/code/Users/Simon.Albergel/ds-solar-cmv-datascience/notebooks/~/anaconda3/envs/pyaml4/lib/python3.9/site-packages/satpy/scene.py:154), in Scene._create_reader_instances(self, filenames, reader, reader_kwargs)
149 def _create_reader_instances(self,
150 filenames=None,
151 reader=None,
152 reader_kwargs=None):
153 """Find readers and return their instances."""
--> 154 return load_readers(filenames=filenames,
155 reader=reader,
...
125 ascii_startswith = b'FormatName : NATIVE'
--> 126 with open(self.filename, mode='rb') as istream:
127 return istream.read(36) == ascii_startswith
FileNotFoundError: [Errno 2] No such file or directory: 'eumetsat_nat/EO_EUM_DAT_MSG_HRSEVIRI/20230504074242/MSG3-SEVI-MSG15-0100-NA-20230504074242.069000000Z-NA.nat'
Thank you in advance and sorry if I wasn't clear enough in my question.
Environment Info:
OS: Linux
Python: 3.9.16
Satpy Version: 0.41.1
PyResample Version: 1.26.1
Readers and writers dependencies (when relevant):
Readers
=======
abi_l1b: ok
abi_l1b_scmi: ok
abi_l2_nc: ok
acspo: cannot find module 'satpy.readers.acspo' (No module named 'netCDF4')
agri_fy4a_l1: ok
agri_fy4b_l1: ok
ahi_hrit: ok
ahi_hsd: ok
ahi_l1b_gridded_bin: ok
ami_l1b: cannot find module 'satpy.readers.ami_l1b' (No module named 'pyspectral')
amsr2_l1b: ok
amsr2_l2: ok
amsr2_l2_gaasp: ok
amsub_l1c_aapp: ok
ascat_l2_soilmoisture_bufr: cannot find module 'satpy.readers.ascat_l2_soilmoisture_bufr' (('Missing eccodes-python and/or eccodes C-library installation. Use conda to install eccodes.\n Error: ', ModuleNotFoundError("No module named 'eccodes'")))
atms_l1b_nc: cannot find module 'satpy.readers.atms_l1b_nc' (No module named 'netCDF4')
atms_sdr_hdf5: ok
avhrr_l1b_aapp: ok
avhrr_l1b_eps: ok
avhrr_l1b_gaclac: cannot find module 'satpy.readers.avhrr_l1b_gaclac' (No module named 'pygac')
avhrr_l1b_hrpt: cannot find module 'satpy.readers.hrpt' (No module named 'geotiepoints')
avhrr_l1c_eum_gac_fdr_nc: ok
caliop_l2_cloud: cannot find module 'satpy.readers.caliop_l2_cloud' (No module named 'pyhdf')
clavrx: cannot find module 'satpy.readers.clavrx' (No module named 'netCDF4')
cmsaf-claas2_l2_nc: cannot find module 'satpy.readers.cmsaf_claas2' (No module named 'netCDF4')
electrol_hrit: ok
epic_l1b_h5: ok
fci_l1c_nc: cannot find module 'satpy.readers.fci_l1c_nc' (No module named 'netCDF4')
fci_l2_nc: ok
generic_image: ok
geocat: cannot find module 'satpy.readers.geocat' (No module named 'netCDF4')
ghi_l1: ok
ghrsst_l2: ok
glm_l2: ok
goes-imager_hrit: ok
goes-imager_nc: ok
gpm_imerg: ok
grib: cannot find module 'satpy.readers.grib' (No module named 'pygrib')
hsaf_grib: cannot find module 'satpy.readers.hsaf_grib' (No module named 'pygrib')
hsaf_h5: ok
hy2_scat_l2b_h5: ok
iasi_l2: ok
iasi_l2_so2_bufr: cannot find module 'satpy.readers.iasi_l2_so2_bufr' (('Missing eccodes-python and/or eccodes C-library installation. Use conda to install eccodes.\n Error: ', ModuleNotFoundError("No module named 'eccodes'")))
ici_l1b_nc: cannot find module 'satpy.readers.ici_l1b_nc' (No module named 'geotiepoints')
insat3d_img_l1b_h5: cannot find module 'satpy.readers.insat3d_img_l1b_h5' (No module named 'datatree' It can be installed with the xarray-datatree package.)
jami_hrit: ok
li_l2_nc: cannot find module 'satpy.readers.li_l2_nc' (No module named 'netCDF4')
maia: ok
meris_nc_sen3: ok
mersi2_l1b: cannot find module 'satpy.readers.mersi2_l1b' (No module named 'pyspectral')
mhs_l1c_aapp: ok
mimicTPW2_comp: cannot find module 'satpy.readers.mimic_TPW2_nc' (No module named 'netCDF4')
mirs: ok
modis_l1b: cannot find module 'satpy.readers.modis_l1b' (No module named 'pyhdf')
modis_l2: cannot find module 'satpy.readers.modis_l2' (No module named 'pyhdf')
msi_safe: cannot find module 'satpy.readers.msi_safe' (No module named 'rioxarray')
msu_gsa_l1b: ok
mtsat2-imager_hrit: ok
mviri_l1b_fiduceo_nc: ok
mwi_l1b_nc: cannot find module 'satpy.readers.ici_l1b_nc' (No module named 'geotiepoints')
mws_l1b_nc: cannot find module 'satpy.readers.mws_l1b' (No module named 'netCDF4')
nucaps: cannot find module 'satpy.readers.nucaps' (No module named 'netCDF4')
nwcsaf-geo: ok
nwcsaf-msg2013-hdf5: ok
nwcsaf-pps_nc: ok
oceancolorcci_l3_nc: cannot find module 'satpy.readers.oceancolorcci_l3_nc' (No module named 'netCDF4')
olci_l1b: ok
olci_l2: ok
omps_edr: ok
safe_sar_l2_ocn: ok
sar-c_safe: cannot find module 'satpy.readers.sar_c_safe' (No module named 'defusedxml')
satpy_cf_nc: ok
scatsat1_l2b: cannot find module 'satpy.readers.scatsat1_l2b' (cannot import name 'Dataset' from 'satpy.dataset' (/home/azureuser/anaconda3/envs/pyaml4/lib/python3.9/site-packages/satpy/dataset/__init__.py))
seadas_l2: cannot find module 'satpy.readers.seadas_l2' (No module named 'pyhdf')
seviri_l1b_hrit: ok
seviri_l1b_icare: cannot find module 'satpy.readers.seviri_l1b_icare' (No module named 'pyhdf')
seviri_l1b_native: ok
seviri_l1b_nc: ok
seviri_l2_bufr: cannot find module 'satpy.readers.seviri_l2_bufr' (Missing eccodes-python and/or eccodes C-library installation. Use conda to install eccodes)
seviri_l2_grib: cannot find module 'satpy.readers.seviri_l2_grib' (Missing eccodes-python and/or eccodes C-library installation. Use conda to install eccodes)
slstr_l1b: ok
slstr_l2: cannot find module 'satpy.readers.slstr_l2' (No module named 'satpy.readers.slstr_l2')
smos_l2_wind: cannot find module 'satpy.readers.smos_l2_wind' (No module named 'netCDF4')
tropomi_l2: cannot find module 'satpy.readers.tropomi_l2' (No module named 'netCDF4')
vaisala_gld360: ok
vii_l1b_nc: cannot find module 'satpy.readers.vii_l1b_nc' (No module named 'geotiepoints')
vii_l2_nc: cannot find module 'satpy.readers.vii_l2_nc' (No module named 'geotiepoints')
viirs_compact: ok
viirs_edr_active_fires: cannot find module 'satpy.readers.viirs_edr_active_fires' (No module named 'netCDF4')
viirs_edr_flood: cannot find module 'satpy.readers.viirs_edr_flood' (No module named 'pyhdf')
viirs_l1b: cannot find module 'satpy.readers.viirs_l1b' (No module named 'netCDF4')
viirs_l2_cloud_mask_nc: cannot find module 'satpy.readers.viirs_l2' (No module named 'netCDF4')
viirs_sdr: ok
virr_l1b: cannot find module 'satpy.readers.virr_l1b' (No module named 'pyspectral')
Writers
=======
awips_tiled: ok
cf: cannot find module 'satpy.writers.cf_writer' (Ensure that the netCDF4 or h5netcdf package is installed.)
geotiff: ok
mitiff: ok
ninjogeotiff: ok
ninjotiff: cannot find module 'satpy.writers.ninjotiff' (No module named 'pyninjotiff')
simple_image: ok
Extras
======
cartopy: No module named 'cartopy'
geoviews: No module named 'geoviews'
The text was updated successfully, but these errors were encountered:
Hello again, after investigation on my side, remote streaming is simply not implemented for SEVIRI l1b native reader, sorry for mistaking it with a bug.
Here I am sharing the work around I have found working for my usage. It is not equivalent, as with this solution I don't stream the data but store it to a temporary local file util I am done initializing the Scene object. Thank you again for the very useful package.
import os
import tempfile
import shutil
from satpy import Scene
from satpy.readers.utils import generic_open
from satpy.utils import convert_remote_files_to_fsspec
def read_native_remotely(uri_file):
"""Remotely reads native files, by creating a temporary local file to read from.
Temporary file is deleted as soon as it is not needed anymore.
Args:
- uri_file, str
Returns:
- seviri_scene, satpy.scene.Scene
"""
fsfile = convert_remote_files_to_fsspec([uri_file])[0]
with tempfile.TemporaryDirectory() as tmp_dir:
tmp_destination_path = os.path.join(tmp_dir, fsfile._file)
os.makedirs(os.path.dirname(tmp_destination_path), exist_ok=True)
with open(tmp_destination_path, "wb") as tmp_destination:
with generic_open(fsfile, "rb") as remote_source:
shutil.copyfileobj(remote_source, tmp_destination)
seviri_scene = Scene(
reader="seviri_l1b_native",
filenames=[tmp_destination_path],
reader_kwargs={"fill_disk": True},
)
return seviri_scene
Hello, thank for the great work the package is very useful. I am quite new to working with remote storage.
I am currently working with Eumetsat's geostationary imagery, in particular the product : EO_EUM_DAT_MSG_HRSEVIRI.
I have data both in HRIT and native .nat file formats that I read from a remote azure blob storage.
Passing in URI for remote reading HRIT files is no issue, but I can't seem to open any .Nat files this way.
I am sure the file does exist :
Downloading and locally read the data works.
Actual results
For HRIT reading (working as expected):
For native reading, not working as intended:
Thank you in advance and sorry if I wasn't clear enough in my question.
Environment Info:
The text was updated successfully, but these errors were encountered: