0

The latitude and longitude are not in dimensions and only are variables, how can I subset them?

f = nc_open("df.nc")

f is in 2 dimension of [stations, time]

Where stations has 2 variables of latitude and longitude

lat = ncvar_get(f,"station_y_coordinate") lon = ncvar_get(f,"station_x_coordinate")

Then, after selecting desired lat and lon, I'm gonna create a time-series of anomalies. I can not use this command.

lat_ind and lon_ind are the indexes of my desired lat and lon

anom_ts = ncvar_get(f, "mwd", start=c(lon_ind[1],lat_ind[1],1), count = c(length(lon_ind),length(lat_ind),-1))

Any thought?

John Polo
  • 547
  • 1
  • 8
  • 25
SHAH
  • 61
  • 5

0 Answers0