-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathui.R
553 lines (525 loc) · 29.4 KB
/
ui.R
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
# ui.R
## This is the user interface for the Ranadu shinyApp.
step <- 60
shinyUI(
fluidPage (theme='www/bootstrap.css', ##navbarPage('Explorer', ##fluidPage(
# titlePanel("Explorer"),
# tabPanel ('plot vs time',
# tags$style (type='text/css', '.well {max-height:140px;}'),
## this doesn't work; 115 is F4 key; fix someday
tags$script(HTML("$(function() {
$(document).keyup(function(e) {
if (e.which == 115) {
$('#resetT').click()
}
});
})")),
navlistPanel (tabPanel (strong('data & plot'), fluidRow (
column (4, wellPanel (
fluidRow (
column (3, radioButtons ('SRC', label='AC', choices=c('NCAR', 'UWYO', 'FAAM'),
width='60px', inline=FALSE)),
column (8,
fluidRow (
column (8, selectInput (inputId='Project', label=NULL,
choices=PJ, selected=plotSpec$Project, width='100px')),
column (4, actionButton (inputId='manual', label = 'help'))
)),
fluidRow (
# column (4, downloadButton ('savePDF', label='PDF')), # icon=icon('file-pdf-o'))),
column (4, downloadButton (outputId='savePNG', label='PNG')), # icon=icon('file-image-o'))),
column (4, actionButton (inputId='saveRdata', label='R', icon=icon('file-archive-o')))
)
))),
column (2, wellPanel (
fluidRow (
column (5, numericInput (inputId='Flight', label='Flight', value=1,
min=1, max=99, step=1, width='80px')),
column (3, radioButtons ('typeFlight', label=NULL, choices=c('rf', 'tf', 'ff'),
width='70px', inline=FALSE)),
column (3, radioButtons ('suffixFlight', label=NULL, choices=c('pre', 'Prod.', 'h'), ##, 'Y', 'KF'),
width='70px', inline=FALSE))))),
column (1,
numericInput (inputId='plot', label='plot', value=1,
min=1, max=5, step=1),
actionButton ('check', 'quick')),
column(5, wellPanel (
fluidRow (
column (6, selectInput ('restore', label=NULL, choices=defFiles, selected='plotSpec.def')),
column (6, textInput ('save', label=NULL, value='plotSpec.def'))
),
fluidRow (
column (6, actionButton (inputId='specRead', label='Read Specs')),
column (6, actionButton (inputId='specSave', label='Save Specs'))
)
)))),
# tags$head(
# tags$style(type="text/css", ".irs {max-height:55px;}"),
# tags$style (type='text/css', '.well {max-height:140px;}')
# ),
# tags$head (
# tags$style(type='text/css', 'irs {max-height:55px;')
# # tags$style(type='text/css', 'textinput {max-height:55px;'),
# # tags$style(type='text/css', 'button-text {font-size:12px; height:20px;}'),
# ),
tabPanel (strong('restrictions'),
column(6,
tags$style(type='text/css', '.well {max-height:120px;top:0px'),
wellPanel(
tags$style(type='text/css', 'irs {max-height:53px;'),
sliderInput("times", label=NA, min=plotSpec$Times[1], max=plotSpec$Times[2],
value=plotSpec$Times,
# animate=TRUE,
step=step,
timeFormat='%T', dragRange=TRUE,
timezone='+0000'),
fluidRow (
# column (4, tags$textarea(id = "tstart", rows = "1", cols = "11", value=formatTime(time[1]))), # text input with 10 rows aka lines
# column (4, tags$textarea(id = "t-end", rows = "1", cols = "11")),
column (4,
# tags$style(type="text/css", "input.shiny-bound-input {font-size:12px; height:15px;}"),
textInput ('tstart', label=NULL, value=formatTime(plotSpec$Times[1])),
tags$style(type='text/css', "#tstart {width: 100px; height: 22px; }")),
column (4,
# tags$style(type="text/css", "input.shiny-bound-input {font-size:12px; height:15px;}"),
textInput ('tend', label=NULL, value=formatTime(plotSpec$Times[2])),
tags$style(type='text/css', "#tend {width: 100px; height: 22px; }")),
column (2, shinyBS::bsButton ('resetT', label='reset', size='extra-small')),
column (1, shinyBS::bsButton ('prevT', label=NULL, icon=icon('angle-left'), size='extra-small')),
# tags$style(type='text/css', "#button { vertical-align: middle; height: 15px; width: 100%; font-size: 12px;}")
column (1, shinyBS::bsButton ('nextT', label=NULL, icon=icon('angle-right'), size='extra-small'))
# tags$style(type='text/css', "#button { vertical-align: middle; height: 15px; width: 100%; font-size: 12px;}")
)
)),
column (6, wellPanel ( fluidRow (
# tags$style(type="text/css", "input.shiny-bound-input {font-size:14px; height:30px;}"),
column (2, numericInput ('rvNumber', 'R#', 1)),
column (3, selectInput ('rvar', 'var', choices=c(sort(FI$Variables)),
selected=plotSpec$Restrictions$RVAR[1])),
column (1, '?', checkboxInput ('apply', label=NULL,
value=plotSpec$Restrictions$apply[1])),
column (3, numericInput ('rmin', 'min', plotSpec$Restrictions$min[1])),
column (3, numericInput ('rmax', 'max', plotSpec$Restrictions$max[1]))
)
))), widths=c(2,10)),
bsAlert("pleasewait"),
bsModal("quickCheck", title=NULL, trigger='check', size = "large", plotOutput("quickPlot")),
tabsetPanel (id='whichTab', type='pills',
tabPanel ('plot vs time',
sidebarLayout(
sidebarPanel(h4('define plot'),
fluidRow (
column (6, numericInput ('panels', 'panels',
plotSpec$Plot[[1]]$panels, width='60px')),
column (6, numericInput ('cols', 'cols', plotSpec$Plot[[1]]$columns, min=1, width='60px'))),
fluidRow (
column (6, numericInput ('panel', 'panel', 1, min=1, max=6,width='50px')),
column (6, checkboxInput ('logY', 'log?'),
checkboxInput ('fixed', 'set ylim?',
value=plotSpec$Plot[[1]]$panel[[1]]$fixed)
)),
fluidRow (
column (6, numericInput ('panelMin', 'min', plotSpec$Plot[[1]]$panel[[1]]$ylim[1])),
column (6, numericInput ('panelMax', 'max', plotSpec$Plot[[1]]$panel[[1]]$ylim[2]))),
fluidRow (
column (7, checkboxInput ('restrict','apply restrictions', plotSpec$Plot[[1]]$restrict)),
column (5, checkboxInput ('footer','footer?'))),
wellPanel (
fluidRow (
column (2, 'line:'),
column (4, numericInput ('lineV', NULL, 1, width='70px')),
column (2, 'lwd:'),
column (4, numericInput ('lineW', NULL, 1, width='70px'))),
fluidRow (
column (1, 'v:'),
column (11, selectInput ('addVarP', label=NULL,
choices=c('select', 'omit', sort(FI$Variables)),
selected=plotSpec$Plot[[1]]$panel[[1]]$var[1]))),
fluidRow(
column (1, 'l:'),
column (11, textInput ('ylbl', label=NULL, value=plotSpec$Plot[[1]]$panel[[1]]$var[1]))),
selectInput ('varColor', NULL, c('blue', 'darkgreen', 'red',
'cyan', 'violet', 'darkorange',
'brown', 'black')),
# fluidRow (
# column (6, 'width:'),
# column (6, numericInput ('lineW', NULL, 1, width='90px'))),
fluidRow (
column (6, radioButtons ('lineStyle', label='line type', choices=ltyps, inline=TRUE,
selected=ltyps[plotSpec$Plot[[1]]$panel[[1]]$lt[1]],
width='90px')),
column (6, checkboxInput ('smooth','smooth?', plotSpec$Plot[[1]]$panel[[1]]$smooth[1]),
numericInput ('SGpoints', 'SG pts', plotSpec$Plot[[1]]$panel[[1]]$SGlength[1])
))),
width=3),
mainPanel( tabsetPanel (tabPanel ('plots', plotOutput (outputId='display', click=clickOpts(id='plot_click'),
brush=brushOpts(id='plot_brush', delay=3000, delayType='debounce', resetOnNew=TRUE))),
tabPanel ('stats', dataTableOutput ('stats')),
tabPanel ('histograms', plotOutput (outputId='hist')),
tabPanel ('soundings', plotOutput (outputId='barWvsZ')),
tabPanel ('listing', dataTableOutput ('listing')),
tabPanel ('checkV', h2('1-min averages centered on listed time'),
textInput ('RefT', label=NULL, value=formatTime(checkTime)),
dataTableOutput ('checkV')),
id='display')
))
# ),
# tabPanel ('track')
),
tabPanel ('track',
sidebarLayout(
sidebarPanel(h4('track definition'),
checkboxInput ('limits2','apply restrictions'),
checkboxInput ('footer2', 'footer?'),
checkboxInput ('drift', 'drifting?'),
numericInput ('track.xc', 'center long.', value=NULL),
numericInput ('track.yc', 'center lat.', value=NULL),
numericInput ('track.sz', 'size (deg.', value=NULL),
numericInput ('track.spacing', 'time between labels (min)', 15),
numericInput ('track.WF', 'scale for wind flags', 5),
width=2),
mainPanel( tabsetPanel (tabPanel ('plan view', plotOutput (outputId='track')),
tabPanel ('time-height', plotOutput ('theight'))
)))
),
tabPanel ('stats/listing',
sidebarLayout(
sidebarPanel(h4('stats/listing definition'),
checkboxInput ('limits2a','apply restrictions'),
actionButton ('statVariables', 'select variables'),
radioButtons ('statslist', label='type of output', choices=c('stats', 'listing')),
numericInput ('avgsec', label='for listing, ave. seconds:', value=1, min=1),
width=2),
mainPanel(dataTableOutput ('statistics')))
),
navbarMenu ('more plots',
tabPanel ('histogram',
sidebarLayout(
sidebarPanel(h4('histogram definition'),
fluidRow (
column (6, checkboxInput ('limits3','apply restrictions')),
column (6, checkboxInput ('densityH', 'plot density?'))
),
fluidRow (
column (6, checkboxInput ('cdf', 'include CDF')),
column (6, checkboxInput ('hfooter','footer? (NA)'))),
fluidRow (
column (6, numericInput ('hpanels', 'panels',
plotSpec$Hist[[1]]$panels, width='60px')),
column (6, numericInput ('hcols', 'cols', plotSpec$Hist[[1]]$columns, min=1, width='60px'))),
fluidRow (
column (4, numericInput ('hpanel', 'panel', 1, min=1, max=5,width='50px')),
column (4, numericInput ('hbins', 'bins', 50, min=10)),
column (4, checkboxInput ('hlogY', 'log? (NA)'),
checkboxInput ('hfixed', 'set xlim?',
value=plotSpec$Hist[[1]]$panel[[1]]$fixed)
)),
fluidRow (
column (6, numericInput ('hpanelMin', 'xmin', plotSpec$Hist[[1]]$panel[[1]]$ylim[1])),
column (6, numericInput ('hpanelMax', 'xmax', plotSpec$Hist[[1]]$panel[[1]]$ylim[2]))),
wellPanel (
fluidRow (
column (6, h4('line:')),
column (6, numericInput ('hlineV', NULL, 1, width='90px'))),
selectInput ('haddVarP', label=NULL,
choices=c('select', 'omit',sort(FI$Variables)),
selected=plotSpec$Hist[[1]]$panel[[1]]$var[1]),
selectInput ('hvarColor', NULL, c('blue', 'darkgreen', 'red',
'cyan', 'violet', 'darkorange',
'brown', 'black')),
fluidRow (
column (6, 'width:'),
column (6, numericInput ('hlineW', NULL, 1, width='90px'))),
radioButtons ('hlineStyle', label='line type', choices=ltyps, inline=TRUE,
selected=ltyps[plotSpec$Hist[[1]]$panel[[1]]$lt[1]],
width='90px')),
width=3),
mainPanel(plotOutput (outputId='histogram')))
),
tabPanel ('scatterplot',
sidebarLayout(
sidebarPanel(h4('scatterplot'),
fluidRow (
column (5, checkboxInput ('limits4','restrictions')),
column (6, checkboxInput ('ssmooth','smoothed display? (1st pair only)'))),
fluidRow (
column (6, numericInput ('spanels', 'panels',
plotSpec$Scat[[1]]$panels, width='60px')),
column (6, numericInput ('scols', 'cols', plotSpec$Scat[[1]]$columns, min=1, width='60px'))),
fluidRow (
column (6, numericInput ('spanel', 'panel', 1, min=1, max=5,width='50px')),
column (6, checkboxInput ('slogX', 'log x?'),
checkboxInput ('slogY', 'log y?'),
checkboxInput ('sfixed', 'fixed?',
value=plotSpec$Scat[[1]]$panel[[1]]$fixed)
)),
wellPanel (
fluidRow (
column (5, h4('pair:')),
column (7, numericInput ('slineV', NULL, 1, width='90px'))),
fluidRow (
column (2, 'x'),
column (10, selectInput ('saddVarP1', label=NULL,
choices=c('select', 'omit',sort(FI$Variables)),
selected=plotSpec$Scat[[1]]$panel[[1]]$varx))),
fluidRow (
column (2, 'y'),
column (10, selectInput ('saddVarP2', label=NULL,
choices=c('select', 'omit',sort(FI$Variables)),
selected=plotSpec$Scat[[1]]$panel[[1]]$vary[1]))),
selectInput ('svarColor', NULL, c('blue', 'darkgreen', 'red',
'cyan', 'violet', 'darkorange',
'brown', 'black')),
fluidRow (
column (6, 'symbol size:'),
column (6, numericInput ('ssize', NULL, 1, width='90px'))),
numericInput ('symbol', 'symbol', plotSpec$Scat[[1]]$panel[[1]]$symbol[1], width='90px'),
fluidRow (
column (6, numericInput ('spanelMinx', 'xmin', plotSpec$Scat[[1]]$panel[[1]]$xlim[1])),
column (6, numericInput ('spanelMaxx', 'xmax', plotSpec$Scat[[1]]$panel[[1]]$xlim[2]))),
fluidRow (
column (6, numericInput ('spanelMiny', 'ymin', plotSpec$Scat[[1]]$panel[[1]]$ylim[1])),
column (6, numericInput ('spanelMaxy', 'ymax', plotSpec$Scat[[1]]$panel[[1]]$ylim[2])))),
width=3),
mainPanel(plotOutput (outputId='scatterplot')))
),
tabPanel ('bin-average plots',
sidebarLayout(
sidebarPanel(h4('bin averages'),
checkboxInput ('limits5','apply restrictions'),
fluidRow (
column (5, checkboxInput ('bfooter','footer? (NA)'))),
fluidRow (
column (6, numericInput ('bpanels', 'panels',
plotSpec$Bin[[1]]$panels, width='60px')),
column (6, numericInput ('bcols', 'cols', plotSpec$Bin[[1]]$columns, min=1, width='60px'))),
fluidRow (
column (6, numericInput ('bpanel', 'panel', 1, min=1, max=5,width='50px'),
checkboxInput ('bhoriz', 'horizontal?')),
column (6, checkboxInput ('blogX', 'log x?'),
checkboxInput ('blogY', 'log y?'),
checkboxInput ('bfixed', 'fixed?',
value=plotSpec$Bin[[1]]$panel[[1]]$fixed)
)),
wellPanel (
fluidRow (
column (5, h4('pair:')),
column (7, numericInput ('blineV', NULL, 1, width='90px'))),
fluidRow (
column (2, 'x'),
column (10, selectInput ('baddVarP1', label=NULL,
choices=c('select', 'omit',sort(FI$Variables)),
selected=plotSpec$Bin[[1]]$panel[[1]]$varx))),
fluidRow (
column (2, 'y'),
column (10, selectInput ('baddVarP2', label=NULL,
choices=c('select', 'omit',sort(FI$Variables)),
selected=plotSpec$Bin[[1]]$panel[[1]]$vary[1]))),
selectInput ('bvarColor', NULL, c('blue', 'darkgreen', 'red',
'cyan', 'violet', 'darkorange',
'brown', 'black')),
fluidRow (
column (6, 'symbol size:'),
column (6, numericInput ('bsize', NULL, 1, width='90px'))),
numericInput ('bsymbol', 'symbol', plotSpec$Bin[[1]]$panel[[1]]$symbol[1], width='90px'),
fluidRow (
column (6, numericInput ('bpanelMinx', 'xmin', plotSpec$Bin[[1]]$panel[[1]]$xlim[1])),
column (6, numericInput ('bpanelMaxx', 'xmax', plotSpec$Bin[[1]]$panel[[1]]$xlim[2]))),
fluidRow (
column (6, numericInput ('bpanelMiny', 'ymin', plotSpec$Bin[[1]]$panel[[1]]$ylim[1])),
column (6, numericInput ('bpanelMaxy', 'ymax', plotSpec$Bin[[1]]$panel[[1]]$ylim[2])))),
width=3),
mainPanel(plotOutput (outputId='binplot')))
)),
navbarMenu ('particles',
tabPanel ('size distributions',
sidebarLayout(
sidebarPanel(h4('define size distributions'),
fluidRow(
column(6, checkboxInput ('limits7','restrictions?')),
column(3, checkboxInput ('LWC', 'LWC?')),
column(3, checkboxInput ('addcdf', 'CDF?'))
),
selectInput ('sdtype', 'type of axes',
choices=c('linear', 'log-y', 'log-x', 'both log'),
selected='both log'),
checkboxGroupInput ('probe', 'probe?', c('CDP', 'FSSP', 'UHSAS', 'PCASP', '2DC'),
selected='CDP'),
width=2),
mainPanel(plotOutput (outputId='sdplot')))
),
tabPanel ('hydrometeor images',
sidebarLayout (
sidebarPanel (h4('2D probe images'),
actionButton ('fname2d', 'select input file'),
textInput ('fnametext', 'file selected:', value=plotSpec$fname2d),
radioButtons ('mode2d', 'type of display:',
choices=c('record', 'page', 'second (max)', 'image')),
fluidRow (
column (7, 'min. seconds between displayed records:'),
column (5, numericInput ('max2d', label=NULL, value=0, min=0, width='200px'))),
shinyBS::bsButton ('prev2d', label=NULL, icon=icon('angle-left'), size='small'),
shinyBS::bsButton ('next2d', label=NULL, icon=icon('angle-right'), size='small'),
width=3),
mainPanel(plotOutput (outputId='image2d'))))),
navbarMenu ('thermo. diagrams',
tabPanel ('skewT diagram',
sidebarLayout(
sidebarPanel(h4('skew-T definition'),
checkboxInput ('limits6', 'apply restrictions'),
numericInput ('sndbins', 'bins for sounding', value=50, min=20, max=1000),
checkboxInput ('hodograph', 'show hodograph?'),
checkboxInput ('cape', 'CAPE / LCL / adiabats?'),
checkboxInput ('footer6', 'footer?'),
width=2),
mainPanel(plotOutput (outputId='skewT')))
),
tabPanel ('mixing and stability plots',
sidebarLayout(
sidebarPanel (h4('Paluch / sat.-point, stability diagrams'),
checkboxInput ('limits9', 'apply restrictions'),
selectInput ('paluchBetts', label=NULL, choices=c('Paluch', 'Betts sat. point', 'stability profiles')),
h4('sounding times:'),
fluidRow (
column (6, textInput ('paluchStart', label=NULL, value=formatTime (plotSpec$PaluchTimes[1]))),
column (6, textInput ('paluchEnd', label=NULL, value=formatTime (plotSpec$PaluchTimes[2])))
),
fluidRow (
column (2, 'bins:'),
column (4, numericInput ('nbsa', label=NULL, value=18, min=5, width='70px')),
column (2, 'avg:'),
column (4, numericInput ('nbss', label=NULL, value=7, min=5, width='70px'))
),
selectInput('paluchLWC', 'LWC variable', choices=c(sort(FI$Variables)),
selected=plotSpec$paluchLWC),
h4('in-cloud times for mixing diagrams:'),
fluidRow (
column (6, textInput ('paluchCStart', label=NULL, value=formatTime (plotSpec$PaluchCTimes[1]))),
column (6, textInput ('paluchCEnd', label=NULL, value=formatTime (plotSpec$PaluchCTimes[2])))
),
h4 ('variable for stability profiles:'),
radioButtons ('tvORthetap', label=NULL, choices=c('THETAV', 'THETAP'), inline=TRUE),
width=4),
mainPanel (plotOutput (outputId='paluch')))
)
),
tabPanel ('variance spectra',
sidebarLayout(
sidebarPanel(h4('spectral analysis'),
fluidRow(
column(4, checkboxInput ('limits8','apply restrictions')),
column(5, selectInput ('varTheme', label='theme', choices=Themes)),
column(3, checkboxInput ('varXanadu', label='Xanadu?', value=FALSE))),
selectInput('specvar', 'variable', choices=c(sort(FI$Variables)),
selected=plotSpec$Variance[[1]]$Definition$var),
selectInput('speccovar', 'co-variable', choices=c(sort(FI$Variables)),
selected=plotSpec$Variance[[1]]$Definition$cvar),
tabsetPanel (type='pills',
tabPanel ('fft-spectrum',
fluidRow (
column(6, selectInput ('ffttype1', label=NULL, choices=c('fp(f)', 'p(f)', 'co-variable fp(f)', 'both fp(f)',
'cospec. / quad.', 'coherence / phase', 'edr-weighted', 'AllanVariance', 'data'))),
column(3, numericInput ('spans', 'spans (should be odd)', 49))),
fluidRow (
column (6, selectInput ('FFTcolor1', 'color', choices=c('blue', 'darkgreen', 'red', 'cyan', 'darkorange', 'brown', 'magenta', 'black'))),
column(3, numericInput ('fftavg1', 'log avg intervals', plotSpec$Variance[[1]]$Definition$fftavg)),
column(3, checkboxInput ('ffterrbar1', 'error bars?'))),
sliderInput("fftedrRange1", label='for EDR plot, freq range:', min=0.05, max=12.5,
value=c(0.1,8), step=0.01),
fluidRow(
column(3, checkboxInput ('FFTadd1', 'add to prev. plot', value=FALSE)),
column(6, checkboxInput ('FFTshowU1', 'show unsmoothed spectrum', value=FALSE)),
column(3, checkboxInput ('FFTcaption1', 'show caption', value=TRUE)))),
tabPanel ('fft-Welch',
fluidRow (
column(6, selectInput ('ffttype', label=NULL, choices=c('fp(f)', 'p(f)', 'co-variable fp(f)', 'both fp(f)',
'cospec. / quad.', 'coherence / phase', 'edr-weighted', 'AllanVariance', 'data'))),
column(3, numericInput ('fftpts', 'segment length (s)', plotSpec$Variance[[1]]$Definition$fftpts)),
column(3, selectInput ('fftwindow', label=NULL, choices=c('Parzen', 'square', 'Welch', 'Hanning')))),
fluidRow (
column (6, selectInput ('FFTcolor', 'color', choices=c('blue', 'darkgreen', 'red', 'cyan', 'darkorange', 'brown', 'magenta', 'black'))),
column(3, numericInput ('fftavg', 'log avg intervals', plotSpec$Variance[[1]]$Definition$fftavg)),
column(3, checkboxInput ('ffterrbar', 'error bars?'))),
sliderInput("fftedrRange", label='for EDR plot, freq range:', min=0.05, max=12.5,
value=c(0.1,8), step=0.01),
fluidRow(
column(3, checkboxInput ('FFTadd', 'add to prev. plot', value=FALSE)),
column(6, checkboxInput ('FFTshowU', 'show unsmoothed spectrum', value=FALSE)),
column(3, checkboxInput ('FFTcaption', 'show caption', value=TRUE)))),
tabPanel ('acv',
checkboxInput ('acvdetrend', 'remove trend?', value=TRUE),
selectInput ('acvtype', label=NULL, choices=c('fp(f)', 'p(f)', 'var2 fp(f)', 'var2 p(f)',
'autocorrelation', 'crosscorrelation', 'data')),
numericInput ('acvtau', 'smoothing time', plotSpec$Variance[[1]]$Definition$acvtau),
numericInput ('acvavg', 'log avg intervals', plotSpec$Variance[[1]]$Definition$acvavg)),
tabPanel ('MEM',
fluidRow (
column(6, selectInput ('MEMtype', label=NULL, choices=c('fp(f)', 'p(f)', 'co-variable fp(f)', 'both',
'cospec./quadrature', 'coherence/phase',
'edr-weighted', 'data'))),
column(3, numericInput ('MEMpoles', 'poles', plotSpec$Variance[[1]]$Definition$MEMpoles)),
column(3, numericInput ('MEMres', 'resoln', plotSpec$Variance[[1]]$Definition$MEMres))),
fluidRow (
column(6, selectInput ('MEMcolor', 'color', choices=c('blue', 'darkgreen', 'red', 'cyan', 'darkorange', 'brown', 'magenta', 'black'))),
column(6, numericInput ('MEMavg', 'log avg intervals', plotSpec$Variance[[1]]$Definition$MEMavg))),
sliderInput("MEMedrRange", label='for EDR plot, freq range:', min=0.05, max=12.5,
value=c(0.1,8), step=0.01),
fluidRow(
column(3, checkboxInput ('MEMadd', 'add to prev. plot', value=FALSE)),
column(6, checkboxInput ('MEMshowU', 'show unsmoothed spectrum', value=FALSE)),
column(3, checkboxInput ('MEMcaption', 'show caption', value=TRUE)))
), id='spectype'),
width=3),
mainPanel(plotOutput (outputId='varplot')))
),
navbarMenu ('utilities',
tabPanel ('run other programs',
selectInput ('otherprogram', label=NULL,
choices=c('ncplot', 'Xanadu', 'Excel', 'python',
'NCL', 'IDL', 'IDV')),
checkboxInput ('limits10','apply restrictions'),
actionButton ('xfrVariables', 'select variables'),
actionButton ('ncplot', 'start program')),
tabPanel ('fits to data',
sidebarLayout (
sidebarPanel (h4('linear fits'),
checkboxInput ('limitsFit', 'apply restrictions?', value=TRUE),
selectInput ('response', label='response variable',
choices=sort(VarList)),
helpText(h4('formula use:'),
'the fit formula can take several forms:',
tags$ul(
tags$li('a single variable'),
tags$li('multiple variables separated by + signs (e.g., A+B)'),
tags$li('additional expressions enclosed in isolating expressions ',
tags$strong('+I()'),', where the enclosed formula may',
'use operations like *, /, etc., or ^ for powers (e.g., A^2 for the square of A)'),
tags$li('you can also use new variables previously defined by the utility \"create new variable\"')
)),
textInput ('fformula', 'fit formula (example shown)', placeholder='I(ADIFR/QCF)+I(MACHX^3)'),
actionButton ('lfit', 'show linear fit'),
actionButton ('dfit', 'show Deming fit')
),
mainPanel (plotOutput (outputId='fitplot'),
htmlOutput (outputId='fittext'),
tableOutput (outputId='coeftable'))
)),
tabPanel ('create new variable',
actionButton ('createV', 'create new variable'),
helpText (h4('Usage:'),
'Provide a name for the new variable,',
'then give a formula for calculating it. The',
'formula can use names of existing variables',
'if they are separated by spaces from other',
'text or numbers, and it can use standard',
'math operations like +-*/ or math functions',
'like sin(). An example is shown. Click the',
'top button once the formula is ready.',
h4('Warning:'), 'If the',
'variable already exists it will be replaced.'),
textInput ('newvar', 'name of new variable', value='AOAREF'),
textInput ('formla', 'formula for new variable',
value='PITCH - GGVSPD / TASX * 180 / pi')))
)
)
)