pycif.plugins.transforms.basic.clipcrop — API reference#
Configuration reference: clipcrop plugin
- pycif.plugins.transforms.basic.clipcrop.adjoint.adjoint(transform, inout_datastore, controlvect, obsvect, mapper, di, df, mode, runsubdir, workdir, onlyinit=False, **kwargs)[source]#
Propagate adjoint sensitivities through the clip/crop mask.
The adjoint of
forward(): copiesadj_outfrom the output datastore to the input datastore, then zeroes the same spatial mask (sensitivities at zeroed cells in the forward pass are zero in the adjoint too).- Parameters:
transform (Plugin) – clipcrop instance.
inout_datastore (dict) – mutable datastore.
controlvect – unused.
obsvect – unused.
mapper (dict) – transform mapper.
di (datetime) – sub-simulation start date.
df (datetime) – unused.
mode (str) –
'adj'.runsubdir (str) – unused.
workdir (str) – unused.
onlyinit (bool) – if
True, return immediately.**kwargs – unused.
- pycif.plugins.transforms.basic.clipcrop.forward.forward(transform, inout_datastore, controlvect, obsvect, mapper, di, df, mode, runsubdir, workdir, onlyinit=False, **kwargs)[source]#
Zero out grid cells inside (clip) or outside (crop) a lon/lat rectangle.
Builds a boolean mask from the domain coordinates and
transform.{xmin, xmax, ymin, ymax}, then sets all masked cells to zero in both'spec'and (in TL mode)'incr'.mode = 'crop': mask = cells inside the rectangle → zeroed.mode = 'clip': mask = cells outside the rectangle → zeroed.
- Parameters:
transform (Plugin) – clipcrop instance (carries
mode,xmin,xmax,ymin,ymax).inout_datastore (dict) – mutable datastore.
controlvect – unused.
obsvect – unused.
mapper (dict) – transform mapper (provides domain coordinates).
di (datetime) – sub-simulation start date.
df (datetime) – sub-simulation end date.
mode (str) –
'fwd'or'tl'.runsubdir (str) – unused.
workdir (str) – unused.
onlyinit (bool) – unused.
**kwargs – unused.