[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #YGN-366139]: quesiton on interpolation of asynchronous temporal sensor data



> Hi
> I read up on fimex - no luck.  this is for gridded data.  looks interesting 
> though!

Well, if none of the existing packages do exactly what you need or can be
adapted to what you want, you'll have to write a program.

Looking at the example problem you provided, some things will require decisions 
to
specify the problem more formally.  For example, you can't really interpolate 
the
azimuth value for time=1, because it's not provided for any times before 1.1, so
you'll either have to extrapolate or store some sort of flag value there.

You may also want to use something fancier than simple linear interpolation, for
which there are lots of choices, but none of them are provided with netCDF.

Sorry, but something above the level of an I/O library will be required to 
regrid values, even if it's only a !D grid.

--Russ

> -----Original Message-----
> From: Unidata netCDF Support [mailto:address@hidden]
> Sent: Wednesday, 8 August 2012 11:29 PM
> To: Kennedy, Paul
> Cc: address@hidden
> Subject: [netCDF #YGN-366139]: quesiton on interpolation of asynchronous 
> temporal sensor data
> 
> Hi Paul,
> 
> > forgive me for the dumb question, but I am pretty new to NetCDF / NCO
> > and I am banging my head trying to make this work 'out of the box'.  I
> > have a lot of marine sensor data to process, which is all in netcdf v3
> > format (CF 1.6 convention), but the essence of my question is below.
> >
> > I have 2 sensors, a GPS and a Gyro:
> >
> > *The GPS data is in a 'position.nc' file and has 1 Hz data, *The Gyro
> > data is in a 'azimuth.nc' file and has 2Hz data, but the timestamps
> > are not necessarily the same as the GPS (ie they are asynchronous), ie
> > Ta, Tb, Tc
> >
> > My question is "How can I compute the azimuth from the azimuth.nc file
> > for the timestamps in the position.nc file and drop them into a new
> > variable in the position.nc file?"
> >
> > a sample azimuth file...
> > netcdf AzimuthTrue {
> > dimensions:
> > time = UNLIMITED ; // (10 currently)
> > variables:
> > double time(time) ;
> > time:units = "seconds since 1970-01-01 00:00:00" ; time:standard_name
> > = "time" ; double azimuth(time) ; azimuth:units = "degrees" ;
> > azimuth:long_name = "azimuth" ;
> > data:
> > time = 1.1, 1.6, 2.1, 2.6, 3.1, 3.6, 4.1, 4.6, 5.1, 5.6, 6.1, 6.6,
> > 7.1, 7.6, 8.1, 8.6, 9.1, 9.6, 10.1, 10.6; azimuth = 1, 2, 3, 4, 5, 6,
> > 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20; }
> >
> > and a corresponding position file...
> >
> > netcdf Position {
> > dimensions:
> > time = UNLIMITED ; // (5 currently)
> > variables:
> > double time(time) ;
> > time:units = "seconds since 1970-01-01 00:00:00" ; time:standard_name
> > = "time" ; double latitude(time) ; latitude:units = "degrees" ;
> > latitude:long_name = "latitude" ; double longitude(time) ;
> > longitude:units = "degrees" ; longitude:long_name = "longitude" ;
> > data:
> > time = 1, 2, 3, 4, 5;
> > latitude = -31, -32, -33, -34, -35;
> > longitude = 114, 115, 116, 117, 118;
> > }
> >
> > As you can see, both have a record variable of time, but they are
> > asynchronous.  This is due to the hardware outputting raw data at
> > different rates.  Unfortunately, this cannot be changed, so I was
> > hoping to align all the data once it is in NetCDF file format.
> >
> > In this simple example, I would hope to merge the azimuth into the
> > position.nc file, and compute a valid azimuth for time== 1,2,3...
> >
> > Is this feasible with existing tools, or do I need to write some
> > software to index, then lookup a given variable (azimuth in this case)
> > and with something like
> >
> > double valueAt(time, variablename)
> > {
> > //interpolate across the requested vector to compute a value for the
> > specific time }
> 
> There are third-party freely available software packages that provide 
> interpolation of netCDF data.  If you search for "interp" in "Software for 
> Manipulating or Displaying NetCDF Data" at
> 
> http://www.unidata.ucar.edu/netcdf/software.html
> 
> you'll find descriptions and links to packages such as CDO, Fimex, NCL, and 
> NCO that each support this capability.  The netCDF library just does I/O, 
> without providing any built-in interpolation or other analysis capabilities 
> ...
> 
> --Russ
> 
> Russ Rew                                         UCAR Unidata Program
> address@hidden                      http://www.unidata.ucar.edu
> 
> 
> 
> Ticket Details
> ===================
> Ticket ID: YGN-366139
> Department: Support netCDF
> Priority: Normal
> Status: Closed
> 
> 

Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: YGN-366139
Department: Support netCDF
Priority: Normal
Status: Closed