Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gher-uliege/seadatacloud

Tools and interfaces to work with DIVA interpolation software tool.
https://github.com/gher-uliege/seadatacloud

data-analysis data-visualization interpolation nco netcdf ocean-sciences oceanography

Last synced: 12 days ago
JSON representation

Tools and interfaces to work with DIVA interpolation software tool.

Awesome Lists containing this project

README

        

# SeaDataCloud
Tools and interfaces to work with DIVA interpolation software tool.

## Re-gridding

Re-gridding is the action of interpolation a field from a grid to another grid, usually with a higher resolution.
[nco](http://nco.sourceforge.net) provides a tool [`ncremap`](http://nco.sourceforge.net/nco.html#ncremap) for this purpose.

### Installation

1. Download and compile [ESMF](https://earthsystemmodeling.org/download/)
2. Download a recent version of nco.

### Usage

```bash
ncremap -i data.nc -d grid.nc -o data_regridded.nc
```
where:
- *data.nc* is the original file containing the fields,
- *grid.nc* is another file containing the new grid
- *data_regridded.nc* is the final output file with the fields interpolated onto the new grid.

The grid file looks like:
```
dimensions:
longitude = 851 ;
latitude = 321 ;
variables:
float longitude(longitude) ;
longitude:units = "degrees east" ;
float latitude(latitude) ;
latitude:units = "degrees north" ;
}
```

Note that the input file needs to have lon and lat as coordinates. If that's not te case, one can always use [`ncrename`](https://linux.die.net/man/1/ncrename), for instance:
```bash
ncrename -d x,lon -v x,lon in.nc
```
* the dimension *x* is renamed *lon*
* the variable *x* is renamed *lon*

### Troubleshooting

#### NetCDF

If you get errors related to netCDF, define the environment variables as in:
http://www.earthsystemmodeling.org/esmf_releases/last_built/ESMF_usrdoc/node9.html#SECTION00093200000000000000

#### Grid file

It seems that the dimensions should be named *longitude* and *latitude*, otherwise the result is strange.