<commit_before><?php
putenv("TZ=GMT");
include("../../config/settings.inc.php");
include("$rootpath/include/database.inc.php");
$mos = iemdb("mos");
pg_exec($mos, "SET TIME ZONE 'GMT'");


$station = isset($_GET["station"])? $_GET["station"]: "KAMW";
$ts = isset($_GET["valid"])? strtotime($_GET["valid"]): time();
$year = date("Y", $ts);
if ($year == 1970){
	exit();
}

$rs = pg_prepare($mos, "SELECTOR", "select *, t06_1 ||'/'||t06_2 as t06, 
                 t12_1 ||'/'|| t12_2 as t12  from t${year} WHERE station = $1
                 and ftime >= $2 and ftime <= ($2 + '10 days'::interval) ORDER by ftime ASC");


if (isset($_GET["runtime"]) && isset($_GET["model"])){
  $ts = strtotime($_GET["runtime"]);
  $year = date("Y", $ts);
  $rs = pg_prepare($mos, "SELECTOR2", "select *, t06_1 ||'/'||t06_2 as t06, 
                 t12_1 ||'/'|| t12_2 as t12  from t${year} WHERE station = $1
                 and runtime = $2 and model = $3 ORDER by ftime ASC");
  $rs = pg_execute($mos, "SELECTOR2", Array($station, date("Y-m-d H:i",$ts),<commit_msg>prevent ugly error from hitting the db<commit_after><?php
putenv("TZ=GMT");
include("../../config/settings.inc.php");
include("$rootpath/include/database.inc.php");
$mos = iemdb("mos");
pg_exec($mos, "SET TIME ZONE 'GMT'");


$station = isset($_GET["station"])? $_GET["station"]: "KAMW";
$ts = isset($_GET["valid"])? strtotime($_GET["valid"]): time();
$year = date("Y", $ts);
if ($year < 2000){
	exit();
}

$rs = pg_prepare($mos, "SELECTOR", "select *, t06_1 ||'/'||t06_2 as t06, 
                 t12_1 ||'/'|| t12_2 as t12  from t${year} WHERE station = $1
                 and ftime >= $2 and ftime <= ($2 + '10 days'::interval) ORDER by ftime ASC");


if (isset($_GET["runtime"]) && isset($_GET["model"])){
  $ts = strtotime($_GET["runtime"]);
  $year = date("Y", $ts);
  $rs = pg_prepare($mos, "SELECTOR2", "select *, t06_1 ||'/'||t06_2 as t06, 
                 t12_1 ||'/'|| t12_2 as t12  from t${year} WHERE station = $1
                 and runtime = $2 and model = $3 ORDER by ftime ASC");
  $rs = pg_execute($mos, "SELECTOR2", Array($station, date("Y-m-d H:i",$ts),
{'fraction_non_alphanumeric': 0.23825187969924813, 'fraction_numerical': 0.043233082706766915, 'mean_word_length': 3.6997792494481234, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '2532011', 'n_tokens_mistral': 839, 'n_tokens_neox': 794, 'n_words': 197}