I have seen the following example to access a netcdf file using excel.
I was wondering if it possible to access a certain part of the data based on specific indices (e.g. a time series of a parameter at a certain point on a map from a 4D variable)
It seems to me like it would not be possible without any coding?
Any thoughts?
There are two ways I know of to access data from Unidata's THREDDS Data Server using Excel:
1) Extract a time series is using the ASCII response from OpenDAP as described here: https://publicwiki.deltares.nl/display/OET/OPeNDAP+access+with+Excel. This approach will work with any OPeNDAP server.
2) Use the NetCDF-Subset Service provided by the THREDDS Data Server (here I'm using the latest TDS, version 4.3).
So if you go to a particular dataset served by THREDDS, like this one:
and click on the NetcdfSubset service, and then "Grid as Point Dataset", you get this form:
http://geoport-dev.whoi.edu/thredds/ncss/grid/coawst_2_2/fmrc/coawst_2_2_best.ncd/dataset.html
where you can extract a time series closest to a particular location, and choose CSV as the output type, which can of course be easily loaded into Excel. The nice thing is this form just generates a RESTful URL query, which can be modified or easily generate by code. So for example, this query extracts a time series for the variable temp
over a 6 hour interval near the surface and closest to -70.6W, 42.3N:
produces:
date,lat[unit="degrees_north"],lon[unit="degrees_east"],vertCoord[unit=""],temp[unit="Celsius"]
2011-08-01T00:00:00Z,42.31439418116631,-70.58628311827651,-0.03125,18.44405174255371
2011-08-01T01:00:00Z,42.31439418116631,-70.58628311827651,-0.03125,18.361846923828125
2011-08-01T02:00:00Z,42.31439418116631,-70.58628311827651,-0.03125,18.31492805480957
2011-08-01T03:00:00Z,42.31439418116631,-70.58628311827651,-0.03125,18.254281997680664
2011-08-01T04:00:00Z,42.31439418116631,-70.58628311827651,-0.03125,18.24005889892578
2011-08-01T05:00:00Z,42.31439418116631,-70.58628311827651,-0.03125,18.186853408813477
2011-08-01T06:00:00Z,42.31439418116631,-70.58628311827651,-0.03125,18.114046096801758
Documentation on the NetCDF Subset Service is here: http://www.unidata.ucar.edu/projects/THREDDS/tech/interfaceSpec/NetcdfSubsetService_4_3.html#Vertical
There are a few issues with vertical coordinate in the NetCDF Subset Service that I have reported to Unidata:
I have reported all of these issues to Unidata.