2 Sep 2020 |
| @mark-wieczorek:matrix.org changed their display name from mwczrk to mrk-w. | 15:25:22 |
3 Sep 2020 |
| @_slack_fatiando_UT0BDHKPE:matrix.org joined the room. | 12:27:35 |
11 Sep 2020 |
| @mark-wieczorek:matrix.org changed their display name from mrk-w to Mark Wieczorek. | 15:26:26 |
22 Sep 2020 |
@_slack_fatiando_UT0BDHKPE:matrix.org | is there a function in verde to extract the points from grid based on lists of coordinates? | 09:10:31 |
| @_slack_fatiando_UMFSBQVMG:matrix.org joined the room. | 19:39:05 |
| @_slack_fatiando_UMGPUQCFL:matrix.org joined the room. | 19:45:55 |
| @_slack_fatiando_UMGLPTLAW:matrix.org joined the room. | 19:59:54 |
@_slack_fatiando_UMGLPTLAW:matrix.org | In reply to@_slack_fatiando_UT0BDHKPE:matrix.org is there a function in verde to extract the points from grid based on lists of coordinates? think there is... i'll see if I can find it... | 19:59:55 |
@_slack_fatiando_UMGLPTLAW:matrix.org | In reply toundefined
(edited) think there is... i'll see if I can find it... => There is a `sample` method. `coords = [(x, y) for x, y in zip(survey.X, survey.Y)]`
`survey['sample_points'] = [x[0] for x in grid.sample(coords)]` | 20:05:33 |
@_slack_fatiando_UMGLPTLAW:matrix.org | In reply toundefined
(edited) ... method. `coords = [(x, y) for x, y in zip(survey.X, survey.Y)]`
`survey['sample_points'] = [x[0] for x in grid.sample(coords)]` => ... method. Something like this.
`coords = [(x, y) for x, y in zip(survey.X, survey.Y)]`
`survey['sample_points'] = [x[0] for x in grid.sample(coords)]` . There is an example in the docs somewhere but I couldn't find it. | 20:10:15 |
23 Sep 2020 |
@_slack_fatiando_UT0BDHKPE:matrix.org | In reply to@_slack_fatiando_UMGLPTLAW:matrix.org There is a sample method. Something like this.
coords = [(x, y) for x, y in zip(survey.X, survey.Y)]
survey['sample_points'] = [x[0] for x in grid.sample(coords)] . There is an example in the docs somewhere but I couldn't find it. Many thanks Craig Miller. Will test that. Thsi sample method should work also with general xarray grid? Or sepcific only to Verde? | 05:56:56 |
@_slack_fatiando_UMGLPTLAW:matrix.org | In reply to@_slack_fatiando_UT0BDHKPE:matrix.org Many thanks Craig Miller. Will test that. Thsi sample method should work also with general xarray grid? Or sepcific only to Verde? in that case it was a geosoft or surfer grid I read in using rasterio | 06:00:02 |
@_slack_fatiando_UMGLPTLAW:matrix.org | In reply to@_slack_fatiando_UMGLPTLAW:matrix.org in that case it was a geosoft or surfer grid I read in using rasterio but I think an xarray grid will work to. I think it's actually a rasterio method come to think of it. | 06:01:25 |
@_slack_fatiando_UMGLPTLAW:matrix.org | In reply to@_slack_fatiando_UMGLPTLAW:matrix.org but I think an xarray grid will work to. I think it's actually a rasterio method come to think of it. rather than verde | 06:01:36 |
@_slack_fatiando_UMGLPTLAW:matrix.org | In reply to@_slack_fatiando_UMGLPTLAW:matrix.org rather than verde https://rasterio.readthedocs.io/en/latest/api/rasterio.sample.html | 06:02:14 |
@_slack_fatiando_UMGLPTLAW:matrix.org | In reply to@_slack_fatiando_UMGLPTLAW:matrix.org https://rasterio.readthedocs.io/en/latest/api/rasterio.sample.html but I was using it in a script with a bunch of verde stuff as well. | 06:02:30 |
@_slack_fatiando_UT0BDHKPE:matrix.org | In reply to@_slack_fatiando_UMGLPTLAW:matrix.org but I was using it in a script with a bunch of verde stuff as well. ok thanks. I tried with a standard `xarray.Dataset`but it seems that the the sample methods do not exist in xarray | 06:31:20 |
@_slack_fatiando_UT0BDHKPE:matrix.org | In reply to@_slack_fatiando_UT0BDHKPE:matrix.org ok thanks. I tried with a standard `xarray.Dataset`but it seems that the the sample methods do not exist in xarray I found a solutions but it works only with lang, lot coordinates | 06:31:44 |
@_slack_fatiando_UT0BDHKPE:matrix.org | In reply to@_slack_fatiando_UT0BDHKPE:matrix.org I found a solutions but it works only with lang, lot coordinates in any case what i need is a little more complicated since i need to finde the nearest coordinate of my survey in a grid, so I think the sample method will not works… | 06:32:41 |
| @_slack_fatiando_UMSRSPEMA:matrix.org joined the room. | 09:00:29 |
@_slack_fatiando_UMSRSPEMA:matrix.org | In reply to@_slack_fatiando_UT0BDHKPE:matrix.org in any case what i need is a little more complicated since i need to finde the nearest coordinate of my survey in a grid, so I think the sample method will not works… That's an xarray thing and it should have a method to interpolate values on a set of points. Can't find it now but look into "indexing" | 09:00:30 |
@_slack_fatiando_UT0BDHKPE:matrix.org | In reply to@_slack_fatiando_UMSRSPEMA:matrix.org That's an xarray thing and it should have a method to interpolate values on a set of points. Can't find it now but look into "indexing" ok thnask | 09:18:59 |
@_slack_fatiando_UMSRSPEMA:matrix.org | In reply to@_slack_fatiando_UT0BDHKPE:matrix.org ok thnask Found it: http://xarray.pydata.org/en/stable/indexing.html#nearest-neighbor-lookups | 11:24:03 |
@_slack_fatiando_UMSRSPEMA:matrix.org | In reply to@_slack_fatiando_UMSRSPEMA:matrix.org Found it: http://xarray.pydata.org/en/stable/indexing.html#nearest-neighbor-lookups You can also use Verde for this:
python
data = vd.grid_to_table(grid)
interp = vd.ScipyGridder(method="nearest")
interp.fit((data.easting, data.northing), data.field)
sample_points = (easting, northing)
sample_field = interp.predict(sample_points) | 11:26:18 |
@_slack_fatiando_UMSRSPEMA:matrix.org | In reply to@_slack_fatiando_UMSRSPEMA:matrix.org You can also use Verde for this:
python
data = vd.grid_to_table(grid)
interp = vd.ScipyGridder(method="nearest")
interp.fit((data.easting, data.northing), data.field)
sample_points = (easting, northing)
sample_field = interp.predict(sample_points) And then you can choose which interpolation method you want to do the sampling. ScipyGridder supports nearest neighbours, linear, and cubic. You could also use a vd.Spline there or any other gridder. | 11:27:41 |
@_slack_fatiando_UT0BDHKPE:matrix.org | In reply to@_slack_fatiando_UMSRSPEMA:matrix.org And then you can choose which interpolation method you want to do the sampling. ScipyGridder supports nearest neighbours, linear, and cubic. You could also use a vd.Spline there or any other gridder. leouieda yes sure I forgot the predict option… | 11:32:51 |
@_slack_fatiando_UT0BDHKPE:matrix.org | In reply to@_slack_fatiando_UT0BDHKPE:matrix.org leouieda yes sure I forgot the predict option… good points…will test this approach | 11:33:00 |
| @_slack_fatiando_U0156QCM6AH:matrix.org joined the room. | 12:13:38 |
1 Oct 2020 |
| @_slack_fatiando_U0156QCM6AH:matrix.org changed their profile picture. | 23:48:49 |
4 Oct 2020 |
@_slack_fatiando_U0156QCM6AH:matrix.org | In reply to@_slack_fatiando_UT0BDHKPE:matrix.org good points…will test this approach good example for examples, that one | 07:26:07 |