Advanced Topics¶
Virtual layers¶
Virtual Layers allow you to use a parameter expression to access multiple variables from a dataset in a special way, while specifying a descriptive layer name that will also appear in the GetCapabilities documents. This is so that generic web clients don’t necessarility need to know the intracacies of assembling sci-wms
parameter expressions in requests.
Suported parameter expressions:
[layer_1],[layer_2]
This will treat layer_1 as a U vector and layer_2 as a V vector and produce vector plots.
Topology Cache¶
The topology cache is an important optimization that speeds up response times for datasets that are accessed over opendap. The cache is current located in the folder of the sci-wms
instance at path/to/sci-wms/wms/topology
. There are a number of files that make up the cache, and they vary by dataset type.
Each file has a name that is taken directly from the sci-wms
Dataset’s ‘Name’.
Spatial Tree (.idx and .dat)¶
These files contain serialized RTree spatial objects that are used for quickly making nearest neighbor queries as part of GetFeatureInfo requests.
These are necessary for large unstructured meshes, but are also used for the logically rectangular grids as well. Ideally it would be nice to move away from RTree into a better KD-Tree implementation, like sklearn’s, that will have better on disk performance lookup performance, but will be slower to initially build.
These files are constructed once when the dataset is added and not updated unless an Update Dataset
request is triggered via the sci-wms
admin page or API. If a dataset is set to Keep up to date
then it will update this cache every X seconds, depending on what the dataset is configured for.
Adding a new dataset through the website when running in Quickstart mode may timeout due to the topology cache taking along time to complete. If you run across this case, it is better to add the Dataset manually through the command line (no documentation at this point) or to use the Advanced mode of running sci-wms
.
NetCDF (.nc)¶
This file contains the up-to-date coordinate variable data for the dataset. This is typically Latitude/Longitude, and Time. For forecasts that are routinely updates, the time variable typically is growing with each update. This file is updated periodially if the Dataset
is set to “Keep up to date” or an update is manually triggered via the sci-wms
admin page or API.
Default Layer Settings¶
sci-wms
takes a three tier approach to figure out what the min
, max
, and logscale
values should be for a request.
In order of precedence:
- URL request arguments
Always preferred for maximum client control. Controlled with the
LOGSCALE
andCOLORSCALERANGE
URL parameters.
- Layer defaults
Used when populated on a
Layer
. Controlled on eachDataset
page on a per-variable basis. For each netCDF variable, we look for the following when processing a variable in order of most precedence first:scale_min and scale_max
scale_range
valid_min and valid_max
valid_range
- Global defaults
Used when the previous two are not populated. Controlled on the global defaults page on a
standard_name
andunits
basis.
WMS Extensions¶
sci-wms
implements a number of additional WMS parameters that are not defined in the WMS specification while remaining completely backwards compatible.
Parameter |
Requests |
Possible Values |
Usage |
Examples |
---|---|---|---|---|
LOGSCALE |
GetLegendGraphic GetMap |
|
If the request should use logscaling |
|
COLORSCALERANGE |
GetLegendGraphic GetMap |
|
A tuple in the format [min],[max] that defines the scale range to visualize |
|
SHOWLABEL |
GetLegendGraphic |
|
If the units label should be shows in the legend |
|
SHOWVALUES |
GetLegendGraphic |
|
If the value ticks should be shows in the legend |
|
COLORBARONLY |
GetLegendGraphic |
|
If |
|
UNITLABEL |
GetLegendGraphic |
|
Set the unit label on a legend to a custom value |
|
HORIZONTAL |
GetLegendGraphic |
|
Return a horizontal legend (vertical is the default) |
|
NUMCONTOURS |
GetLegendGraphic GetMap |
|
Return request with the specified number of contours. Only valid for the |
|
STYLE/STYLES |
GetLegendGraphic GetMap |
|
While some styles are defined in the GetCapabilities document, a use can specify any combination of an |
|
VECTORSCALE |
GetMap |
|
Controls the scale of vector arrows when plotting a |
|
VECTORSTEP |
GetMap |
|
Set the number of vector steps to be used when rendering a GetMap request using a |
|
Developers¶
To start sci-wms
with the Django development server on port :7002, type the following commands
$ python manage.py runserver 0.0.0.0:7002
This server is not considered secure for production implementations, and it is recommended you use an alternative wsgi server like Gunicorn.