<jupyter_start><jupyter_text>Read netCDFobrero comes with a small module that uses `xarray.open_dataset()` function to read netCDF files. But after it reads the netCDF file, it will make sure its coordinates are named `latitude`, `longitude` and `level`, to be able to keep consistency everywhere else with other obrero code. Aditionally it adds a new bound method to the xarray's `DataArray` class: `.convert_units()`, which uses cf-units module to convert units when possible. So let's first import obrero:<jupyter_code># small hack to be able to import module without install
import os
import sys
sys.path.append(os.getcwd() + '/../')

import obrero<jupyter_output><empty_output><jupyter_text>Now we can simply read the netCDF file using function `obrero.read_nc()`:<jupyter_code># read data
fname = 'data/ctl.nc'

# read as data array
ds = obrero.read_nc(fname)<jupyter_output><empty_output><jupyter_text>Depending on the contents of the netCDF file `da` will be a `DataArray` (single variable) or `Dataset` (multiple variables). In this case we can see the object contains several arrays, one for each variable:<jupyter_code>ds<jupyter_output><empty_output><jupyter_text>If we want a single variable, we can put this inside the function call next to the file name string:<jupyter_code># read as data array
da = obrero.read_nc(fname, 'pr')
da<jupyter_output><empty_output><jupyter_text>We can even select several variables using a list object:<jupyter_code># read as data array
ds2 = obrero.read_nc(fname, ['pr', 'tas'])
ds2<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09050064184852374, 'fraction_numerical': 0.0012836970474967907, 'mean_word_length': 6.184331797235023, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '74571', 'license': 'MIT', 'n_tokens_mistral': 505, 'n_tokens_neox': 501, 'n_words': 188, 'path': 'examples/nb/example_01.ipynb', 'repo_name': 'Maduvi/obrero', 'size': '1558'}