ls
- ls(fs, extra_keys=[], filter={}, no_print=False)
- Fieldset.ls(extra_keys=[], filter={}, no_print=False)
New in metview-python version 1.8.0.
Lists the messages of a
Fieldset
by printing the values of some ecCodes keys.- Parameters
fs (
Fieldset
) – input fieldsetextra_keys (list of str) – list of additional ecCodes keys. Type qualifiers (s=string, l=long, d=double) can be appended to each key name following the “:” character. E.g. to get “centre” as long use “centre:l”.
filter (dict) – defines a filter to list only a subset of the messages. A filter is a set of ecCodes keys each with a matching value or list of values. These individual conditions are combined together with a logical AND to define the filter (just like in
select()
).no_print (boolean) – optionally suppress printing to standard output when not in a Jupyter notebook
- Return type
Pandas dataframe. If not in a Jupyter notebook the dataframe is printed to the standard output
ls()
scans theFieldset
and for each message extracts values for a default set of ecCodes keys. Additional keys can be listed withextra_keys
whilefilter
defines the conditions to list only a subset of the messages.The following example shows how the output looks in a notebook using the default set of ecCodes keys:
We can add additional keys by using
extra_keys
:To list only the fields on 850 hPa we can use
filter
in the following way: