Skip to content

Commit a521cbb

Browse files
authored
added consolidated: true to hrrrzarr source in catalog and updated instructions to add that argument. This improve performance of the notebooks considerable. (#16)
1 parent c00c99c commit a521cbb

File tree

3 files changed

+35
-1763
lines changed

3 files changed

+35
-1763
lines changed

notebooks/catalog.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ sources:
1313
metadata: {}
1414
hrrrzarr:
1515
args:
16-
chunks:
17-
projection_x_coordinate: 1799
18-
projection_y_coordinate: 1059
16+
chunks: null
17+
consolidated: true
1918
storage_options:
2019
anon: true
2120
urlpath:

notebooks/creating_catalogs.ipynb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,10 @@
173173
"urls = ['s3://hrrrzarr/sfc/20160824/20160824_00z_anl.zarr/surface/TMP/surface',\n",
174174
" 's3://hrrrzarr/sfc/20160824/20160824_00z_anl.zarr/surface/TMP']\n",
175175
"\n",
176-
"chunks = {'projection_x_coordinate': 1799,\n",
177-
" 'projection_y_coordinate': 1059}\n",
176+
"source = intake.open_zarr(urls, chunks=None,\n",
177+
" storage_options={\"anon\": True},\n",
178+
" consolidated=True)\n",
178179
"\n",
179-
"so = {\"anon\": True}\n",
180-
"\n",
181-
"source = intake.open_zarr(urls, chunks=chunks, storage_options=so)\n",
182180
"source.name = 'hrrrzarr'\n",
183181
"source.description = \"Mesowest's HRRR data. See readme source for more information.\"\n",
184182
"ds = source.read()\n",
@@ -189,7 +187,7 @@
189187
"cell_type": "markdown",
190188
"metadata": {},
191189
"source": [
192-
"Above we used the `storage_options` argument to tell Intake how to access data on AWS. In this case we accessed the data as an anonymous user.\n",
190+
"Above we used the `storage_options` argument to tell Intake how to access data on AWS. In this case we accessed the data as an anonymous user. The `consolidated=True` argument is given to tell [Xarray](https://foundations.projectpythia.org/core/xarray.html) how to load the metadata for this source. Zarr data may contain consolidated metadata. If it does, using it can increase performance significantly.\n",
193191
"\n",
194192
"When you use Intake's `open_{driver}` methods, it creates a catalog entry for the source. You can view the yaml using the source's `yaml` method."
195193
]
@@ -433,7 +431,7 @@
433431
"source": [
434432
"## Testing the Catalog\n",
435433
"\n",
436-
"Now that your catalog is on Github let's try using it. In the cell below replace the url with the url pointing to the raw catalog file on Github"
434+
"Now that your catalog is on Github let's try using it. In the cell below replace the url with the url pointing to the raw catalog file on your Github account"
437435
]
438436
},
439437
{

0 commit comments

Comments
 (0)