Replies: 3 comments
-
|
Hey @blaylockbk, I too am running into a similar issue here with attempting to subset a lat/lon box post-download. Any thoughts on this issue? |
Beta Was this translation helpful? Give feedback.
-
|
I had a similar issue some time ago and sometimes found it helpful to shift my longitude range (-180, 180) <-> (0, 360). This was just a band-aid but I never got around to diagnosing the issue. |
Beta Was this translation helpful? Give feedback.
-
|
Here's a trial-and-error approach I have used to select subsets of the HRRR. I just needed to pick a reasonable area once, so it was good enough for my use, even if it isn't "optimal." ds = Herbie(date='2021-06-19 06:00', model='HRRR', product="sfc", fxx=36).xarray('DSWRF',remove_grib=True)That returned a preview of the xarray dataset. We will want to slice the datasets (subset them) to reduce file size. Ideally, we would do this based on latitude and longitude ranges, but the HRRR does not use Cartesian coordinates (see #45). So, we will use trial and error to find x and y ranges that cover our region of interest (SE US, in my case). Note that y ranges from 0-1059, and x ranges from 0-1799 (see dimensions in the output above). Modify the ranges used in xmin, xmax = 1080, 1440
ymin, ymax = 220, 440
ds_cropped = ds.sel(x=slice(xmin, xmax), y=slice(ymin, ymax))Generate a simple plot: ax = EasyMap().STATES().OCEAN().LAND().DOMAIN(ds_cropped).ax
ds_cropped.dswrf.plot(
x="longitude",
y="latitude",
ax=ax,
transform=pc,
cbar_kwargs={"shrink": 0.5, "orientation": "horizontal", "pad": 0.01},
)Go back up and modify the slice limits ( |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Hi Brian,
Recently, I have run into some issues with my system not being able to allocate enough memory in order to run ds.to_dataframe().
As a result, I am trying to subset the xarray dataset by min/max lat/lons before converting it to a dataframe. At this point, I've exhausted everything I find to try:
Can you provide some insight how to achieve this? I hypothesize that xarray is having issues with the Lambert Conformal projection format the lat/lons are in. I am confused why the ds.where() function is failing on these coordinates. Would you be able to try and reproduce this?
Beta Was this translation helpful? Give feedback.
All reactions