.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/example_omb_csv_reader.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_omb_csv_reader.py: Reading an OMB Rock7 CSV file into trajan ================================================ .. GENERATED FROM PYTHON SOURCE LINES 5-15 .. code-block:: Python from pathlib import Path from trajan.readers.omb import read_omb_csv import coloredlogs import datetime # adjust the level of information printed # coloredlogs.install(level='error') coloredlogs.install(level='debug') .. GENERATED FROM PYTHON SOURCE LINES 16-17 example 1: default configuration of the wave packets .. GENERATED FROM PYTHON SOURCE LINES 17-37 .. code-block:: Python path_to_test_data = Path.cwd().parent / "tests" / "test_data" / "csv" / "omb1.csv" # for most users, using the default spectra packet format and this will be enough xr_result = read_omb_csv(path_to_test_data) # remember to add the CF required metadata for your specific deployment xr_result = xr_result.assign_attrs( { "creator_name": "your name", "creator_email": "your email", "title": "a descriptive title", "summary": "a descriptive summary", "anything_else": "corresponding data", } ) # look at the dataset obtained print(xr_result) .. rst-class:: sphx-glr-script-out .. code-block:: none 2024-10-31 20:50:12 fv-az1024-670 trajan.readers.omb[2149] DEBUG read path to pandas 2024-10-31 20:50:12 fv-az1024-670 trajan.readers.omb[2149] DEBUG omb_dataframe at index 3 is: Date Time (UTC) 12/Nov/2022 02:29:16 Device 2022_DOFI_13 Direction MT Payload 2447465130323b2457465130343b Approx Lat/Lng NaN Payload (Text) $GFQ02;$WFQ04; Length (Bytes) 14 Credits 1 Name: 3, dtype: object this is not a from buoy (Direction: MO) message, drop 2024-10-31 20:50:12 fv-az1024-670 trajan.readers.omb[2149] DEBUG omb_dataframe at index 4 is: Date Time (UTC) 12/Nov/2022 02:20:16 Device 2022_DOFI_13 Direction MO Payload NaN Approx Lat/Lng 78.56353333333334,-1.4456333333333333 Payload (Text) NaN Length (Bytes) 0 Credits 1 Name: 4, dtype: object this is empty (Length (Bytes) is 0), drop 2024-10-31 20:50:12 fv-az1024-670 trajan.readers.omb[2149] DEBUG start applying sliding_filter_nsigma 2024-10-31 20:50:12 fv-az1024-670 trajan.readers.omb[2149] DEBUG done applying sliding_filter_nsigma 2024-10-31 20:50:12 fv-az1024-670 trajan.readers.omb[2149] DEBUG start applying sliding_filter_nsigma 2024-10-31 20:50:12 fv-az1024-670 trajan.readers.omb[2149] DEBUG done applying sliding_filter_nsigma 2024-10-31 20:50:12 fv-az1024-670 trajan.accessor[2149] DEBUG Detecting time-dimension for "obs".. 2024-10-31 20:50:12 fv-az1024-670 trajan.accessor[2149] DEBUG Detected obs-dim: obs, detected time-dim: time. 2024-10-31 20:50:12 fv-az1024-670 trajan.accessor[2149] DEBUG Detected un-structured (2D) trajectory dataset 2024-10-31 20:50:12 fv-az1024-670 trajan.traj[2149] DEBUG No grid-mapping specified, checking if coordinates are lon/lat.. 2024-10-31 20:50:12 fv-az1024-670 trajan.traj[2149] DEBUG No grid-mapping specified, checking if coordinates are lon/lat.. 2024-10-31 20:50:12 fv-az1024-670 trajan.traj[2149] DEBUG No grid-mapping specified, checking if coordinates are lon/lat.. 2024-10-31 20:50:12 fv-az1024-670 trajan.traj[2149] DEBUG No grid-mapping specified, checking if coordinates are lon/lat.. Size: 4kB Dimensions: (trajectory: 2, frequencies_waves_imu: 55, obs: 6, obs_waves_imu: 1) Coordinates: * trajectory (trajectory) Size: 3kB Dimensions: (trajectory: 1, frequencies_waves_imu: 85, obs: 1, obs_waves_imu: 1) Coordinates: * trajectory (trajectory) ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: example_omb_csv_reader.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: example_omb_csv_reader.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_