Warning
This is an experimental package - use at your own risk!
A Julia package for plotting ice sheet model netCDF outputs from WAVI.jl for MISMIP+ experiments.
julia --project=.using Pkg
Pkg.add(url="https://github.com/WAVI-ice-sheet-model/WAVIPlotting.jl")
Pkg.resolve()
Pkg.instantiate()git clone https://github.com/WAVI-ice-sheet-model/WAVIPlotting.jl.git
cd WAVIPlotting.jl
julia --project=. -e 'using Pkg; Pkg.instantiate()'In this case, since you've cloned the script, you can run it directly from the bin directory:
bin/wavi_plot mismip_plus file1.nc file2.ncTo use wavi_plot from the command line, you need to make the script executable and add it to your PATH:
chmod +x bin/wavi_plot
export PATH="/path/to/WAVIPlotting.jl/bin:$PATH"Add the export line to your ~/.bashrc or ~/.zshrc to make it permanent.
sudo ln -s /path/to/WAVIPlotting.jl/bin/wavi_plot /usr/local/bin/wavi_plotAfter installing the package, the wavi_plot executable is placed in the package's bin directory. Add this directory to your PATH (or invoke it via its full path) to run the tool. For example:
# Add the bin directory to PATH (adjust the version path as needed)
export PATH="$HOME/.julia/packages/WAVIPlotting/<version>/bin:$PATH"
# Now you can run the command directly
wavi_plot mismip_plus file1.nc file2.ncAlternatively, you can call the script directly without modifying PATH:
$(julia --project=. -e 'using WAVIPlotting; print(joinpath(dirname(pathof(WAVIPlotting)), "..", "bin", "wavi_plot"))') mismip_plus file1.nc file2.ncNote
But, using this approach, you cannot pass options to the script like the following examples.
wavi_plot mismip_plus outputs/output.nc outputs2/output.ncWith options:
wavi_plot mismip_plus file1.nc file2.nc -o comparison.jpgusing WAVIPlotting
# Plot MISMIP+ outputs
plot_mismip_plus(
["outputs/output.nc", "outputs2/output.nc"],
"comparison.jpg",
)--output, -o: Output file path (default: nothing), if nothing, it will show plot in an interactive window--version, -v: Show version information--help, -h: Show help message
mismip_plus: MISMIP+ ice sheet experiment comparisons
Your NetCDF files should contain the following coordinate variables:
x: x-coordinatey: y-coordinateTIME: time coordinate (optional)
And data variables with dimensions TIME, y, x, such as:
h: ice thicknessu: u-component of ice velocityv: v-component of ice velocity
Warning
Definitely subject to change as I learn more about Julia!
- Create a new file in
src/plots/ - Include it in
src/WAVIPlotting.jl - Add the plot type to the command-line parser
- Update the README
MIT License
Contributions are welcome! Please feel free to submit a Pull Request.
