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
Dear Alberto,
I have used your notebook to extract wind and pressure data from:
gfs = f"https://nomads.ncep.noaa.gov/dods/gfs_0p25_1hr"
I have produced a netcdf file with u10m, v10m and prmsl (pressure at sea surface level) using:
with xr.open_dataset(url) as ds:
(
ds[var1]
.isel(time=slice(*time))
.sel(lat=slice(*lat), lon=lon)
.to_netcdf(f"{date}_{run:02d}_uv10prmsl.nc")
)
I woiuld like to add the description of the variables contained in the netcdf file par example:
u10m: x-component of the wind at 10m
u10m: y-componet of the wind at 10m
prmsl: atmospheric pressure at sea surface level.
How to proceed please?
Thank you.
The text was updated successfully, but these errors were encountered:
The NetCDF should already have some metadata, although not exactly that. You can print it in the notebook with something like this:
with xr.open_dataset(url) as ds:
ds1 = ds[var1].isel(time=slice(*time)).sel(lat=slice(*lat), lon=lon)
# similar for the other variables
print(ds1["u10m"].attrs)
ds1.to_netcdf(f"{date}_{run:02d}_uv10prmsl.nc")
If you want to change that metadata, you can just assign something to it:
Dear Alberto,
I have used your notebook to extract wind and pressure data from:
gfs = f"https://nomads.ncep.noaa.gov/dods/gfs_0p25_1hr"
I have produced a netcdf file with u10m, v10m and prmsl (pressure at sea surface level) using:
with xr.open_dataset(url) as ds:
(
ds[var1]
.isel(time=slice(*time))
.sel(lat=slice(*lat), lon=lon)
.to_netcdf(f"{date}_{run:02d}_uv10prmsl.nc")
)
I woiuld like to add the description of the variables contained in the netcdf file par example:
u10m: x-component of the wind at 10m
u10m: y-componet of the wind at 10m
prmsl: atmospheric pressure at sea surface level.
How to proceed please?
Thank you.
The text was updated successfully, but these errors were encountered: