You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -78,12 +92,12 @@ First we format the base URL for our query allowing us to reuse it for each file
78
92
Next we loop through our array and create a customized URL while making the call to fetch the data using the `requests` interface.
79
93
Finally we open the output file and use a loop to write the retrieved data.
80
94
81
-
```{python py_fetch_image_files, eval=FALSE}
95
+
```{python py_fetch_image_files}
82
96
import requests
83
97
from io import open
84
98
85
99
# We are using the same `url` and `key` variables declared in the previous example above.
86
-
filesurl = url + '/files/'
100
+
filesurl = url + 'files/'
87
101
params={ 'key': key }
88
102
89
103
for f in files:
@@ -108,71 +122,3 @@ Below are examples of images captured approximately one month apart [^1] [^2]
108
122
109
123
[^1]: May 4, 2018 - rgb_geotiff_L1_ua-mac_2018-05-04__13-07-04-077_right.tif,rgb_geotiff_L1_ua-mac_2018-05-04__13-07-04-077_left.tif
110
124
[^2]: Jun 2, 2018 - rgb_geotiff_L1_ua-mac_2018-06-02__14-12-05-077_right.tif,rgb_geotiff_L1_ua-mac_2018-06-02__14-12-05-077_left.tif
111
-
112
-
113
-
<!-- The following is the 'correct' way of retrieving file names and IDS based upon a site and sensor name
114
-
115
-
116
-
117
-
## Objective: To be able to demonstrate how to locate and retrieve RGB image files
118
-
119
-
This vignette shows how to locate and retrieve image files from your site for a specific date range using Python.
120
-
We will be searching for and retrieving [ublicly available images associated with growing Season 6 from the University of Arizona's [Maricopa Agricultural Center](http://cals-mac.arizona.edu/).
121
-
Note that the search in this vignette will not return any results, but we wull walk you through the process so that you can query your own data.
122
-
The files are stored online on the data management system Clowder, which is accessed using an API.
123
-
124
-
After completing this vignette it should be possible to search for and retrieve other files through the use of the API.
125
-
126
-
As an added bonus we've also included an exmple of how to retrieve the list of available sensor names through the API.
127
-
By using the sensor names returned, it's possible to retrieve other files containing the data the sensors have collected.
128
-
129
-
**Requirements**
130
-
131
-
* Python
132
-
* the terrautils library
133
-
+ this can be installed from pypi by running `pip install terrautils` in the terminal
134
-
* an API key to access these data
135
-
136
-
The API key is a string that gets generated upon request through your Clowder account.
137
-
Existing API keys will work with this vignette.
138
-
The following steps can help you get a new API key
139
-
140
-
1. first register with Clowder at "https://terraref.ncsa.illinois.edu/clowder/" site
141
-
a) click the `Login` button and wait for the login screen to appear
142
-
b) then select the `Sign up` button and enter an email address you have access to
143
-
2. an email is sent to the entered address with instructions for completing the registration process
144
-
3. once registration is complete
145
-
c) log into Clowder and select the `View profile` menu option from the drop-down that is near the search control
146
-
d) enter a name and click the `+ Add` button under "User API Keys" heading in the profile page to generate a new key
147
-
4. copy the key shown for use in this vignette
148
-
149
-
## Locating the images
150
-
151
-
To begin looking for files, a sensor name and site name are needed.
152
-
We will be using 'RGB GeoTIFFs Datasets' as the sensor name and 'MAC Field Scanner Season 6 Range 20 Column 6' as the site name.
153
-
Later in this vignette we show how to retrieve the list of available sensors.
154
-
When seraching for your images, you will want to use your site name.
155
-
156
-
The URL string points to the API to query.
157
-
In this case we'll be using "https://terraref.ncsa.illinois.edu/clowder/api".
158
-
We will be using an empty key for this example since we are querying public data.
159
-
You will want to use the key you created for your Clowder account when querying your data.
160
-
161
-
As mentioned in the Objectives, we are limiting the search timeframe through the use of the `since` and `until` parameters.
162
-
These parameters can be omitted to search for all available images (or all other files by changing the sensor).
0 commit comments