home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1467520091

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/7621#issuecomment-1467520091 https://api.github.com/repos/pydata/xarray/issues/7621 1467520091 IC_kwDOAMm_X85XeJRb 5821660 2023-03-14T07:21:30Z 2023-03-14T07:35:37Z MEMBER

First, I've found this on SO: https://gis.stackexchange.com/questions/454543/fixing-the-flipped-inverted-y-axis-in-the-xarray-with-rasterio

For your data reading method 1, it works for me like this:

```python

load root group with coordinates

ds_NSIDC_root = xr.open_dataset(os.path.join(input_path, fn_NSIDC_output), group="/", engine='netcdf4')

load data from Geophysical_Data group

ds_NSIDC_precip = xr.open_dataset(os.path.join(input_path, fn_NSIDC_output), group="Geophysical_Data", engine='netcdf4')

merge groups

ds_NSIDC = xr.merge([ds_NSIDC_root, ds_NSIDC_precip])

plot

ds_NSIDC.precipitation_total_surface_flux.plot()

the above is essentially the same as

ds_NSIDC.precipitation_total_surface_flux.plot(x="x", y="y")

```

This can be expanded to use the cell_lon/cell_lat:

```

set lat/lon as coords

ds_NSIDC = ds_NSIDC.set_coords(["cell_lon", "cell_lat"]) ds_NSIDC.precipitation_total_surface_flux.plot(x="cell_lon", y="cell_lat") ```

Update: This should also work like above when directly using NASA Earth Data.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  1622197017
Powered by Datasette · Queries took 74.771ms · About: xarray-datasette