From 7ed6480e485996b5f5fb3faa10cb95a083ad29ed Mon Sep 17 00:00:00 2001 From: jrutyna Date: Wed, 3 Apr 2024 10:35:12 -0400 Subject: [PATCH 1/3] Updated gssha_demo.ipynb 1) Fixed direct and global radiation parameter selection, 2) performs unit conversion from J/m^2 to W/m^2 for both direct and global radiation parameters, and 3) fixed wind speed calculation --- examples/gssha_demo.ipynb | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/examples/gssha_demo.ipynb b/examples/gssha_demo.ipynb index b933d81..98919a2 100644 --- a/examples/gssha_demo.ipynb +++ b/examples/gssha_demo.ipynb @@ -1029,8 +1029,8 @@ " 'total_cloud_cover',\n", " '10m_u_component_of_wind', # used to calculate wind speed\n", " '10m_v_component_of_wind', # used to calculate wind speed\n", + " 'total_sky_direct_solar_radiation_at_surface',\n", " 'surface_solar_radiation_downwards',\n", - " 'surface_net_solar_radiation',\n", " ],\n", " start_time='2023-03-01T00:00:00',\n", " end_time='2023-03-31T23:00:00',\n", @@ -1832,7 +1832,9 @@ "calculated_wind_speed = False\n", "converted_clouds = False\n", "converted_temp = False\n", - "converted_pressure = False" + "converted_pressure = False\n", + "converted_direct_radiation = False\n", + "converted_global_radiation = False" ] }, { @@ -1896,7 +1898,7 @@ "if not calculated_wind_speed:\n", " wind_speed = metpy.calc.wind_speed(\n", " (hmet_data['10m_u_component_of_wind'] * units.meter_per_second),\n", - " (hmet_data['10m_u_component_of_wind'] * units.meter_per_second),\n", + " (hmet_data['10m_v_component_of_wind'] * units.meter_per_second),\n", " ).metpy.convert_units(units.kts)\n", "\n", " # convert to kts\n", @@ -1981,6 +1983,30 @@ " converted_temp = True" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Convert both direct and global radition to W/m^2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "if not converted_direct_radiation:\n", + " hmet_data['total_sky_direct_solar_radiation_at_surface'] = hmet_data['total_sky_direct_solar_radiation_at_surface'] / 3600\n", + " hmet_data['total_sky_direct_solar_radiation_at_surface'].attrs['units'] = 'W/m^2'\n", + " converted_direct_radiation = True\n", + "\n", + "if not converted_global_radiation:\n", + " hmet_data['surface_solar_radiation_downwards'] = hmet_data['surface_solar_radiation_downwards'] / 3600\n", + " hmet_data['surface_solar_radiation_downwards'].attrs['units'] = 'W/m^2'\n", + " converted_global_radiation = True" + ] + }, { "cell_type": "code", "execution_count": 24, @@ -2761,8 +2787,8 @@ " 'total_cloud_cover': 'Total Sky Cover',\n", " 'wind_speed': 'Wind Speed',\n", " '2m_temperature': 'Dry Bulb Temperature',\n", - " 'surface_solar_radiation_downwards': 'Direct Radiation',\n", - " 'surface_net_solar_radiation': 'Global Radiation',\n", + " 'total_sky_direct_solar_radiation_at_surface': 'Direct Radiation',\n", + " 'surface_solar_radiation_downwards': 'Global Radiation',\n", "}" ] }, From 109b0fc4f0f7dfc633538f914ba72744e8e88d62 Mon Sep 17 00:00:00 2001 From: Anthony Aufdenkampe Date: Mon, 17 Feb 2025 11:18:27 -0600 Subject: [PATCH 2/3] Add icechunk conda env First step toward #5. It was interesting to see that icechunk itself is rather light-weight, with minimal dependencies. --- environment_icechunk.yml | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 environment_icechunk.yml diff --git a/environment_icechunk.yml b/environment_icechunk.yml new file mode 100644 index 0000000..2457124 --- /dev/null +++ b/environment_icechunk.yml @@ -0,0 +1,55 @@ +name: icechunk +channels: + - conda-forge + # - nodefaults # Speeds solving env, by limiting the number of options + +dependencies: + - python =3.12 + + # Data Engine + - icechunk # installs zarr3 + + # Data processing + - geopandas # installs shapely, pyarrow, pyogrio, libgdal, networkx + - xarray + - rioxarray + - dask + + # Remote Access + - fsspec + - s3fs # Access to Amazon S3 filesystem + - cdsapi # Access to Copernicus Data System for ERA5 + + + # # HyRiver packages for data fetching + # - pygeoogc # Retrieve Data from RESTful, WMS, and WFS Services + # - async-retriever # Asynchronous requests with persistent caching + + # # Visualization (optional) + # - hvplot # hvPlot installs most HoloViz libs, https://holoviz.org + # - geoviews + # - contextily # for static plotting + + # # Interactivity via Jupyter Notebooks + # - jupyterlab + # - nodejs # required for many extensions + # - ipympl # jupyter-matplotlib, https://github.com/matplotlib/ipympl + # - ipywidgets # Interactive HTML widgets for Jupyter + # - ipywidgets_bokeh + # - jupyter_bokeh # Renders Holviz / Bokeh objects in Jupyter + # - pyviz_comms # bidirectional communication between Python & JavaScript for Jupyter + + # Dev tools: Language Server Protocol (LSP) (Optional) + - python-lsp-server # LSP extension for Python (pylsp), including: + - pylsp-mypy # MyPy type checking for Python >=3.7. + # - jupyterlab-lsp # Provides both server extension and lab extension + + # Environment and package management + - conda + - conda-build + - conda-libmamba-solver # Faster env solver, https://conda.github.io/conda-libmamba-solver/ + - pip + - git # for pip installing directly from GitHub + # PIP install requirements only if it is not possible with conda + - pip: + # - \ No newline at end of file From 3000951d6605208cbc4dfb15a02f19e31e7ec8af Mon Sep 17 00:00:00 2001 From: Anthony Aufdenkampe Date: Mon, 17 Feb 2025 13:06:36 -0600 Subject: [PATCH 3/3] Add VirtualiZarr & Kerchunk --- environment_icechunk.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/environment_icechunk.yml b/environment_icechunk.yml index 2457124..986b332 100644 --- a/environment_icechunk.yml +++ b/environment_icechunk.yml @@ -18,6 +18,8 @@ dependencies: # Remote Access - fsspec - s3fs # Access to Amazon S3 filesystem + - kerchunk + - virtualizarr - cdsapi # Access to Copernicus Data System for ERA5 @@ -38,6 +40,7 @@ dependencies: # - ipywidgets_bokeh # - jupyter_bokeh # Renders Holviz / Bokeh objects in Jupyter # - pyviz_comms # bidirectional communication between Python & JavaScript for Jupyter +# - jupyter_fsspec # Dev tools: Language Server Protocol (LSP) (Optional) - python-lsp-server # LSP extension for Python (pylsp), including: