<commit_before><?php
/*
 * Generate a GR placefile with TIME..MOT..LOC values 
 * $Id: $:
 */
include("../../../config/settings.inc.php");
include_once "$rootpath/include/database.inc.php";
$plimit = isset($_GET["all"]) ? "('TO','SV')" : "('TO')";
$pgconn = iemdb('postgis');
$rs = pg_query($pgconn, "SELECT x(tml_geom) as lon, y(tml_geom) as lat,
	tml_valid at time zone 'UTC' as tmlv, tml_direction, tml_sknt, 
	polygon_end at time zone 'UTC' as pe, eventid, wfo, phenomena
	 from sbw_". date("Y") ." 
	WHERE polygon_end > now() and phenomena in $plimit and status != 'CAN'
	and tml_valid is not null");

header( 'Content-type: text/plain');


putenv("TZ=GMT");

echo "RefreshSeconds: 60
Threshold: 999
Title: NWS Warning Time-Mot-Loc 
Color: 255 0 0
Font: 1, 11, 1, \"Courier New\" 

";

for ($k=0;$row=@pg_fetch_array($rs,$k);$k++){
	$valid = strtotime($row["tmlv"]);
	$pe = strtotime($row["pe"]);
	
	$dur = $pe - $valid;
	$min = $dur/60;
	$spd = floatval($row["tml_sknt"]) * 0.514444444;
	$dir = floatval($row["tml_direction"]);
	$lat1 = floatval($row["lat"]);
	$lon1 = floatval($row["lon"]);
	$distance = $spd * $dur;
	$lon2 = round($lon1 + (($distance * cos(deg2rad(270-$dir)))/(111325 * cos(deg2rad($lat1)))),6);
	$lat2 = round($lat1 + (($distance * sin(deg2rad(270-$dir)))/111325),6);

	echo "Line: 2,0,\"NWS Warning Track (". $row["wfo"] ."-". $row["phenomena"] 
	."-". $row["eventid"].")\"
  ".$lat1.",".$lon1."
  ".$lat2.",".$lon2."
End:

";<commit_msg>add title in there<commit_after><?php
/*
 * Generate a GR placefile with TIME..MOT..LOC values 
 * $Id: $:
 */
include("../../../config/settings.inc.php");
include_once "$rootpath/include/database.inc.php";
$plimit = isset($_GET["all"]) ? "('TO','SV')" : "('TO')";
$title = isset($_GET["all"]) ? "SVR+TOR" : "TOR";
$pgconn = iemdb('postgis');
$rs = pg_query($pgconn, "SELECT x(tml_geom) as lon, y(tml_geom) as lat,
	tml_valid at time zone 'UTC' as tmlv, tml_direction, tml_sknt, 
	polygon_end at time zone 'UTC' as pe, eventid, wfo, phenomena
	 from sbw_". date("Y") ." 
	WHERE polygon_end > now() and phenomena in $plimit and status != 'CAN'
	and tml_valid is not null");

header( 'Content-type: text/plain');


putenv("TZ=GMT");

echo "RefreshSeconds: 60
Threshold: 999
Title: NWS $title Warning Time-Mot-Loc 
Color: 255 0 0
Font: 1, 11, 1, \"Courier New\" 

";

for ($k=0;$row=@pg_fetch_array($rs,$k);$k++){
	$valid = strtotime($row["tmlv"]);
	$pe = strtotime($row["pe"]);
	
	$dur = $pe - $valid;
	$min = $dur/60;
	$spd = floatval($row["tml_sknt"]) * 0.514444444;
	$dir = floatval($row["tml_direction"]);
	$lat1 = floatval($row["lat"]);
	$lon1 = floatval($row["lon"]);
	$distance = $spd * $dur;
	$lon2 = round($lon1 + (($distance * cos(deg2rad(270-$dir)))/(111325 * cos(deg2rad($lat1)))),6);
	$lat2 = round($lat1 + (($distance * sin(deg2rad(270-$dir)))/111325),6);

	echo "Line: 2,0,\"NWS Warning Track (". $row["wfo"] ."-". $row["phenomena"] 
	."-". $row["eventid"].")\"
  ".$lat1.",".$lon1."
  ".$lat2.",".$lon2."
End:

";
{'fraction_non_alphanumeric': 0.24732620320855614, 'fraction_numerical': 0.042112299465240643, 'mean_word_length': 4.563197026022305, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '110258', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1237, 'n_words': 268}