Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

events_common.rst_ 12 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
  1. |No-spaces|
  2. Description
  3. -----------
  4. Reads (*x*, *y*\ [, *z*] [, *size*], *time* [, *length*] [, *label*]) data from *table* [or standard
  5. input] and plots how the symbol for each event should look for the specified *now* time.
  6. The reason they may differ is that events may have different lengths and we may
  7. wish to accentuate the symbol attributes in ways to draw attention to an event when
  8. it first happens and perhaps tone it down after a while to reduce clutter and focus
  9. on more recent events. Optionally, each symbol may have a label that can be displayed at the
  10. same time or delayed with respect to the symbol. This module is typically used in conjunction with :doc:`movie`
  11. where the implicit loop over time is used to call it over a time-sequence and
  12. thus plot symbols as events unfold.
  13. Required Arguments
  14. ------------------
  15. .. _-J:
  16. .. |Add_-J| unicode:: 0x20 .. just an invisible code
  17. .. include:: explain_-J.rst_
  18. .. _-R:
  19. .. |Add_-R| unicode:: 0x20 .. just an invisible code
  20. .. include:: explain_-R.rst_
  21. .. |Add_-Rz| unicode:: 0x20 .. just an invisible code
  22. .. include:: explain_-Rz.rst_
  23. .. _-S:
  24. **-S**\ *symbol*\ [*size*]
  25. Specify the symbol to use for the event. Optionally, append symbol *size* with unit from
  26. (**c**\|\ **i**\|\ **p**\ ). If no *size* is given then we read an event-specific size
  27. from the data file's third column (fourth if **-C** is used). **Note**: Not all the symbols that
  28. are available in :doc:`psxy` can be used here. At the moment we only support the basic
  29. symbols and custom symbols; bars, vectors, ellipses, fronts, decorated and quoted lines cannot
  30. be specified. Symbols sizes read from a data file will be assumed to be in the unit controlled
  31. by :term:`PROJ_LENGTH_UNIT` unless they have **c**, **i**, or **p** appended. If you are only
  32. plotting labels then **-S** is not required.
  33. .. _-T:
  34. **-T**\ *now*
  35. Set the current plot time. The time shifts and increments set in **-E** are all relative to this
  36. current time. If an absolute time is given you may need to use :term:`TIME_UNIT` to indicate
  37. the unit of the values given in options like **-E** and **-L**.
  38. Optional Arguments
  39. ------------------
  40. .. |Add_intables| unicode:: 0x20 .. just an invisible code
  41. .. include:: explain_intables.rst_
  42. .. _-B:
  43. .. include:: explain_-B.rst_
  44. .. _-C:
  45. **-C**\ *cpt*
  46. Use the *cpt* to convert *z* values given in the optional third column to assign symbol colors.
  47. .. _-D:
  48. **-D**\ [**j**\|\ **J**]\ *dx*\ [/*dy*][**+v**\ [*pen*]]
  49. Offset the text from the projected (*x*,\ *y*) point by *dx*,\ *dy*
  50. [0/0]. If *dy* is not specified then it is set equal to *dx*. Use
  51. **-Dj** to offset the text away from the point instead (i.e., the
  52. text justification will determine the direction of the shift). Using
  53. **-DJ** will shorten diagonal offsets at corners by
  54. sqrt(2). Optionally, append **+v** which will draw
  55. a line from the original point to the shifted point; append a *pen*
  56. to change the attributes for this line.
  57. .. _-E:
  58. **-Es**\|\ **t**\ [**+o**\|\ **O**\ *dt*][**+r**\ *dt*][**+p**\ *dt*][**+d**\ *dt*][**+f**\ *dt*][**+l**\ *dt*]
  59. Set the time knots for the **s**\ ymbol or **t**\ ext time-functions. Append
  60. **+o** to shift the event start and end times by a constant offset (basically shifting
  61. the event in time by *dt*\ ; or use **+O** to only shift the start time, effectively shortening
  62. the duration of the event), **+r** to indicate the
  63. duration of the rise phase, **+p** to set the duration of the plateau phase, **+d**
  64. to specify the duration of the decay phase, and **+f** to set the duration of the
  65. fade phase. These are all optional [and default to zero], and can be set separately for symbols and texts.
  66. If neither **s** or **t** is given then we set the time knots for both features. **Note**: The **+l** modifier is
  67. restricted to **-Et** and specifies an alternative duration (visibility) of the text [same duration as symbol].
  68. Furthermore, the **+p** and **+d** periods do not apply to text labels. **Note**: The **-Et** option is
  69. required if you wish to plot labels [plot symbols only].
  70. .. _-F:
  71. **-F**\ [**+a**\ *angle*][**+f**\ *font*][**+j**\ *justify*][**+r**\ [*first*]\|\ **z**\ [*format*]]
  72. By default, event label text will be placed horizontally, using the primary
  73. annotation font attributes (:term:`FONT_ANNOT_PRIMARY`), and centered
  74. on the data point. Use this option to override these defaults by specifying up to three
  75. text attributes (font, angle, and justification) directly on the command line. Use **+f**
  76. to set the font (size,fontname,color), **+a** to set the angle, and **+j** to set the justification.
  77. Normally, the text to be plotted is the trailing text. Instead, use **+r** to use the
  78. record number (counting up from *first* [0]) or **+z** to format incoming *z* values (requires **-C**)
  79. to a string using the supplied *format* [use :term:`FORMAT_FLOAT_MAP`].
  80. .. _-G:
  81. **-G**\ *fill* :ref:`(more ...) <-Gfill_attrib>`
  82. Set constant shade or color for all symbols.
  83. .. include:: explain_-Jz.rst_
  84. .. _-L:
  85. **-L**\ [*length*\|\ **t**]
  86. Specify the length (i.e., duration) of the event. Append a *length* if all events have the same length,
  87. append **t** if end-times instead of lengths are given in the file after the *time* column,
  88. or leave blank if lengths can be read from the input file after the *time* column. If **-L** is not
  89. given we assume events have an infinite duration.
  90. .. _-M:
  91. **-M**\ **i**\|\ **s**\|\ **t**\ [*val1*]\ [**+c**\ *val2*]
  92. Modify the initial **i**\ ntensity, **s**\ ize magnification, or **t**\ ransparency of the symbol during
  93. the *rise* interval [1, 1, and 100, respectively]. Repeatable for the different attributes.
  94. Optionally, for finite-duration events you may append **+c** to set the corresponding terminal value
  95. during the coda [0, 0, 100, respectively].
  96. .. _-Q:
  97. **-Q**\ *prefix*
  98. Save the intermediate event symbols and labels to permanent files instead of removing them when done.
  99. Files will be named *prefix*\ _symbols.txt and *prefix*\ _labels.txt.
  100. .. _-U:
  101. .. include:: explain_-U.rst_
  102. .. _-:
  103. .. |Add_-V| unicode:: 0x20 .. just an invisible code
  104. .. include:: explain_-V.rst_
  105. .. _-W:
  106. **-W**\ *pen*
  107. Specify symbol outline pen attributes [Default is no outline].
  108. .. |Add_-bi| replace:: [Default is 3 input columns].
  109. .. include:: explain_-bi.rst_
  110. .. |Add_-di| unicode:: 0x20 .. just an invisible code
  111. .. include:: explain_-di.rst_
  112. .. |Add_-e| unicode:: 0x20 .. just an invisible code
  113. .. include:: explain_-e.rst_
  114. .. |Add_-f| unicode:: 0x20 .. just an invisible code
  115. .. include:: explain_-f.rst_
  116. .. |Add_-h| unicode:: 0x20 .. just an invisible code
  117. .. include:: explain_-h.rst_
  118. .. include:: explain_-icols.rst_
  119. .. |Add_perspective| unicode:: 0x20 .. just an invisible code
  120. .. include:: explain_perspective.rst_
  121. .. include:: explain_-qi.rst_
  122. .. include:: explain_colon.rst_
  123. .. include:: explain_help.rst_
  124. The meaning of time
  125. -------------------
  126. While normally the meaning of "time" (e.g., such as in the argument to **-T**)
  127. is in fact the time of the phenomenon being plotted, it may also be any other monotonically
  128. increasing quantity of convenience, such as elapsed time, model time, frame number, or other physical
  129. quantities such as distance. It all depends on the context of the movie. The values
  130. given for delays, fades, etc. in **-E** are assumed to be in the same unit as the
  131. given *time* argument to **-T**. Thus, if *time* is a monotonically increasing frame
  132. counter then the values in **-E** and **-L** refer to number of frames. A special
  133. situation occurs when *time* is in fact actual calendar time given by date/clock markers.
  134. Here, the unit of the arguments in **-E** and **-L** is determined by the :term:`TIME_UNIT`
  135. setting [second]. You will need to specify the desired time unit that should be used when
  136. interpreting your **-E** and **-L** arguments. The example below for seismicity uses
  137. actual earthquake times but we use days as the unit as second is too small.
  138. The three time-functions
  139. ------------------------
  140. Events typically have either a finite length, e.g., the temporal extent of
  141. the reign of a particular monarch, or are infinite. Here, infinite simply means
  142. its length exceeds the temporal extent of the time we are plotting. In a movie,
  143. a basic representation of these events as points on a map would be to start plotting
  144. the symbol when the event starts and then keep the symbol visible on all frames until the
  145. event ends (or never stop plotting them in the infinite length case). However, to draw
  146. attention to the arrival of a new event we can temporarily change three attributes of
  147. the symbol: Its size, color intensity, and transparency. You can think of these three
  148. attributes as functions of time. For some option settings, figure below
  149. illustrates how the symbol size may vary through the timespan of the movie.
  150. .. figure:: /_images/psevents_size.*
  151. :width: 400 px
  152. :align: center
  153. Implied evolution of one symbol's size-variation as a function of time
  154. given the time-knots from **-Es** and the magnifications from **-Ms**.
  155. Here we temporarily magnify the symbol size five times before decaying
  156. to the intended size and eventually shrink it further down to a small
  157. size during the fade and coda phases.
  158. Similarly, to draw attention to the newly arrived event you may want to whiten the color
  159. temporarily; this can be done via the **-Mi** option and figure below
  160. illustrates how intensity may vary accordingly.
  161. .. figure:: /_images/psevents_intensity.*
  162. :width: 400 px
  163. :align: center
  164. Implied evolution of one symbol's color intensity as a function of time
  165. given the time-knots from **-Es** and the intensities from **-Mi**. Here we
  166. seek to whiten the symbol during the event arrival, as well as darken it
  167. during a permanent code phase.
  168. Finally, for finite events you may wish to either fade them out completely or
  169. simply fade them to a constant but still visible transparency; this future stage
  170. is referred to as the coda and levels can be specified via the **-Mt** option.
  171. Figure below illustrates how transparency may vary through time.
  172. .. figure:: /_images/psevents_transparency.*
  173. :width: 400 px
  174. :align: center
  175. Here we show how a symbol may go from being invisible to reaching full opaqueness
  176. at the event begin time, finally fading to a near-invisible stage after reaching
  177. its length.
  178. While shown in these examples, the rise, plateau, fade, and coda periods are all optional
  179. and can be selected or ignored as you wish via **-E**. You can choose to specify any or none
  180. of the three time histories. By default the symbol size is constant, there is no intensity
  181. variation, and all symbols are opaque.
  182. If trailing text is plotted (i.e., by selecting **-Et**) then only the transparency time-function
  183. is used and neither the plateau nor decay periods apply. The appearance and disappearance of a
  184. label is thus dictated by an initial (and optional) rise time (during which the label slowly
  185. becomes fully visible), an normal period (where it remains visible), followed by the optional
  186. fade period (where the text fades out). The figure below illustrate the setup:
  187. .. figure:: /_images/psevents_labels.*
  188. :width: 400 px
  189. :align: center
  190. Here we show how a label may go from being invisible to reaching full opaqueness
  191. at the event begin time, staying visible for the given duration, and then finally
  192. fade away completely. For labels, the plateau and decay periods do not apply.
  193. Sorting the data
  194. ----------------
  195. While only the events that should be visible will be plotted at the given time set via **-T**,
  196. the order of plotting is simply given by the order of records in the file. Thus, if the
  197. file is *not* sorted into ascending time then later events might plot *beneath* earlier events.
  198. To prevent this, you can sort your file into ascending order via the :doc:`gmtconvert` **-N** option.
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...