diff --git a/catalog/cprep_tasmax_day_I35txdetrp1-DeltaSD-A12L01K00_rcp26_r6i1p1_I35Land_20060101-20991231/collection.json b/catalog/cprep_tasmax_day_I35txdetrp1-DeltaSD-A12L01K00_rcp26_r6i1p1_I35Land_20060101-20991231/collection.json index 275b37ccbd6697e67bebba9ed77ff1572677d2fb..95c80fe298bb51db8e5363ca8eec2c821e283b6b 100644 --- a/catalog/cprep_tasmax_day_I35txdetrp1-DeltaSD-A12L01K00_rcp26_r6i1p1_I35Land_20060101-20991231/collection.json +++ b/catalog/cprep_tasmax_day_I35txdetrp1-DeltaSD-A12L01K00_rcp26_r6i1p1_I35Land_20060101-20991231/collection.json @@ -62,7 +62,7 @@ "cube:variables": { "crs": { "dimensions": [], - "type": "data", + "type": "auxiliary", "description": null, "unit": null }, diff --git a/workflows/archive/cprep_create_collection_from_zarr.ipynb b/workflows/archive/cprep_create_collection_from_zarr.ipynb index 8b9a1b9da64835deeaffd89deecca5c7e1f8a542..df0be7b8d2d3dae9878db12a38cfe38f8b70f929 100644 --- a/workflows/archive/cprep_create_collection_from_zarr.ipynb +++ b/workflows/archive/cprep_create_collection_from_zarr.ipynb @@ -270,6 +270,18 @@ "## Get crs info" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "4a981eca-93fd-4a9d-bbdf-52d0a99d6bc0", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "crs_var = 'crs'" + ] + }, { "cell_type": "code", "execution_count": null, @@ -280,7 +292,7 @@ "outputs": [], "source": [ "# use pyproj to automatically extract crs info\n", - "crs = pyproj.CRS.from_cf(ds.crs.attrs)\n", + "crs = pyproj.CRS.from_cf(ds[crs_var].attrs)\n", "\n", "# alternatively, create the appropriate cartopy projection\n", "# crs = ccrs.LambertConformal(central_longitude=crs_info.longitude_of_central_meridian, \n", @@ -288,6 +300,30 @@ "# standard_parallels=crs_info.standard_parallel)" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "1a0f2a58-a126-4438-a4c2-5c35653f4a62", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "ds[crs_var]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a702f7ff-6201-4283-8e8c-c23f685d7165", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "crs.to_proj4()" + ] + }, { "cell_type": "markdown", "id": "a8c3ed37-8564-400b-a7fb-25bd5e43d21c", @@ -849,7 +885,7 @@ "vars_dict={}\n", "for v in vars:\n", " unit = stac_helpers.get_unit(ds, v)\n", - " var_type = stac_helpers.get_var_type(ds, v)\n", + " var_type = stac_helpers.get_var_type(ds, v, crs_var)\n", " long_name = stac_helpers.get_long_name(ds, v)\n", " vars_dict[v] = pystac.extensions.datacube.Variable({'dimensions':list(ds[v].dims), 'type': var_type, 'description': long_name, 'unit': unit})" ] diff --git a/workflows/examples/create_collection_from_zarr_conus404-daily.ipynb b/workflows/examples/create_collection_from_zarr_conus404-daily.ipynb index 58161e5ad0b7268bc9b395e155db170d92319bf4..307828daf6712524fb0f6e672db8dabe5341983f 100644 --- a/workflows/examples/create_collection_from_zarr_conus404-daily.ipynb +++ b/workflows/examples/create_collection_from_zarr_conus404-daily.ipynb @@ -235,7 +235,7 @@ "metadata": {}, "outputs": [], "source": [ - "ds.crs" + "ds[crs_var]" ] }, { diff --git a/workflows/examples/create_item_from_zarr_conus404-daily.ipynb b/workflows/examples/create_item_from_zarr_conus404-daily.ipynb index ad517d534a202cf8c06b1d087f4fbe54bd6612c6..4f4bf9cb9b33698a56ca69a8a793279abb573af6 100644 --- a/workflows/examples/create_item_from_zarr_conus404-daily.ipynb +++ b/workflows/examples/create_item_from_zarr_conus404-daily.ipynb @@ -219,7 +219,7 @@ "metadata": {}, "outputs": [], "source": [ - "ds.crs" + "ds[crs_var]" ] }, {