-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·1774 lines (1648 loc) · 58.2 KB
/
index.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
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 lang="en">
<head>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-122671965-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-122671965-1');
</script>
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="width=device-width, shrink-to-fit=no, initial-scale=1" name="viewport">
<meta content="" name="description">
<meta content="" name="author"><!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/theme.css" rel="stylesheet"><!-- Custom CSS -->
<link href="css/simple-sidebar.css" rel="stylesheet"><!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<meta content="Doxygen 1.8.11" name="generator">
<link rel="icon" href="apple-icon.png">
<title>Ocean Navigator API</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="css/plotInfo.css" rel = "stylesheet" type ="text/css">
<link href="documentation.css" rel="stylesheet" type="text/css">
<link href="functions.css" rel="stylesheet" type="text/css">
<script src="jquery.js" type="text/javascript">
</script>
<script src="dynsections.js" type="text/javascript">
</script>
<link href="navtree.css" rel="stylesheet" type="text/css">
<script src="resize.js" type="text/javascript">
</script>
<script src="navtreedata.js" type="text/javascript">
</script>
<script src="navtree.js" type="text/javascript">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css">
<script src="search/searchdata.js" type="text/javascript">
</script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="search/search.js" type="text/javascript">
</script>
<script type="text/javascript">
$(document).ready(function () { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<!-- Sidebar -->
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li>
<img src="apple-icon.png">
</li>
<li class="sidebar-brand">Ocean Navigator API</li>
<li>
<a href="#documentation" onclick="openTab(event, 'Documentation')">Documentation</a>
</li>
<li>
<a href="#DataInfo" onclick="openTab(event, 'Input_Options'); getDatasets()">API Dataset Information</a>
</li>
<li>
<a href="#PlotInfo" onclick="openTab(event, 'Contact')">Plotting Information</a>
</li>
</ul>
</div><!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container-fluid" style="width: 100%">
<!--
<div onload="load_home()" class="tabcontent" id="Home">
<h3>Welcome to the Ocean Navigator API Guide</h3>-->
<!--<img class='mainImage' src="main_page.jpg">
</div>-->
<!--</div>
</div>-->
<!--<div class="page-content-wrapper">
<div class="container_fluid">-->
<div class="tabcontent" id="Documentation">
<button onclick="toggleSidebar()" style="float: left; font-size: 22px;"><i class="fa fa-bars"></i></button>
<h3 style="padding-left: 40px;">API Documentation</h3>
<div id="top">
</div>
<h2 class="groupheader">
<a id="func-members" name="func-members"></a> How To:</h2>
<div class="how_to">
<div class='all_content' id="query_construct_all">
<div class='expand-button'>
<button class='howto_button' id="query_construct_button" onclick="openContents(event, 'query_construct', 'query_construct_all', 'query_construct_button')">
<span>
<i class='fa fa-angle-down' style='font-size: 20px;'></i>
<h4 style='display: inline; padding: 20px'>Format a Query</h4>
</span>
</button>
</div>
<div class='expand-contents' id="query_construct" border="1">
The Ocean Navigator uses 2 different methods to receive API queries. </br>
Both methods require the query to be prepended with "http://navigator.oceansdata.ca/" </br>
The first method uses Query Parameters, and the second uses Template Parameters </br>
</br>
<b>(1) Query Parameters</b>
</br>
The query method uses a base query followed by the input parameters </br>
To indicate the start of variable input, a ? is used.
<br/> Similarly, to include more than one variable in the query, seperate each variable with a &
<br/> Variables included at the end of a query can be defined using
<br/> ?variable= ...
<br/>
<br/> Example:
<br/>
<pre class='whitespace'>
<a target="_blank" href="http://navigator.oceansdata.ca/api/variables/?dataset=giops_day&3d_only">http://navigator.oceansdata.ca/api/variables/?dataset=giops_day&3d_only</a><br/>
? : beginning of parameter input
dataset : parameter with assigned value
=giops_day : assigning value to dataset
& : indicates next parameter
3d_only : standalone parameter (no value)
</pre> When scripting, longer queries should be written in JSON and converted to encodedURI format
</br>
</br>
<b>(2) Template Parameters</b>
</br>
Template based parameters differ from query based parameters in various ways: </br>
<b>-</b> Parameter Order Matters </br>
<b>-</b> Parameter values are separated by '/' </br>
<b>-</b>Input paramater types must match expected parameter types </br>
This means you cannot provide an iteger if the query is expecting a string. </br>
The expectations for each query are outlined in the documentation below. </br>
</br>
Example:
<pre class='whitespace'>
<a target="_blank" href="http://navigator.oceansdata.ca/api/class4/forecasts/class4_20180531_GIOPS_CONCEPTS_2.3_profile/500">http://navigator.oceansdata.ca/api/class4/forecasts/class4_20180531_GIOPS_CONCEPTS_2.3_profile</a>
</br>
format: /api/class4/<string:q>/<string<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
</br>
/api/class4/ : Base
<string:q> : 1st Parameter Value
<string:class4_id> : 2nd Parameter Value <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
</pre> API Queries can be tested by copying and pasting the query into a browser, or can be automated by constructing them in
a script
</div>
</div>
<div class='all_content' id="query_construct_json_all">
<div class='expand-button'>
<button class='howto_button' id="query_construct_json_button" onclick="openContents(event, 'query_construct_json', 'query_construct_json_all', 'query_construct_json_button')">
<span>
<i class='fa fa-angle-down' style='font-size: 20px'></i>
<h4 style='display: inline; padding-left: 20px'>Construct a JSON API - Script</h4>
</span>
</button>
</div>
<div class='expand-contents' id="query_construct_json">
Using JSON to construct queries is very useful for creating long queries. </br>
It is both easier to make changes, as well as easier to read</br>
</br>
Although somewhat complicated, the example below is an excellent example of when you would want to use this method </br>
This example will save 10 images at 10 different timestamps to the current directory
<pre class='whitespace'>
from PIL import Image <div class='comments'>#Library used to save images</div>
import urllib <div class='comments'>#Library used to convert and open URL's</div>
<div class='comments'>#Constructs the JSON query - each line is a variable: value pair</div>
query = {
"scale": "-1.6,5",
"depth_limit": False,
"colormap": "default",
"dataset": "glorys3",
"showmap": True,
"variable": "votemper",
"surfacevariable": "none",
"time": 207,
"quantum": "month",
"path": [[47.649768922115356, -52.60316173355579], [45.227624722564485, -48.53822032730579]],
"type": "transect",
"linearthresh": 200,
}
<div class='comments'>#Loops through 10 different timestamps</div>
for t in range(0,10) <div class='comments'>#In practice, the range would be a valid time format</div>
query['time'] = t <div class='comments'>#Sets the time portion of the query</div>
<div class='comments'>#Constructs the URL</div>
url = "http://navigator.oceansdata.ca/plot/?" + urlliv.urlencode({
"query": json.dumps(query), <div class='comments'>#Converts the query from JSON to encodedURI</div>
"dpi" : "72",
"size" : "10x7",
})
<div class='comments'>#Opens the URL / Sends the API Request</div>
with closing(urllib.urlopen(url)) as f:
img = Image.open(f)
images.save("image" + str(t) + ".png", "PNG") <div class='comments'>#Saves the image as image{#}.png</div>
<a href="save_image.py" download><img class='icon_custom' src="savefile_icon.png"></a>
</pre> This will save an image for each time stamp in the specified range </br>
**Example written in python3**
</div>
</div>
<div class='all_content' id="query_usage_all">
<div class='expand-button'>
<button class='howto_button' id="query_usage_button" onclick="openContents(event, 'query_usage', 'query_usage_all', 'query_usage_button')">
<span>
<i class='fa fa-angle-down' style='font-size: 20px'></i>
<h4 style='display: inline; padding-left: 20px'>Construct a Formatted API Script</h4>
</span>
</button>
</div>
<div class='expand-contents' id="query_usage">
There are multiple ways to construct an API request in a script. 2 examples are given below.</br>
**Both examples will print 4 lists displaying the depths available for each of the variables specified** </br>
</br>
<b>(1) String Replacement</b>
</br>
In this example, the 3 curly brace sets "{}" will be replaced by the 3 values given in .format() </br>
These values can be assigned, incremented, or modified to make multiple automated API requests. </br>
<pre class='whitespace'>
import urllib
base_url = "http://navigator.oceansdata.ca/api/v1.0/depth/"
dataset = 'giops_day'
variables = ['votemper', 'vosaline', 'vozocrtx', 'vomecrty']
for variable in variables:
url = ('{}?dataset={}&variable={}'.format(base_url, dataset, variable))
f = urllib.urlopen(url)
output = f.read()
print(output)
<a href="print_depth_replacement.py" download><img class='icon_custom' src="savefile_icon.png"></a>
</pre> **Example written in python3** </br>
</br>
<b>(2) String Concatenation</b>
</br>
In this example, the variables are incorporated directly in place, and are concatenated together in the order they appear
</br>
The text given in quotations "..." are hardcoded strings which will become part of the query
<pre class='whitespace'>
import urllib
dataset = giops_day
variables = [votemper, vosaline, vozocrtx, vomecrty]
for variable in variables:
url = "http://navigator.oceansdata.ca/api/v1.0/depth/?dataset=" + dataset + "&variables=" + variable
f = urllib.urlopen(link)
output = f.read()
print(output)
<a href="print_depth_concatenate.py" download><img class='icon_custom' src="savefile_icon.png"></a>
</pre> **Example written in python3**
</div>
</div>
</div>
<div class="request_links">
<table class="memberdecls">
<tr class="heading">
<td colspan="2">
<h2 class="groupheader"><a id="func-members" name="func-members"></a>API Queries</h2>
</td>
</tr>
<!--DATASETS-->
<tr class="memitem:datasets">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#datasets">/api/v1.0/datasets/</a>
</td>
</tr>
<tr class="separator:datasets">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--DATASETS ID-->
<tr class="memitem:datasets_id">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#datasets_id">/api/v1.0/datasets/?id</a>
</td>
</tr>
<tr class="separator:datasets_id">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--VARIABLES-->
<tr class="memitem:variables">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#variables">/api/v1.0/variables/</a>
</td>
</tr>
<tr class="separator:variables">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--OBSERVATION VARIABLES-->
<tr class="memitem:observation_variables">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#observation_variables">/api/v1.0/observationvariables/</a>
</td>
</tr>
<tr class="separator:observation_variables">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--TIMESTAMPS-->
<tr class="memitem:timestamps">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#timestamps">/api/v1.0/timestamps/?dataset=' '</a>
</td>
</tr>
<tr class="separator:timestamps">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--DEPTH-->
<tr class="memitem:depth">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#depth">/api/v1.0/depth/?dataset=<string:dataset_id>&variable=<string:variable></a>
</td>
</tr>
<tr class="separator:depth">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--SCALE-->
<tr class="memitem:scale">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#scale">/api/v1.0/scale/<string:dataset>/<string:variable>/<string:scale>.png</a>
</td>
</tr>
<tr class="separator:scale">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--RANGE-->
<tr class="memitem:range">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#range">/api/v1.0/range/<string:dataset_id>/ <string:variable>/ <string:interp>/ <string:radius>/<string:neighbours>/<string:projection>/<string:extent>/<string:depth>/<string:time>.json</a>
</td>
</tr>
<tr class="separator:range">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--DATA-->
<tr class="memitem:data">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#data">/api/v1.0/data/<string:dataset>/<string:variable>/<string:date>/<string:Depth>/
<string:location>.json</a>
</td>
</tr>
<tr class="separator:data">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--CLASS4-->
<tr class="memitem:class4">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#class4">/api/v1.0/class4/<string:q>/<string:class4_id>/</a>
</td>
</tr>
<tr class="separator:class4">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--DRIFTERS-->
<tr class="memitem:drifters">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#drifters">/api/v1.0/drifters/<string:q>/<string:drifter_id></a>
</td>
</tr>
<tr class="separator:drifters">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--STATS-->
<tr class="memitem:stats">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#stats">/api/v1.0/stats/?query='...'</a>
</td>
</tr>
<tr class="separator:stats">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--SUBSET-->
<tr class="memitem:subset">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#subset">/api/v1.0/subset/?query='...'</a>
</td>
</tr>
<tr class="separator:subset">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--PLOT-->
<tr class="memitem:plot">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#plot">/api/v1.0/plot/?query='...'</a>
</td>
</tr>
<tr class="separator:plot">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--COLORS-->
<tr class="memitem:colors">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#colors">/api/v1.0/colors/</a>
</td>
</tr>
<tr class="separator:colors">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--COLORMAPS-->
<tr class="memitem:colormaps">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#colormaps">/api/v1.0/colormaps/</a>
</td>
</tr>
<tr class="separator:colormaps">
<td class="memSeparator" colspan="2"> </td>
</tr>
<!--COLORMAPS IMAGES-->
<tr class="memitem:colormaps_image">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#colormaps_image">/api/v1.0/colormaps.png</a>
</td>
</tr>
<tr class="separator:colormaps_image">
<td class="memSeparator" colspan="2"> </td>
</tr>
<tr class="memitem:aa7dc666c286b9bee527dc0a54c3dfb2c">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#aa7dc666c286b9bee527dc0a54c3dfb2c">/api/v1.0/<string:q>/</a>
</td>
</tr>
<tr class="separator:aa7dc666c286b9bee527dc0a54c3dfb2c">
<td class="memSeparator" colspan="2"> </td>
</tr>
<tr class="memitem:a1556b1b7886947e93c0bf92b5199e0ed">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#a1556b1b7886947e93c0bf92b5199e0ed">/api/v1.0/<string:q>/<string:projection>/<int:resolution>/<string:extent>/<string:file_id>.json</a>
</td>
</tr>
<tr class="separator:a1556b1b7886947e93c0bf92b5199e0ed">
<td class="memSeparator" colspan="2"> </td>
</tr>
<tr class="memitem:aba7d3e274471275dede916bdb40838e4">
<td class="memItemRight" valign="bottom">
<a class="el" href="index.html#aba7d3e274471275dede916bdb40838e4">/api/v1.0/<string:q>/<string:q_id>.json</a>
</td>
</tr>
<tr class="separator:aba7d3e274471275dede916bdb40838e4">
<td class="memSeparator" colspan="2"> </td>
</tr>
</table>
</div>
<h2 class="groupheader">API Query Documentation</h2>
<!--DATASETS - DESCRIPTION-->
<a class="anchor" id="datasets"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">/api/v1.0/datasets/</td>
</tr>
</table>
</div>
<div class="memdoc">
<pre class="fragment">
Will return a list of possible datasets and their corresponding data
</pre>
</div>
</div>
<!--DATASET_ID - DESCRIPTION-->
<a class="anchor" id="datasets_id"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">/api/v1.0/datasets/?id</td>
</tr>
</table>
</div>
<div class="memdoc">
<pre class="fragment">
Will return a list of Dataset names and their corresponding id's
</pre>
</div>
</div>
<!--VARIABLES - DESCRIPTION-->
<a class="anchor" id="variables"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">/api/v1.0/variables/?dataset=<dataset_id>&3d_only&vectors_only&vectors</td>
</tr>
</table>
</div>
<div class="memdoc">
<pre class="fragment">
example: <a target="_blank" href="http://navigator.oceansdata.ca/api/v1.0/variables/?dataset=giops_day">/api/v1.0/variables/?dataset=giops_day</a>
**Only use variables required for your specific request**
dataset_id : Dataset to extract data - Can be found using /api/datasets/id
3d_only : When included, ONLY variables with depth will be shown
vectors_only : When included, ONLY variables with magnitude will be shown
vectors : When included, magnitude components will be included
**Boolean: True / False**
Will return a list of variables in the specified dataset, this output can be filtered by including keywords in the query
</pre>
</div>
</div>
<!--OBSERVATION VARIABLES - DESCRIPTION-->
<a class="anchor" id="observation_variables"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">/api/v1.0/observationvariables/</td>
</tr>
</table>
</div>
<div class="memdoc">
<pre class="fragment">
example: <a target="_blank" href="http://navigator.oceansdata.ca/api/v1.0/observationvariables">/api/v1.0/observationvariables/</a>
Returns a list of the possible observation variables
</pre>
</div>
</div>
<!--TIMESTAMPS - DESCRIPTION-->
<a class="anchor" id="timestamps"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">/api/v1.0/timestamps/?dataset=<string:dataset></td>
</tr>
</table>
</div>
<div class="memdoc">
<pre class="fragment">
example: <a target="_blank" href="http://navigator.oceansdata.ca/api/v1.0/timestamps/?dataset=giops_day">/api/v1.0/timestamps/?dataset=giops_day</a>
<string:dataset> : Dataset id - Can be found using /api/datasets
Finds all timestamps associated with a dataset
</pre>
</div>
</div>
<!-- DEPTH - DESCRIPTION-->
<a class="anchor" id="depth"></a>
<div class="memitem">
<div class="memproto">
<div class="memname">/api/v1.0/depth/?dataset=<string:dataset_id>&variable=<string:variable></div>
</div>
<div class="memdoc">
<pre class="fragment">
example: <a target="_blank" href="http://navigator.oceansdata.ca/api/v1.0/depth/?dataset=giops_day&variable=votemper">/api/v1.0/depth/?dataset=giops_day&variable=votemper</a>
<dataset_id> : id of the desired dataset - Can be found using /api/datasets/id
<variable> : Type of data to retrieve - found using /api/variables/?dataset='...'
Returns all depths available for that variable in the dataset
</pre>
</div>
</div>
<!--SCALE - DESCRIPTION-->
<a class="anchor" id="scale"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">/api/v1.0/scale/<string:dataset>/<string:variable>/<string:scale_min, scale_max>.png</td>
</tr>
</table>
</div>
<div class="memdoc">
<pre class="fragment">
example: <a target="_blank" href="http://navigator.oceansdata.ca/api/v1.0/scale/giops_day/votemper/-5,30.png">/api/v1.0/scale/giops_day/votemper/-5,30.png</a>
<string:dataset> : Dataset id - found using /api/datasets/id
<string:variable> : Type of data to retrieve - found using /api/variables/?dataset='...'
<string:scale_min,scale_max> : Desired Scale
Returns a coloured scale bar using the provided scale
</pre>
</div>
</div>
<!--RANGE - DESCRIPTION-->
<a class="anchor" id="range"></a>
<div class="memitem">
<div class="memproto">
<div class="memname">/api/v1.0/range/<string:dataset_id>/<string:variable>/<string:interp>/<string:radius>/<string:neighbours>/<string:projection>/<string:extent>/<string:depth>/<string:time>.json</div>
</div>
<div class="memdoc">
<pre class="fragment">
example: <a target="_blank" href="http://navigator.oceansdata.ca/api/v1/0/data/giops_day/votemper/823/0/63.51801708389351,-56.13861083984375.json">/api/v1.0/data/giops_day/votemper/823/0/63.51801708389351,-56.13861083984375.json</a>
<string:interp> : Dataset id - Can be found using /api/v1.0/datasets/?id
<string:radius> : Type of data to retrieve - found using /api/v1.0/variables/?dataset='...'
<int:neighbours> : Time of data collection
<string:dataset_id> : Water Depth - found using /api/v1.0/depth/?dataset='...'
<string:Lat,Lon> : Location of the data you want to retrieve
**All Components Must be Included**
Returns JSON object containing the location, name, units, and value based on the input values
</pre>
</div>
</div>
<!--DATA - DESCRIPTION-->
<a class="anchor" id="data"></a>
<div class="memitem">
<div class="memproto">
<div class="memname">/api/v1.0/data/<string:dataset>/<string:variable>/<string:time>/<string:Depth>/<string:location>.json'</div>
</div>
<div class="memdoc">
<pre class="fragment">
example: <a target="_blank" href="http://navigator.oceansdata.ca/api/v1.0/data/giops_day/votemper/823/0/63.51801708389351,-56.13861083984375.json">/api/v1.0/data/giops_day/votemper/823/0/63.51801708389351,-56.13861083984375.json</a>
<string:dataset> : Dataset id - Can be found using /api/v1.0/datasets/?id
<string:variable> : Type of data to retrieve - found using /api/v1.0/variables/?dataset='...'
<string:time> : Timestamp of data collection
<string:Depth> : Water Depth - found using /api/v1.0/depth/?dataset='...'
<string:Lat,Lon> : Location of the data you want to retrieve
**All Components Must be Included**
Returns JSON object containing the location, name, units, and value based on the input values
</pre>
</div>
</div>
<!--CLASS4 - DESCRIPTION-->
<a class="anchor" id="class4"></a>
<div class="memitem">
<div class="memproto">
<div class="memname">/api/v1.0/class4/<string:q>/<string:class4_id>/</div>
</div>
<div class="memdoc">
<pre class="fragment">
example: <a target="_blank" href="http://navigator.oceansdata.ca/api/class4/models/class4_20180512_GIOPS_CONCEPTS_2.3_profile/100">/api/class4/models/class4_20180512_GIOPS_CONCEPTS_2.3_profile/100</a>
<string:q> : forecasts (dates) models (?)
<string:class4_id> : ID of the desired class4 - Can be found using /api/v1.0/class4/
Returns in-situ observations with global prediction system estimates
</pre>
</div>
</div>
<!--DRIFTERS - DESCRIPTION-->
<a class="anchor" id="drifters"></a>
<div class="memitem">
<div class="memproto">
<div class="memname">/api/v1.0/drifters/<string:q>/<string:drifter_id></div>
</div>
<div class="memdoc">
<pre class="fragment">
example: <a target="_blank" href="http://navigator.oceansdata.ca/api/v1.0/drifters/vars/300234063261890">/api/v1.0/drifters/vars/300234063261890/</a>
<string:q> : vars / time (Data Request)
<string:drifter_id> : ID of Drifter of Interest - Options can be found using /api/
Vars - Returns a list of Variables applicable to the specified drifter
Time - Returns the max and min time of the specified drifter
</pre>
</div>
</div>
<!--STATS - DESCRIPTION-->
<a class="anchor" id="stats"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">/api/v1.0/stats/?query=<string:query></td>
</tr>
</table>
</div>
<div class="memdoc">
<pre class="fragment">
example: <a target="_blank" href="http://navigator.oceansdata.ca">not working</a>
<string:query> = {
dataset : Dataset id - found using /api/v1.0/datasets/id
variable : Type of data to plot - Options found using /api/v1.0/variables/?dataset='...'
time : Time retrieved data was observed / modeled
depth : Water Depth - found using /api/v1.0/depth/?dataset='...'
area : Selected Area
}
**Query must be written in JSON and converted to encodedURI**
**Not all components of query are required
Returns a list of statistical variables associated with the plot selected.
This may include variable name, units, min, max, mean, median, and stddev
</pre>
</div>
</div>
<!--SUBSET - DESCRIPTION-->
<a class="anchor" id="subset"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">/api/v1.0/subset/?query='...'</td>
</tr>
</table>
</div>
<div class="memdoc">
<pre class="fragment">
example: <a target="_blank" href="http://navigator.oceansdata.ca/api/v1.0/subset/?&output_format=NETCDF3_CLASSIC&dataset_name=riops&variables=sokaraml&min_range=51.09063483675129,-55.392697784916535&max_range=60.20578518215365,-39.836057159916535&time=4661,4661&should_zip=0">Click for Example</a>
query = {
Output Format : File Format
Dataset id : id of the desired dataset - found using /api/v1.0/datasets/id
Variables : data type ex. temperature - found using /api/v1.0/variables/?dataset='...'
Min range : Minimum of bounding box - displayed below
Max range : Maximum of bounding box - displayed below
time : Data Time Period
zip : Takes a value of 1 or 0 [1: create a zip file, 0: do not zip file]
}
Bounding Box:
<img src="bounding_box.webp">
**Query must be written in JSON and converted to encodedURI**
**Not all components of query are required
Returns a subset of data based on the criteria provided, this can be in multiple different file formats
</pre>
</div>
</div>
<!--PLOT - DESCRIPTION-->
<a class="anchor" id="plot"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">/api/v1.0/plot/?query=<json:query></td>
</tr>
</table>
</div>
<div class="memdoc">
<pre class="fragment">
example: <a target="_blank" href="http://navigator.oceansdata.ca/api/v1.0/plot/?query=%7B%22area%22%3A%5B%7B%22innerrings%22%3A%5B%5D%2C%22name%22%3A%22%22%2C%22polygons%22%3A%5B%5B%5B62.27693797488524%2C-53.94134521484374%5D%2C%5B59.98669914224615%2C-36.80267333984375%5D%2C%5B56.180809047819764%2C-37.681579589843736%5D%2C%5B56.434830853922364%2C-55.96282958984374%5D%2C%5B62.27693797488524%2C-53.94134521484374%5D%5D%5D%7D%5D%2C%22bathymetry%22%3Atrue%2C%22colormap%22%3A%22default%22%2C%22contour%22%3A%7B%22colormap%22%3A%22default%22%2C%22hatch%22%3Afalse%2C%22legend%22%3Atrue%2C%22levels%22%3A%22auto%22%2C%22variable%22%3A%22%22%7D%2C%22dataset%22%3A%22giops_day%22%2C%22depth%22%3A0%2C%22interp%22%3A%22gaussian%22%2C%22neighbours%22%3A10%2C%22projection%22%3A%22EPSG%3A3857%22%2C%22quiver%22%3A%7B%22colormap%22%3A%22default%22%2C%22magnitude%22%3A%22length%22%2C%22variable%22%3A%22%22%7D%2C%22radius%22%3A25%2C%22scale%22%3A%22-5%2C30%2Cauto%22%2C%22showarea%22%3Atrue%2C%22time%22%3A823%2C%22type%22%3A%22map%22%2C%22variable%22%3A%22votemper%22%7D&format=png">Click for Example</a>
**MORE DETAILS ABOUT PLOTS CAN BE FOUND <a href="#PlotInfo" onclick="openTab(event, 'Contact')">HERE</a>
<json:query> = {
scale :
quiver :
colormap :
area : {
u'innerrings':
u'polygons' :
}
bathymetry: True/False - If true, area plots will show bathymetry lines
dataset : Dataset id - found using /api/v1.0/datasets/id
showarea : If true, the selected area lines will be displayed
variable : Type of data to plot - Options can be found in the documentation input section
depth : Depth of data to plot (depths available depended on dataset)
plottitle : Title of Plot (Default if blank)
quantum : (year, month, day, hour)
showmap : Include a map of the plots location on the map
station : Coordinates of the point/line/area/etc
time : Time retrieved data was gathered/modeled
contour : {
variable :
hatch :
levels :
colormap :
legend :
}
projection:
radius :
type : Plot Type (Check Navigator for Possible options)
}
Plot Types - map, transect, timeseries, ts, sound, profile, hovmoller, observation, drifter, class4, stick
**Query must be written in JSON and converted to encodedURI**
**Not all components of query are required
This query is used to create plots of all types, as well as to create some file types including csv
</pre>
</div>
</div>
<!--COLORS - DESCRIPTION-->
<a class="anchor" id="colors"></a>
<div class="memitem">
<div class="memproto">
<div class="memname">/api/v1.0/colors/</div>
</div>
<div class="memdoc">
<pre class="fragment">
Returns a list of colours for use in colour maps
</pre>
</div>
</div>
<!--COLORMAPS - DESCRIPTION-->
<a class="anchor" id="colormaps"></a>
<div class="memitem">
<div class="memproto">
<div class="memname">/api/v1.0/colormaps/</div>
</div>
<div class="memdoc">
<pre class="fragment">
Returns a list of colourmaps
</pre>
</div>
</div>
<!--COLORMAPS_IMAGE - DESCRIPTION-->
<a class="anchor" id="colormaps_image"></a>
<div class="memitem">
<div class="memproto">
<div class="memname">/api/v1.0/colormaps.png</div>
</div>
<div class="memdoc">
<pre class="fragment">
Returns image of colourmap example configurations
</pre>
</div>
</div>
<!-- SINGLE STRING - DESCRIPTION-->
<a class="anchor" id="aa7dc666c286b9bee527dc0a54c3dfb2c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">/api/v1.0/<string:q>/</td>
</tr>
</table>
</div>
<div class="memdoc">
<pre class="fragment">
example: <a target="_blank" href="http://navigator.oceansdata.ca/api/v1.0/lines/">/api/v1.0/lines/</a>
<string:q> : Zone Type Can be (points,lines, areas, or class4)
Returns predefined points / lines / areas / class4's
</pre>
</div>
</div>
<!--TWO STRINGS - DESCRIPTION-->
<a class="anchor" id="aba7d3e274471275dede916bdb40838e4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">/api/v1.0/<string:q>/<string:q_id>.json'</td>
</tr>
</table>
</div>
<div class="memdoc">
<pre class="fragment">
example: <a target="_blank" href="http://navigator.oceansdata.ca/api/v1.0/drifters/meta.json">/api/v1.0/drifters/meta.json</a>
<string:q> : Type of Data (areas, class4, drifters, observation)
<string:q_id> : metafile name drifters: meta, observation: meta
Returns a list of all the objects of the selected type
</pre>
</div>
</div>
<!-- FIVE STRINGS - DESCRIPTION-->
<a class="anchor" id="dataset_id"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">/api/v1.0/<string:q>/<string:projection>/<int:resolution>/<string:extent>/<string:file_id>.json</td>
</tr>
</table>
</div>
<div class="memdoc">
<pre class="fragment">
example: <a target="_blank" href="http://navigator.oceansdata.ca/api/v1.0/class4/EPSG:3857/9784/-15618972,1596939,4487023,12369057/class4_20180510_GIOPS_CONCEPTS_2.3_profile.json">/api/v1.0/class4/EPSG:3857/9784/-15618972,1596939,4487023,12369057/class4_20180510_GIOPS_CONCEPTS_2.3_profile.json</a>
--At this time, only the class4 option is available
<string:q> : Type of data (points, lines, areas, class4, drifters, observations)
<string:projection> : Current projection of the map (EPSG:3857, EPSG:32661, EPSG:3031)
<int:resolution> : Current zoom level of the map
<string:extent> : The current bounds of the map view
<string:file_id> : Class 4 file ID
**All Components Must be Included**
**Used Primarily by WebPage**
At this time will return a list of class4's and their data
</pre>
</div>
</div>
</div>
<!-- contents -->
<div class="tabcontent" id="Input_Options">
<button onclick="toggleSidebar()" style="float: left; font-size: 22px;"><i class="fa fa-bars"></i></button>
<h3 style="padding-left: 40px;">Input Options</h3>
<h2 class="groupheader"></h2>
<h2>Available Datasets</h2>
<div class='datasets' id="load_datasets"></div>
</div>
<!-- Plot Information Page Wrapper -->
<div class="tabcontent" id="Contact">
<!-- Page Header -->
<button onclick="toggleSidebar()" style="float: left; font-size: 22px;"><i class="fa fa-bars"></i></button>
<h3 style="padding-left: 40px;">Plot API Information</h3>
<p>
This page provides different variables that can be included in your plot queries.
Some of them are required while others are optional and are used to achieve the
described task outlined next to them. </br>
**Class4's do not use this api request to create plots
</p>
<!-- Main container for the plot information-->
<!--
This container contains 4 panes, 1 for each of the types of the plots
Each pane consists of a table, as well as a <pre> element.
The table is made up of rows, and 3 cols
- Each column has different sizing (This is the reason for using 3 different classes)
The <pre> element displays the JSON example and is needed to maintain whitespace
-->
<div class='plotInformation'>
<!-- Point Plot Info -->
<button class='howto_button' id="pointPlotButton" onclick="openContents(event, 'pointPlotPane', 'query_usage_all', 'pointPlotButton')">
<span>
<i class='fa fa-angle-down' style='font-size: 20px'></i>
<h4 style='display: inline; padding-left: 20px'>Point Plot</h4>
</span>
</button>
<div class='PlotPane' id='pointPlotPane'>
<table class='PlotPaneTable'>
<tr class='PlotPaneRow'>
<td class='PlotVariable'>
<b>VARIABLE</b>
</td>
<td class='PlotVarType'>
<b>TYPE</b>
</td>
<td class='PlotDescription'>
<b>DESCRIPTION</b>