|
191 | 191 | "url = env['url'] + \"am-uds-dapa/collections/\"+data_set+\"/items\"\n",
|
192 | 192 | "\n",
|
193 | 193 | "params = []\n",
|
194 |
| - "params.append((\"limit\", 20))\n", |
| 194 | + "#params.append((\"limit\", 20))\n", |
195 | 195 | "\n",
|
196 | 196 | "response = requests.get(url, headers={\"Authorization\": \"Bearer \" + token}, params=params)\n",
|
197 | 197 | "\n",
|
| 198 | + "print(f\"Endpoint: \"+url)\n", |
198 | 199 | "print(f\"Total number of files: {response.json()['numberMatched']}\")\n",
|
199 | 200 | "print(\"File IDs, titles, and hrefs in Collection \" + data_set + \"\\n\")\n",
|
200 | 201 | "\n",
|
201 | 202 | "features = response.json()['features']\n",
|
202 | 203 | "\n",
|
203 | 204 | "for data_file in features: {\n",
|
204 |
| - " print(data_file['id']),\n", |
205 |
| - " print(data_file['assets']['metadata__data']['title']),\n", |
206 |
| - " print(data_file['assets']['metadata__data']['href']),\n", |
| 205 | + " print(\"For \"+ data_file['id']),\n", |
| 206 | + " print(\"File:\\t\\t\"+data_file['assets']['data']['href']),\n", |
| 207 | + " print(\"Metadata:\\t\"+data_file['assets']['metadata__data']['href']),\n", |
207 | 208 | " print(\"\")\n",
|
208 | 209 | "}\n",
|
209 | 210 | "\n",
|
| 211 | + "\n", |
210 | 212 | "print(\"Full JSON response object:\")\n",
|
211 | 213 | "JSON(response.json())\n"
|
212 | 214 | ]
|
|
240 | 242 | "params.append((\"datetime\", \"2000-11-01T00:00:00Z/2022-11-01T02:31:12Z\"))\n",
|
241 | 243 | "\n",
|
242 | 244 | "# limit - how many results to return in a single request\n",
|
243 |
| - "params.append((\"limit\", 10))\n", |
| 245 | + "#params.append((\"limit\", 10))\n", |
244 | 246 | "\n",
|
245 | 247 | "response = requests.get(url, headers={\"Authorization\": \"Bearer \" + token}, params=params)\n",
|
246 | 248 | "\n",
|
|
253 | 255 | " print(data_file['id']),\n",
|
254 | 256 | " print(data_file['properties']['created']),\n",
|
255 | 257 | " print(data_file['assets']['metadata__data']['href']),\n",
|
| 258 | + " print(data_file['assets']['data']['href']),\n", |
256 | 259 | " print(\"\")\n",
|
257 | 260 | " }\n",
|
258 | 261 | " # Get the next page of results\n",
|
|
433 | 436 | "import xarray as xr\n",
|
434 | 437 | "ds = xr.open_dataset('test_file11.nc')\n",
|
435 | 438 | "ds"
|
| 439 | + |
436 | 440 | ]
|
437 | 441 | },
|
438 | 442 | {
|
|
0 commit comments