Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read goes-r data from https aws, gcp or azure (it uses h5netcdf) #1424

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
12 changes: 10 additions & 2 deletions satpy/readers/abi_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

import numpy as np
import xarray as xr
import requests
import io

from pyresample import geometry
from satpy.readers.file_handlers import BaseFileHandler
Expand All @@ -42,13 +44,19 @@ def __init__(self, filename, filename_info, filetype_info):
"""Open the NetCDF file with xarray and prepare the Dataset for reading."""
super(NC_ABI_BASE, self).__init__(filename, filename_info, filetype_info)
# xarray's default netcdf4 engine
url = self.filename
if 'googleapis' in url or 'amazonaws' in url or 'core.windows' in url:
resp = requests.get(url)
store = io.BytesIO(resp.content)
else:
store = url
try:
self.nc = xr.open_dataset(self.filename,
self.nc = xr.open_dataset(store,
decode_cf=True,
mask_and_scale=False,
chunks={'x': CHUNK_SIZE, 'y': CHUNK_SIZE}, )
except ValueError:
self.nc = xr.open_dataset(self.filename,
self.nc = xr.open_dataset(store,
decode_cf=True,
mask_and_scale=False,
chunks={'lon': CHUNK_SIZE, 'lat': CHUNK_SIZE}, )
Expand Down