<jupyter_start><jupyter_text>Tutorial on how to use `timestaps` in Field construction<jupyter_code>from parcels import Field
from glob import glob
import numpy as np<jupyter_output><empty_output><jupyter_text>Some NetCDF files, such as for example those from the [World Ocean Atlas](https://www.nodc.noaa.gov/OC5/woa18/), have time calendars that can't be parsed by `xarray`. These result in a `ValueError: unable to decode time units`, for example when the calendar is in 'months since' a particular date.In these cases, a workaround in Parcels is to use the `timestamps` argument in `Field` (or `FieldSet`) creation. Here, we show how this works for example temperature data from the World Ocean Atlas in the Pacific Ocean The following cell would give an error, since the calendar of the World Ocean Atlas data is in "months since 1955-01-01 00:00:00"<jupyter_code># tempfield = Field.from_netcdf(glob('WOA_data/woa18_decav_*_04.nc'), 't_an', 
#                               {'lon': 'lon', 'lat': 'lat', 'time': 'time'})<jupyter_output><empty_output><jupyter_text>However, we can create our own numpy array of timestamps associated with each of the 12 snapshots in the netcdf file<jupyter_code>timestamps = np.expand_dims(np.array([np.datetime64('2001-%.2d-15' %m) for m in range(1,13)]), axis=1)<jupyter_output><empty_output><jupyter_text>And then we can add the `timestamps` as an extra argument<jupyter_code>tempfield = Field.from_netcdf(glob('WOA_data/woa18_decav_*_04.nc'), 't_an', 
                              {'lon': 'lon', 'lat': 'lat', 'time': 'time'}, 
                              timestamps=timestamps)<jupyter_output>WARNING: File WOA_data/woa18_decav_t10_04.nc could not be decoded properly by xarray (version 0.12.1).
         It will be opened with no decoding. Filling values might be wrongly parsed.
WARNING: Casting depth data to np.float32
{'fraction_non_alphanumeric': 0.10128617363344052, 'fraction_numerical': 0.027867095391211148, 'mean_word_length': 4.41159420289855, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '229385', 'license': 'MIT', 'n_tokens_mistral': 632, 'n_tokens_neox': 586, 'n_words': 206, 'path': 'parcels/examples/tutorial_timestamps.ipynb', 'repo_name': 'MariusWiggert/parcels', 'size': '1866'}