home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where author_association = "NONE" and issue = 1622197017 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: reactions, created_at (date), updated_at (date)

user 1

  • RY4GIT 3

issue 1

  • Y-axis flipped when reading data with Xarray · 3 ✖

author_association 1

  • NONE · 3 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1470494062 https://github.com/pydata/xarray/issues/7621#issuecomment-1470494062 https://api.github.com/repos/pydata/xarray/issues/7621 IC_kwDOAMm_X85XpfVu RY4GIT 52061672 2023-03-15T17:53:22Z 2023-03-15T17:53:36Z NONE

@kmuehlbauer

The code I provided above (with the fn_NASA_Earthdata_download file) works for you too, but with fn_NSIDC_output it does not?

You are right. I've gone made updates to both the issue description (i.e., the first post) and the Jupyter notebook based on our discussion. So, there might be an issue with the data or the rasterio engine, but for now, we'll use the NetCDF engine for NSIDC data, and hope that someone figures out the problem. Also, thanks for your suggestion on SO; it's much appreciated!

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Y-axis flipped when reading data with Xarray 1622197017
1469408924 https://github.com/pydata/xarray/issues/7621#issuecomment-1469408924 https://api.github.com/repos/pydata/xarray/issues/7621 IC_kwDOAMm_X85XlWac RY4GIT 52061672 2023-03-15T06:19:10Z 2023-03-15T06:19:10Z NONE

The post on SO is actually what I wrote. I didn't feel right about messing around with y coordinates, so I came here to figure out what was happening.

Thank you so much for taking the time out of your busy schedule to download the data and test it.

The Xarray Netcdf engine solution worked on my end as well. It was really helpful in exploring what works best for this specific data, where latitude and longitude are stored in different locations. I appreciate your code and will use it for my future processing.

As for the rasterio solution, the output is still flipped along the Y axis. I updated both the rasterio and xarray packages to the latest versions, but the results were still the same. I used the same lines of code that you provided, but with a different file (instead of direct NASA output, I used NSIDC output, as the filename was specified as a variable, fn_NSIDC_output).

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Y-axis flipped when reading data with Xarray 1622197017
1467200120 https://github.com/pydata/xarray/issues/7621#issuecomment-1467200120 https://api.github.com/repos/pydata/xarray/issues/7621 IC_kwDOAMm_X85Xc7J4 RY4GIT 52061672 2023-03-14T01:20:10Z 2023-03-14T01:21:40Z NONE

Thank you for checking the code, @kmuehlbauer. However, I am still experiencing issues even after fixing it.

Regarding the coordinates: - The y coordinate starts from the maximum values and decreases as you move down the array. - The latitude values increase with increasing y-coordinate values. - i.e., The latitude corresponding to the maximum y coordinate is around 85, and the one corresponding to the minimum y coordinate is around -85.

Regarding the precipitation data: - The structure is the same as the cell_lat/cell_lon array. - The y coordinate starts from the maximum values and decreases as you move down the array. - If I plot the precipitation with the xy coordinate, it looks like this, indicating that the data is still inverted. Please refer to these images for further clarification: Note that the unit is read incorrectly as degrees_north and degrees_east; please ignore it.

Here is the updated code:

``` lons = ds_NSIDC_output_rasterio.cell_lon.load() lons_array = lons[0][0]

lats = ds_NSIDC_output_rasterio.cell_lat.load() lats_array = np.arange(lats[0][0][0], lats[0][-1][0], -1*(lats.max().values-lats.min().values)/ds_NSIDC_output.y.size)

ds_NSIDC_output_rasterio_xymanual = xr.DataArray( data=ds_NSIDC_output_rasterio.precipitation_total_surface_flux.sel(band=1).values, dims = ["y","x"], coords = dict( y = lats_array, x = lons_array.values ) ) ds_NSIDC_output_rasterio_xymanual.plot() ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Y-axis flipped when reading data with Xarray 1622197017

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 23.118ms · About: xarray-datasette