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

Downloading data for one selected pressure level. #149

Open
ChenyuDongNUS opened this issue May 3, 2024 · 1 comment
Open

Downloading data for one selected pressure level. #149

ChenyuDongNUS opened this issue May 3, 2024 · 1 comment

Comments

@ChenyuDongNUS
Copy link

When I want to download data for one selected pressure level (full resolution), e.g. 850hPa uwind.
If I download the data in directory: weatherbench2/datasets/era5/1959-2022-full_37-1h-0p25deg-chunk-1.zarr-v2/u_component_of_wind
However, accessing this data results in downloading approximately 200 TB, which includes uwind data across 37 pressure levels.
Is there a way to download data for only selected pressure levels?
I apologize if this question seems trivial, and I appreciate any comment/guidance.
Thank you!

@SadeghTabas-NOAA
Copy link

SadeghTabas-NOAA commented May 3, 2024

@ChenyuDongNUS Please see below:

import xarray as xr
ds = xr.open_zarr('gs://weatherbench2/datasets/era5/1959-2023_01_10-wb13-6h-1440x721_with_derived_variables.zarr')
u_wind_850 = ds['u_component_of_wind'].sel(level=850)
u_wind_850.to_netcdf('your/save/directory.nc')
# or to save in zarr:
# u_wind_850.to_zarr('your/save/directory.zarr', mode='w')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants