NcCut is a GUI for getting pixel data from images and data values from NetCDF files along linear transects. This simplifies the analysis of images with linear features where the brightness of the pixel can be used to gauge some physical value. Some examples include measuring sea ice floe concentration or characterizing ice sheet fractures from satellite imagery. For NetCDF files, NcCut serves as an easy way to view datasets quickly along any set of dimensions and to extract data along transects. Using NcCut users can view vertical transect images of their data along a third dimension and the marked out line. In addition, NcCut is designed to make the measurement of linear features as automatic as possible through it's "Transect Marker" tool where linear features can be marked out and have transects automatically be made perpendicular to the feature. Multiple features can be marked at once on a file and saved all together as a “project” that can be uploaded and continued or edited.
Users can display a plot of the data as well as package the data into a downloadable JSON file. When extracting values from the image/dataset, the program uses linear interpolation to interpolate between the values of the pixels to ensure an accurate portrayal of the line drawn.
This is an open source project. For contribution guidelines please refer to the contribution section of the docs.
It is recommended to first create a virtual environment before installing packages on your system to prevent package compatibility issues. From the terminal at your desired directory use:
For Linux and Mac:
python3 -m venv nccut-venv
source nccut-venv/bin/activate
For Windows:
python3 -m venv nccut-venv
nccut-venv\Scripts\activate
Then install NcCut using PIP:
pip install nccut
from nccut.nccut import NcCut
NcCut().run()
deactivate
To open the same virtual environment again in the future simply execute:
For Linux and Mac:
source nccut-venv/bin/activate
For Windows:
nccut-venv\Scripts\activate
If you are having trouble installing NcCut please refer to the Troubleshooting section of the docs
If you would like to try out the app there are example image and NetCDF files in the support folder of this repository
Relative file paths:
support/example.jpg
\
support/test_img.png
\
support/example_4v.nc
\
support/example_3d.nc
\
There is an example project file for upload as well:
support/project_example.json
from nccut.nccut import NcCut
NcCut().run()
To load an image file or NetCDF file type the relative or absolute file path to the file into the file entry text box and select "Go"
You can scroll to zoom in and out of the image and can click and drag the image to move it around.
From the "View" menu in the settings bar you can rotate or flip the image as well as change graphic settings for the tools.
If you are loading a NetCDF file, from the "NetCDF" menu in the settings bar you can change which variable or z value you'd like to see as well as change the color map or contrast of the image.
For more on these tools please refer to usage section of the docs.