Skip to content

Conversation

@evenmn
Copy link
Contributor

@evenmn evenmn commented Sep 17, 2025

Added support for:

  • defining variables from expressions
  • ws is automatically converted to the expression "([10u]**2+[10v]**2)**0.5"

Variables expressions support basic math operators, and expression mode is invkoed if there is a left braket '[' in the variable definition:

Example:

- verif:
          filename: /path/to/output.nc
          variable: ws
          units: m/s
          obs_sources:
            - anemoidataset:
                dataset: ${verif_dataset}
                variable: "([10u]**2+[10v]**2)**0.5"

This functionality was also incorporated into the NetCDF output class, here demonstrated by converting total cloud coverage (tcc) from the range 0-1 to 0-100:

- netcdf:
    filename_pattern: /path/to/output.nc
    variables: [2t, msl]
    extra_variables: ["100*[tcc]"]

evenmn and others added 5 commits September 9, 2025 16:00
@havardhhaugen
Copy link
Contributor

kan du rebase?

@havardhhaugen
Copy link
Contributor

Sorry can you rebase again? I tried doing it but it was slightly complicated so I'm afraid to mess things up.

…: 'ws'='([10u]**2+[10v]**2)**0.5', scaling a variable can be done with 'tp'='0.001*[tp]' etc..

Signed-off-by: evenmn <[email protected]>
Signed-off-by: evenmn <[email protected]>
Signed-off-by: evenmn <[email protected]>
Signed-off-by: evenmn <[email protected]>
Signed-off-by: evenmn <[email protected]>
Signed-off-by: evenmn <[email protected]>
Signed-off-by: evenmn <[email protected]>
Signed-off-by: evenmn <[email protected]>
Signed-off-by: evenmn <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants