Merge pull request #69 from srcarter3/website

Updates to website branch to reflect new changes in METARs blog
This commit is contained in:
srcarter3 2022-06-13 14:43:45 -06:00 committed by GitHub
commit b271e54463
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 543 additions and 11 deletions

View file

@ -273,26 +273,29 @@
"# define a dictionary and array that will be populated from our for loop below\n",
"obs = dict({params: [] for params in params})\n",
"station_names = []\n",
"time_title = \"\"\n",
"\n",
"# only grab the first skyCover record related to a station \n",
"new_station_id = True\n",
"# cycle through all the data in the response\n",
"for ob in response:\n",
"# cycle through all the data in the response, in reverse order to get the most recent data first\n",
"for ob in reversed(response):\n",
" avail_params = ob.getParameters()\n",
" # if it has cloud information and is the first entry for this station id\n",
" if \"skyCover\" in avail_params and new_station_id:\n",
" # store the associated cloud cover int for the skyCover string\n",
" obs['skyCover'].append(get_cloud_cover(ob.getString(\"skyCover\")))\n",
" new_station_id = False\n",
" #print(avail_params)\n",
" # if it has cloud information, we want the last of the 6 entries (most recent)\n",
" if \"skyCover\" in avail_params:\n",
" if i == 5:\n",
" # store the associated cloud cover int for the skyCover string\n",
" obs['skyCover'].append(get_cloud_cover(ob.getString(\"skyCover\")))\n",
" i = i + 1\n",
" elif \"stationName\" in avail_params:\n",
" new_station_id=True\n",
" # If we already have a record for this stationName, skip\n",
" if ob.getString('stationName') not in station_names:\n",
" station_names.append(ob.getString('stationName'))\n",
" i = 0\n",
" for param in single_value_params: \n",
" if param in avail_params:\n",
" if param == 'timeObs':\n",
" obs[param].append(datetime.fromtimestamp(ob.getNumber(param)/1000.0))\n",
" if time_title == \"\":\n",
" time_title = str(ob.getDataTime())\n",
" else:\n",
" try:\n",
" obs[param].append(ob.getNumber(param))\n",
@ -392,7 +395,7 @@
"\n",
"# Set plot bounds\n",
"ax.set_extent((-118, -73, 23, 50))\n",
"ax.set_title(str(ob.getDataTime()) + \" | METAR | \" + edexServer)\n",
"ax.set_title(time_title + \" | METAR | \" + edexServer)\n",
"\n",
"# Winds, temps, dewpoint, station id\n",
"custom_layout = StationPlotLayout()\n",

File diff suppressed because one or more lines are too long