|
1 | 1 | """
|
2 |
| -GMT supplementary X2SYS module for crossover analysis. |
| 2 | +x2sys_cross - Calculate crossovers between track data files. |
3 | 3 | """
|
4 | 4 | import contextlib
|
5 | 5 | import os
|
@@ -54,115 +54,6 @@ def tempfile_from_dftrack(track, suffix):
|
54 | 54 | os.remove(tmpfilename)
|
55 | 55 |
|
56 | 56 |
|
57 |
| -@fmt_docstring |
58 |
| -@use_alias( |
59 |
| - D="fmtfile", |
60 |
| - E="suffix", |
61 |
| - F="force", |
62 |
| - G="discontinuity", |
63 |
| - I="spacing", |
64 |
| - N="units", |
65 |
| - R="region", |
66 |
| - V="verbose", |
67 |
| - W="gap", |
68 |
| - j="distcalc", |
69 |
| -) |
70 |
| -@kwargs_to_strings(I="sequence", R="sequence") |
71 |
| -def x2sys_init(tag, **kwargs): |
72 |
| - r""" |
73 |
| - Initialize a new x2sys track database. |
74 |
| -
|
75 |
| - Serves as the starting point for x2sys and initializes a set of data bases |
76 |
| - that are particular to one kind of track data. These data, their associated |
77 |
| - data bases, and key parameters are given a short-hand notation called an |
78 |
| - x2sys TAG. The TAG keeps track of settings such as file format, whether the |
79 |
| - data are geographic or not, and the binning resolution for track indices. |
80 |
| -
|
81 |
| - Before you can run :meth:`pygmt.x2sys_init` you must set the environmental |
82 |
| - parameter X2SYS_HOME to a directory where you have write permission, which |
83 |
| - is where x2sys can keep track of your settings. |
84 |
| -
|
85 |
| - Full option list at :gmt-docs:`supplements/x2sys/x2sys_init.html` |
86 |
| -
|
87 |
| - {aliases} |
88 |
| -
|
89 |
| - Parameters |
90 |
| - ---------- |
91 |
| - tag : str |
92 |
| - The unique name of this data type x2sys TAG. |
93 |
| -
|
94 |
| - fmtfile : str |
95 |
| - Format definition file prefix for this data set (see |
96 |
| - :gmt-docs:`GMT's Format Definition Files |
97 |
| - <supplements/x2sys/x2sys_init.html#format-definition-files>` |
98 |
| - for more information). Specify full path if the file is not in the |
99 |
| - current directory. |
100 |
| -
|
101 |
| - Some file formats already have definition files premade. These include: |
102 |
| -
|
103 |
| - - **mgd77** (for plain ASCII MGD77 data files) |
104 |
| - - **mgd77+** (for enhanced MGD77+ netCDF files) |
105 |
| - - **gmt** (for old mgg supplement binary files) |
106 |
| - - **xy** (for plain ASCII x, y tables) |
107 |
| - - **xyz** (same, with one z-column) |
108 |
| - - **geo** (for plain ASCII longitude, latitude files) |
109 |
| - - **geoz** (same, with one z-column). |
110 |
| -
|
111 |
| - suffix : str |
112 |
| - Specifies the file extension (suffix) for these data files. If not |
113 |
| - given we use the format definition file prefix as the suffix (see |
114 |
| - ``fmtfile``). |
115 |
| -
|
116 |
| - discontinuity : str |
117 |
| - **d**\|\ **g**. |
118 |
| - Selects geographical coordinates. Append **d** for discontinuity at the |
119 |
| - Dateline (makes longitude go from -180 to +180) or **g** for |
120 |
| - discontinuity at Greenwich (makes longitude go from 0 to 360 |
121 |
| - [Default]). If not given we assume the data are Cartesian. |
122 |
| -
|
123 |
| - spacing : str or list |
124 |
| - *dx*\[/*dy*]. |
125 |
| - *dx* and optionally *dy* is the grid spacing. Append **m** to |
126 |
| - indicate minutes or **s** to indicate seconds for geographic data. |
127 |
| - These spacings refer to the binning used in the track bin-index data |
128 |
| - base. |
129 |
| -
|
130 |
| - units : str or list |
131 |
| - **d**\|\ **s**\ *unit*. |
132 |
| - Sets the units used for distance and speed when requested by other |
133 |
| - programs. Append **d** for distance or **s** for speed, then give the |
134 |
| - desired *unit* as: |
135 |
| -
|
136 |
| - - **c** - Cartesian userdist or userdist/usertime |
137 |
| - - **e** - meters or m/s |
138 |
| - - **f** - feet or feet/s |
139 |
| - - **k** - km or km/hr |
140 |
| - - **m** - miles or miles/hr |
141 |
| - - **n** - nautical miles or knots |
142 |
| - - **u** - survey feet or survey feet/s |
143 |
| -
|
144 |
| - [Default is ``units=["dk", "se"]`` (km and m/s) if ``discontinuity`` is |
145 |
| - set, and ``units=["dc", "sc"]`` otherwise (e.g., for Cartesian units)]. |
146 |
| -
|
147 |
| - {R} |
148 |
| - {V} |
149 |
| -
|
150 |
| - gap : str or list |
151 |
| - **t**\|\ **d**\ *gap*. |
152 |
| - Give **t** or **d** and append the corresponding maximum time gap (in |
153 |
| - user units; this is typically seconds [Default is infinity]), or |
154 |
| - distance (for units, see ``units``) gap [Default is infinity]) allowed |
155 |
| - between the two data points immediately on either side of a crossover. |
156 |
| - If these limits are exceeded then a data gap is assumed and no COE will |
157 |
| - be determined. |
158 |
| -
|
159 |
| - {j} |
160 |
| - """ |
161 |
| - with Session() as lib: |
162 |
| - arg_str = " ".join([tag, build_arg_string(kwargs)]) |
163 |
| - lib.call_module(module="x2sys_init", args=arg_str) |
164 |
| - |
165 |
| - |
166 | 57 | @fmt_docstring
|
167 | 58 | @use_alias(
|
168 | 59 | A="combitable",
|
|
0 commit comments