sparse2sample/std sparse2sample/std

sparse2sample/std sparse2sample/std#

Description#

sparse2sample transform: scatter sparse observations onto the model grid.

The inverse direction of array2sampled: takes a sparse observation-indexed DataFrame and accumulates its values onto the full model grid array (forward), or extracts the gridded adjoint sensitivity at each observation location back into the sparse DataFrame (adjoint).

Forward: sparse observations → gridded array (np.add.at scatter). Adjoint: gridded sensitivity → sparse observation sensitivities.

Warning

The adjoint function contains an active debug code.interact() call that will pause execution in interactive mode. This must be removed before production use.

YAML arguments#

The following arguments are used to configure the plugin. pyCIF will return an exception at the initialization if mandatory arguments are not specified, or if any argument does not fit accepted values or type:

Optional arguments#

parameter : str, optional

Parameter name on which the transform works on

component : str, optional

Component name on which the transform works on

orig_parameter_plg : Plugin, optional

Plugin object on which the transform works on

orig_component_plg : Plugin, optional

Corresponding component object on which the transform works on

successor : str, optional

Name of the successor transform

precursor : str, optional

Name of the precursor transform

YAML template#

Please find below a template for a YAML configuration:

 1transform:
 2  plugin:
 3    name: sparse2sample
 4    version: std
 5    type: transform
 6
 7  # Optional arguments
 8  parameter: XXXXX  # str
 9  component: XXXXX  # str
10  orig_parameter_plg: XXXXX  # Plugin
11  orig_component_plg: XXXXX  # Plugin
12  successor: XXXXX  # str
13  precursor: XXXXX  # str