Skip to content

Commit

Permalink
ready for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
konstntokas committed Aug 6, 2024
1 parent 1bdcc4c commit 9447e65
Show file tree
Hide file tree
Showing 10 changed files with 1,547 additions and 41 deletions.
82 changes: 82 additions & 0 deletions docs/source/cli/xcube_serve.rst
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,88 @@ Both, reversed and alpha blending is possible as well and can be configured by n
ColorBar: plasma_r_alpha
ValueRange: [0., 24.]
Colormaps may be user-defined within the configuration file. One example is shown below.


.. code-block:: yaml
Styles:
- Identifier: default
ColorMappings:
conc_chl:
CustomColorBar: my_cmap
The colormap `my_cmap` can then be configured in is described in section
`customcolormaps`_.


.. _customcolormaps:

CustomColorMaps [optional]
-----------------
Colormaps can be customized by the user in the section CustomColorMaps. Xcube server
supports three types of colormaps, namely

* Continuous
* Stepwise
* Categorical

which can be configured as shown below:

.. code-block:: yaml
CustomColorMaps:
- Identifier: my_cmap
Type: categorical # or continuous, stepwise
Colors:
- ColorEntry
- ...
where the *ColorEntry* may have one of the following forms (in TypeScript notation):

.. code-block:: javascript
type ColorEntry = ColorEntryObj | ColorEntryTuple;
interface ColorEntryObj {
Value: number;
Color: Color;
Label?: string;
}
type ColorEntryTuple = [number, Color] | [number, Color: label];
type Color = ColorName | ColorHex | ColorTuple;
type ColorName = <A CSS color name>;
type ColorHex = <A CSS color in hexdecimal form>;
type ColorTuple = [number, number, number] | [number, number, number, number]
For example *CustomColorMaps* can look like this:

.. code-block:: yaml
CustomColorMaps:
- Identifier: my_cmap
Type: continuous # or categorical, stepwise
Colors:
- Value: 0
Color: red
Label: low
- Value: 12
Color: "#0000FF"
Label: medium
- Value: 18
Color: [0, 255, 0]
Label: mediumhigh
- Value: 24
Color: [0, 1, 0, 0.3]
Label: high
- Identifier: cmap_bloom_risk
Type: categorical
Colors:
- [ 0, [0, 1, 0., 0.5], low_risk]
- [ 1, orange, medium_risk]
- [ 2, [1, 0, 0], high_risk]
.. _example:

Example
Expand Down
5 changes: 2 additions & 3 deletions examples/serve/demo/config-with-stores.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ DataStores:
# time_period: 1D
# tile_size: [512, 512]
# max_cache_size: 16777216

Styles:
- Identifier: S2L2A
ColorMappings:
Expand Down Expand Up @@ -105,7 +104,8 @@ Styles:
ColorBar: "bone"
ValueRange: [0., 0.25]
SCL:
CustomColorBar: S2_L2_SCL
ColorBar: "bone"
ValueRange: [ 0, 255 ]
rgb:
Red:
Variable: B04
Expand All @@ -117,7 +117,6 @@ Styles:
Variable: B08
ValueRange: [0., 0.25]


ServiceProvider:
ProviderName: "Brockmann Consult GmbH"
ProviderSite: "https://www.brockmann-consult.de"
Expand Down
22 changes: 0 additions & 22 deletions examples/serve/demo/server_store.py

This file was deleted.

Loading

0 comments on commit 9447e65

Please sign in to comment.