Firstly, I am a super rookie and just recently started working with GIS. Therefore I am not sure how to ask/word the question, or even if it makes sense. So bear with me.
I have some NetCDF files, consisting some spatiotemporal data. When I import one of them, it looks like this:
<xarray.Dataset>
Dimensions: (bnds: 2, time: 31, x: 720, y: 938)
Coordinates:
lon (y, x) float64 ...
lat (y, x) float64 ...
* time (time) datetime64[ns] 1999-01-01T11:30:00 ... 1999-01-31T11:30:00
Dimensions without coordinates: bnds, x, y
Data variables:
time_bnds (time, bnds) datetime64[ns] ...
datum (time) float64 ...
temperature (time, y, x) float32 ...
Attributes:
CDI: Climate Data Interface version 1.7.0 (http://mpimet.mpg.d...
Conventions: CF-1.4
source: some source
institution: Deutscher Wetterdienst
title: Temperature daily gridded dataset
project_id: TRY-advancement
realization: v1.0
contact: some email
creation_date: 2016-01-22 21:35:27
CDO: some cdo
history: Wed Jun 22 09:48:12 2016: ncatted -a history,global,d,c, ...
What I want to do with this data is, I would like to call a function with parameters latitude and longitude, and get the temperature of that point. However as far as I understood, .sel()
function can not help me since coordinates are only indexed(?) on time
, not lat
and long
, from what I can see from the (*) sign near the coordinate time
.
How would I somehow index it on lat-long as well, or attain the same functionality from some other function?
You can find example nc files here: https://opendata.dwd.de/climate_environment/CDC/grids_germany/daily/Project_TRY/air_temperature_mean/
I can just get the lat and lon from a point/cell, but can not do otherwise. I would like to use nearest neighbor or some similar method to retrieve a value (in this case, temp) of a point, given the coordinates.