This App connects the Origin project to NetCDF files (*.nc).
Installation
This App is pre-installed with Origin. If it is not installed, click Data: Connect to File: Add New.... The App Center opens listing only Connector Apps. Click the Download and Install button beside NetCDF Connector to install the App.
Basic Usage
- With a worksheet or a matrix sheet active, click on the Data menu.
- To connect to a local file, click Data: Connect to File: NetCDF File and select the file. To connect to web data, click Data: Connect to Web and enter the URL.
- In the data selection dialog, you can add/remove datasets to be connected, then click OK to connect to the selected ones.
Only one dataset is supported when importing to a worksheet.
Only one dataset is supported when importing to a matrix sheet.
- Once a connector is added, click the connector icon in the upper-left corner of the book to open a popup menu with various commands.
- By default, connector-imported data are NOT saved with the project file. To save a book's data with the project file, click the connector icon in the upper-left corner for that book and uncheck Exclude Imported When Saving. Note that each book has its own Exclude setting.
Features
This app is capable of loading particular slices of a dataset.
In the following image, the dataset ua is a 5D dataset: time[1] * plev[17] * lat[128] * lon[256]. Once the dataset is selected, you can double-click into cell in the lower panel to specify the slices:
ua[1][z][y][x]
It means, the process will create 17 matrices for each z = plev value, which contains 128 rows for y = lat each and 256 columns for x = lon each.
While only x, y and z are supported, it does not mean you have to specify all of them. The one omitted is equivalent to 1.
For example
- ua[1][1][y][x] creates 1 matrix of y (lat = 128) rows, x (lon = 256) columns.
- ua[1][z][2][x] creates z (plev = 17) matrices of 1 row (second lat value), x (lon = 256) columns.
This syntax is also supported in LabTalk for this data connector. Take the above as example, the selection could be
wks.dc.sel$ = ua[1][z][y][x]
A full example:
newbook mat:=1; // create a matrix book
fname$=<full-path-to-the-netcef-file>;
wbk.dc.add("NETCDF"); // initialize data connector for the matrix book
wks.dc.source$=fname$; // connect to the file
wks.dc.sel$=ua[1][z][y][x]; // dataset selection
wks.dc.import(); //import data
If data includes a time variable, more features are supported in the Import Options dialog including:
- Partial import
- Calculate annual/monthly average
- Longitude shift
- Latitude flip
- Specify range of longitude and latitude
- Transformation formula
For more information, see the NetCDF Connector document.