act.transform.Transform#
- class act.transform.Transform(ds)[source]#
Xarray Dataset accessor exposing the
act.transformkernels.Every method here forwards straight through to the corresponding module-level function (
act.transform.bin_average(),act.transform.interpolate(),act.transform.subsample(),act.transform.transform_dataset()) usingself._ds[var]in place of an explicit DataArray argument. No transform logic is duplicated here.Examples
The accessor takes variable names and looks them up in the Dataset, where the module-level functions take
xarray.DataArrayobjects. Note that the QC argument changes name accordingly:qc_var_namehere versusqcon the functions.import act ds = act.io.arm.read_arm_netcdf(filename, cleanup_qc=True) target = act.transform.make_coord('2023-03-01', '2023-03-02', '30min') result, result_qc = ds.transform.bin_average( 'temp_mean', target, dim='time', qc_var_name='qc_temp_mean', qc_mask=4 )
These two calls are equivalent; the accessor forwards straight to the function, so neither form is more capable than the other.
result, result_qc = ds.transform.interpolate('temp_mean', target, dim='time') result, result_qc = act.transform.interpolate(ds['temp_mean'], target, dim='time')
Any extra keyword arguments are passed through to the underlying function, and
transform_datasettakes every argument exceptdsitself.result, result_qc = ds.transform.bin_average( 'wspd_arith_mean', target, dim='time', std_ind_max=0.8 ) new_ds = ds.transform.transform_dataset( target=target, dim='time', transform='bin_average', qc_mask=4 )
|
Bin-average |
|
Interpolate |
|
Subsample |
|
Apply a transform to every matching variable in this Dataset. |