File Exchange > Data Connector >    NetCDF Connector

Author:
OriginLab Technical Support
Date Added:
9/18/2019
Last Update:
11/14/2024
Downloads (90 Days):
705
Total Ratings:
3
File Size:
153 KB
Average Rating:
File Name:
NetCDF_Connector.opx
File Version:
1.56
Minimum Versions:
License:
Free
Type:
App
Summary:

Create a connection to a NetCDF file

Screen Shot and Video:
Description:

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
  1. With a worksheet or a matrix sheet active, click on the Data menu.
  2. 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. 
  3. 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.
  4. 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.
  5. 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

  1. ua[1][1][y][x] creates 1 matrix of y (lat = 128) rows, x (lon = 256) columns.
  2. 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.

Updates:

v1.56 11/14/2024 Fixed bugs.
v1.55 5/7/2024 Fixed bug of Use an embedded Matrixbook or Worksheet Columns.
v1.51 1/11/2023 Support 4D data as multiple sheets
v1.4 10/31/2022 Supported *.nc4 files.
v1.37 5/6/2022 Supported period arithmetic calculation.
v1.36 4/8/2021 Improved data in climatology, meteorology area.
v1.12 10/21/2020 Fixed reimport issues.
v1.07 5/15/2020 Fixed bug of failing to connect to web file.

Reviews and Comments:
08/08/2024B202265090hajkja

04/06/2024m.toulabigood

07/11/2022noissegood it's nice!