Introduction
The Sinlge Page web app is a panel web app that can be used to quickly modify values of a NETCdf file. It shows calculations of endoric basins (values below 0 surrounded by land values) and diffusive passages (see straights that are only 1 cell across).
You can choose the variable you visualize and the assocaited colormaps and steps.
Finally there are a number of methods to modify values and save then save the netcdf as either a .nc
file or a python script to apply the same processing steps to other files.
Table of Contents
Interface
Browse
The entrypoint to the app is to upload a file using the available upload tool, seen below.
Currently Google Cloud seems to only accept files less than roughly 20mb, however the limit for local deployement has been set to 100mb and is modifiable.
Under the hood the import and manipulation of the netCDF files is done by xarray.
import xarray as xr
data = xr.open_dataset(FILENAME)
Curvilinear Coordinates
Curvilinear coordinates are supported HOWEVER they are reprojected into ij space. This is done because calculating selections on a non uniform grid is costly. Below the curvilinear grid is on the left, notice the areas in black that were not initially covered.
Options
More details about how to interact with data.
Extra Maps
Finally we can choose to show extra maps. These carry out useful calculations to show locations that could cause a problem.
Internal Oceans
The simulation code has problems when internal oceans are present. Internal oceans are defined by values of 0 or less surrounded by values of land. By checking this option the backend will calculate in the current configuration the number of internal oceans and their locations.
Diffusive passages
Due to the way that the simulation code is written water passages (value of 0 or less) with a width of one cell will only have diffusive properties and no advection, whilst this may be desired in certain locations this can be undesirable in certain areas (Strait of Gibraltar, Panama, … ). By checking this option the backend will calculate in the current configuration the number of diffusive oceanic cells and their locations.
Theory
Convolutions were used to determine the diffusive passages.
The template that was used was the following and it’s Transpose:
? | Water | ? | 0 | 1 | 0 | |
Land | Water | Land | -1 | 1 | -1 | |
? | Water | ? | 0 | 1 | 0 |
A convolution works by passing a moving window over the underlying array and multiplying each value of the base array with the value in the template, it then calculates the sum and assigns it to the center cell.
By coding in the template and the base array:
- Land -> -1
- Ocean -> 1
It is possible to use 0 as values that we do not care about hence the templates above.