home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

8 rows where issue = 1052918815 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 4

  • huaracheguarache 3
  • spencerkclark 2
  • mathause 2
  • TomNicholas 1

author_association 2

  • MEMBER 5
  • NONE 3

issue 1

  • Plotting interpolated data causes artefacts · 8 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
974505817 https://github.com/pydata/xarray/issues/5987#issuecomment-974505817 https://api.github.com/repos/pydata/xarray/issues/5987 IC_kwDOAMm_X846FcdZ huaracheguarache 33153877 2021-11-19T22:10:48Z 2021-11-19T22:10:48Z NONE

@mathause Sorry for the late reply! I've been very busy lately, but yes, please move it to a discussion.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting interpolated data causes artefacts 1052918815
970244888 https://github.com/pydata/xarray/issues/5987#issuecomment-970244888 https://api.github.com/repos/pydata/xarray/issues/5987 IC_kwDOAMm_X8451MMY mathause 10194086 2021-11-16T12:56:10Z 2021-11-16T12:56:10Z MEMBER

@huaracheguarache can I convert this issue to a discussion? I think it would better fit there.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting interpolated data causes artefacts 1052918815
969842619 https://github.com/pydata/xarray/issues/5987#issuecomment-969842619 https://api.github.com/repos/pydata/xarray/issues/5987 IC_kwDOAMm_X845zp-7 TomNicholas 35968931 2021-11-16T04:15:41Z 2021-11-16T04:15:41Z MEMBER

As an aside, this is something that we might want to try and fix via a PeriodicIndex, once the explicit indexes refactor is complete.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting interpolated data causes artefacts 1052918815
968911384 https://github.com/pydata/xarray/issues/5987#issuecomment-968911384 https://api.github.com/repos/pydata/xarray/issues/5987 IC_kwDOAMm_X845wGoY spencerkclark 6628425 2021-11-15T13:29:01Z 2021-11-15T13:29:01Z MEMBER

@mathause I think the issue is that non-periodic interpolation introduces NaNs into the dataset, which get plotted as a white line.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting interpolated data causes artefacts 1052918815
968903764 https://github.com/pydata/xarray/issues/5987#issuecomment-968903764 https://api.github.com/repos/pydata/xarray/issues/5987 IC_kwDOAMm_X845wExU mathause 10194086 2021-11-15T13:20:04Z 2021-11-15T13:20:04Z MEMBER

If this solves your issue all is fine. However, I am a bit surprised that the pcolormesh creates a white line - can you print the lon coords? For the contourf you may need to add a cyclic point.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting interpolated data causes artefacts 1052918815
968380475 https://github.com/pydata/xarray/issues/5987#issuecomment-968380475 https://api.github.com/repos/pydata/xarray/issues/5987 IC_kwDOAMm_X845uFA7 huaracheguarache 33153877 2021-11-14T22:56:32Z 2021-11-14T22:56:44Z NONE

@spencerkclark Thanks for the suggestion! I haven't made any serious tests yet, but my initial tests worked fine =)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting interpolated data causes artefacts 1052918815
968298551 https://github.com/pydata/xarray/issues/5987#issuecomment-968298551 https://api.github.com/repos/pydata/xarray/issues/5987 IC_kwDOAMm_X845txA3 spencerkclark 6628425 2021-11-14T14:13:07Z 2021-11-14T14:13:07Z MEMBER

Xarray's built-in interpolation method does not know how to handle periodic coordinates, which is why you see the blank center line. I would recommend using xESMF, which is an xarray wrapper of some code specifically written to interpolate from one geospatial grid to another, and knows how to handle periodic coordinates (see the periodic flag in the constructor of the Regridder object). It also provides multiple different interpolating methods which, depending on your application, might be more applicable than xarray's options.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting interpolated data causes artefacts 1052918815
968291159 https://github.com/pydata/xarray/issues/5987#issuecomment-968291159 https://api.github.com/repos/pydata/xarray/issues/5987 IC_kwDOAMm_X845tvNX huaracheguarache 33153877 2021-11-14T13:28:20Z 2021-11-14T13:28:20Z NONE

I decided to also look at what happens when you plot with contourf. In this case both the plot of the original data and the interpolated data have a white line at the central longitude, but the interpolated data also has white lines at the poles:

Original MPI-ESM

Interpolated MPI-ESM

Here's the code that produced the plots:

```python import xarray as xr import matplotlib.pyplot as plt import cartopy.crs as ccrs

cesm2_waccm = xr.open_dataset('pr_day_CESM2-WACCM_ssp245_r2i1p1f1_gn_20750101-20841231.nc') mpi = xr.open_dataset('pr_day_MPI-ESM1-2-LR_ssp245_r1i1p1f1_gn_20750101-20941231.nc')

cesm2_waccm_subset = cesm2_waccm.sel(time=slice('2075-01-01', '2075-12-31')).mean(dim='time') mpi_subset = mpi.sel(time=slice('2075-01-01', '2075-12-31')).mean(dim='time')

map_proj = ccrs.PlateCarree()

Now this also produces a white line.

plot = mpi_subset.pr.plot.contourf(subplot_kws={'projection': map_proj}) plot.axes.coastlines() plt.show()

mpi_interp = mpi_subset.interp(lat=cesm2_waccm_subset['lat'], lon=cesm2_waccm_subset['lon'])

Has a white line at the central longitude.

plot = mpi_interp.pr.plot.contourf(subplot_kws={'projection': map_proj}) plot.axes.coastlines() plt.show() ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting interpolated data causes artefacts 1052918815

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 12.593ms · About: xarray-datasette