This toolbox is for extracting pixel values from netCDF (Network Common Data Form) files at the location of a set of points. The toolbox includes a single tool that takes as inputs a folder containing netCDF files, a point shapefile, and an output folder location. The tool outputs a table and a CSV with columns for each point in the shapefile and rows for each date represented in the netCDF files name. The pixel values are extracted for each point using the xarray library in Python.
Before using this toolbox, you will need:
- ArcGIS Pro (Tested with ArcGIS Pro 3.0)
- Python 3.7 or later
- xarray library
- Clone the repository or download the zip file to your local machine.
- Open ArcGIS Pro and create a new project or open an existing project.
- Go to the Project tab and click on the Python tab.
- Click on the Add Package button and search for xarray. Install the xarray library.
- Go to the Project tab and click on the Geoprocessing tab.
- Click on the Tools button and then Add Toolbox.
- Navigate to the location where you cloned the repository or unzipped the file and select the ExtractNetCDFvalues.pyt file.
- The Extract Pixel Values from NetCDF toolbox should now be added to your ArcGIS project.
- Go to the Extract Pixel Values from NetCDF toolbox and double-click on the Extract Pixel Values tool.
- In the NetCDF Folder field, browse to the folder containing the netCDF files.
- In the Point Shapefile field, select the point shapefile to extract values from the netCDF files.
- In the Output Folder field, specify the folder to store the output table.
- In the Output Table field, specify a name for the output table.
- Click on the Run button to execute the tool.
The tool will create an output table and a CSV with the following columns:
- date: date of the netCDF file
- point1, point2, ..., point_n: pixel values at the points in the shapefile
- The output table will be stored in the output folder as a dBase file with a .dbf extension and .csv.
- Tool assumes that your netCDF files have date in their names at specific location.
- Tool assumes that your shapefile and netCDF have same spatial reference system.
- Tool assumes that your netCDF files have only single variable along with time, lat, and lng.
You may need to edit the source code to fit your needs.
- This tool has been tested with netCDF files in the CF convention with lon/lat coordinates. It may not work with other coordinate systems or conventions.
- The tool assumes that the first variable in the netCDF file is the data variable to extract values from.
- The tool assumes that the date of the netCDF file can be extracted from the file name.
If you encounter any issues or have questions about this toolbox, please contact me at !