Skip to content

Commit 7ed6480

Browse files
committed
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
1 parent 2a19d0c commit 7ed6480

1 file changed

Lines changed: 31 additions & 5 deletions

File tree

examples/gssha_demo.ipynb

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,8 +1029,8 @@
10291029
" 'total_cloud_cover',\n",
10301030
" '10m_u_component_of_wind', # used to calculate wind speed\n",
10311031
" '10m_v_component_of_wind', # used to calculate wind speed\n",
1032+
" 'total_sky_direct_solar_radiation_at_surface',\n",
10321033
" 'surface_solar_radiation_downwards',\n",
1033-
" 'surface_net_solar_radiation',\n",
10341034
" ],\n",
10351035
" start_time='2023-03-01T00:00:00',\n",
10361036
" end_time='2023-03-31T23:00:00',\n",
@@ -1832,7 +1832,9 @@
18321832
"calculated_wind_speed = False\n",
18331833
"converted_clouds = False\n",
18341834
"converted_temp = False\n",
1835-
"converted_pressure = False"
1835+
"converted_pressure = False\n",
1836+
"converted_direct_radiation = False\n",
1837+
"converted_global_radiation = False"
18361838
]
18371839
},
18381840
{
@@ -1896,7 +1898,7 @@
18961898
"if not calculated_wind_speed:\n",
18971899
" wind_speed = metpy.calc.wind_speed(\n",
18981900
" (hmet_data['10m_u_component_of_wind'] * units.meter_per_second),\n",
1899-
" (hmet_data['10m_u_component_of_wind'] * units.meter_per_second),\n",
1901+
" (hmet_data['10m_v_component_of_wind'] * units.meter_per_second),\n",
19001902
" ).metpy.convert_units(units.kts)\n",
19011903
"\n",
19021904
" # convert to kts\n",
@@ -1981,6 +1983,30 @@
19811983
" converted_temp = True"
19821984
]
19831985
},
1986+
{
1987+
"cell_type": "markdown",
1988+
"metadata": {},
1989+
"source": [
1990+
"### Convert both direct and global radition to W/m^2"
1991+
]
1992+
},
1993+
{
1994+
"cell_type": "code",
1995+
"execution_count": null,
1996+
"metadata": {},
1997+
"outputs": [],
1998+
"source": [
1999+
"if not converted_direct_radiation:\n",
2000+
" hmet_data['total_sky_direct_solar_radiation_at_surface'] = hmet_data['total_sky_direct_solar_radiation_at_surface'] / 3600\n",
2001+
" hmet_data['total_sky_direct_solar_radiation_at_surface'].attrs['units'] = 'W/m^2'\n",
2002+
" converted_direct_radiation = True\n",
2003+
"\n",
2004+
"if not converted_global_radiation:\n",
2005+
" hmet_data['surface_solar_radiation_downwards'] = hmet_data['surface_solar_radiation_downwards'] / 3600\n",
2006+
" hmet_data['surface_solar_radiation_downwards'].attrs['units'] = 'W/m^2'\n",
2007+
" converted_global_radiation = True"
2008+
]
2009+
},
19842010
{
19852011
"cell_type": "code",
19862012
"execution_count": 24,
@@ -2761,8 +2787,8 @@
27612787
" 'total_cloud_cover': 'Total Sky Cover',\n",
27622788
" 'wind_speed': 'Wind Speed',\n",
27632789
" '2m_temperature': 'Dry Bulb Temperature',\n",
2764-
" 'surface_solar_radiation_downwards': 'Direct Radiation',\n",
2765-
" 'surface_net_solar_radiation': 'Global Radiation',\n",
2790+
" 'total_sky_direct_solar_radiation_at_surface': 'Direct Radiation',\n",
2791+
" 'surface_solar_radiation_downwards': 'Global Radiation',\n",
27662792
"}"
27672793
]
27682794
},

0 commit comments

Comments
 (0)