forked from nrcc-cornell/ACISQueryBuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1350 lines (1309 loc) · 58.1 KB
/
index.html
File metadata and controls
1350 lines (1309 loc) · 58.1 KB
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
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>ACIS Web Services Query Builder</title>
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/redmond/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="css/ACIS_Builder.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/date.min.js"></script>
<script type="text/javascript" src="js/json2.min.js"></script>
<script type="text/javascript" src="js/jquery.acis-widgets.js"></script>
<noscript>
<style type="text/css">
.pagecontainer {display:none;}
</style>
<div class="noscriptmsg">
It appears you don't have JavaScript enabled. Please turn on JavaScript to use this site.
</div>
</noscript>
<script type="text/javascript">
var serverUrl = "http://data" +
(window.location.hash.length > 1 ? "." + window.location.hash.slice(1) : "") +
".rcc-acis.org/";
function makeList(x) {
var l = [];
$(x.split(",")).each(function (i, e) {
l.push(parseFloat(e.replace(/[^\d\-\.]/g, '')));
});
return l;
}
function makeObject(items) {
var newObj = {};
$.each(items, function (i, j) {
if (j[1]) {
newObj[j[0]] = j[1];
}
});
return newObj;
}
function table_events(ttype, input_name, table) {
$(ttype + "[name=" + input_name + "]")
.die("focusin focusout")
// need to delay show/hide to allow time for click event to fire
.live("focusin", function () {
setTimeout(function () {
$("#" + table).show();
}, 200);
})
.live("focusout", function () {
setTimeout(function () {
$("#" + table).hide();
}, 200);
});
}
function process_request(params) {
var args = JSON.stringify(params),
server = serverUrl + $("#wstype input:checked").val();
$("#jparams_h2").html('Parameters (JSON)');
$("#jparams").empty().html("<pre>" + args + "<\/pre>");
$("#jresults_h2 span").html('Results');
$('#jresults').empty().html('Loading...');
$("#formatButton").hide();
$("#output").show();
if (server.search("General") >= 0) {
server += $("select[name=area] :selected").text();
$("#jparams pre").prepend("Server=/General/" + $('select[name=area] :selected').text() + " params=");
}
if (params.output && params.output.toLowerCase() === "image") {
$("#jresults_h2 span").html('Results (PNG)');
$("#jresults").empty().html("<img src='" + server + "?params=" + args + "'><\/img>");
} else {
// using proxy server to avoid cross domain problems
$.post(server, {params: args}, function (res) {
if (params.output && params.output.toLowerCase() === "csv") {
$("#jresults_h2 span").html('Results (CSV)');
$("#jresults").empty().html("<pre>" + res + "<\/pre>");
} else {
$("#jresults_h2 span").html('Results (JSON)');
$("#jresults").empty().html("<pre>" + JSON.stringify(res) + "<\/pre>");
$("#formatButton").text("Format").show().off("click").on("click", function () {
$(this).hide();
if ($(this).text() === "Format") {
$("#jresults_h2 span").html('Results (formatted)');
$("#jresults").empty();
$.each(res, function (key, val) {
$("#jresults").append("<pre>" + key + ":<\/pre>");
if (key === "data" && typeof (val) === 'string' && val.search("image/png;base64") >= 0) {
$("#jresults").append("<img src='" + val + "'><\/img>");
} else {
$(val).each(function (i, elem) {
$("#jresults").append("<pre>" + JSON.stringify(elem) + "<\/pre>");
});
}
});
$(this).text("Back to raw").show();
} else {
$("#jresults_h2 span").html('Results (JSON)');
$("#jresults").empty().html("<pre>" + JSON.stringify(res) + "<\/pre>");
$(this).text("Format").show();
}
});
}
},'json');
}
$("#jparams").one("keyup", function () {
if (server.search("General") < 0) {
$("#jparams_h2").html('Parameters (JSON) <button id="submitJson" class="otherButtons ui-corner-all ui-state-default">Submit</button>');
$("#specs input,textarea,button").attr("disabled", true).addClass("grayout");
$("#submitJson").attr("disabled", false).on("click", function () {
$("#specs input,textarea,button").attr("disabled", false).removeClass("grayout");
process_request(JSON.parse($("#jparams").text()));
});
}
});
}
function collect_data() {
var params = {}, img_obj = {};
$('#specs input').not(".elems_opts input").not(".image_opts input").each(function () {
if (this.name.length && this.value.length) {
params[this.name] = this.value.replace(/,\s/g, ",").toLowerCase();
}
});
if ($("textarea[name=elems_container]").is(":visible") && $("textarea[name=elems_container]").val().length) {
params.elems = JSON.parse($("textarea[name=elems_container]").val());
}
if ($("#showimgopts").length && $("#showimgopts").is(":checked")) {
$('.image_opts input').each(function () {
if (this.name.length && this.value.length) {
if (this.name === 'levels') {
img_obj.levels = makeList(this.value);
} else if ($.isNumeric(this.value)) {
img_obj[this.name] = parseInt(this.value, 10);
} else {
img_obj[this.name] = this.value.replace(/,\s/g, ",");
}
}
});
params["image"] = img_obj;
}
if (params.meta && params.meta.search('valid_daterange') >= 0 && !params.elems) {
alert("Need to specify elements when requesting valid_daterange");
$("[name=elems]").addClass("makeRequired").effect("highlight", {color: "yellow"}, 1000).focus();
return false;
}
if ($("#singledate").is(":checked")) {
params.date = params.sdate;
delete params.sdate;
delete params.edate;
}
process_request(params);
}
function add_element_interaction() {
var single_elem, elem_list, combo_list;
$("#add_elem").button().on("click", function () {
if ($("input[name=duration]").val().search(/std/i) >= 0 && $("input[name=season_start]").val().length === 0) {
if ($("input[name=interval]").val().search(/dly/i) >= 0) {
alert("For dly season-to-date, need to specify a season start in the form mm-dd");
} else {
alert("For mly season-to-date, need to specify a season start in the form mm");
}
$("[name=season_start]").effect("highlight", {color: "yellow"}, 1000).focus();
return false;
}
if ($("input[name=duration]").val().length && $("input[name=duration]").val().search(/dly/i) < 0 && $("input[name=duration]").val() !== "1" && $("input[name=reduce]").val().length === 0) {
alert("For this duration, need to specify a reduction");
$("[name=reduce]").effect("highlight", {color: "yellow"}, 1000).focus();
return false;
}
if ($("input[name=duration]").val().search(/std/i) >= 0 && $("input[name=interval]").val().search(/mly/i) >= 0 && $("input[name=season_start]").val().search(/-|,/) >= 0) {
alert("For monthly season-to-date, need to specify a season start as just a month");
$("[name=season_start]").effect("highlight", {color: "yellow"}, 1000).focus();
return false;
}
$("#add_elem").removeClass("makeRequired");
$('#elem_box').show();
$('input[name=elems]').val("").parent().parent().hide();
single_elem = {};
$('.elems_opts input').each(function () {
if (this.value.length > 0) {
if ($.isNumeric(this.value) && this.name !== "season_start") {
single_elem[this.name] = parseInt(this.value, 10);
} else {
single_elem[this.name] = this.value.replace(/\s/g, "").toLowerCase();
}
}
});
if (single_elem.season_start && single_elem.season_start.search(",") >= 0) {
single_elem.season_start = makeList(single_elem.season_start);
}
if (single_elem.interval && !$.isNumeric(single_elem.interva) && single_elem.interval.search(",") >= 0) {
single_elem.interval = makeList(single_elem.interval);
} else if (single_elem.interval && $.isNumeric(single_elem.interval)) {
single_elem.interval = [single_elem.interval];
}
if (single_elem.groupby && single_elem.groupby.search(",") >= 0) {
combo_list = [];
$(single_elem.groupby.split(",")).each(function (i, e) {
combo_list.push(e);
});
single_elem.groupby = combo_list;
}
if (single_elem.smry && single_elem.smry.search(",") >= 0) {
combo_list = [];
$(single_elem.smry.split(",")).each(function (i, e) {
combo_list.push(e);
});
single_elem.smry = combo_list;
}
if (single_elem.reduce_add || single_elem.reduce_n || single_elem.reduce_maxmissing) {
single_elem.reduce = makeObject([["reduce", single_elem.reduce], ["add", single_elem.reduce_add],
["n", single_elem.reduce_n], ["run_maxmissing", single_elem.reduce_maxmissing]]);
delete single_elem.reduce_add;
delete single_elem.reduce_n;
delete single_elem.reduce_maxmissing;
}
if (single_elem.smry_add || single_elem.smry_n || single_elem.smry_maxmissing) {
single_elem.smry = makeObject([["reduce", single_elem.smry], ["add", single_elem.smry_add],
["n", single_elem.smry_n], ["run_maxmissing", single_elem.smry_maxmissing]]);
delete single_elem.smry_add;
delete single_elem.smry_n;
delete single_elem.smry_maxmissing;
}
if ($("textarea[name=elems_container]").val().length) {
elem_list = JSON.parse($("textarea[name=elems_container]").val());
} else {
elem_list = [];
}
elem_list.push(single_elem);
$("textarea[name=elems_container]").attr('rows', elem_list.length).val(JSON.stringify(elem_list));
$("input[name=interval]").attr("disabled", true).addClass("grayout");
});
$("#clear_elem").button().on("click", function () {
elem_list = [];
$("textarea[name=elems_container]").attr('rows', 1).val(elem_list);
$("input[name=interval]").attr("disabled", false).removeClass("grayout");
});
$(".oelem input").on("keydown", function (e) {
if (e.keyCode !== 9) {
$("#add_elem").addClass("makeRequired");
}
});
$("#singledate").on("change", function () {
if ($(this).is(':checked')) {
$("input[name=sdate]").parent().parent().children("th").text("Date:");
$("input[name=edate]").parent().parent().hide();
} else {
$("input[name=sdate]").parent().parent().children("th").text("Start Date:");
$("input[name=edate]").parent().parent().show();
}
});
$("input[name=elems]").on("keyup", function () {
if ($(this).val().search(",") >= 0 || $(this).val().length > 5) {
$(".oelem").hide();
} else {
$(".oelem").show();
$("input[name=season_start]").val("").parent().parent().hide();
}
});
$("input[name=name]").on({
focus: function () {
$("input[name=name]").val($("input[name=elems]").val());
},
keyup: function () {
if ($(this).val().length >= 3) {
if ($(this).val().search(/hdd/i) >= 0 || $(this).val().search(/cdd/i) >= 0 || $(this).val().search(/gdd/i) >= 0) {
$("input[name=base]").parent().parent().show();
} else {
$("input[name=base]").val("").parent().parent().hide();
}
} else if ($(this).val().length === 0) {
$("input[name=base]").val("").parent().parent().hide();
}
}
});
$("input[name=smry]").on("keyup", function () {
if ($(this).val().length >= 1) {
$("input[name=smry_add]").parent().parent().fadeIn('fast');
$("input[name=smry_n]").parent().parent().fadeIn('fast');
$("input[name=smry_only]").parent().parent().fadeIn('fast');
if ($(this).val().length >= 3 && $(this).val().substr(0, 3).toLowerCase() === 'run') {
$("input[name=smry_maxmissing]").parent().parent().fadeIn('fast');
} else {
$("input[name=smry_maxmissing]").parent().parent().fadeOut('fast');
}
} else if ($(this).val().length === 0) {
$("input[name=smry_add]").val('').parent().parent().fadeOut('fast');
$("input[name=smry_n]").val('').parent().parent().fadeOut('fast');
$("input[name=smry_only]").val('').parent().parent().fadeOut('fast');
$("input[name=smry_maxmissing]").val('').parent().parent().fadeOut('fast');
}
});
$("input[name=reduce]").on("keyup", function () {
if ($(this).val().length >= 1) {
$("input[name=reduce_add]").parent().parent().fadeIn('fast');
if ($(this).val().length >= 3 && $(this).val().substr(0, 3).toLowerCase() === 'run') {
$("input[name=reduce_n]").parent().parent().fadeIn('fast');
$("input[name=reduce_maxmissing]").parent().parent().fadeIn('fast');
} else {
$("input[name=reduce_n]").parent().parent().fadeOut('fast');
$("input[name=reduce_maxmissing]").parent().parent().fadeOut('fast');
}
} else if ($(this).val().length === 0) {
$("input[name=reduce_add]").val('').parent().parent().fadeOut('fast');
$("input[name=reduce_n]").val('').parent().parent().fadeOut('fast');
$("input[name=reduce_maxmissing]").val('').parent().parent().fadeOut('fast');
}
});
$("input[name=interval]").on("keyup", function () {
if ($(this).val().length >= 3) {
if ($(this).val().search(/yly/i) >= 0) {
$("input[name=groupby]").val("").parent().parent().hide();
} else {
$("input[name=groupby]").parent().parent().show();
}
} else if ($(this).val().length === 0) {
$("input[name=groupby]").parent().parent().show();
}
});
$("input[name=duration]").on("keyup", function () {
if ($(this).val().length >= 3 || $.isNumeric($(this).val())) {
if ($(this).val().search(/std/i) >= 0) {
$("input[name=season_start]").addClass("makeRequired").parent().parent().show();
} else {
$("input[name=season_start]").removeClass("makeRequired").val("").parent().parent().hide();
}
if ($(this).val().search(/dly/i) >= 0 || ($(this).val() === "1" && $("input[name=interval]").val().search(/dly/i) >= 0)) {
$("input[name=reduce]").removeClass("makeRequired").val("").parent().parent().hide();
$("input[name=reduce_add]").val('').parent().parent().hide();
$("input[name=reduce_n]").val('').parent().parent().hide();
$("input[name=reduce_maxmissing]").val('').parent().parent().hide();
$("input[name=maxmissing]").val("").parent().parent().hide();
$("input[name=add]").parent().parent().show();
} else {
$("input[name=reduce]").addClass("makeRequired").parent().parent().show();
$("input[name=maxmissing]").parent().parent().show();
$("input[name=add]").val("").parent().parent().hide();
}
}
});
}
function go_general() {
var areaname;
$("#prelimMsg").hide();
$("#specs").empty().append('<h2>Required input<\/h2>' +
'<table class="input_opts">' +
'<tr><th>Area:<td><select name="area">' +
'<option>state<\/option><option>county<\/option><option>climdiv<\/option><option>cwa<\/option><option>basin<\/option>' +
'<\/select><\/tr>' +
'<tr class="gqual"><td colspan=2><span style="font-style:italic;">Enter one of the following qualifiers<\/span><\/tr>' +
'<tr class="gqual"><th>State:<td><input type="text" name="state" size=11 \/><\/tr>' +
'<tr class="gqual"><th>ID:<td><input type="text" name="id" size=11 \/><\/tr>' +
'<tr class="gqual"><th>Bounding box:<td><input type="text" name="bbox" size=22 \/><\/tr>' +
'<\/table>' +
'<h2>Optional input<\/h2>' +
'<table class="input_opts">' +
'<tr><th>Meta options:<td><input type="text" name="meta" size=52 \/><\/tr>' +
'<\/table>' +
'<p><button id="request_submit" class="submitButton">Submit<\/button><\/p>');
$("#specs :input").addClass("ui-widget-content ui-corner-all ui-state-default");
$("#select[name=area]").addClass("ui-widget-content ui-corner-all ui-state-default");
$("#request_submit").button();
$(".gqual input").on("keyup", function () {
if ($(this).val().length) {
areaname = $(this).attr("name");
$(".gqual").each(function () {
if ($(this).find("input").attr("name") !== areaname) {
$(this).fadeOut('fast');
}
});
} else if ($(this).val().length === 0) {
$(".gqual").fadeIn('fast');
}
});
table_events("input", "bbox", "bbox_table");
table_events("input", "state", "state_table");
table_events("input", "meta", "general_table");
}
function go_multistndata() {
var areaname;
$("#prelimMsg").hide();
$("#specs").empty().append('<h2>Required input<\/h2>' +
'<table class="input_opts">' +
'<tr class="areatype"><td colspan=2><span style="font-style:italic;">(Enter id(s) for one of the following area types)<\/span><\/tr>' +
'<tr class="areatype"><th>County:<td><input type="text" name="county" size=22 \/><\/tr>' +
'<tr class="areatype"><th>Climate division:<td><input type="text" name="climdiv" size=22 \/><\/tr>' +
'<tr class="areatype"><th>CWA:<td><input type="text" name="cwa" size=22 \/><\/tr>' +
'<tr class="areatype"><th>Basin:<td><input type="text" name="basin" size=22 \/><\/tr>' +
'<tr class="areatype"><th>State:<td><input type="text" name="state" size=22 \/><\/tr>' +
'<tr class="areatype"><th>Bounding box:<td><input type="text" name="bbox" size=22 \/><\/tr>' +
'<tr class="areatype"><th>Station list:<td><input type="text" name="sids" size=22 \/><\/tr>' +
'<tr><th>Start Date:<td><input type="text" name="sdate" size=12 \/><input type="checkbox" id="singledate" \/>single date<\/tr>' +
'<tr><th>End Date:<td><input type="text" name="edate" size=12 \/><\/tr>' +
'<tr><th>Element name(s):<td><input type="text" name="elems" size=35 \/><\/tr>' +
'<\/table>' +
'<div id="elem_box" class="ui-helper-hidden">' +
'<span style="line-height:1.8em;font-weight:bold;">Elements:<\/span>' +
'<br \/><textarea name="elems_container" rows="1" cols="65" \/>' +
'<\/div>' +
'<h2 class="oelem">Optional element specifications<\/h2>' +
'<table class="oelem elems_opts">' +
'<tr><th>Name:<td><input type="text" name="name" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Base:<td><input type="text" name="base" size=12 \/><\/tr>' +
'<tr><th>Interval:<td><input type="text" name="interval" size=12 \/><\/tr>' +
'<tr><th>Duration:<td><input type="text" name="duration" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Season start:<td><input type="text" name="season_start" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Add:<td><input type="text" name="add" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Reduction:<td><input type="text" name="reduce" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th style="padding-left:1em;">• Add:<td><input type="text" name="reduce_add" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th style="padding-left:1em;">• Number:<td><input type="text" name="reduce_n" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th style="padding-left:1em;">• Run max miss:<td><input type="text" name="reduce_maxmissing" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Max missing:<td><input type="text" name="maxmissing" size=12 \/><\/tr>' +
'<tr><th>Summary:<td><input type="text" name="smry" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th style="padding-left:1em;">• Add:<td><input type="text" name="smry_add" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th style="padding-left:1em;">• Smry number:<td><input type="text" name="smry_n" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th style="padding-left:1em;">• Run max miss:<td><input type="text" name="smry_maxmissing" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Summary only:<td><input type="text" name="smry_only" size=12 \/><\/tr>' +
'<tr><th>Normal:<td><input type="text" name="normal" size=12 \/><\/tr>' +
'<tr><th>Group by:<td><input type="text" name="groupby" size=12 \/><\/tr>' +
'<tr><th>Precision:<td><input type="text" name="prec" size=12 \/><\/tr>' +
'<tr><td colspan=2 style="text-align:center;"><button id="add_elem">Add element<\/button><button id="clear_elem">Clear elements<\/button><\/tr>' +
'<\/table>' +
'<h2>Other optional input<\/h2>' +
'<table class="input_opts">' +
'<tr><th>Meta options:<td><input type="text" name="meta" size=52 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Output option:<td><input type="text" name="output" size=12 \/><\/tr>' +
'<\/table>' +
'<p><button id="request_submit" class="submitButton">Submit<\/button><\/p>');
$("#specs :input").addClass("ui-widget-content ui-corner-all ui-state-default");
$("#request_submit").button();
add_element_interaction();
$(".areatype input").on("keyup", function () {
if ($(this).val().length) {
areaname = $(this).attr("name");
$(".areatype").each(function () {
if ($(this).find("input").attr("name") !== areaname) {
$(this).fadeOut('fast');
}
});
$(".areatype th").css("padding-left", "0em");
} else if ($(this).val().length === 0) {
$(".areatype th").css("padding-left", "1em");
$(".areatype").fadeIn('fast');
}
});
$("#singledate").on("change", function () {
if ($(this).is(':checked') && $("input[name=meta]").val().length === 0) {
$("input[name=output]").parent().parent().show();
} else {
$("input[name=output]").parent().parent().hide();
}
});
table_events("input", "bbox", "area_table");
table_events("input", "state", "area_table");
table_events("input", "meta", "meta_table");
}
function go_stndata() {
$("#prelimMsg").hide();
$("#specs").empty().append('<h2>Required input<\/h2>' +
'<table class="input_opts">' +
'<tr><th>Station id:<td><input type="text" name="sid" size=12 \/><\/tr>' +
'<tr><th>Start Date:<td><input type="text" name="sdate" size=12 \/><input type="checkbox" id="singledate" \/>single date<\/tr>' +
'<tr><th>End Date:<td><input type="text" name="edate" size=12 \/><\/tr>' +
'<tr><th>Element name(s):<td><input type="text" name="elems" size=35 \/><\/tr>' +
'<\/table>' +
'<div id="elem_box" class="ui-helper-hidden">' +
'<span style="line-height:1.8em;font-weight:bold;">Elements:<\/span>' +
'<br \/><textarea name="elems_container" rows="1" cols="65" \/>' +
'<\/div>' +
'<h2 class="oelem">Optional element specifications<\/h2>' +
'<table class="oelem elems_opts">' +
'<tr><th>Name:<td><input type="text" name="name" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Base:<td><input type="text" name="base" size=12 \/><\/tr>' +
'<tr><th>Interval:<td><input type="text" name="interval" size=12 \/><\/tr>' +
'<tr><th>Duration:<td><input type="text" name="duration" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Season start:<td><input type="text" name="season_start" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Add:<td><input type="text" name="add" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Reduction:<td><input type="text" name="reduce" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th style="padding-left:1em;">• Add:<td><input type="text" name="reduce_add" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th style="padding-left:1em;">• Number:<td><input type="text" name="reduce_n" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th style="padding-left:1em;">• Run max miss:<td><input type="text" name="reduce_maxmissing" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Max missing:<td><input type="text" name="maxmissing" size=12 \/><\/tr>' +
'<tr><th>Summary:<td><input type="text" name="smry" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th style="padding-left:1em;">• Add:<td><input type="text" name="smry_add" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th style="padding-left:1em;">• Smry number:<td><input type="text" name="smry_n" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th style="padding-left:1em;">• Run max miss:<td><input type="text" name="smry_maxmissing" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Summary only:<td><input type="text" name="smry_only" size=12 \/><\/tr>' +
'<tr><th>Normal:<td><input type="text" name="normal" size=12 \/><\/tr>' +
'<tr><th>Group by:<td><input type="text" name="groupby" size=12 \/><\/tr>' +
'<tr><th>Precision:<td><input type="text" name="prec" size=12 \/><\/tr>' +
'<tr><td colspan=2 style="text-align:center;"><button id="add_elem">Add element<\/button><button id="clear_elem">Clear elements<\/button><\/tr>' +
'<\/table>' +
'<h2>Other optional input<\/h2>' +
'<table class="input_opts">' +
'<tr><th>Meta options:<td><input type="text" name="meta" size=52 \/><\/tr>' +
'<tr><th>Output option:<td><input type="text" name="output" size=12 \/><\/tr>' +
'<\/table>' +
'<p><button id="request_submit" class="submitButton">Submit<\/button><\/p>');
$("#specs :input").addClass("ui-widget-content ui-corner-all ui-state-default");
$("#request_submit").button();
add_element_interaction();
table_events("input", "meta", "meta_table");
}
function go_stnmeta() {
var others;
$("#prelimMsg").hide();
$("#specs").empty().append('<h2>Required input<\/h2>' +
'<table class="input_opts" style="margin-top:8px;">' +
'<tr class="mmeta"><td colspan=2><span style="font-style:italic;">(Enter one or more of the following)<\/span><\/tr>' +
'<tr><th>Station id(s):<td><input type="text" name="sids" size=22 \/><\/tr>' +
'<tr class="mmeta"><th>County:<td><input type="text" name="county" size=22 \/><\/tr>' +
'<tr class="mmeta"><th>Climate division:<td><input type="text" name="climdiv" size=22 \/><\/tr>' +
'<tr class="mmeta"><th>CWA:<td><input type="text" name="cwa" size=22 \/><\/tr>' +
'<tr class="mmeta"><th>Basin:<td><input type="text" name="basin" size=22 \/><\/tr>' +
'<tr class="mmeta"><th>State:<td><input type="text" name="state" size=22 \/><\/tr>' +
'<tr class="mmeta"><th>Bounding box:<td><input type="text" name="bbox" size=22 \/><\/tr>' +
'<\/table>' +
'<h2>Optional input<\/h2>' +
'<table class="input_opts">' +
'<tr><th>Meta options:<td><input type="text" name="meta" size=52 \/><\/tr>' +
'<tr class="ometa"><th>Elements:<td><input type="text" name="elems" size=52 \/><\/tr>' +
'<tr class="ometa"><th>Start Date:<td><input type="text" name="sdate" size=12 \/><input type="checkbox" id="singledate" \/>single date<\/tr>' +
'<tr class="ometa"><th>End Date:<td><input type="text" name="edate" size=12 \/><\/tr>' +
'<tr><th>Output option:<td><input type="text" name="output" size=12 \/><\/tr>' +
'<\/table>' +
'<p><button id="request_submit" class="submitButton">Submit<\/button><\/p>');
$("#specs :input").addClass("ui-widget-content ui-corner-all ui-state-default");
$("#request_submit").button();
$(".ometa").hide();
$(".mmeta input").on("keyup", function () {
if ($(this).val().length) {
$("input[name=sids]").parent().parent().fadeOut('fast');
$(".ometa").show();
} else {
others = 0;
$(".mmeta input").each(function (i, j) {
others += j.value.length;
});
if (!others) {
$("input[name=sids]").parent().parent().fadeIn('fast');
$(".ometa").hide();
}
}
});
$("input[name=sids]").on("keyup", function () {
if ($(this).val().length) {
$(".mmeta").fadeOut('fast');
} else {
$(".mmeta").fadeIn('fast');
}
});
$("input[name=meta]").on("keyup", function () {
if ($(this).val().length) {
$("input[name=output]").parent().parent().fadeOut('fast');
} else {
$("input[name=output]").parent().parent().fadeIn('fast');
}
if ($(this).val().search(/valid_daterange/i) >= 0) {
$("input[name=elems]").addClass("makeRequired").parent().parent().show();
} else if ($("input[name=sids]").val().length) {
$("input[name=elems]").removeClass("makeRequired").parent().parent().hide();
}
});
$("#singledate").on("change", function () {
if ($(this).is(':checked')) {
$("input[name=sdate]").parent().parent().children("th").text("Date:");
$("input[name=edate]").parent().parent().hide();
} else {
$("input[name=sdate]").parent().parent().children("th").text("Start Date:");
$("input[name=edate]").parent().parent().show();
}
});
table_events("input", "bbox", "area_table");
table_events("input", "state", "area_table");
table_events("input", "meta", "meta_table");
}
function go_griddata() {
var areaname, hwchoice;
$("#prelimMsg").show();
$("#specs").empty().append('<h2>Required input<\/h2>' +
'<table class="input_opts">' +
'<tr class="areatype"><td colspan=2><span style="font-style:italic;">(Enter information for one of the following grid selection types)<\/span><\/tr>' +
'<tr class="areatype"><th>Point location:<td><input type="text" name="loc" size=22 \/><\/tr>' +
'<tr class="areatype"><th>State:<td><input type="text" name="state" size=22 \/><\/tr>' +
'<tr class="areatype"><th>Bounding box:<td><input type="text" name="bbox" size=22 \/><\/tr>' +
'<tr><th>Start Date:<td><input type="text" name="sdate" size=12 \/><input type="checkbox" id="singledate" \/>single date<\/tr>' +
'<tr><th>End Date:<td><input type="text" name="edate" size=12 \/><\/tr>' +
'<tr><th>Grid id:<td><input type="text" name="grid" size=12 \/><\/tr>' +
'<tr><th>Element name(s):<td><input type="text" name="elems" size=35 \/><\/tr>' +
'<\/table>' +
'<div id="elem_box" class="ui-helper-hidden">' +
'<span style="line-height:1.8em;font-weight:bold;">Elements:<\/span>' +
'<br \/><textarea name="elems_container" rows="1" cols="65" \/>' +
'<\/div>' +
'<h2 class="oelem">Optional element specifications<\/h2>' +
'<table class="oelem elems_opts">' +
'<tr><th>Name:<td><input type="text" name="name" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Base:<td><input type="text" name="base" size=12 \/><\/tr>' +
'<tr><th>Interval:<td><input type="text" name="interval" size=12 \/><\/tr>' +
'<tr><th>Duration:<td><input type="text" name="duration" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Season start:<td><input type="text" name="season_start" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Reduction:<td><input type="text" name="reduce" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Max missing:<td><input type="text" name="maxmissing" size=12 \/><\/tr>' +
'<tr><th>Summary:<td><input type="text" name="smry" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden"><th>Summary only:<td><input type="text" name="smry_only" size=12 \/><\/tr>' +
'<tr><th>Units:<td><input type="text" name="units" size=12 \/><\/tr>' +
'<tr><th>Area reduction:<td><input type="text" name="area_reduce" size=12 \/><\/tr>' +
'<tr><td colspan=2 style="text-align:center;"><button id="add_elem">Add element<\/button><button id="clear_elem">Clear elements<\/button><\/tr>' +
'<\/table>' +
'<h2>Other optional input<\/h2>' +
'<table class="input_opts">' +
'<tr><th>Meta options:<td><input type="text" name="meta" size=12 \/><\/tr>' +
'<tr><th>Output option:<td><input type="text" name="output" size=12 \/><\/tr>' +
'<tr><th>Generate map: <input type="checkbox" id="showimgopts" \/><\/tr>' +
'<tr class="ui-helper-hidden image_opts"><th style="padding-left:1em;">• Info only:<td><input type="text" name="info_only" size=12" \/><\/tr>' +
'<tr class="ui-helper-hidden image_opts"><th style="padding-left:1em;">• Proj:<td><input type="text" name="proj" size=12 value="lcc" \/><\/tr>' +
'<tr class="ui-helper-hidden image_opts"><th style="padding-left:1em;">• Overlays:<td><input type="text" name="overlays" size=12 value="state" \/><\/tr>' +
'<tr class="ui-helper-hidden image_opts"><th style="padding-left:1em;">• Interp:<td><input type="text" name="interp" size=12 value="cspline" \/><\/tr>' +
'<tr class="ui-helper-hidden image_opts"><th style="padding-left:1em;">• Cmap:<td><input type="text" name="cmap" size=12 value="Blues" \/><\/tr>' +
'<tr class="ui-helper-hidden image_opts image-size"><th style="padding-left:1em;">• Width:<td><input type="text" name="width" size=12 value=350 \/><\/tr>' +
'<tr class="ui-helper-hidden image_opts image-size"><th style="padding-left:1em;">• Height:<td><input type="text" name="height" size=12 \/><\/tr>' +
'<tr class="ui-helper-hidden image_opts"><th style="padding-left:1em;">• Levels:<td><input type="text" name="levels" size=22 \/><\/tr>' +
'<\/table>' +
'<p><button id="request_submit" class="submitButton">Submit<\/button><\/p>');
$("#specs :input").addClass("ui-widget-content ui-corner-all ui-state-default");
$("#request_submit").button();
add_element_interaction();
$(".areatype input").on("keyup", function () {
if ($(this).val().length >= 1 && $(".areatype :visible").length > 3) {
areaname = $(this).attr("name");
$(".areatype").each(function () {
if ($(this).find("input").attr("name") !== areaname) {
$(this).fadeOut('fast');
}
});
if (areaname === 'loc') {
$("input[name=area_reduce]").val("").parent().parent().fadeOut('fast');
} else {
$("input[name=area_reduce]").parent().parent().fadeIn('fast');
}
$(".areatype th").css("padding-left", "0em");
} else if ($(this).val().length === 0) {
$(".areatype th").css("padding-left", "1em");
$(".areatype").fadeIn('fast');
}
});
$("input[name=output]").on("keyup", function () {
var checked = $("#showimgopts").attr("checked");
if ($(this).val().length >= 3 && $(this).val().search(/image/i) === 0) {
if (checked !== "checked") {
$("#showimgopts").trigger("click");
}
} else if ($(this).val().length === 0) {
if (checked === "checked") {
$("#showimgopts").trigger("click");
}
}
});
$("#showimgopts").on("change", function () {
if ($(this).is(':checked')) {
$(".image_opts").fadeIn('fast');
if ($("input[name=output]").val().search(/image/i) === 0) {
$("input[name=info_only]").parent().parent().hide();
}
} else {
$(".image_opts").fadeOut('fast');
}
});
$(".image-size input").on("keyup", function () {
if ($(this).val().length >= 1) {
hwchoice = $(this).attr("name");
$(".image-size").each(function () {
if ($(this).find("input").attr("name") !== hwchoice) {
$(this).fadeOut('fast').find("input").val("");
}
});
} else if ($(this).val().length === 0) {
$(".image-size").fadeIn('fast');
}
});
table_events("input", "bbox", "bbox_table");
table_events("input", "state", "state_table");
table_events("input", "meta", "grid_meta_table");
}
$(function () {
$('<div id="wstypebar"><\/div>')
.appendTo("#builder")
.buttonBar({
barName: "wstype",
barOrient: "horizontal",
buttonInfo: [["stnmeta_button", "StnMeta"], ["stndata_button", "StnData"], ["multistndata_button", "MultiStnData"], ["griddata_button", "GridData"], ["general_button", "General"]],
buttonDefault: "stnmeta_button"
});
$("#wstype input").on("click", function () {
$(".codes").parent().hide();
$("#output").hide();
});
$("#stnmeta_button").val("StnMeta").on("click", go_stnmeta).click();
$("#stndata_button").val("StnData").on("click", go_stndata);
$("#multistndata_button").val("MultiStnData").on("click", go_multistndata);
$("#griddata_button").val("GridData").on("click", go_griddata);
$("#general_button").val("General/").on("click", go_general);
$("#builder").append('<div id="prelimMsg" class="ui-helper-hidden">... Preliminary Release - subject to change based on feedback ...</div>');
$("#infoDialog").dialog({
autoOpen: false,
modal: true,
show: true,
hide: true,
position: "center",
width: "auto"
});
$("#request_submit").live("click", collect_data);
$(".makeRequired").live("change", function () {
$(this).removeClass("makeRequired");
});
$(".codes").live("click", function () {
$("#infoDialog").dialog("option", "title", $(this).find('caption').text()).html($(this).parent().html()).dialog('open');
$("#infoDialog caption").remove();
});
// setup all events for all the tables (except bbox, state and meta, which differ between General and others)
table_events("input", "add", "add_table");
table_events("input", "basin", "area_table");
table_events("input", "climdiv", "area_table");
table_events("input", "county", "area_table");
table_events("input", "cwa", "area_table");
table_events("input", "duration", "duration_table");
table_events("input", "edate", "date_table");
table_events("input", "elems", "elems_table");
table_events("input", "id", "general_table");
table_events("input", "interval", "interval_table");
table_events("input", "maxmissing", "maxmissing_table");
table_events("input", "name", "elems_table");
table_events("input", "normal", "normal_table");
table_events("input", "output", "output_table");
table_events("input", "prec", "prec_table");
table_events("input", "reduce", "reduce_table");
table_events("input", "reduce_add", "reduce-smry_add_table");
table_events("input", "reduce_n", "reduce-smry_n_table");
table_events("input", "reduce_maxmissing", "reduce-smry_maxmissing_table");
table_events("input", "sdate", "date_table");
table_events("input", "season_start", "season_start_table");
table_events("input", "sid", "sid_table");
table_events("input", "sids", "sid_table");
table_events("input", "smry", "smry_table");
table_events("input", "smry_add", "reduce-smry_add_table");
table_events("input", "smry_only", "smry_only_table");
table_events("input", "smry_n", "reduce-smry_n_table");
table_events("input", "smry_maxmissing", "reduce-smry_maxmissing_table");
table_events("select", "area", "general_table");
table_events("textarea", "elems_container", "elems_keys_table");
table_events("input", "grid", "grid_table");
table_events("input", "loc", "loc_table");
table_events("input", "area_reduce", "area_reduce_table");
table_events("input", "type", "type_table");
table_events("input", "info_only", "info_only_table");
table_events("input", "proj", "proj_table");
table_events("input", "overlays", "overlays_table");
table_events("input", "interp", "interp_table");
table_events("input", "cmap", "cmap_table");
table_events("input", "width", "width_height_table");
table_events("input", "height", "width_height_table");
table_events("input", "levels", "levels_table");
table_events("input", "groupby", "groupby_table");
table_events("input", "units", "units_table");
// Ajax error handling
$.ajaxSetup({
error: function (x, e) {
if (x.status === 0) {
$("#jresults").empty().html("<pre>" + serverUrl + " is offline - check your network.<\/pre>");
} else if (x.status === 404) {
$("#jresults").empty().html("<pre>Requested URL not found.<\/pre>");
} else if (x.status === 500) {
$("#jresults").empty().html("<pre>Internal Server Error.<\/pre>");
} else if (e === "parsererror") {
$("#jresults").empty().html("<pre>Error parsing JSON response.<\/pre>");
} else if (e === "timeout") {
$("#jresults").empty().html("<pre>Request timed out<\/pre>.");
} else {
$("#jresults").empty().html("<pre>Error: " + x.responseText + "<\/pre>");
}
}
});
});
</script>
</head>
<body>
<div class="pagecontainer">
<h2 style="margin-bottom:0px;">ACIS Query Builder</h2>
<div id="builder"></div>
<div id="allspecs">
<div id="specs"></div>
<!-- <hr /> -->
<div id="sid_table">
<table class="codes">
<caption>Station Id Types</caption>
<tr><th>Type <th>Code <th>Description <th>Example</tr>
<tr><td>WBAN <td>1 <td>5-digit WBAN id <td>14742</tr>
<tr><td>COOP <td>2 <td>6-digit COOP id <td>304174</tr>
<tr><td>FAA <td>3 <td>3-character FAA id <td>LAX</tr>
<tr><td>WMO <td>4 <td>5-digit WMO id <td>72223</tr>
<tr><td>ICAO <td>5 <td>4-character ICAO id <td>KGRR</tr>
<tr><td>GHCN <td>6 <td>11-character GHCN id <td>USW00003927</tr>
<tr><td>NWSLI<td>7 <td>5-character NWSLI <td>AURN6</tr>
<tr><td>RCC <td>8 <td>RCC local id <td>301402</tr>
<tr><td>ThreadEx <td>9 <td>6-character ThreadEx id <td>HSVthr</tr>
<tr><td>CoCoRaHS <td>10 <td>8-character CoCoRaHS id <td>NYTM0004</tr>
<!--
<tr><td>16 <td>AWDN <td>7-character HPRCC AWDN id <td>a250059</tr>
-->
</table>
</div>
<div id="elems_table">
<table class="codes">
<caption>Common Element Codes</caption>
<tr><th>Abbreviation <th>Var Major <th>Description</tr>
<tr><td>maxt <td>1 <td>Maximum temperature </tr>
<tr><td>mint <td>2 <td>Minimum temperature </tr>
<tr><td>avgt <td>43 <td>Average temperature </tr>
<tr><td>obst <td>3 <td>Obs time temperature </tr>
<tr><td>pcpn <td>4 <td>Precipitation </tr>
<tr><td>snow <td>10 <td>Snowfall </tr>
<tr><td>snwd <td>11 <td>Snow Depth </tr>
<tr><td> <td>7 <td>Pan evap (inches) </tr>
<tr><td>cdd <td>44 <td>Degree days above base (CDD) (default base 65) </tr>
<tr><td>hdd <td>45 <td>Degree days below base (HDD) (default base 65) </tr>
<tr><td>gdd <td>- <td>Growing Degree Days (base 50) </tr>
<tr><td>cddXX<td>- <td>Cooling Degree Days; where XX is base temperature </tr>
<tr><td>hddXX<td>- <td>Heating Degree Days; where XX is base temperature </tr>
<tr><td>gddXX<td>- <td>Growing Degree Days; where XX is base temperature </tr>
<tfoot>
<tr><td colspan=3>Degree days can also be specified within an <code>elems</code>
object with the keys "name" (or "vX") and "base".</tr>
</tfoot>
</table>
</div>
<div id="meta_table">
<table class="codes">
<caption>Meta Options</caption>
<tr><th>Code <th>Description </tr>
<tr><td>name <td>Station name </tr>
<tr><td>state <td>2-letter state abbrev </tr>
<tr><td>sids <td>Array of station ids/types </tr>
<tr><td>ll <td>Longitude and latitude </tr>
<tr><td>elev <td>Elevation </tr>
<tr><td>uid <td>ACIS id </tr>
<tr><td>county<td>5-digit FIPS id </tr>
<tr><td>climdiv<td>4-character climate division id </tr>
<tr><td>valid_daterange <td>Valid date range (by variable) </tr>
</table>
</div>
<div id="grid_meta_table">
<table class="codes">
<caption>Meta Options</caption>
<tr><th>Code <th>Description </tr>
<tr><td>ll <td>Longitude and latitude of grid points </tr>
<tr><td>elev <td>Elevation of grid points </tr>
</table>
</div>
<div id="reduce-smry_add_table">
<table class="codes">
<caption>Reduction/Summary Add Codes</caption>
<thead>
<tr><th>Code <th>Description</tr>
</thead>
<tbody>
<tr><td>mcnt <td>Count of missing values in the reduction period </tr>
<tr><td>date <td>Date of occurrence (for max, min, run) </tr>
<tr><td>value <td>Value on date of occurrence (for first and last) </tr>
<tr><td>rmcnt <td>Count of missing values in the run period (for run only)</tr>
</tbody>
</table>
</div>
<div id="smry_only_table">
<table class="codes">
<caption>Summary Only</caption>
<thead>
<tr><th>Code <th>Description</tr>
</thead>
<tbody>
<tr><td>1 <td>Return only the summary value (no intermediate results). If used, must be specified for each element.</tr>
</tbody>
</table>
</div>
<div id="reduce-smry_n_table">
<table class="codes">
<caption>Reduction/Summary Number</caption>
<thead>
<tr><th>Value <th>Description</tr>
</thead>
<tbody>
<tr><td><i>integer</i> <td>Used with "run" reduction to specify max number of results returned per interval. </tr>
</tbody>
</table>
</div>
<div id="reduce-smry_maxmissing_table">
<table class="codes">
<caption>Reduction/Summary Run Max Missing</caption>
<thead>
<tr><th>Value <th>Description</tr>
</thead>
<tbody>
<tr><td><i>integer</i> <td>Used with "run" reduction to specify max number of missing days to allow before terminating run. </tr>
</tbody>
</table>
</div>
<div id="add_table">
<table class="codes">
<caption>Additions Codes</caption>
<thead>
<tr><th>Code <th>Description</tr>
</thead>
<tbody>
<tr><td>f <td>Flags </tr>
<tr><td>t <td>Time of observation </tr>
<tr><td>i <td>Station ID associated with data </tr>
<tr><td>v <td>Var minor associated with data </tr>
<tr><td>n <td>Network associated with data </tr>
</tbody>
</table>
</div>
<div id="normal_table">
<table class="codes">
<caption>Normals Codes</caption>
<thead>
<tr><th>Code <th>Description</tr>
</thead>
<tbody>
<tr><td>1 <td>Display normals </tr>
<tr><td>departure <td>Display departure from normal </tr>
<tr><td colspan="2">Normals are for the period 1981-2010 </tr>
</tbody>
</table>
</div>
<div id="interval_table">
<table class="codes">
<caption>Interval Options</caption>
<tr><th>Code <th>Description</tr>
<tr><td>dly <td>results have daily time step </tr>
<tr><td>mly <td>results have monthly time step </tr>
<tr><td>yly <td>results have yearly time step </tr>
<tr><td><i>list</i> <td>documentation forthcoming </tr>
</table>
</div>
<div id="duration_table">
<table class="codes">
<caption>Duration Options</caption>
<tr><th>Code <th>Description <th>Valid with intervals</tr>
<tr><td>dly <td>daily <td>dly </tr>
<tr><td>mly <td>monthly <td>mly </tr>
<tr><td>yly <td>yearly <td>yly </tr>
<tr><td>mtd <td>month-to-date <td>dly </tr>
<tr><td>ytd <td>year-to-date <td>dly, mly </tr>
<tr><td>std <td>season-to-date <td>dly, mly </tr>
<tr><td><i>integer</i> <td>length of data to be analyzed in units specified in interval <td>dly, mly, yly </tr>
<tr><td colspan=3 style="text-align:center;">Advanced options will be described in documentation. </tr>
</table>
</div>
<div id="reduce_table">
<table class="codes">
<caption>Reduction Types</caption>
<thead>
<tr><th>Code <th>Description</tr>
</thead>
<tbody>
<tr><td>max <td>Maximum value for the period </tr>
<tr><td>min <td>Minimum value for the period </tr>
<tr><td>sum <td>Sum of the values for the period </tr>
<tr><td>mean <td>Average of the values for the period </tr>
<tr><td>stdev <td>Standard deviation of the values (GridData only) </tr>
<tr><td>cnt_xx_yyy <td>Count of number of daily values exceeding threshold </tr>
<tr><td>pct_xx_yyy <td>Percent (integer) of daily values exceeding threshold </tr>
<tr><td>fct_xx_yyy <td>Fraction (float) of daily values exceeding threshold </tr>
<tr><td>first_xx_yyy <td>First occurrence of daily value exceeding threshold </tr>
<tr><td>last_xx_yyy <td>Last occurrence of daily value exceeding threshold </tr>
<tr><td>run_xx_yyy <td>Consecutive daily values exceeding threshold </tr>
<tr><td> <td>xx is operator (ge, gt, le, lt, eq, ne)<br />
yyy is threshold (integer or floating point)<br ?>
Examples: cnt_ge_0.01, pct_eq_100</tr>
</tbody>
</table>
</div>
<div id="smry_table">
<table class="codes">