Skip to content

Commit

Permalink
feat: start supporting WIGOS identifiers #603
Browse files Browse the repository at this point in the history
  • Loading branch information
akrherz committed Dec 4, 2023
1 parent eab0e03 commit e50abba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions htdocs/sites/site.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,16 @@ function df($val){
$ab = df($metadata["archive_begin"]);
$ae = df($metadata["archive_end"]);

$wigos = "";
if (! is_null($metadata["wigos"])){
$wigos = sprintf(
"<tr><th>WIGOS ID:</th>".
"<td><a href=\"https://oscar.wmo.int/surface/#/search/station/".
"stationReportDetails/%s\">%s</a></td></tr>",
$metadata["wigos"],
$metadata["wigos"]);
}

$t->content = <<<EOF
{$alertmsg}
Expand All @@ -189,6 +199,7 @@ function df($val){
<table class="table table-condensed table-striped">
<tr><th>IEM Internal ID:</th><td>{$metadata["iemid"]}</td></tr>
{$wigos}
<tr><th>Station Identifier:</th><td>{$station}</td></tr>
<tr><th>Station Name:</th><td>{$metadata["name"]}</td></tr>
<tr><th>Network:</th><td>{$network}</td></tr>
Expand Down
3 changes: 2 additions & 1 deletion scripts/dbutil/sync_stations.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def sync(df, dbname):
sigstage_record = %(sigstage_record)s, ugc_county = %(ugc_county)s,
ugc_zone = %(ugc_zone)s, id = %(id)s, ncdc81 = %(ncdc81)s,
ncei91 = %(ncei91)s,
temp24_hour = %(temp24_hour)s, precip24_hour = %(precip24_hour)s
temp24_hour = %(temp24_hour)s, precip24_hour = %(precip24_hour)s,
wigos = %(wigos)s
WHERE iemid = %(iemid)s
""",
prow,
Expand Down

0 comments on commit e50abba

Please sign in to comment.