Decrease unit depency of plotting styles

Issue #328 resolved
Joern Ungermann created an issue

Most plotting styles still make some assumptions about the units, with which the data is supplied. In the last version, a data_units field was made available that can be used by styles to check on the supplied unit and potentially make conversions. One should either make use of a generic unit conversion library, but at least support the most common units for pressure (Pa+hPa) and geopotential altitude (m+km+m^2/s^2).

With the current state, some plots seem to succeed, while others fail in more obvious ways.

Comments (2)

  1. Reimar Bauer

    Add a very simple unit conversion routine for the most obvious problems.

    The original DLR models use mostly Pa for pressure and m^2s^-2 for geopotential altitude, while FZJ ones use often hPa and m or km. Instead of assuming the model to be in a given unit, the units attribute can be read out. This has already been implemented in a past patch, but was not consistently used so far. There are also libraries for unit conversion, but they fail, e.g., when converting GPH in m^2/s^2 to m. The current solution is very simple, extendable, and effective replaceable by a more professional solution by putting all conversion in one place.

    Fix issue #328

    → <<cset 647b8ba6d8fc>>

  2. Log in to comment