Skip to content

Commit 464faf2

Browse files
committed
Merge branch 'master' of github.com:terraref/tutorials
2 parents 52c3a61 + 8300498 commit 464faf2

2 files changed

Lines changed: 101 additions & 0 deletions

File tree

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2017, TERRA REF
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Generating file lists by plot
2+
3+
## Finding plot ID
4+
```
5+
SENSOR_NAME = "MAC Field Scanner Season 1 Field Plot 101 W"
6+
GET https://terraref.ncsa.illinois.edu/clowder/api/geostreams/sensors?sensor_name={SENSOR_NAME}
7+
```
8+
9+
This returns a JSON object with an 'id' parameter. You can use this ID parameter to specify the right data stream.
10+
11+
## Finding stream ID within a plot
12+
The names are formatted as "<Sensor Group> Datasets (<Sensor ID>)".
13+
```
14+
SENSOR_ID = 3355
15+
STREAM_NAME = "Thermal IR GeoTIFFs Datasets ({SENSOR_ID})"
16+
GET https://terraref.ncsa.illinois.edu/clowder/api/geostreams/streams?stream_name={STREAM_NAME}
17+
```
18+
19+
This returns a JSON object with an 'id' parameter. You can use this ID parameter to get the right datapoints.
20+
21+
## Listing Clowder file IDs for that plot & sensor stream
22+
```
23+
STREAM_ID = "11586"
24+
GET https://terraref.ncsa.illinois.edu/clowder/api/geostreams/datapoints?stream_id={STREAM_ID}
25+
```
26+
27+
This returns a list of datapoint JSON objects, each with a 'properties' parameter that looks like:
28+
```
29+
properties: {
30+
dataset_name: "Thermal IR GeoTIFFs - 2016-05-09__12-07-57-990",
31+
source_dataset: "https://terraref.ncsa.illinois.edu/clowder/datasets/59fc9e7d4f0c3383c73d2905"
32+
},
33+
```
34+
35+
The source_dataset URL can be used to view the dataset in Clowder.
36+
37+
You can also filter the datapoints by date:
38+
```
39+
GET https://terraref.ncsa.illinois.edu/clowder/api/geostreams/datapoints?stream_id={STREAM_ID}&since=2017-01-02&until=2017-06-10
40+
```
41+
42+
## Getting ROGER file path from dataset
43+
Given a source dataset URL, we can call the API to get the files and their paths.
44+
```
45+
SOURCE_DATASET = "https://terraref.ncsa.illinois.edu/clowder/datasets/59fc9e7d4f0c3383c73d2905"
46+
# Add /api after /clowder, and add /files at the end of the URL
47+
GET "https://terraref.ncsa.illinois.edu/clowder/api/datasets/59fc9e7d4f0c3383c73d2905/files"
48+
```
49+
50+
This returns a list of files in the dataset and their paths if available:
51+
```
52+
[
53+
{
54+
size: "346069",
55+
date-created: "Fri Nov 03 11:51:13 CDT 2017",
56+
id: "59fc9e814f0c3383c73d2962",
57+
filepath: "/home/clowder/sites/ua-mac/Level_1/ir_geotiff/2016-05-09/2016-05-09__12-07-57-990/ir_geotiff_L1_ua-mac_2016-05-09__12-07-57-990.png",
58+
contentType: "image/png",
59+
filename: "ir_geotiff_L1_ua-mac_2016-05-09__12-07-57-990.png"
60+
},
61+
{
62+
size: "1231298",
63+
date-created: "Fri Nov 03 11:51:16 CDT 2017",
64+
id: "59fc9e844f0c3383c73d2980",
65+
filepath: "/home/clowder/sites/ua-mac/Level_1/ir_geotiff/2016-05-09/2016-05-09__12-07-57-990/ir_geotiff_L1_ua-mac_2016-05-09__12-07-57-990.tif",
66+
contentType: "image/tiff",
67+
filename: "ir_geotiff_L1_ua-mac_2016-05-09__12-07-57-990.tif"
68+
}
69+
]
70+
```
71+
72+
Depending on permissions you may need to provide authentication to get this list.

0 commit comments

Comments
 (0)