diff --git a/catalog/iclus_hc/collection.json b/catalog/iclus_hc/collection.json index 721bd8e156788453c70f6c7e30838439d6d01f55..20a6c218ffdf15264074e75ab3588e194229b64f 100644 --- a/catalog/iclus_hc/collection.json +++ b/catalog/iclus_hc/collection.json @@ -28,7 +28,7 @@ 2258235.90913645 ], "step": 100.0, - "reference_system": "{\"$schema\":\"https://proj.org/schemas/v0.5/projjson.schema.json\",\"type\":\"Conversion\",\"name\":\"PROJ-based coordinate operation\",\"method\":{\"name\":\"PROJ-based operation method: +proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs\"},\"parameters\":[]}" + "reference_system": "{\"$schema\":\"https://proj.org/schemas/v0.6/projjson.schema.json\",\"type\":\"ProjectedCRS\",\"name\":\"undefined\",\"base_crs\":{\"name\":\"undefined\",\"datum\":{\"type\":\"GeodeticReferenceFrame\",\"name\":\"undefined\",\"ellipsoid\":{\"name\":\"undefined\",\"semi_major_axis\":6378137,\"inverse_flattening\":298.257222101},\"prime_meridian\":{\"name\":\"undefined\",\"longitude\":0}},\"coordinate_system\":{\"subtype\":\"ellipsoidal\",\"axis\":[{\"name\":\"Longitude\",\"abbreviation\":\"lon\",\"direction\":\"east\",\"unit\":\"degree\"},{\"name\":\"Latitude\",\"abbreviation\":\"lat\",\"direction\":\"north\",\"unit\":\"degree\"}]}},\"conversion\":{\"name\":\"unknown\",\"method\":{\"name\":\"Albers Equal Area\",\"id\":{\"authority\":\"EPSG\",\"code\":9822}},\"parameters\":[{\"name\":\"Latitude of false origin\",\"value\":23,\"unit\":\"degree\",\"id\":{\"authority\":\"EPSG\",\"code\":8821}},{\"name\":\"Longitude of false origin\",\"value\":-95.9999999999999,\"unit\":\"degree\",\"id\":{\"authority\":\"EPSG\",\"code\":8822}},{\"name\":\"Latitude of 1st standard parallel\",\"value\":29.5,\"unit\":\"degree\",\"id\":{\"authority\":\"EPSG\",\"code\":8823}},{\"name\":\"Latitude of 2nd standard parallel\",\"value\":45.5,\"unit\":\"degree\",\"id\":{\"authority\":\"EPSG\",\"code\":8824}},{\"name\":\"Easting at false origin\",\"value\":0,\"unit\":{\"type\":\"LinearUnit\",\"name\":\"Metre\",\"conversion_factor\":1},\"id\":{\"authority\":\"EPSG\",\"code\":8826}},{\"name\":\"Northing at false origin\",\"value\":0,\"unit\":{\"type\":\"LinearUnit\",\"name\":\"Metre\",\"conversion_factor\":1},\"id\":{\"authority\":\"EPSG\",\"code\":8827}}]},\"coordinate_system\":{\"subtype\":\"Cartesian\",\"axis\":[{\"name\":\"Easting\",\"abbreviation\":\"E\",\"direction\":\"east\",\"unit\":\"metre\"},{\"name\":\"Northing\",\"abbreviation\":\"N\",\"direction\":\"north\",\"unit\":\"metre\"}]}}" }, "y": { "type": "spatial", @@ -39,7 +39,7 @@ 3172445.2073140107 ], "step": -100.0, - "reference_system": "{\"$schema\":\"https://proj.org/schemas/v0.5/projjson.schema.json\",\"type\":\"Conversion\",\"name\":\"PROJ-based coordinate operation\",\"method\":{\"name\":\"PROJ-based operation method: +proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs\"},\"parameters\":[]}" + "reference_system": "{\"$schema\":\"https://proj.org/schemas/v0.6/projjson.schema.json\",\"type\":\"ProjectedCRS\",\"name\":\"undefined\",\"base_crs\":{\"name\":\"undefined\",\"datum\":{\"type\":\"GeodeticReferenceFrame\",\"name\":\"undefined\",\"ellipsoid\":{\"name\":\"undefined\",\"semi_major_axis\":6378137,\"inverse_flattening\":298.257222101},\"prime_meridian\":{\"name\":\"undefined\",\"longitude\":0}},\"coordinate_system\":{\"subtype\":\"ellipsoidal\",\"axis\":[{\"name\":\"Longitude\",\"abbreviation\":\"lon\",\"direction\":\"east\",\"unit\":\"degree\"},{\"name\":\"Latitude\",\"abbreviation\":\"lat\",\"direction\":\"north\",\"unit\":\"degree\"}]}},\"conversion\":{\"name\":\"unknown\",\"method\":{\"name\":\"Albers Equal Area\",\"id\":{\"authority\":\"EPSG\",\"code\":9822}},\"parameters\":[{\"name\":\"Latitude of false origin\",\"value\":23,\"unit\":\"degree\",\"id\":{\"authority\":\"EPSG\",\"code\":8821}},{\"name\":\"Longitude of false origin\",\"value\":-95.9999999999999,\"unit\":\"degree\",\"id\":{\"authority\":\"EPSG\",\"code\":8822}},{\"name\":\"Latitude of 1st standard parallel\",\"value\":29.5,\"unit\":\"degree\",\"id\":{\"authority\":\"EPSG\",\"code\":8823}},{\"name\":\"Latitude of 2nd standard parallel\",\"value\":45.5,\"unit\":\"degree\",\"id\":{\"authority\":\"EPSG\",\"code\":8824}},{\"name\":\"Easting at false origin\",\"value\":0,\"unit\":{\"type\":\"LinearUnit\",\"name\":\"Metre\",\"conversion_factor\":1},\"id\":{\"authority\":\"EPSG\",\"code\":8826}},{\"name\":\"Northing at false origin\",\"value\":0,\"unit\":{\"type\":\"LinearUnit\",\"name\":\"Metre\",\"conversion_factor\":1},\"id\":{\"authority\":\"EPSG\",\"code\":8827}}]},\"coordinate_system\":{\"subtype\":\"Cartesian\",\"axis\":[{\"name\":\"Easting\",\"abbreviation\":\"E\",\"direction\":\"east\",\"unit\":\"metre\"},{\"name\":\"Northing\",\"abbreviation\":\"N\",\"direction\":\"north\",\"unit\":\"metre\"}]}}" } }, "cube:variables": { diff --git a/workflows/archive/iclus_hc_create_collection_from_zarr.ipynb b/workflows/archive/iclus_hc_create_collection_from_zarr.ipynb index 47b207f236e93f3072b0c125f9e6c221359ebb1e..893156005dc72e245d64102e098d347f4315df67 100644 --- a/workflows/archive/iclus_hc_create_collection_from_zarr.ipynb +++ b/workflows/archive/iclus_hc_create_collection_from_zarr.ipynb @@ -35,7 +35,6 @@ "import pandas as pd\n", "import json\n", "import numpy as np\n", - "import metpy\n", "import cartopy.crs as ccrs\n", "import cfunits\n", "import json\n", @@ -45,7 +44,8 @@ "import stac_helpers\n", "import dask\n", "import dask.array as da\n", - "from dask.distributed import Client, LocalCluster" + "from dask.distributed import Client, LocalCluster\n", + "import pyproj" ] }, { @@ -227,9 +227,13 @@ }, "outputs": [], "source": [ - "ds = ds.metpy.parse_cf()\n", - "crs = ds[list(ds.keys())[0]].metpy.pyproj_proj\n", - "#cartopycrs = ds[list(ds.keys())[0]].metpy.cartopy_crs" + "# use pyproj to automatically extract crs info\n", + "crs = pyproj.CRS.from_cf(ds.crs.attrs)\n", + "\n", + "# alternatively, create the appropriate cartopy projection\n", + "# crs = ccrs.LambertConformal(central_longitude=crs_info.longitude_of_central_meridian, \n", + "# central_latitude=crs_info.latitude_of_projection_origin,\n", + "# standard_parallels=crs_info.standard_parallel)" ] }, { @@ -342,7 +346,7 @@ }, "outputs": [], "source": [ - "transformer = Transformer.from_crs(crs.crs, \"EPSG:4326\", always_xy=True)" + "transformer = Transformer.from_crs(crs, \"EPSG:4326\", always_xy=True)" ] }, { @@ -377,7 +381,7 @@ " min_lat = lat.min()\n", " max_lon = lon.max()\n", " max_lat = lat.max()\n", - " return min_lon, min_lat, max_lon, max_la" + " return min_lon, min_lat, max_lon, max_lat" ] }, { @@ -395,10 +399,10 @@ "# min_lat = result[1]\n", "# max_lon = result[2]\n", "# max_lat = result[3]\n", - "min_lon = -127.88612576329054\n", - "min_lat = 22.872641668268155\n", - "max_lon = -65.34617124487134\n", - "max_lat = 51.60365306185643" + "# min_lon = -127.88612576329054\n", + "# min_lat = 22.872641668268155\n", + "# max_lon = -65.34617124487134\n", + "# max_lat = 51.60365306185643" ] }, { @@ -973,9 +977,9 @@ ], "metadata": { "kernelspec": { - "display_name": "global-global-pangeo", + "display_name": "geo", "language": "python", - "name": "conda-env-global-global-pangeo-py" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -987,7 +991,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.6" + "version": "3.10.0" } }, "nbformat": 4,