Skip to content

computed_fields for SyntheticObservations #216

@glwagner

Description

@glwagner

Say that I want to calibrate CATKE using the mismatch between the gradient of observed and modeled TKE, rather than the absolute value. This is reasonable if we really care about the "shape" of the profile, rather than its absolute magnitude.

For this I think we can allow users to specify transformations on data that get loaded into field_time_series. This is what it might look like:

dz_e = Computation(e -> ∂z(e), inputs=:e)

obs = SyntheticObservations(data_path, field_names=(:b, :e), computed_fields=(; dz_e))

For shear we might write

shear = Computation((u, v) -> sqrt(∂z(u)^2 + ∂z(v)^2), inputs=(:u, :v))
obs = SyntheticObservations(data_path, field_names=(:b, :e), computed_fields=(; dz_e, shear))

under the hood, we can first load the "file-based" FieldTimeSeries, and then use that data to make the list of computed_fields. The first argument to Computation is a function that transforms dependencies (one of or a list of the fields that were loaded from file) into another field or abstract operation.

It's probably also possible to design a macro that allows us to write (since the code gives us the names of the inputs.

shear = @computation (u, v) -> sqrt(∂z(u)^2 + ∂z(v)^2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions