Skip to content

Commit

Permalink
Merge pull request ARM-DOE#324 from zssherman/datafilter_doc_fix
Browse files Browse the repository at this point in the history
DOC: Fix for datafilter missing from __init__.py
  • Loading branch information
AdamTheisen authored May 6, 2021
2 parents 0eb2d3e + 6bb1742 commit a7b4c67
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions act/qc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
qcfilter.QCFilter.check_for_ancillary_qc
qcfilter.QCFilter.compare_time_series_trends
qcfilter.QCFilter.create_qc_variable
qcfilter.QCFilter.datafilter
qcfilter.QCFilter.get_qc_test_mask
qcfilter.QCFilter.get_masked_data
qcfilter.QCFilter.remove_test
Expand Down
22 changes: 10 additions & 12 deletions act/qc/qcfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def unset_test(self, var_name, index=None, test_number=None,

def available_bit(self, qc_var_name, recycle=False):
"""
Method to determine next availble bit or flag to use with a QC test.
Method to determine next available bit or flag to use with a QC test.
Will check for flag_masks first and if not found will check for
flag_values. This will drive how the next value is chosen.
Expand Down Expand Up @@ -658,7 +658,6 @@ def get_masked_data(self, var_name, rm_assessments=None,
fill_value=1e+20, dtype=float32)
"""

qc_var_name = self._obj.qcfilter.check_for_ancillary_qc(
var_name, add_if_missing=False)

Expand Down Expand Up @@ -739,11 +738,11 @@ def datafilter(self, variables=None, rm_assessments=None, rm_tests=None,
"""
Method to apply quality control variables to data variables by
changing the data values in the dataset using quality control variables.
The data variable is changed to to a numpy masked array with failing data
masked or, if requested, to numpy array with failing data set to NaN.
This can be used to update the data variable in the xarray dataset for use with
xarray methods to perform analysis on the data since those methods don't
read the quality control variables.
The data variable is changed to to a numpy masked array with failing
data masked or, if requested, to numpy array with failing data set to
NaN. This can be used to update the data variable in the xarray
dataset for use with xarray methods to perform analysis on the data
since those methods don't read the quality control variables.
Parameters
----------
Expand All @@ -768,10 +767,10 @@ def datafilter(self, variables=None, rm_assessments=None, rm_tests=None,
Opttion to delete quality control variable after processing. Since
the data values can not be determined after they are set to NaN
and xarray method processing would also process the quality control
variables, the default is to remove the quality control data variables.
If numpy masked arrays are used the data are not lost but would need
to be extracted and set to DataArray to return the dataset back to orginal state.
variables, the default is to remove the quality control data
variables. If numpy masked arrays are used the data are not lost
but would need to be extracted and set to DataArray to return the
dataset back to original state.
Examples
--------
Expand All @@ -794,7 +793,6 @@ def datafilter(self, variables=None, rm_assessments=None, rm_tests=None,
All data: 98.86097717285156, Bad Removed: 99.15148162841797
"""

if variables is not None and isinstance(variables, str):
variables = [variables]

Expand Down

0 comments on commit a7b4c67

Please sign in to comment.