NetCDF-Extractor Tool

NetCDF-Extractor was initially employed in this paper: Estimation of meteorological drought indices based on AgMERRA precipitation data and station-observed precipitation data

What is NetCDF-Extractor V2.1?

NetCDF-Extractor stands as a Windows tool tailored for viewing dimensions and variables, extracting data from .nc and .nc4 files, and converting to Excel, csv, and text format. In this version, users can extract time series from multiple .nc files in a simultaneous fashion, streamlining their workflow. By loading multiple files at once, the software streamlines operations and minimizes potential errors.

The most prominent advantage of this software is saving your time. Unlike the cumbersome step-by-step loading procedure, users can swiftly execute their extraction tasks. NetCDF Extractor also features a small calculator tool that computes the grid number for your coordinates based on the latitude and longitude of the file. However, users must exercise caution when inputting the start and end latitudes/longitudes of the file, as highlighted in the accompanying video guide.

Two buttons labeled "Sum" and "Average" are present, offering a convenient means to compute average and sum values for chosen areas (grids). When extracting data for a specific region, a 3-dimensional array (time, latitude, longitude) is obtained. Clicking the Sum or Average button will do the calculation of averages across two dimensions (latitude and longitude). Consequently, a 2-dimensional array is generated, comprising "time" and "average" components.

Within NetCDF-Extractor, a concise API is provided for creating contour and heatmap graphs. Furthermore, the software incorporates a specific button enabling the export of all extracted data without the application of averaging. When conducting data extraction for a designated region, a 3-dimensional array is generated (time, latitude, longitude), whereas text or CSV files commonly exhibit two dimensions. To accommodate this contrast, the tool furnishes two distinct styles for saving NetCDF files: Style 1, characterized by a blue table, and Style 2, yielding an orange table.

netcdf-extractor styles

Typically, most NetCDF files incorporate an unlimited dimension within the primary variable, often denoting time. NetCDF-Extractor capitalizes on this dimension for temporary file merging. However, some NetCDF creators overlook the application of an unlimited dimension. Another noteworthy feature of NetCDF-Extractor is its capability to amalgamate files that lack an unlimited or time dimension. The software will prompt you regarding the presence of an unlimited dimension in your file before proceeding with the merging process if your file does have not unlimited dimension.

If you intend to store a substantial amount of data in CSV or text format, your system's capability becomes a determining factor. Adequate system RAM is essential for this task. Additionally, ensure to disable the "Fill Table" checkbox, allowing the tool to extract data without populating the table within the software. This extracted data can then be stored in CSV, text, or Excel files. Furthermore, there are certain limitations associated with the format of the output file. For instance, an Excel file cannot contain more than 16,384 columns.

NetCDF to excel or csv

Video Thumbnail

The license for this tool grants the purchaser one-year usage on any laptop. This means that once purchased, the tool can be used indefinitely on any laptop without any restrictions or additional fees for one year.


First Tab

NetCDF-Extractor comprises two distinct tabs, each dedicated to specific functions outlined below

The initial tab allows users to visualize the contents of a NetCDF file and export any one or two-dimensional data to a CSV file. Simply select your file, and upon selecting two radio buttons, the data will be displayed. You can refer to the step-by-step instructions provided in the accompanying images below.

The image is accessible in the PDF file. Download it by clicking the "Tutorial" button.

If you wish to extract data from the file, navigate to the "Extract Data" tab. Here, input the grid numbers and click on the "Extract" button. If your variable in the NetCDF file has three dimensions, you will need to select one of the radio buttons corresponding to those dimensions. The "Average" and "Sum" buttons calculate the mean or sum of the two dimensions not selected. For instance, if the time radio button is selected and you click on the "Average" or "Sum" button, you will obtain a spatial mean time series.

Second Tab

If you open one or multiple NetCDF files using the second icon on the top bar, you can utilize the second tab to extract merged data in unlimited dimensions. If your files do not have unlimited dimensions, a window will prompt you to select one of the dimensions as unlimited for merging (typically the time dimension).

Please input the variable name and click on the "Load" button. Upon opening one of the files in the tree view on the left-hand side, you can locate the variable name. Please be aware that occasionally, NetCDF files may have issues causing the variable names to be incorrect. In such cases, you can check the checkbox and input the variable number.

You should enter the grid numbers and click on extract. The first dimension usually is time dimension therefore Average and Sum button will apply on the second and third dimension that here is lat and lon. Also you can use the styles button to resort the three dimensions data in a table (two dimension data).

If you wish to display the extracted data in the table, you can check the "Fill Table" checkbox and save them to a file. Otherwise, after extraction, you can save the result in a CSV file and open the file using Excel.

When utilizing the Style buttons, you have the option to select the number of decimal places. Refer to the image above to understand how the data appears when sorted in different styles.