...
Excerpt | ||
---|---|---|
| ||
Some keys like shortName are strings (native type "string") and it doesn't make any sense to set them as an integer or float as they are not possible values for the key. |
Some keys like "shortName" are strings (native type "string") and it doesn't make any sense to set them as an integer or float as they are not possible values for the key.
Some keys are native type integer like "perturbationNumber" and you can set/get them as integer, float or string as you like.
...
this means that if you set shortName="cape" (as a string), ecCodes will automatically set the keys listed in curly brackets to the corresponding values.
Conversely when you get shortName, ecCodes looks for the best match of the keys listed in the full definition of shortName (not only cape) and will return "cape" only if the following are true:
discipline ==
0
parameterCategory ==
7
parameterNumber ==
6
typeOfFirstFixedSurface ==
1
typeOfSecondFixedSurface ==
8
in the message and there isn't a better match of keys in the list.
...
The idea is that the user should know what to set before choosing the type to use. In the sense that the user should know the meaning of the key before setting it to a value. For this purpose we have built the documentation and I agree that we need to do a big review (with your help) of it to fix all the wrong things and to add what is missing.
There was a bit of confusion regarding the type of step and paramId for the following reason:
...
In the past step was a string because you can have values like '24-36' which you cannot represent as numbersa number. In MARS the step is only the endStep and therefore we had to modify ecCodes to be MARS compliant. Now the step is an integer and is step=set to endStep. As we need a step indicating a range we introduced stepRange which is a string and cannot be set as an integer and will never be set as an integer because it allows values like stepRange=24-36. It is true that most of the time you have stepRange=36 or stepRange=24 or another single number, but this is because in those cases you have also stepType=instant and endStep=startStep and we don't want to write stepRange=24-24 which is redundant. We also write stepRange=24 when stepRange=0-24 (MARS compatibility). If you prefer to set the step as an integer instead of using a string you have the keys starStep , and endStep which are integers and they can also be set as string because it is possible to convert for example the number 24 into the string "24". Therefore you can do:
...