mgr-editing v3.2.3

Mercurial revision 5770:c90c3015e72d | 2026-05-22


Description

mgr-editing is a converter for sea-level time series data. It allows you to transform data between different formats, such as SONEL_HR, RMN, PAB, and PROFILERS.

Note: The input file must be in ASCII format and can be one of the supported types (see File Formats).


Usage

mgr-editing FILE [OPTIONS --header="lon=lon lat=lat code=code name=name depth=depth"]

Options

Option

Description

-h, --help

Display help and exit.

-f <date>

Specify the end date for processing. If not provided, the entire file is read.

-s <date>

Specify the start date for processing. If not provided, the entire file is read.

-o <file>

Specify the output filename (without extension).

--header="lon=lon lat=lat code=code name=name depth=depth"

Include metadata about the mgr station in the output file.

-iF <format>

Specify the input format (e.g., SONEL_HR, YMD, LIST, RMN, PAB, PROFILERS).

-oF <format>

Specify the output format. If not provided, the output is written in a list format with no header.

-b <file>

Path to the bathymetry file.

-p <file>

Path to the polygons file (used for excluding points).

-m <file>

Path to the mesh file (used for filtering points inside/outside the mesh).

-w <wave>

Specify the tidal wave for processing (e.g., M2, S2).

--range <min:max>

Specify a depth range for filtering (e.g., --range 0:1000).

--delta <options>

Apply a delta correction to the data. Use the format: dataFile=... amplitude=... phaselag=... discretisation=....

--shore-distance <distance>

Filter points based on their distance from the shore (in meters or degrees).

--interior

Exclude points outside the mesh or polygon.

--list

Display a list of stations with their coordinates and exit.


File Formats

The following input formats are supported:

Format

Description

Example

SONEL_HR

Format: YYYY-MM-DD HH:MM:SS float_value_of_slv. No header is read. File extension: .slv.

1995-08-10 11:50:00 3.050

YMD

Format: YYYY:MM:DD HH:MM float_value_of_slv. No header is read.

1995:08:10 11:50 3.050

LIST

Format: cnes_date float_value_of_slv, where cnes_date is a Julian date referenced to 1950/01/01 00:00:00. Header not available yet.

24375 3.050

RMN

Format: To be described.

-

PAB

Format: To be described.

-

PROFILERS

Binary format: nbin ntime YYYY MM DD HH MM SS bin1 bin2 ... (all values are float). No header is read.

-


Examples

Convert a SONEL_HR File to ASCII

Convert a SONEL_HR file to a list format (default output):

mgr-editing input.slv -oF ASCII -o output.mgr

Convert a YMD File to NetCDF

Convert a YMD file to NetCDF format:

mgr-editing input.yml -iF YMD -oF NETCDF -o output.nc

Process a Subset of Data

Process data between two dates:

mgr-editing input.slv -s 2000-01-01 -f 2000-12-31 -o output.mgr

Apply a Delta Correction

Apply a delta correction to the data:

mgr-editing input.slv --delta "dataFile=/path/to/delta.nc amplitude=UP_diff_a phaselag=UP_diff_G discretisation=LGP1" -o output.mgr

Filter Points Inside a Mesh

Filter points to include only those inside a mesh:

mgr-editing input.slv -m mesh.nc -o output.mgr

Exclude Points Outside a Polygon

Exclude points outside a polygon:

mgr-editing input.slv -p polygon.txt --interior -o output.mgr

Filter by Depth Range

Filter points within a specific depth range:

mgr-editing input.slv --range 0:1000 -o output.mgr

List All Stations

Display a list of all stations with their coordinates:

mgr-editing input.slv --list

Add Metadata to Output

Include station metadata in the output file:

mgr-editing input.slv --header="lon=2.3522 lat=48.8566 code=PARIS name=Paris depth=0" -o output.mgr

Environment Variables

mgr-editing does not rely on specific environment variables. However, ensure your system has the necessary permissions to read input files and write to the output directory.


Notes

  1. Input File Requirements:

  • Must be in ASCII format (except for PROFILERS, which is binary).

  • Supported formats: SONEL_HR, YMD, LIST, RMN, PAB, PROFILERS.

  1. Output File:

  • If no output format (-oF) is specified, the default is a list format with no header.

  • If no output filename (-o) is provided, the output filename is derived from the input filename with an appropriate extension (e.g., .mgr, .nc, .obs).

  1. Date Handling:

  • If no start (-s) or end (-f) date is specified, the entire file is processed.

  1. Delta Correction:

  • The --delta option requires a string with the following format:

dataFile=<path_to_file> amplitude=<amplitude_var> phaselag=<phase_var> discretisation=<discretisation_method>
``` 5. Mesh and Polygon Filtering:

  • Use -m to filter points inside a mesh.

  • Use -p with --interior to exclude points outside a polygon.

  1. Depth Range:

  • The --range option accepts a string in the format min:max (e.g., 0:1000).

  1. Rejected Points:

  • Points that do not meet the filtering criteria (e.g., outside the mesh or depth range) are saved in a file named rejected.mgr.


See Also