Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation for creating custom styles #37

Open
brancomat opened this issue Oct 21, 2019 · 4 comments
Open

documentation for creating custom styles #37

brancomat opened this issue Oct 21, 2019 · 4 comments

Comments

@brancomat
Copy link
Contributor

If I understand correctly, skinnywms uses magics' default styles in /usr/share/magics/styles/, but it's possible to use a different path with the --style parameter.

Is there any documentation or best practices for the json files in that directory? Particularly on matching products/levels with the desired style.
It seems that there are generic style (contour) definitions and other files with a match between a combination of levels/parameters and those styles.

Thank you.

@sylvielamythepaut
Copy link
Contributor

Hi,
Yes exactly ii is possible to create some json files with rules and styles and have Magics to use them in the skinny wms ..
I am going to create a repo on github with exmaples a "tiny" bit of documentation
Sylvie

@brancomat
Copy link
Contributor Author

Thank you,
in the meantime we tried to boil down our generic question to a couple of more specific points:

  1. how are json styles file read? are there specific names or hierarchies? A wild guess: when the contour_automatig_setting variable it set it seems to read the default syles and then the subdir with the name of the variable, is it correct?

  2. the semantic of the "match" array, i.e. how to express logical and/or in matches and what fields is it possibile to use

@milanavuckovic
Copy link

Hello,
I'll try to answer your questions:

  1. When contour_automatic_setting variable is set to 'ecmwf', Magics will read the metadata and try to find matches in json files (we call them layers, because they originate from ecCharts layers). If it finds something with at least one match it will use the default (first in the list) style from the list of styles.
  2. "match" is a list of dictionaries. In order for the layer to be 'matched', all the parameters in one dictionary must match. So it's dict1 OR dict2 OR dict3 etc. If a value in dictionary element is a list then one element in that list must mach. For example
    "match": [
    {
    "paramId": "34",
    "shortName": "sst"
    },
    {
    "long_name": "Sea surface temperature"
    },
    {
    "standard_name": [
    "sea_surface_temperature",
    "sea_surface_skin_temperature"
    ]
    In order to be matched here it needs to have in its metadata:
  • paramId = 34 AND shortName = sst OR
  • 'long_name' = 'Sea surface temperature' OR
  • 'standard_name' = sea_surface_temperature OR sea_surface_skin_temperature
    I hope this helps,
    Milana

@tnlogy
Copy link

tnlogy commented Feb 15, 2022

Any progress with showing a minimal example of using custom styles? Tried setting the arguments to Styler, but no changes visible. Any example on how to make a custom style for a shortName in a grib file would be much appreciated.

Also tried with setting MAGICS_STYLE_PATH to a path with some styles, but no difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants