File Exchange > Data Analysis >    NetCDF Data Analysis

OriginLab Technical Support
Date Added:
Last Update:
Downloads (90 Days):
Total Ratings:
File Size:
244 KB
Average Rating:
File Name:
File Version:
Minimum Versions:

Perform analysis on NetCDF data.

Screen Shot and Video:

This app can be used to perform analysis on NetCDF data including Sen's Slope, Mann-Kendall Test along the time direction, Linear Fit and Correlation Coefficient between two NetCDF data.

Download the file NetCDF_Data_Analysis.opx, and then drag-and-drop onto the Origin workspace. An icon will appear in the Apps Gallery window.
NOTE: This tool requires OriginPro.


  • Make an MBook for NetCDF data active. Click on the NetCDF Data Analysis icon in the Apps Gallery window. A dialog with six buttons will appear.
    1. Click the first Sen's Slope button. Sen's slope result will be calculated in a new MBook.
    2. Click the second Mann-Kendall Test button. Three matrices will be created in the new MBook including Mann-Kendall Test's statistic, P-value and significant flag (1 represents significant for alpha=0.05).
    3. Click the third Linear Fit for Two NetCDF Files button. It will use the active MSheet as the first NetCDF data, and pop up a dialog to choose the second NetCDF data, the second data can be a NetCDF data in another MSheet or data in a column with the same size as that of time for the first NetCDF data. Two matrices will be created in the new MBook including the intercepts and slopes.
    4. Click the 4th Correlation between Two NetCDF Data button. It will use the active MSheet as the first NetCDF data, and pop up a dialog to choose the second data. In the dialog, choose Lag for 1st Data or 2nd Data, and set a value in Lags edit box to specify the lag between two data in the calculation of correlation. Two matrices for the correlation and significance of the correlation will be created in the new MBook. In the Show Correlations dropdown list, three options are available: Output All, Set Missing for Insignificance Correlations and Output Significance Flag. When the last two options are chosen, Significance Level edit box is available. For the 2nd option, correlations whose significance levels are greater than the specified value will be set missing values. For the 3rd option, the significance matrix will be replaced with 0(insignificance) or 1 (significance). Note that If the NetCDF data is large, it may be slow to read data in MBook. Progress is shown in the status bar. And when it is finished, a message box will open.
  • Click the 5th OK button. The dialog for buttons will be closed. The MBook for the result will be activated.

This app provides a sample OPJU file. Right click on the NetCDF Data Analysis icon in the Apps Gallery window, and choose Show Samples Folder from the short-cut menu. A folder will open. Drag-and-drop the project file NetCDFDASample.opju from the folder onto Origin. The Notes window in the project shows detailed steps. Note: If you wish to save the OPJU after changing, it is recommended that you save to a different folder location (e.g. User Files Folder).


  • Sen's Slope
    \(Sen's Slope=Median\{\frac{x_j-x_i}{j-i},\ i< j\}\)
  • Mann-Kendall Test
    Statistic: \(S=\displaystyle \sum_{i=1}^{n-1} \displaystyle \sum_{j=i+1}^{n} sign(x_j - x_i)\)
    Variance: \(var=\frac{1}{18}[n(n-1)(2n+5)-\displaystyle \sum_t f_t(f_t-1)(2f_t+5)]\)
    where n is size along the time direction, and t is the set of tied ranks, and ft is number of times for the tied rank.
    Normal distribution z for n>10: \(z=\begin{cases} \frac{S-1}{\sqrt{var}} , & S>0 \\ 0 , & S=0 \\ \frac{S+1}{\sqrt{var}} , & S<0 \end{cases}\)
  • Linear Fit
    Perform linear fit along time direction for two NetCDF data.
  • Correlation 
    Calculate correlation coefficients along time direction between two NetCDF data.


7/5/2022 v1.01 Fixed error message for split MSheet.

Reviews and Comments:
06/04/2024Li HongOK


07/20/2022AndrewThis is nice!