IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42180 for trunk/ippMonitor


Ignore:
Timestamp:
Apr 27, 2022, 12:20:56 PM (4 years ago)
Author:
tdeboer
Message:

Updated magnitude zeropoints in plots

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/raw/czartool_labels.php

    r42040 r42180  
    285285// nebulous dbs
    286286showDatabaseStatus($HOST_NEBULOUS, $USER_NEBULOUS, $PASSWORD_NEBULOUS, $LABEL_NEBULOUS);
    287 showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_LABEL_NEBULOUS);
     287//showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_LABEL_NEBULOUS);
    288288showReplicationsStatus($REPL_HOST_NEBULOUS_SECONDARY, $REPL_USER_NEBULOUS_SECONDARY, $REPL_PASSWORD_NEBULOUS_SECONDARY, $REPL_LABEL_NEBULOUS_SECONDARY);
    289289showReplicationsStatus($REPL_HOST_NEBULOUS_TERTIARY, $REPL_USER_NEBULOUS_TERTIARY, $REPL_PASSWORD_NEBULOUS_TERTIARY, $REPL_LABEL_NEBULOUS_TERTIARY);
     
    364364   # gnuplots
    365365   # time series plot
    366    echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br><br>";
    367    echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=log\"><br><br>";
     366#   echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br><br>";
     367#   echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=log\"><br><br>";
    368368   # rate series plot
    369    echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=rt&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br><br>";
     369#   echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=rt&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br><br>";
     370   #for dev version
     371   # google chart
     372   # time series plot
     373   echo Gettimeseries($czardb, $selectedMode, $selectedLabel, $proj, $selectedStage);
     374   # rate series plot
     375   echo Getrate($czardb, $selectedMode, $selectedLabel, $proj, $selectedStage);
    370376} else {
    371377   # google chart
     
    375381   echo Getrate($czardb, $selectedMode, $selectedLabel, $proj, $selectedStage);
    376382}
     383
    377384
    378385# data quality timeseries
     
    17201727
    17211728    $sql = "select format(used/total*100,1), usable from cluster_space order by timestamp desc limit 1;";
     1729
    17221730    if ($debug) {echo "$sql<br>";}
    17231731    $qry = $db->query($sql);
     
    18301838
    18311839    #also find the median zeropoint
    1832     foreach($DQarray as $row) {
    1833         $zpt[]    = $row[3];
    1834     }
    1835 
    1836     sort($zpt);
    1837     $count = sizeof($zpt);   // cache the count
    1838     $index = floor($count/2);  // cache the index
    1839     $zpt_med = $zpt[$index];
     1840#    foreach($DQarray as $row) {
     1841#        $zpt[]    = $row[3];
     1842#    }
     1843
     1844#    sort($zpt);
     1845#    $count = sizeof($zpt);   // cache the count
     1846#    $index = floor($count/2);  // cache the index
     1847#    $zpt_med = $zpt[$index];
    18401848
    18411849    #echo "<script type=\"text/javascript\" src=\"https://www.gstatic.com/charts/loader.js\"></script>";
     
    19271935    echo "        data.addColumn('datetime', 'Time');";
    19281936    echo "        data.addColumn('number', 'zeropoint');";
     1937    echo "        data.addColumn({'type': 'string', 'role': 'style'});";
    19291938    echo "        data.addColumn({'type': 'string', 'role': 'tooltip', 'p': {'html': true}});";
    19301939    echo "        data.addColumn({id:'i0', type:'number', role:'interval'});";
     1940    echo "        data.addColumn({id:'i0','type': 'string', 'role': 'style'});";
    19311941    echo "        data.addColumn({id:'i0', type:'number', role:'interval'});";
     1942    echo "        data.addColumn({id:'i0','type': 'string', 'role': 'style'});";
    19321943    echo "   data.addRows([";
    19331944    foreach($DQarray as $row) {
     
    19401951        $zp_low = $zp-$zp_stdev;
    19411952        $zp_high = $zp+$zp_stdev;
     1953        $col_string = '#0000ff';
     1954        $zpt_off = 0.;
    19421955
    19431956        $tt_string1 = sprintf('time: %s\n zeropoint: %s\n filter: %s\n exp_time: %s\n comment: %s', $timestamp, $zp,$row[5],$row[6],$row[7]);
    19441957#       new Date(Year, Month, Day, Hours, Minutes, Seconds, Milliseconds)
    1945        echo "[new Date($dat[0], $dat[1]-1, $dat[2], $tm[0], $tm[1]), $zp,'$tt_string1', $zp_low, $zp_high],";
     1958       echo "[new Date($dat[0], $dat[1]-1, $dat[2], $tm[0], $tm[1]), $zp,'$col_string','$tt_string1', $zp_low,'$col_string', $zp_high,'$col_string'],";
    19461959    }
    19471960
     
    19581971   echo "               alignment: 'center',";
    19591972   echo "              },";
    1960    echo "     lineWidth: 2, ";
    19611973   echo "     series: {";
    1962    echo "         0: { color: '#0000ff', lineWidth: 3 },      ";
     1974   echo "         0: { color: '#0000ff'},      ";
    19631975   echo "              },";
    1964    echo "     intervals: { 'style':'line' },  ";
     1976   echo "     intervals: { color: 'grey','style':'points', pointSize: 1 },  ";
    19651977   echo "     hAxis: {  ";
    19661978   echo "             title: 'Date/Time (HST)',";
     
    19741986   echo "     fontSize: 12,";
    19751987   echo "   };";
    1976    echo "   var chart = new google.visualization.LineChart(document.getElementById('dqzp_div'));";
     1988   echo "   var chart = new google.visualization.ScatterChart(document.getElementById('dqzp_div'));";
    19771989   echo "   chart.draw(data, options);";
    19781990   echo " }";
     
    19972009    echo "        data.addColumn('datetime', 'Time');";
    19982010    echo "        data.addColumn('number', 'zeropoint');";
     2011    echo "        data.addColumn({'type': 'string', 'role': 'style'});";
    19992012    echo "        data.addColumn({'type': 'string', 'role': 'tooltip', 'p': {'html': true}});";
    20002013    echo "        data.addColumn({id:'i0', type:'number', role:'interval'});";
    2001     echo "        data.addColumn({id:'i0', type:'number', role:'interval'});";
     2014    echo "        data.addColumn({id:'i1', type:'number', role:'interval'});";
    20022015    echo "   data.addRows([";
    20032016    foreach($DQarray as $row) {
     
    20082021        $zp    = $row[3];
    20092022        $zp_stdev = $row[4];
    2010         $zp_low = $zp-$zp_stdev;
    2011         $zp_high = $zp+$zp_stdev;
     2023        $zp_low = $zp_stdev;
     2024        $zp_high = $zp_stdev;
     2025        $col_string = '#0000ff';
     2026        $zpt_off = 0.;
     2027
     2028        #if(substr($row[5],0,1) == 'g') {$col_string = 'blue'; $zpt_off = $zp - 24.563;}
     2029        #if(substr($row[5],0,1) == 'r') {$col_string = 'red'; $zpt_off = $zp - 24.740;}
     2030        #if(substr($row[5],0,1) == 'i') {$col_string = '#6a3d9a'; $zpt_off = $zp - 24.611;}
     2031        #if(substr($row[5],0,1) == 'z') {$col_string = 'green'; $zpt_off = $zp - 24.250;}
     2032        #if(substr($row[5],0,1) == 'y') {$col_string = 'cyan'; $zpt_off = $zp - 23.320;}
     2033        #if(substr($row[5],0,1) == 'w') {$col_string = 'grey'; $zpt_off = $zp - 26.300;}
     2034
     2035        #define new zeropoints
     2036        if(substr($row[5],0,1) == 'g') {$col_string = 'blue'; $zpt_off = $zp - 25.013;}
     2037        if(substr($row[5],0,1) == 'r') {$col_string = 'red'; $zpt_off = $zp - 24.840;}
     2038        if(substr($row[5],0,1) == 'i') {$col_string = '#6a3d9a'; $zpt_off = $zp - 24.711;}
     2039        if(substr($row[5],0,1) == 'z') {$col_string = 'green'; $zpt_off = $zp - 24.30;}
     2040        if(substr($row[5],0,1) == 'y') {$col_string = 'cyan'; $zpt_off = $zp - 23.57;}
     2041        if(substr($row[5],0,1) == 'w') {$col_string = 'grey'; $zpt_off = $zp - 26.000;}
    20122042
    20132043        $tt_string1 = sprintf('time: %s\n zeropoint: %s\n filter: %s\n exp_time: %s\n comment: %s', $timestamp, $zp,$row[5],$row[6],$row[7]);
    20142044#       new Date(Year, Month, Day, Hours, Minutes, Seconds, Milliseconds)
    2015        echo "[new Date($dat[0], $dat[1]-1, $dat[2], $tm[0], $tm[1]), $zp,'$tt_string1', $zp_low, $zp_high],";
     2045       echo "[new Date($dat[0], $dat[1]-1, $dat[2], $tm[0], $tm[1]), $zpt_off,'$col_string','$tt_string1', $zp_low, $zp_high],";
    20162046    }
    20172047
     
    20282058   echo "               alignment: 'center',";
    20292059   echo "              },";
    2030    echo "     lineWidth: 2, ";
     2060   echo "     pointSize: 3, ";
    20312061   echo "     series: {";
    2032    echo "         0: { color: '#0000ff', lineWidth: 3 },      ";
     2062   echo "         0: { color: '#0000ff'},      ";
    20332063   echo "              },";
    2034    echo "     intervals: { 'style':'line' },  ";
     2064   echo "     intervals: { color: 'grey','style':'points', pointSize: 1 },  ";
    20352065   echo "     hAxis: {  ";
    20362066   echo "             title: 'Date/Time (HST)',";
     
    20392069   echo "     },";
    20402070   echo "     vAxis: {  ";
    2041    echo "                  title: 'Zeropoint (mag)',";
    2042    echo "     viewWindow: {   min: $zpt_med-0.2, max: $zpt_med+0.2    },  ";
     2071   echo "                  title: 'Zeropoint offset (mag)',";
     2072   echo "     viewWindow: {   min: -0.5, max: 0.5    },  ";
    20432073   echo "     },";
    20442074   echo "     chartArea: {left:80, top:50, right:20, bottom:50},";
    20452075   echo "     fontSize: 12,";
    20462076   echo "   };";
    2047    echo "   var chart = new google.visualization.LineChart(document.getElementById('dqzp_zoom_div'));";
     2077   echo "   var chart = new google.visualization.ScatterChart(document.getElementById('dqzp_zoom_div'));";
    20482078   echo "   chart.draw(data, options);";
    20492079   echo " }";
     
    20602090    echo "<center>loading plot in $total_time seconds<br></center>";
    20612091}
    2062 
    20632092
    20642093###########################################################################
     
    29682997
    29692998?>
    2970 
Note: See TracChangeset for help on using the changeset viewer.