make_motionTS
Description
make_motionTS is a utility designed to generate synthetic time-series data for vessel motion (roll, pitch, heading, heave). It allows users to define various “motion packets,” each specifying a type of motion, its duration, period, and peak amplitude. The tool then superimposes these sinusoidal motion components to create a composite motion time series, which is output to an ASCII file.
This tool is useful for creating controlled test data for Quality Control (QC) purposes, such as testing motion compensation algorithms or analyzing the response of processing routines to specific types of vessel motion.
Usage
make_motionTS [-v] [-roll <start_time> <stop_time> <start_period> <stop_period> <peak_amplitude>] [-pitch ...] [-heading ...] [-heave ...]
Arguments
| Option | Description | |—|—| | -roll <start_time> <stop_time> <start_period> <stop_period> <peak_amplitude> | Defines a sinusoidal roll motion component. Parameters are: * start_time: Time (seconds) when this motion starts. * stop_time: Time (seconds) when this motion stops. * start_period: Period (seconds) of the sinusoidal motion at start_time. * stop_period: Period (seconds) of the sinusoidal motion at stop_time. * peak_amplitude: Maximum amplitude (e.g., in degrees for roll/pitch/heading, meters for heave). | | -pitch | Same parameters as -roll, but for pitch motion. | | -heading | Same parameters as -roll, but for heading motion. | | -heave | Same parameters as -roll, but for heave motion. | | -v | Enable verbose output. | |
How It Works
- Initialization: Parses command-line arguments to define
motion_packetstructures. It supports multiplemotion_packetdefinitions for various types of motion. - Time Series Generation:
- Initializes a
motion_samplearray (timeSeries) ofnumSECONDS * perSECONDelements (currently 600 seconds with 10 samples/second, totaling 6000 samples). - Each
motion_samplehas fields fortime,roll,pitch,heading, andheave. - For each defined
motion_packet:- It iterates through the
timeSeriesarray. - If a sample’s
timefalls within thestart_timeandstop_timeof the packet:- It calculates a sinusoidal
valuebased on the packet’speak_amplitudeand a phase derived fromtime,start_time, andstart_period. - A cosine-squared
taperis applied to thevalueto smooth the onset and offset of the motion. - This
valueis added to the corresponding motion component (roll, pitch, heading, or heave) in thetimeSeriesarray.
- It calculates a sinusoidal
- It iterates through the
- Initializes a
- Output: Writes the generated
timeSeriesto an ASCII file namedfake.ts. The output format is:<total_number_of_samples> <time> <roll> <pitch> <heading> <heave> ... - Cleanup: Closes the output file.
Output Files
fake.ts: An ASCII text file containing the generated synthetic time series data.
Dependencies
support.h: For general utility functions.math.h: For mathematical functions.
Notes
This tool is particularly valuable for controlled testing and validation of motion compensation algorithms. By generating synthetic motion with known characteristics, it allows for rigorous assessment of processing routines without the complexities of real-world noise and unpredictable motion patterns. The cosine-squared taper helps create smooth transitions for the onset and offset of motion components.