|
1029 | 1029 | " 'total_cloud_cover',\n", |
1030 | 1030 | " '10m_u_component_of_wind', # used to calculate wind speed\n", |
1031 | 1031 | " '10m_v_component_of_wind', # used to calculate wind speed\n", |
| 1032 | + " 'total_sky_direct_solar_radiation_at_surface',\n", |
1032 | 1033 | " 'surface_solar_radiation_downwards',\n", |
1033 | | - " 'surface_net_solar_radiation',\n", |
1034 | 1034 | " ],\n", |
1035 | 1035 | " start_time='2023-03-01T00:00:00',\n", |
1036 | 1036 | " end_time='2023-03-31T23:00:00',\n", |
|
1832 | 1832 | "calculated_wind_speed = False\n", |
1833 | 1833 | "converted_clouds = False\n", |
1834 | 1834 | "converted_temp = False\n", |
1835 | | - "converted_pressure = False" |
| 1835 | + "converted_pressure = False\n", |
| 1836 | + "converted_direct_radiation = False\n", |
| 1837 | + "converted_global_radiation = False" |
1836 | 1838 | ] |
1837 | 1839 | }, |
1838 | 1840 | { |
|
1896 | 1898 | "if not calculated_wind_speed:\n", |
1897 | 1899 | " wind_speed = metpy.calc.wind_speed(\n", |
1898 | 1900 | " (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", |
1900 | 1902 | " ).metpy.convert_units(units.kts)\n", |
1901 | 1903 | "\n", |
1902 | 1904 | " # convert to kts\n", |
|
1981 | 1983 | " converted_temp = True" |
1982 | 1984 | ] |
1983 | 1985 | }, |
| 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 | + }, |
1984 | 2010 | { |
1985 | 2011 | "cell_type": "code", |
1986 | 2012 | "execution_count": 24, |
|
2761 | 2787 | " 'total_cloud_cover': 'Total Sky Cover',\n", |
2762 | 2788 | " 'wind_speed': 'Wind Speed',\n", |
2763 | 2789 | " '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", |
2766 | 2792 | "}" |
2767 | 2793 | ] |
2768 | 2794 | }, |
|
0 commit comments