You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
obsarray enables users to define, store and interface with flag variables in :py:class:`xarray.Dataset`'s following the `CF Convention <https://cfconventions.org/Data/cf-conventions/cf-conventions-1.10/cf-conventions.html#flags>`_ metadata standard.
5
+
6
+
To access the information from a particular flag variable, use the dataset's ``flag`` accessor as follows,
7
+
8
+
.. code-block:: python
9
+
10
+
import xarray as xr
11
+
import obsarray
12
+
13
+
ds = xr.open_dataset("measurement_data.nc")
14
+
print(ds.flag["flag_var"])
15
+
16
+
This lists the flags for that variable. To access the flag values for a particular flag variable,
17
+
18
+
.. code-block:: python
19
+
20
+
ds.flag["flag_var"]["flag_1"].value # get flag mask
21
+
ds.flag["flag_var"]["flag_1"][:, 0] =True# set flag mask values
22
+
23
+
24
+
25
+
You can add a flag variable in a similar way to adding a new variable to a dataset,
0 commit comments