-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathncplot.html
770 lines (729 loc) · 29.4 KB
/
ncplot.html
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
<html>
<head>
<title>NCPLOT User's Guide</title>
<style type="text/css">
<!--
body { background: white; color: black; margin: 2em; margin-left: 3em; }
h1,h2 { font-size: 1.5em }
h3 { font-size: 1.3em }
h4 { font-size: 1.2em }
h1, h2, h3, h4 { font-style: normal; font-weight: normal; color: #3860B0; }
span.runin { font-size: 1.1em; font-weight: bold; color: #3860B0; }
a:link { color:navy; }
a:visited { color:#386090; }
li.toc { list-style: none; padding: .1em; }
kbd.att { font-weight: normal; color: blue; }
div.example { margin-left: 3em; margin-right: 3em; }
div.definition { margin-left: 1em; }
pre.CDL { color: brown; }
table { padding: .25em; }
span.new { background-color: #FF6666; }
span.old { background-color: #FFFF88; text-decoration: line-through; }
span.comment { background-color: #88FF88; font-style: italic; }
-->
</style>
</head>
<body>
<h1 align=CENTER>NCPLOT User's Guide</h1>
<h1 align=CENTER>Version 4.12.0</h1>
<hr>
<h1 align=CENTER>Table Of Contents</h1>
<ol type=A>
<li><a href="#oview">Overview</a>
<li><a href="#gs">Getting Started</a>
<ol>
<li>Acquiring
<li>Environment
<li>Fonts
<li>Command line options
</ol>
<li><a href="#vsw">Variable Selection Window</a>
<ol>
<li>Moving around in Time
<li>Selecting plot type
<li>Axes
<li>Panels
<li>Selecting and Deselecting variables
<li>Options
<li>XY and XYZ additional options
</ol>
<li><a href="#pc">Plot Canvas</a>
<ol>
<li><a href="#pc1">Canvas features</a>
<ol type=a>
<li>Annotations
<li>Resizing canvas windows
<li>Zooming
<li>Menu accelerators
</ol>
<li><a href="#pc2">Guide to menus</a>
<ol type=a>
<li>File menu
<ol>
<li>Data files
<li>Templates
<li>Printing
<li>Save PNG (GIF substitute)
</ol>
<li>Edit Menu
<ol>
<li>Editing plot parameters
</ol>
<li>View Menu
<ol>
<li>ASCII
<li>Statistics
<li>Variable Titles
<li>netCDF header
<li>Spectra, Cospectra, Quadrature, Phase and Coherence
</ol>
<li>Options Menu
<ol>
<li>Expression Parser/User Calculations
<li>Regressions
</ol>
</ol>
</ol>
<li><a href="#sw">Spectral Window</a>
<ol>
<li><a href="#sw1">Features</a>
<ol type=a>
<li>Detrending, Segment lengths, and Windowing functions
<li>Band Limited Variance
<li>Equal-log interval averaging
<li>Time shifting (co-spectra)
<li>Plot Options
</ol>
<li><a href="#sw2">How is my Spectrum being computed?</a>
</ol>
<li><a href="#cf">Configuration File</a>
<li><a href="#gmt">GMT Geo-Political Map Installation</a>
<li><a href="#kp">Known problems</a>
</ol>
<a name="oview"></a>
<hr>
<h1 align=CENTER>Overview</h1>
<b>ncplot</b> is an interactive plotting tool for workstations running X11/R5,
Motif 1.2. <b>ncplot</b> allows the user to view time-series data stored in
<a href="https://www.unidata.ucar.edu/software/netcdf/">netCDF</a>
files that conform to the
<a href="https://www.eol.ucar.edu/raf/Software/netCDF.html">NCAR-RAF/nimbus</a>
conventions. Both Low-rate and Mixed-rate files are supported, as well as
files where the data have been reduced below 1 sps (sample per second), e.g.,
files run through <b>ncav</b>.
<p>
A few of its features are:
<p>
<ul>
<li>Plots up to 8 datasets per graph.
<li>Can draw from up to 4 netCDF files on the same plot.
<li>1 to 4 time-series strip charts.
<li>1 to 4 XY plots.
<li>XYZ plot.
<li>ASCII window.
<li>Spectra, Co-spectra, Quadrature, Coherence, and Phase.
<li>Allows user-defined titles, labels, scaling, and major & minor tic marks.
<li>Annotations.
<li>Publication quality [Encapsulated] [color] PostScript printouts.
<li>Optional realtime/on-board mode.
</ul>
<b>ncplot</b> is NOT for contouring, image or vector data.
<p>
<b>ncplot</b> was written at the <a href="https://www.eol.ucar.edu/">Research
Aviation Facility</a> of <a href="https://www.ncar.ucar.edu/">The National
Center for Atmospheric Research</a> to view and analyze our aircraft data
(and NOAA's GIV). The
<a href="https://www.eol.ucar.edu/raf/Software/netCDF.html">NCAR-RAF/nimbus</a>
conventions were designed to store multi-rate data, i.e., variable A may be
stored at 5sps and variable B at 25sps. <b>ncplot</b> will plot variables of
differing rates (and from different files) next to each other. Every effort
has been made to make it "what you see is what you get" between the screen
and printouts.
<a name="gs"></a>
<hr>
<h1 align=CENTER>Getting Started</h1>
<dl>
<dt><h3>Acquiring</h3></dt>
<dd><b>ncplot</b> is available at <a href="https://github.com/ncar/ncplot">https://github.com/ncar/ncplot</a>.</dd>
<dt><h3>Environment</h3></dt>
<dd><b>ncplot</b> is written in C, requiring X11/R6 and Motif 1.2 (or later),
and the <b>netCDF</b> library 3.0 or later. Specifically it is developed
and maintained on Redhat Enterprise Linux. Builds on most, if not all, Linux
derivatives and MacOS using Homebrew, also availble through MacPorts.
<p>
<b>ncplot</b> uses, though it is not required, a shell environment variable
called <b>DATA_DIR</b> as the default directory to locate data files.
<p>
The Landmarks button on the track window looks in the directory defined by
the environment variable <b>PROJ_DIR</b> to locate <b>WINDS</b> landmarks
file. If <b>PROJ_DIR</b> points to <b>/home/local/proj</b>, and you are
looking at data from ACE-1, (which is project number 130), then <b>ncplot</b>
will look for the file <b>/home/local/proj/130/landmarks</b>. The project
number is stored in the header of the netCDF file and can be viewed from
the <b>netCDF Header</b> option under the <b>View</b> menu, or with the
netCDF utility program <b>ncdump</b>.
<p>
As of 2006 we have started to embed landmarks in the netCDF file as a global
attribute.</dd>
<dt><h3>Fonts</h3></dt>
<dd>Fonts can be over-ridden in the file <b>fbr.h</b>.
</dd>
<dt><h3>Command Line Options</h3></dt>
<dd>
<!-- Not supported.
<kbd class="att">-r</kbd> Run in realtime "onboard" mode.
-->
<p>
<kbd class="att">-t hh:mm:ss-hh:mm:ss</kbd>, allows time segment to be entered on command line.
<p>
<kbd class="att">-s template_file</kbd>, load a template file at startup.
<p>
<kbd class="att">data_file</kbd>, a netCDF data file that conforms to the
<a href="https://www.eol.ucar.edu/raf/Software/netCDF.html">NCAR-RAF/nimbus</a>
conventions.
</dd>
<dt><h3>Examples</h3></dt>
<dd>Run with no command line parameters:
<ul>
<pre class="CDL">1024% ncplot</pre>
</ul>
<p>
Load a single data file:
<ul>
<pre class="CDL">1025% ncplot /home/data/817rf15.cdf</pre>
</ul>
<p>
Using everything:
<ul>
<pre class="CDL">1025% ncplot -s ~/sounding -t 02:00:00-03:00:00 /home/data/181rf15.cdf</pre>
</ul>
</dd>
</dl>
<a name="vsw"></a>
<hr>
<h1 align=CENTER>Variable Selection Window</h1>
<img src="ctrl.png" align=right>
<dl>
<dt><h3>Moving around in Time</h3></dt>
<dd><b>ncplot</b> comes up with the first 30 minutes of the file as the starting
time frame. New time frames may be entered in the <b>Time Period</b> area
at the top of the Variable Selection window, and then pressing <b>Apply</b>.
<p>
<b>PgFwd</b> and <b>PgBkd</b> buttons exist to facilitate moving through the
file in a sequential manner. The <b>Page</b> buttons will keep the same
time frame length until End-of-File is reached; then the time frame may change
to whatever amount of time is remaining in the file. Subsequent <b>PgBkd</b>
will maintain the new time frame length.
<p>
The time frame may also be changed in the <b>time-series</b> plots via the
<b>zoom</b> option.
<p>
If the flight wraps around midnight, times past midnight should be greater
than 24:00:00 (e.g. 1:00am start time should be entered as 25:00).
<dt><h3>Plot Type</h3></dt>
<dd>Three primary plot types are supported, <b>time-series</b>, <b>XY</b>, and
<b>XYZ</b>. When you move from one plot type to another, your previous plot
is not lost. To select a plot type, click on its button.
<p>
When you select <b>XY</b> or <b>XYZ</b> plot types, a window with additional
options pops up.
<p>
Keep in mind that, if you have all the plot types loaded with variables and
move around in time, ALL the variables will be reloaded from all the plots
(including wind vectors), and this may have a serious impact on execution
speed.
<dt><h3>Axes</h3></dt>
<dd>The various plot types have different active axes. (Inactive axes
are in gray and cannot be selected.)
<p>
For the <b>time-series</b> plot, only the Y axis is valid, but you may
select whether future variables you select will be labeled on the right
or left side of the graph.
<p>
The <b>XY</b> plot has valid X and Y axes. When the Y axis is selected,
you may choose left or right. The <b>XY</b> plot maps each X with a Y
until one axis runs out of variables, then all remaining variables in
the longer list will be mapped to the last variable in the shorter list.
This allows for doing things like overlaying a GPS track plot on top of
a INS track plot without getting "cross-product" traces drawn.
<p>
The <b>XYZ</b> plot only supports one variable on each axis; therefore, there
is no "de-selecting" of variables; just select the new variables you want.
<dt><h3>Panels</h3></dt>
<dd>Panels are for <b>time-series</b> and <b>XY</b> plots. This
allows you to have up to 4 strip-chart panels in one window for
<b>time-series</b> or 4 vertical profile style panels for <b>XY</b> plots.
Select which panel you want to add or delete variables from. Use the
<b>Add</b> and <b>Delete</b> buttons to add and remove panels. The
<b>Clear</b> button will remove all selected variables from the current panel.
<dt><h3>Selecting and Deselecting Variables</h3></dt>
<dd>After you have selected which data file, plot type, panel, axis
and location, just click on the variable you wish to <b>select</b>.
<p>
<dd>To <b>de-select</b> a variable, click on it again. The file, axis, location and panel must all match from when the variable was selected. This can get confusing if you are drawing data from multiple files. When things get out of hand, you can can clear all variables from the current plot via the <b>Options</b> menu.
<p>
The <b>Variable Search</b> allows the user to quickly subset the visible list of variables based on the text typed into this box.
<dt><h3>Options</h3></dt>
<dd>
<dl><dt><b>Black & White (on/off)</b></dt>
<dd>Converts all color traces to black and white. Dashed lines are used
to differentiate variables in black and white. This option is provided
to let the user preview monochrome printing.
<p>
<dt><b>UT seconds (on/off)</b></dt>
<dd>Changes time format to seconds since midnight on <b>time-series</b> plots
only.
<p>
<dt><b>Grid (on/off)</b></dt>
<dd>Turns grid on or off for <b>time-series, XY, and XYZ</b> plots.
<p>
<dt><b>Tracking (on/off)</b></dt>
<dd>Provides cross-hair target across all plots, displaying engineering values
of the center of the cross hair.
<p>
<dt><b>Missing value count(on/off)</b></dt>
<dd>Scans time-series data for gaps and displays a count of missing values on the
plot.
<p>
<dt><b>Line thickness</b></dt>
<dd>Let's you select how thick the data traces will be.
</dl>
<dt><h3>XY and XYZ additional options (separate window)</h3></dt>
<dd>Much of this window is oriented toward flight track plots. This window
is only effective for <b>XY</b> and <b>XYZ</b> plots.
<p>
<img src="xy.png" align=center>
<dl>
<dt><h4>Flight Tracks</h4></dt>
<ul>
<li>The <b>INS Track</b> and <b>GPS Track</b> buttons are convienence
functions to quickly load the variables from the respective instruments. In
the case of the <b>XYZ</b> plot, Pressure Altitude is loaded. The variable
names used are currently hard-coded into the software (LAT, LON, [PALT], and
GLAT, GLON, [GALT]). <b>ncplot</b> will load as many of the variables as
it can find (e.g. GALT is routinely not output, and therefore nothing will
be loaded for the Z axis in the <b>XYZ</b> plot when <b>GPS Track</b> is
pressed).
<p>
<li>The <b>Landmarks</b> file is the same one used by <b>WINDS</b>
(see the <b>Environment</b> section for details on location). Below is
the file from <b>ACE-1</b>:
<div class="example">
<pre class="CDL">
-42.83 147.52 Hobart 1
-43.05 147.08 Huonville 1
-43.64 146.82 SEcape 1
-43.57 146.04 SWcape 1
-42.157 145.80 Strahan 1
</pre>
</div>
The trailing value of zero or one is not used by <b>ncplot</b>, but is
relevant to <b>WINDS</b>.
<p>
<li>The <b>geo-political map</b> makes use of the GMT coastline and
geo-political maps. See appendix on GMT Installation.
<p>
<li><b>Track scaling</b> is a convenience button to over-ride autoscaling and "square up" the track plot. Degrees lat and lon are converted to a distance based on median lat, and then equal delta X and delta Y are computed.
</ul>
<dt><h4>Wind vectors</h4></dt>
<dd><b>Wind vectors</b> may be added to the <b>XY</b> plot only. (We decided
it would look too confusing on the <b>XYZ</b> plot.) Select whether you
would like <b>averaged</b> or <b>instantaneous</b> vectors, and the
<b>interval</b> in seconds that you would like them displayed. You may
also change the variables you wish to be used. If wind vectors are already
turned on when you change the variables, you must turn them off and then
back on to reload the new variables.
<p>
<dt><h4>Miscellaneous options</h4></dt>
<dd>
<dl>
<dt><b>Direction arrows</b></dt>
<dd>Enter the number of direction arrows desired in the text box.
<p>
<dt><b>Time stamps</b></dt>
<dd>Enter the number of time-stamps desired in the text box.
<p>
<dt><b>Scatter plot</b></dt>
<dd>Changes line segments to dots, for <b>XY</b> only.
<p>
<dt><b>Project to XY-plane</b></dt>
<dd>Projects a trace of the XYZ plot onto the XY plane.
<p>
<dt><b>Project to back plane</b></dt>
<dd>Projects a trace of the XYZ plot onto the back and side planes.
</dl>
</dl>
</dl>
<a name="pc"></a>
<a name="pc1"></a>
<hr>
<h1 align=CENTER>Canvas Features</h1>
<dl>
<dt><b>Annotate</b></dt>
<dd><b>ncplot</b> has the ability to <b>annotate</b> graphs. In the upper
right corner of the main <b>plot canvas</b> there are a couple of buttons,
one with the letter "<b>A</b>". Press the "<b>A</b>", and your pointer
will turn into a text insertion style cursor. Move the cursor to where
you would like to start the annotation, and press the left mouse button.
Start typing, and finish the annotation by pressing <b>return</b>. Doing
just about anything will clear all annotations (due to the difficulty of
tracking their location as the user moves around in time, and rescales axes).
They should be added as the final option before printing.</dd>
<p>
<dt><b>Resize</b></dt>
<dd>All plot canvas windows are fully <b>resizable</b>. In the case of the
<b>spectral</b> window, some buttons will get clipped off the screen.
Resizing the screen will have <b>no</b> affect on sizing or proportion
of your printout, this is controlled via the <b>Printer Setup</b> option.</dd>
<p>
<dt><b>Zoom</b></dt>
<dd>A <b>zoom</b> feature exists; place the mouse in the upper left corner
of what you want to zoom in on, hold the left mouse button down, and drag the
box over the segment you want to see. Moving left or above the initial
point will cancel the zoom when you let go. Your mileage may vary if
autoscaling is turned on. There is a un-zoom located in the
Options menu.</dd>
<p>
<dt><b>Menu accelerators</b></dt>
<dd>When looking through the various menus, one will notice <b>CTRL</b>
sequences to the right of the menu option label. These are called
<b>menu accelerators</b>, in <b>ncplot</b> they only work while the
cursor is located in the <b>plot canvas</b>.</dd>
</dl>
<a name="pc2"></a>
<hr>
<h1 align=CENTER>Guide to Menus</h1>
<dl>
<dt><h3>File Menu</h3></dt>
<dd>The items in the File menu allow opening of data files from disk,
printer setup, and printing. In the case of an operation that will
overwrite an existing file, you will be prompted by an alert that allows
you to abort the write if you don't want the file to be overwritten.
<p>
<dl>
<dt><b>Open Data File</b>.</dt>
<dd>This displays a File Selection Box to select a file to read. There
is no error checking to see if the input file is valid. Invalid files
tend to cause a segmentation fault. Open Data File will close out all
previously-opened files.</dd>
<p>
<dt><b>Add Data File</b>.</dt>
<dd>This displays a File Selection Box to select an additional file to open.</dd>
<p>
<dt><b>Save Template</b>.</dt>
<dd>Save current plot to disk file for future retrieval. Note, file names and
time slices are not saved, this just saves the plot type, number of panels,
the current variables, and User Calculations.</dd>
<p>
<dt><b>Load Template</b>.</dt>
<dd>Load a previously saved template. This will clear the current plot that
matches the plot type in the template file. You must already have a file</dd>
open.
<p>
<dt><b>Save PostScript</b>.</dt>
<dd>This displays a File Selection Box prompting for the name of the file
where you want to write the PostScript output.</dd>
<p>
<dt><b>Printer Setup</b>.</dt>
<dd>This pops up a window with options to change the 'lp' command, the size of
plot to be printed, whether to print landscape or portrait, and color vs.
black and white.</dd>
<p>
<dt><b>Print</b>.</dt>
<dd>This opens a pipe and sends PostScript commands to <b>lp(1)</b>.</dd>
<p>
<dt><b>Save <a href="https://www.libpng.org/pub/png/">PNG</a></b>.</dt>
<dd>This option allows you to save the plot image as a graphics file, which
can then be used in web pages, etc. You can adjust the size of the image
saved by first sizing the plot canvas.</dd>
<p>
</dl></dd>
<dt><h3>Edit Menu</h3></dt>
<dd>The <b>Edit Parameter</b> windows allow the user to edit titles, labels,
autoscaling, number of tic marks, log vs. linear, and scale inversion for
each of the plots or windows.
<p>
<img src="eparm.png">
<p>
<dl>
<dt><b>Time Series Parameters</b>.</dt>
<dd>This pops up a window showing all the parameters that are user modifiable
for the main plot window (also contains ASCII options).</dd>
<p>
<dt><b>XY Parameters</b>.</dt>
<dd>This pops up a window showing all the parameters that are user modifiable
for the XY plot.</dd>
<p>
<dt><b>XYZ Parameters</b>.</dt>
<dd>This pops up a window showing all the parameters that are user modifiable
for the XYZ plot.</dd>
<p>
<dt><b>Spectral Parameters</b>.</dt>
<dd>This pops up a window showing all the parameters that are user modifiable
for the spectral window.</dd>
<p>
</dl></dd>
<dd>Note: When displaying log scales and auto-scaling is off, the min's and
max's you choose should be powers, not absolute values (i.e. the value you
enter will become 10^x).</dd>
<dt><h3>View Menu</h3></dt>
<dd>
<dl>
<dt><b>ASCII</b>.</dt>
<dd>This opens a window for viewing the data in ASCII format. Some options
pertaining to this are available in the 'Edit Plot Parameters' menu item.
Note: Because it is possible so many points may be displayed on the graphs
the ASCII window only displays the first 300 (by default) points. Furthermore,
only the first 60 points are printed. However, the save button pops up a
file selection window allowing you to save the entire time segment to a file
of your choice. If the <b>Spectral</b> window is open, then the ASCII window
will display the frequency domain output.</dd>
<p>
<dt><b>Variable Titles</b>.</dt>
<dd>This opens a window listing variables names and their titles. The
"Category" menu may be used to reduce the list to just variables that belong
in a given category. The category system is not perfect, our system allows a
variable to exist in 1 category, even though some variables should belong in
more than one category.</dd>
<p>
<dt><b>netCDF Header</b>.</dt>
<dd>This opens a window with output from the <b>ncdump</b>(1) program.</dd>
<p>
<dt><b>Statistics</b>.</dt>
<dd>This opens a window displaying statistics from all variables currently
being used by ncplot.</dd>
<p>
<dt><b>Spectrum</b>.</dt>
<dd>This opens a window with Log/Log plot, showing the Power Spectral Density
of the first variable currently being displayed on the main plot window.</dd>
<p>
<dt><b>Co-Spectra, Quadrature, Coherence, and Phase</b>.</dt>
<dd>This opens a window with Linear/Log plot, showing, whichever of the
above four options, the first two variables currently being displayed
in the main plot window. Sample rates must match.</dd>
</dl></dd>
<dt><h3>Options Menu</h3></dt>
<dd>
<dl>
<dt><b>Un-zoom</b>.</dt>
<dd>The drag-zoom has a stack, choose Un-zoom repeatedly to back out.</dd>
<p>
<dt><b>Clear current plot</b>.</dt>
<dd>Remove all variables from the currently visible plot (Time-series, XY,
or XYZ).</dd>
<p>
<dt><b>User Calculations</b>.</dt>
<dd>Pops up a window allowing the user to enter their own calculations.
Upto 5 variables can be defined using complex algebraic expressions. Variable
names are case-sensitive and must be quoted. The new variables show up at the
bottom of the variable list in the control window (USER1, USER2, etc). Only
the variables defined will show up.
<p>
<img src="expar.png" align=center>
<p>
All of the standard arithmetic operators are available plus the following
intrinsic functions:<p>
<kbd class="att">sqrt()</kbd> = Square root.<br>
<kbd class="att">ln()</kbd> = Natural log.<br>
<kbd class="att">log()</kbd> = log base 10.<br>
<kbd class="att">exp()</kbd> = Exponential.<br>
<kbd class="att">sin()</kbd> = Sine.<br>
<kbd class="att">cos()</kbd> = Cosine.<br>
<kbd class="att">tan()</kbd> = Tangent.<br>
<kbd class="att">abs()</kbd> = Absolute value.<br>
<kbd class="att">^</kbd> = Power (e.g. 2^3 would be 2 cubed).<br></dd>
<p>
<dt><b>Clear regression</b>.</dt>
<dd>Remove all regresions being displayed.</dd>
<p>
<dt><b>Linear regression</b>.</dt>
<dd>Perform a linear regression, and display the equation's line. Statistics
from the regression are output to the window ncplot was started from.
Regressions currently only available on XY plot.</dd>
<p>
<dt><b>Polynomial regression</b>.</dt>
<dd>Prompts user for polynomial order (2nd through 5th), then performs the
regression, and displays the curve. Statistics from the regression are
output to the window ncplot was started from. Regressions currently only
available on XY plot.</dd>
</dl></dd>
</dl>
<a name="sw"></a>
<hr>
<h1 align=CENTER>Spectral Window</h1>
<a name="sw1"></a>
<h3>Features</h3>
A spectrum is computed from the first variable in the <b>time-series</b>
window, using the same time segment. Co-spectra, quadrature, coherence, and
phase are computed from the first two variables being displayed in the
<b>time-series</b> window.
<p>
Along the top row are three buttons, <b>Dismiss</b> and <b>Print</b> should
be obvious. Sizing, <b>lp</b> command, and orientation from the <b>Printer
Setup</b> window will be effective. The <b>Edit Parms</b> button is a
convenient short cut to the <b>Edit</b> menu item of the same name.
<p>
The first group of "radio buttons" in the upper right corner are also
short cuts to the items listed under the <b>View</b> menu of the same
name, which allow you to conveniently toggle between the various spectral
displays.
<p>
The next group, consists of three "option menus", and a recompute button.
These items control some of the power spectrum density computations.
The first menu is the <b>Segment length</b> to be used by the FFT, and
indirectly determines how many segments will be averaged together. The
second menu is the <b>Windowing</b> function to be applied to each segment.
The third menu determines what type of <b>Detrending</b> to apply to the
entire time-series data. (It is not applied to each segment.) See <b>How
is my spectrum being computed</b>, below, for more details. You must press the
<b>Recompute</b> button to have the changes in any of these menus take affect.
<p>
You will notice that two <b>variances</b> are shown at the bottom of the
display. <b>Total variance</b> is always displayed, and the sum includes
the 0th point or DC component of the Pxx spectrum array. The second
variance listed is the <b>Band Limited Variance</b>. By default this
is just the total variance minus the DC component. However you may change
the <b>Start frequency</b> or <b>End frequency</b> to get the <b>variance</b>
computed over a specified interval. The <b>Start/End frequencies</b> will
be truncated down to the nearest bin, no partitioning of these bins will occur.
<p>
<b>Time-shifting</b> for <b>co-spectrum</b> is supported. While you
may enter a value to the nearest millisecond, the data will only be
shifted to the nearest sample. For example, if you are doing spectra
on 25sps data, the gap between samples is 40 milliseconds, anything less
than 40 milliseconds that you enter will be truncated to 0, and anything
between 40 and 79 will be truncated to 40 milliseconds or 1 sample.
<p>
<b>Equal-log interval averaging</b> may be turned on to reduce the noise
being displayed. You may choose how many points to display, however some
number less than that will actually be displayed due to some bins having
no values to average in.
<p>
<img src="spec.png">
<p>
<h3>Plot Options</h3>
<ul>
<li><b>Grid</b> - applies a grid to the plot.<br>
<li><b>Multiply output by frequency</b> - does just that; only works for
<b>spectrum</b> as it is the default for <b>co-spectrum</b>.<br>
<li><b>Wave length scale</b> - may be added to the <b>top</b> of the plot
(TASX required).<br>
<li><b>Wave number scale</b> - can replace the <b>bottom</b> frequency scale
(TASX required).<br>
</ul>
<a name="sw2"></a>
<h3>How is my spectrum being computed?</h3>
<menu>
<menu>
M = segment length divided by 2.
<br>
K = number of segments (nPoints / M) + 2.
<br>
Pxx = Output spectral array (length = M).
<br>
Wss = Window summed and squared.
<br>
nPoints = Number of points in time series.
</menu>
Defaults:
<menu>
Detrend = Linear regression.
<br>
Segment Length = 1024 (M = 512).
<br>
Window = Parzen.
</menu>
</menu>
<p>
The entire time series data shown in the main ncplot window is
detrended with the user-selected detrend function, and padded
with zeroes on each end, to bring the data length up to a 2 to
the N power. (The FFT algorithm used requires this.) K is incremented
by 2 to make sure every real point is used twice.
<p>
The detrended data are then scaled by two different factors, one to
compensate for the effect of zero padding, and the other to compensate
for the effect of windowing.
<p>
The Welch peridiogram is then applied. Data segments (of length 2M)
are window'ed, FFT'ed, and summed into Pxx. Each segment overlaps
the previous segment by 50%. Parzen, Welch, and Hanning are among
the best windows to choose from.
<p>
Pxx is averaged by dividing by K * Wss * 2M.
<p>
<a name="cf"></a>
<hr>
<h1 align=center>Configuration File</h1>
<b>ncplot</b> will read a file titled <b>.ncplotrc</b> in your home directory,
if it exists. The following options may be overridden:<p>
<kbd class="att">Colors = </kbd>a list of seven colors space and/or comma seperated.<br>
<kbd class="att">PrintCommand = </kbd>new print command (eg: lp -d color -o nobanner).<br>
<kbd class="att">PrintColor = </kbd>Color (default is B&W).<br>
<kbd class="att">LineWidth = </kbd># (default is 1).<br>
<kbd class="att">TemplateDirectory = </kbd>Directory path<br>
<kbd class="att">TrueAirspeed = </kbd>TAS variable name (default is TASX).<br>
<kbd class="att">GpsLongitude = </kbd>GPS LON variable name (default is GLON).<br>
<kbd class="att">GpsLatitude = </kbd>GPS LAT variable name (default is GLAT).<br>
<kbd class="att">GpsAltitude = </kbd>GPS ALT variable name (default is GALT).<br>
<kbd class="att">InertialLongitude = </kbd>INS LON variable name (default is LON).<br>
<kbd class="att">InertialLatitude = </kbd>INS LAT variable name (default is LAT).<br>
<kbd class="att">PressureAltitude = </kbd>Pressure ALT variable name (default is PALT).<br>
<div class="example">
<pre class="CDL">
Colors = red,blue,green,yellow,maroon,orange,
PrintCommand = lp -d color -o nobanner
PrintColor = Color
LineWidth = 2
TemplateDirectory = /home/users/chris/.templates
GpsLongitude = GGLON
GpsLatitude = GGLAT
GpsAltitude = GGALT
</pre>
</div>
<p>
The Unix command <b>showrgb(1)</b> can be used to view a list of all available
color names (showrgb | more). The <b>Colors</B> option allows you to override
the plot trace colors.
<a name="gmt"></a>
<hr>
<h1>GMT Geo-Political Map Installation</h1>
The geo-political map makes use of the
<a href="https://www.generic-mapping-tools.org/">GMT</a> <b>pscoast</b> sub-command.
<p>
For GMT installation from source the <b>GMTHOME</b> environment variable must
be defined for <b>ncplot</b> to engage mapping. The <b>gmt</b> command
must be in your <b>$GMTHOME/bin</b>, and the coast libraries
<b>$GMTHOME/lib/binned_*.cdf</b> (~75Mb) must be installed.
<p>
Pre-canned packages exist for Ubuntu/Debian, RHEL/CentOS, MacOSX, and Windows. Usually called 'gmt' or 'GMT'.
<p>
For RHEL/CentOS installs, the gmt-gshhg package is missing the high-resolution netCDF files,
so I <a href="https://www.generic-mapping-tools.org/download/">downloaded</a> those
my self and copied the files into /usr/share/gshhg-gmt-nc4.
<p>
<a name="kp"></a>
<hr>
<h1>Known Problems</h1>
<ul>
<li>Using the window manager X to close or dismiss a window will cause a core dump. Use 'Dimiss' buttons.
<li>If the menu and button text shows up as squares, then some fonts are missing.
'yum install "xorg-x11-fonts-ISO8859-1*"' should solve the problem.
<li>Time gaps in the netCDF file. Time gaps should be filled with _FillValue or
missing_value.
<li>Invalid data files may cause a core dump.
<li>No minor tic marks exist for Y axis on XYZ plot.
</ul>
<hr>
<h1>Author</h1>
Christopher J. Webster<br>
National Center for Atmospheric Research<br>
Research Aviation Facility.<br>
<p>
<address><a href="mailto:cjw@ucar.edu?Subject=from_RAF_Web_Software_Page">email Chris Webster</a></address>
<hr>
<font size=2>
Last update:
Fri Sep 20 10:16:39 MDT 2024
</body>
</html>