@@ -20,7 +20,13 @@ params = {
20
20
" dateTo" : " 2019-06-08T00:00:00.000Z" ,
21
21
}
22
22
23
- onc.getListByDevice(params)
23
+ onc.getArchivefile(params)
24
+
25
+ # Longer method name
26
+ # onc.getArchivefileByDevice(params)
27
+
28
+ # Alias method name
29
+ # onc.getListByDevice(params)
24
30
```
25
31
26
32
### Get a list of all archived files available from a specific device for a specific time-range with a specific extension
@@ -36,13 +42,23 @@ params = {
36
42
" dateTo" : " 2019-06-08T00:00:00.000Z" ,
37
43
}
38
44
39
- onc.getListByDevice(params)
45
+ onc.getArchivefile(params)
46
+
47
+ # Longer method name
48
+ # onc.getArchivefileByDevice(params)
49
+
50
+ # Alias method name
51
+ # onc.getListByDevice(params)
40
52
```
41
53
42
54
### Download a file by its filename
43
55
44
56
``` python
45
- onc.getFile(" RDIADCP600WH25471_20190607T120000.555Z.rdi" , overwrite = True )
57
+
58
+ onc.downloadArchivefile(" ICLISTENHF1560_20181005T000403.000Z-spect.mat" , overwrite = True )
59
+
60
+ # Alias method name
61
+ # onc.getFile("ICLISTENHF1560_20181005T000403.000Z-spect.mat", overwrite=True)
46
62
```
47
63
48
64
## [ /archivefile/location] ( https://data.oceannetworks.ca/OpenAPI#get-/archivefile/location )
@@ -56,49 +72,58 @@ _locationCode_:"**SEVIP**")
56
72
params = {
57
73
" deviceCategoryCode" : " HYDROPHONE" ,
58
74
" locationCode" : " SEVIP" ,
59
- " dateFrom" : " 2017-01-01T00:00 :00.000Z" ,
60
- " dateTo" : " 2019-12-31T00:00 :00.000Z" ,
75
+ " dateFrom" : " 2018-10-05T00:05 :00.000Z" ,
76
+ " dateTo" : " 2018-10-05T00:06 :00.000Z" ,
61
77
}
62
78
63
- onc.getListByLocation(params)[" files" ]
79
+ onc.getArchivefile(params)
80
+
81
+ # Longer method name
82
+ # onc.getArchivefileByLocation(params)
83
+
84
+ # Alias method name
85
+ # onc.getListByLocation(params)
64
86
```
65
87
66
88
### Get a list of all archived files available from a specific location and a device category for a specific time-range with a specific file extension
67
89
68
90
Return the archived files for a device with _ deviceCategoryCode_ "** HYDROPHONE** " at location Straight of Georgia East (
69
- _ locationCode_ :"** SEVIP** ") with file extension "** wav ** ".
91
+ _ locationCode_ :"** SEVIP** ") with file extension "** mat ** ".
70
92
71
93
``` python
72
94
params = {
73
95
" deviceCategoryCode" : " HYDROPHONE" ,
74
96
" locationCode" : " SEVIP" ,
75
- " extension" : " wav " ,
76
- " dateFrom" : " 2017-01-01T00:00 :00.000Z" ,
77
- " dateTo" : " 2019-12-31T00:00 :00.000Z" ,
97
+ " extension" : " mat " ,
98
+ " dateFrom" : " 2018-10-05T00:05 :00.000Z" ,
99
+ " dateTo" : " 2018-10-05T00:06 :00.000Z" ,
78
100
}
79
101
80
- onc.getListByLocation(params)[" files" ]
102
+ onc.getArchivefile(params)
103
+
104
+ # Longer method name
105
+ # onc.getArchivefileByLocation(params)
106
+
107
+ # Alias method name
108
+ # onc.getListByLocation(params)
81
109
```
82
110
83
111
## Download archived files that match the parameters
84
112
85
- Download all "wav" files from a hydrophone at Straight of Georgia East (_ locationCode_ :"** SEVIP** ") from the last 2
86
- hours
113
+ Download all "mat" files from a hydrophone at Straight of Georgia East (_ locationCode_ :"** SEVIP** ") using the parameter above.
87
114
88
115
``` python
89
- import datetime
90
-
91
- # Get the current ISO8601 timestamp, without milliseconds
92
- now = datetime.datetime.utcnow().replace(microsecond = 0 ).isoformat() + " .000Z"
93
-
94
116
params = {
95
- " locationCode " : " SEVIP " , # Strait of Georgia East
96
- " deviceCategoryCode " : " HYDROPHONE " , # Hydrophones
97
- " dateFrom " : " -PT2H " , # Minus 2 hours from dateTo
98
- " dateTo " : now ,
99
- " extension " : " wav " ,
117
+ " deviceCategoryCode " : " HYDROPHONE " ,
118
+ " locationCode " : " SEVIP " ,
119
+ " extension " : " mat " ,
120
+ " dateFrom " : " 2018-10-05T00:05:00.000Z " ,
121
+ " dateTo " : " 2018-10-05T00:06:00.000Z " ,
100
122
}
101
123
102
- # Download available files (will throw an exception if there are no deployments for the device during the last two hours)
124
+ onc.downloadDirectArchivefile(params)
125
+
126
+ # Alias method name
103
127
# onc.getDirectFiles(params)
128
+
104
129
```
0 commit comments