home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

17 rows where user = 12929592 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

issue 10

  • xray methods using shapefile as mask? 5
  • Upsampling - fill 2
  • Dataset.to_netcdf() fails to interpret 'encoding' option 2
  • Extract value for given time latitude and longitude 2
  • resampling with missing data 1
  • hourofyear 1
  • convert xarray dataset to local timezone 1
  • combine datasets and replace 1
  • Rasterio - Attribute Error 1
  • if 10% of ds meets criteria then count 1

user 1

  • slharris · 17 ✖

author_association 1

  • NONE 17
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
391572819 https://github.com/pydata/xarray/issues/2178#issuecomment-391572819 https://api.github.com/repos/pydata/xarray/issues/2178 MDEyOklzc3VlQ29tbWVudDM5MTU3MjgxOQ== slharris 12929592 2018-05-24T03:03:15Z 2018-05-24T03:03:15Z NONE

Thank you that solved my issue

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  if 10% of ds meets criteria then count 325933825
140625189 https://github.com/pydata/xarray/issues/563#issuecomment-140625189 https://api.github.com/repos/pydata/xarray/issues/563 MDEyOklzc3VlQ29tbWVudDE0MDYyNTE4OQ== slharris 12929592 2015-09-16T04:40:00Z 2017-10-12T19:04:48Z NONE

I am sorry but I do not think I can make a contribution. I really do not know what I am doing!

I hope someone with some skills can add the fill method for up-sampling?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Upsampling - fill 105519744
138793112 https://github.com/pydata/xarray/issues/563#issuecomment-138793112 https://api.github.com/repos/pydata/xarray/issues/563 MDEyOklzc3VlQ29tbWVudDEzODc5MzExMg== slharris 12929592 2015-09-09T05:56:23Z 2017-10-12T19:04:34Z NONE

I could try....

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Upsampling - fill 105519744
311250589 https://github.com/pydata/xarray/issues/1466#issuecomment-311250589 https://api.github.com/repos/pydata/xarray/issues/1466 MDEyOklzc3VlQ29tbWVudDMxMTI1MDU4OQ== slharris 12929592 2017-06-27T04:35:14Z 2017-06-27T04:35:14Z NONE

That solved the issue - I should have checked that first!

thank you

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Rasterio - Attribute Error 238731491
253101783 https://github.com/pydata/xarray/issues/1043#issuecomment-253101783 https://api.github.com/repos/pydata/xarray/issues/1043 MDEyOklzc3VlQ29tbWVudDI1MzEwMTc4Mw== slharris 12929592 2016-10-12T02:25:55Z 2016-10-12T02:25:55Z NONE

perfect thank you!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  combine datasets and replace 182168383
251577702 https://github.com/pydata/xarray/issues/1036#issuecomment-251577702 https://api.github.com/repos/pydata/xarray/issues/1036 MDEyOklzc3VlQ29tbWVudDI1MTU3NzcwMg== slharris 12929592 2016-10-05T04:14:59Z 2016-10-05T04:14:59Z NONE

Thank you - ds['time'].to_index() seems to work but I am having trouble replacing the UTC time in the ds with the converted local time in my new ds. I am using .update() because I want to override the original time. However, the time does not seem to have been changed following this step.

import pandas as pd import xray import pytz

ds = xray.open_mfdataset('/DATA/WRF///*T_SFC.nc')

time=ds['time'].to_index()

time_utc = time.tz_localize(pytz.UTC) au_tz = pytz.timezone('Australia/Sydney') time_local = time_utc.tz_convert(au_tz)

convert pandas datetimeindex to a series and then series to xarray dataarray and then to xray dataset

local_series=time_local.to_series() local_da=xray.DataArray.from_series(local_series) local_ds=xray.DataArray.to_dataset(local_da)

create a new dataset that replaces/updates the UTC time in the original dataset with the local time from the newly created dataset (in pandas)

new_ds=ds.update(local_ds)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  convert xarray dataset to local timezone 181005061
251045880 https://github.com/pydata/xarray/issues/1025#issuecomment-251045880 https://api.github.com/repos/pydata/xarray/issues/1025 MDEyOklzc3VlQ29tbWVudDI1MTA0NTg4MA== slharris 12929592 2016-10-03T07:48:53Z 2016-10-03T07:48:53Z NONE

Brilliant - thank you!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Extract value for given time latitude and longitude 180503054
251040498 https://github.com/pydata/xarray/issues/1025#issuecomment-251040498 https://api.github.com/repos/pydata/xarray/issues/1025 MDEyOklzc3VlQ29tbWVudDI1MTA0MDQ5OA== slharris 12929592 2016-10-03T07:08:48Z 2016-10-03T07:08:48Z NONE

Thanks for your response. I am not wanting a range of values that is why I don't want to use slice - I just want the value at the given time, latitude and longitude.

If I use .isel() I receive an 'Assertion Error' on this line: MaxTempatpoint=MaxTempattime.isel(latitude=-39.14952469, longitude=140.84791565)

and if I use .sel() I receive a 'Key Error' - KeyError: -39.14952469 on this line: MaxTempatpoint=MaxTempattime.sel(latitude=-39.14952469, longitude=140.84791565)

I haven't pasted entire error message because I am assuming the issue I am having is simple??

Should I some how convert the latitude and longitude to a different data type and then access? Or is there some way of accessing an index for the latitude and longitude? Any feedback will be greatly appreciated.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Extract value for given time latitude and longitude 180503054
172672626 https://github.com/pydata/xarray/issues/709#issuecomment-172672626 https://api.github.com/repos/pydata/xarray/issues/709 MDEyOklzc3VlQ29tbWVudDE3MjY3MjYyNg== slharris 12929592 2016-01-18T22:37:23Z 2016-01-18T22:37:23Z NONE

please ignore the last comment/issue as soon as I added 'float32' rather than just 'float' it worked fine!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dataset.to_netcdf() fails to interpret 'encoding' option 125386091
172668790 https://github.com/pydata/xarray/issues/709#issuecomment-172668790 https://api.github.com/repos/pydata/xarray/issues/709 MDEyOklzc3VlQ29tbWVudDE3MjY2ODc5MA== slharris 12929592 2016-01-18T22:16:59Z 2016-01-18T22:16:59Z NONE

I am receiving the same error as #709 when trying:

ds.to_netcdf( 'myncfile.nc', encoding={'Temp': {'dtype': 'float'}})

and I am using xray v 0.6.1 - which is the version the 'what's new' changes appear under.

Do I need a different version? am I writing it incorrectly?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dataset.to_netcdf() fails to interpret 'encoding' option 125386091
167933568 https://github.com/pydata/xarray/issues/690#issuecomment-167933568 https://api.github.com/repos/pydata/xarray/issues/690 MDEyOklzc3VlQ29tbWVudDE2NzkzMzU2OA== slharris 12929592 2015-12-30T04:15:49Z 2015-12-30T04:15:49Z NONE

thank you

On 30 December 2015 at 15:01, Stephan Hoyer notifications@github.com wrote:

This is a good idea, but it's not currently supported. You could do something like this, though:

hourofyear = (ds['time.dayofyear'] * 24 + ds['time.hourofday']).rename('hourofyear') result = ds['TEMP'].groupby(hourofyear).mean('time')

— Reply to this email directly or view it on GitHub https://github.com/xray/xray/issues/690#issuecomment-167932904.

Dr Sarah Harris Research Fellow School of Earth, Atmosphere and Environment Room 227, 9 Rainforest Walk Faculty of Science Monash University Ph: 03 9902 4243 Email: sarah.harris@monash.edu Email%3Asarah.harris@monash.edu

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  hourofyear 124300184
164201408 https://github.com/pydata/xarray/issues/673#issuecomment-164201408 https://api.github.com/repos/pydata/xarray/issues/673 MDEyOklzc3VlQ29tbWVudDE2NDIwMTQwOA== slharris 12929592 2015-12-12T23:21:39Z 2015-12-12T23:21:39Z NONE

Updating with the latest release of dask.array fixed it! Thank you so much for responding!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  resampling with missing data 121336727
146031940 https://github.com/pydata/xarray/issues/501#issuecomment-146031940 https://api.github.com/repos/pydata/xarray/issues/501 MDEyOklzc3VlQ29tbWVudDE0NjAzMTk0MA== slharris 12929592 2015-10-06T23:22:50Z 2015-10-06T23:22:50Z NONE

I am trying not to be annoying but is there any chance you were able to fix this bug? I checked on the examples page but could not find anything. thanks

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xray methods using shapefile as mask? 98074194
143899899 https://github.com/pydata/xarray/issues/501#issuecomment-143899899 https://api.github.com/repos/pydata/xarray/issues/501 MDEyOklzc3VlQ29tbWVudDE0Mzg5OTg5OQ== slharris 12929592 2015-09-28T23:20:04Z 2015-09-28T23:20:04Z NONE

Thank you for fixing the last line, I can get your example to run with my own data without any errors being raised however the output does not appear to have any masked applied! I can use where() to plot a selected area but when it comes to being used with another dataset it doesn't appear to be working for me. Is there an example that shows something like temperature data over time for different states, extracted using the method above? This method will be so useful for me - if I can get it to work! Any feedback will be greatly appreciated.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xray methods using shapefile as mask? 98074194
143116745 https://github.com/pydata/xarray/issues/501#issuecomment-143116745 https://api.github.com/repos/pydata/xarray/issues/501 MDEyOklzc3VlQ29tbWVudDE0MzExNjc0NQ== slharris 12929592 2015-09-25T03:49:53Z 2015-09-25T03:49:53Z NONE

Thank you, but can we use the mask and apply it to another xray dataset - so you only take the values from one dataset that fall in the region of the mask)? I have tried below (but this doesn't work). Thanks

ds.states.where(ds.states == state_ids['California']).plot()

dstemp=xray.open_mfdataset(filepath) ds_variable=dstemp['temp'] monthlymean=ds_variable.resample('1MS', dim='time', how='mean') meanmonthlycaliforniatemp=ds.states.where(ds.states==state_ids['California']).monthlymean.groupby('time').mean() meanmonthlycaliforniatemp.to_pandas().plot()

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xray methods using shapefile as mask? 98074194
142788988 https://github.com/pydata/xarray/issues/501#issuecomment-142788988 https://api.github.com/repos/pydata/xarray/issues/501 MDEyOklzc3VlQ29tbWVudDE0Mjc4ODk4OA== slharris 12929592 2015-09-24T02:52:55Z 2015-09-24T02:52:55Z NONE

Now that I am using xray version 0.6.0 I cannot find any examples that use where() to mask out values from one xray dataset using a rasterized shapefile that has been turned into an xray dataset.

Referring to my original post in this thread can I resample a timeseries, find the mean, groupby by time and plot using only the values that fall within one state?

Any feedback will be greatly appreciated

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xray methods using shapefile as mask? 98074194
128216372 https://github.com/pydata/xarray/issues/501#issuecomment-128216372 https://api.github.com/repos/pydata/xarray/issues/501 MDEyOklzc3VlQ29tbWVudDEyODIxNjM3Mg== slharris 12929592 2015-08-06T02:24:17Z 2015-08-06T02:24:17Z NONE

This example is very helpful. Thank you.

I think the where() method you refer to will be very useful - When will the version 0.5.3 be released?

Thanks Sarah

On 31 July 2015 at 06:00, Stephan Hoyer notifications@github.com wrote:

rasterio and geopandas can be combined with xray to make converting shapefiles into raster masks pretty easy. Here's a quick demo: ``python import geopandas from rasterio import features from affine import Affine

def transform_from_latlon(lat, lon): lat = np.asarray(lat) lon = np.asarray(lon) trans = Affine.translation(lon[0], lat[0]) scale = Affine.scale(lon[1] - lon[0], lat[1] - lat[0]) return trans * scale

def rasterize(shapes, coords, fill=np.nan, *

_kwargs): """Rasterize a list of (geometry, fill_value) tuples onto the given xray coordinates. This only works for 1d latitude and longitude arrays. """ transform = transform_from_latlon(coords['latitude'], coords['longitude']) out_shape = (len(coords['latitude']), len(coords['longitude'])) raster = features.rasterize(shapes, out_shape=out_shape, fill=fill, transform=transform, *_kwargs) return xray.DataArray(raster, coords=coords, dims=('latitude', 'longitude'))

states = geopandas.read_file('/Users/shoyer/Downloads/ne_10m_admin_1_states_provinces_lakes') geometries = states.query("admin == 'United States of America'").geometry shapes = [(shape, n) for n, shape in enumerate(geometries)]

ds = xray.Dataset(coords={'longitude': np.linspace(-125, -65, num=2000), 'latitude': np.linspace(50, 25, num=1000)}) ds['states'] = rasterize(shapes, ds.coords) plotting requires the dev version of xray

ds.states.plot()

Once you have the rasterized geometries, you can use them as arrays to do arithmetic: https://github.com/xray/xray/issues/503

When we figure out how to represent coordinate reference systems properly in xray we might add in a direct wrapper for some of these rasterio functions.

— Reply to this email directly or view it on GitHub https://github.com/xray/xray/issues/501#issuecomment-126461466.

Dr Sarah Harris Research Fellow School of Earth, Atmosphere and Environment Room 227, 9 Rainforest Walk Monash University Ph: 03 9902 4243 Email: sarah.harris@monash.edu Email%3Asarah.harris@monash.edu

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  xray methods using shapefile as mask? 98074194

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