Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Specified with only the fieldset as its single argument, sort() sorts in ascending order the fieldset according to the following MARS keys: date, time, step, number (ensembleensemle member) number, level and paramId levelist and param (integer ID).

The second argument allows you to modify the precedence of the sorting keys - e.g. if the second argument is a string "parameterparam", then the sorting is done according to the parameter firstparam key. If the second argument is a list you specify a list of sorting keys - e.g. ["parameterparam", "date"] sorts on parameter and then date. Please note that the "parameter" sorting key represents the paramId.

The third argument specifies a sorting direction. This can be a string (">" or "<") or a list ([">", "<", ">",...]). If it is a string, the sorting direction it specifies applies to all sorting keys specified in the second argument. If it is a list, then the second argument must also be a list with the same number of elements - the sorting directions apply to each sorting key specified.

...