I have a .txt file containing a number of stations accompanied with their coordinates. So, the .txt file has three columns: One with the station id, one with lat and one with lon, as shown:
station , lat , lon
ABTR2100 ,39.13,34.52
GRMR0100 ,20.18,49.00
DDDD0100 ,23.22,46.81
SLPT0100 ,26.91,32.23
NDRT0100 ,29.55,48.97
Also, I have an .nc file containing hourly temperature data for March of 2011. The structure of the .nc file is the following:
2 variables (excluding dimension variables):
char rotated_pole[]
grid_mapping_name: rotated_latitude_longitude
grid_north_pole_latitude: 39.25
grid_north_pole_longitude: -162
float var11[rlon,rlat,height,time]
table: 2
grid_mapping: rotated_pole
4 dimensions:
rlon Size:848
standard_name: grid_longitude
long_name: longitude in rotated pole grid
units: degrees
axis: X
rlat Size:824
standard_name: grid_latitude
long_name: latitude in rotated pole grid
units: degrees
axis: Y
height Size:1
standard_name: height
long_name: height
units: m
positive: up
axis: Z
time Size:744 *** is unlimited ***
standard_name: time
units: hours since 2011-02-28 18:00:00
calendar: proleptic_gregorian
What I wish to do is extract the time series for each one of the stations contained in the .txt file for each time step, and store the time series to a separate .txt file that will have the name of the station id. So, this means that I will have a .txt file named "ABTR2100_temp" that will contain the time series for that specific location. The same will happen with all stations. Ηοw could I do this in R?