.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/example_find_positions_at_obs_times.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_example_find_positions_at_obs_times.py: Finding the closest or interpolated positions at given times (e.g. wave observations). ======================================================================================= .. GENERATED FROM PYTHON SOURCE LINES 5-13 .. code-block:: Python from pathlib import Path from trajan.readers.omb import read_omb_csv import xarray as xr import coloredlogs coloredlogs.install(level='debug') .. GENERATED FROM PYTHON SOURCE LINES 14-15 Read the data .. GENERATED FROM PYTHON SOURCE LINES 15-19 .. code-block:: Python data = Path.cwd().parent / "tests" / "test_data" / "csv" / "omb3.csv" ds = read_omb_csv(data) print(ds) .. rst-class:: sphx-glr-script-out .. code-block:: none 2024-12-16 16:26:13 fv-az1766-447 trajan.readers.omb[2121] DEBUG reading /home/runner/work/trajan/trajan/tests/test_data/csv/omb3.csv.. 2024-12-16 16:26:13 fv-az1766-447 trajan.readers.omb[2121] DEBUG omb_dataframe at index 94 is: Date Time (UTC) 16/Jun/2022 18:27:19 Device drifter_2 Direction MO Payload NaN Approx Lat/Lng 74.36745,3.3274 Payload (Text) NaN Length (Bytes) 0 Credits 1 Name: 94, dtype: object this is empty (Length (Bytes) is 0), drop 2024-12-16 16:26:13 fv-az1766-447 trajan.readers.omb[2121] DEBUG start applying sliding_filter_nsigma 2024-12-16 16:26:13 fv-az1766-447 trajan.readers.omb[2121] DEBUG done applying sliding_filter_nsigma 2024-12-16 16:26:13 fv-az1766-447 trajan.readers.omb[2121] DEBUG start applying sliding_filter_nsigma 2024-12-16 16:26:13 fv-az1766-447 trajan.readers.omb[2121] DEBUG done applying sliding_filter_nsigma 2024-12-16 16:26:13 fv-az1766-447 trajan.readers.omb[2121] DEBUG start applying sliding_filter_nsigma 2024-12-16 16:26:13 fv-az1766-447 trajan.readers.omb[2121] DEBUG done applying sliding_filter_nsigma 2024-12-16 16:26:13 fv-az1766-447 trajan.accessor[2121] DEBUG Detecting trajectory dimension 2024-12-16 16:26:13 fv-az1766-447 trajan.accessor[2121] DEBUG Detecting time-variable for "obs".. 2024-12-16 16:26:13 fv-az1766-447 trajan.accessor[2121] DEBUG Detected obs-dim: obs, detected time-variable: time. 2024-12-16 16:26:13 fv-az1766-447 trajan.accessor[2121] DEBUG Detected un-structured (2D) trajectory dataset 2024-12-16 16:26:13 fv-az1766-447 trajan.traj[2121] DEBUG No grid-mapping specified, checking if coordinates are lon/lat.. 2024-12-16 16:26:13 fv-az1766-447 trajan.traj[2121] DEBUG No grid-mapping specified, checking if coordinates are lon/lat.. 2024-12-16 16:26:13 fv-az1766-447 trajan.traj[2121] DEBUG No grid-mapping specified, checking if coordinates are lon/lat.. 2024-12-16 16:26:13 fv-az1766-447 trajan.traj[2121] DEBUG No grid-mapping specified, checking if coordinates are lon/lat.. Size: 119kB Dimensions: (trajectory: 3, frequencies_waves_imu: 55, obs: 150, obs_waves_imu: 26) Coordinates: * trajectory (trajectory) Size: 2kB Dimensions: (trajectory: 3, obs_waves_imu: 26) Coordinates: * obs_waves_imu (obs_waves_imu) int64 208B 0 1 2 3 4 5 ... 20 21 22 23 24 25 * trajectory (trajectory) Size: 121kB Dimensions: (trajectory: 3, frequencies_waves_imu: 55, obs: 150, obs_waves_imu: 26) Coordinates: * trajectory (trajectory) ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: example_find_positions_at_obs_times.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: example_find_positions_at_obs_times.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_