Skip to content

How to open GEOS-FP netcdf file through https url? #8340

Answered by jhamman
zxdawn asked this question in Q&A
Discussion options

You must be logged in to vote

Try using fsspec along with Xarray:

import fsspec
import xarray as xr

url = 'https://portal.nccs.nasa.gov/datashare/gmao/geos-fp/das/Y2023/M10/D01/GEOS.fp.asm.tavg1_2d_slv_Nx.20231001_0030.V01.nc4'
with fsspec.open(url).open() as f:
    ds = xr.open_dataset(f)
print(ds)
<xarray.Dataset>
Dimensions:   (lon: 1152, lat: 721, time: 1)
Coordinates:
  * lon       (lon) float64 -180.0 -179.7 -179.4 -179.1 ... 179.1 179.4 179.7
  * lat       (lat) float64 -90.0 -89.75 -89.5 -89.25 ... 89.25 89.5 89.75 90.0
  * time      (time) datetime64[ns] 2023-10-01T00:30:00
Data variables: (12/45)
    CLDPRS    (time, lat, lon) float32 ...
    CLDTMP    (time, lat, lon) float32 ...
    DISPH     (time, lat, …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@zxdawn
Comment options

Answer selected by zxdawn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants