IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42360


Ignore:
Timestamp:
Feb 4, 2023, 7:34:46 AM (3 years ago)
Author:
eugene
Message:

merge from trunk : plot improvements

Location:
branches/eam_branches/ipp-20220316/ippMonitor
Files:
2 deleted
6 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20220316/ippMonitor

  • branches/eam_branches/ipp-20220316/ippMonitor/Makefile.in

    r42199 r42360  
    8686$(DESTWWW)/show_log.php \
    8787$(DESTWWW)/heathers_plot.php \
     88$(DESTWWW)/storage.php \
     89$(DESTWWW)/skycoverage.php \
     90$(DESTWWW)/ganglia.php \
    8891$(DESTWWW)/loader.js
    8992
  • branches/eam_branches/ipp-20220316/ippMonitor/def/autocodeImage.php

    r39498 r42360  
    115115  foreach ($row as $i => $value) {
    116116    switch ($value) {
     117    case 'g.00002':
     118      $filter = 1;
     119      break;
     120    case 'r.00002':
     121      $filter = 2;
     122      break;
     123    case 'i.00002':
     124      $filter = 3;
     125      break;
     126    case 'z.00002':
     127      $filter = 4;
     128      break;
     129    case 'y.00002':
     130      $filter = 5;
     131      break;
     132    case 'w.00002':
     133      $filter = 6;
     134      break;
    117135    case 'g.00000':
    118136      $filter = 1;
  • branches/eam_branches/ipp-20220316/ippMonitor/raw/czartool_labels.php

    r42040 r42360  
    207207$ganglia = "http://ganglia.pan-starrs.ifa.hawaii.edu";
    208208$svnlink = "https://svn.pan-starrs.ifa.hawaii.edu/trac/ipp";
    209 $conflink = "https://confluence.ipp.ifa.hawaii.edu";
    210 $jiralink = "https://jira.ipp.ifa.hawaii.edu";
     209$conflink = "https://panstarrs.atlassian.net";
    211210$hsttime1 = date("Y-m-d H:i:s", strtotime("$lastUpdateTime"));
    212211$utctime1 = gmdate("Y-m-d H:i:s", strtotime("$lastUpdateTime"));
     
    218217          <td> PHP: v.$phpversion
    219218  &nbsp|&nbsp <a href=\"$svnlink/browser/trunk/ippMonitor\" target=new><font color=\"blue\">SVN: v.$svnversion</font></a>
    220   &nbsp|&nbsp <a href=\"$jiralink/browse/IPP-86\" target=new><font color=\"blue\">Jira</font></a>
    221   &nbsp|&nbsp <a href=\"http://ippmonitor.ipp.ifa.hawaii.edu/ippMonitor/czartool_labels.php?pass=$pass&proj=$proj\"><font color=\"blue\">online</font></a>,
    222        &nbsp <a href=\"http://ipp117.ipp.ifa.hawaii.edu/ippMonitor/czartool_labels.php?pass=$pass&proj=$proj\"><font color=\"blue\">dev</font></a>,
    223        &nbsp <a href=\"czartool_labels_last.php?pass=$pass&proj=$proj\"><font color=\"blue\">last</font></a>
     219
     220  &nbsp|&nbsp <a href=\"http://ippmonitor.ipp.ifa.hawaii.edu/ippMonitor/czartool_labels.php?pass=$pass&proj=$proj\"><font color=\"blue\">online (ipp113) </font></a>,
     221       &nbsp <a href=\"http://ipp117.ipp.ifa.hawaii.edu/ippMonitor/czartool_labels.php?pass=$pass&proj=$proj\"><font color=\"blue\">dev (ipp117) </font></a>
    224222       version </td></tr>";
    225223echo "<tr><td>Pan-STARRS Data Store</td>
     
    239237          <td><a href=\"$ganglia/?r=hour&s=descending&hc=6&c=IPP%2520Production\" target=new> <font color=\"blue\">Load_reports</font></a>
    240238  &nbsp|&nbsp <a href=\"$ganglia/?m=cpu_report&r=hour&s=by%2520name&c=IPP+Production&h=&sh=1&hc=8&z=small\" target=new> <font color=\"blue\">CPU_reports</font></a>
    241   &nbsp|&nbsp <a href=\"$ganglia/?m=mem_report&r=hour&s=by%2520name&c=IPP+Production&h=&sh=1&hc=8&z=small\" target=new> <font color=\"blue\">Memory_reports</font></a></td></tr>";
     239  &nbsp|&nbsp <a href=\"$ganglia/?m=mem_report&r=hour&s=by%2520name&c=IPP+Production&h=&sh=1&hc=8&z=small\" target=new> <font color=\"blue\">Memory_reports</font></a>
     240  </td></tr>";
    242241echo "<tr><td>Documentations for IPP</td>
    243           <td><a href=\"$conflink/pages/viewrecentblogposts.action?key=IPPCZAR\" target=new><font color=\"blue\">Czarblog</font></a>
    244   &nbsp|&nbsp <a href=\"$conflink/display/IPPCZAR/IPP-Czaring+Home\" target=new><font color=\"blue\">Confluence</font></a>
    245   &nbsp|&nbsp <a href=\"$jiralink/projects/IPP/issues/filter=allissues\" target=new><font color=\"blue\">Jira</font></a>
    246   &nbsp|&nbsp <a href=\"$svnlink/\" target=new><font color=\"blue\">trac</font></a></td></tr>";
     242          <td><a href=\"$conflink/wiki/spaces/IPPCZAR/pages/679903282/Czarblog+Roll\" target=new><font color=\"blue\">Czarblog</font></a>
     243  &nbsp|&nbsp <a href=\"$conflink/wiki/spaces/IPPCZAR/pages/678634250/Czar+Guidelines\" target=new><font color=\"blue\">Czar guidelines</font></a>
     244  &nbsp|&nbsp <a href=\"$conflink/browse/IPP-86\" target=new><font color=\"blue\">ippMonitor Jira</font></a>
     245  &nbsp|&nbsp <a href=\"$conflink/wiki/spaces/IKB/pages/678298859/IPP+Hardware+Status\" target=new><font color=\"blue\">Hardware</font></a>
     246  &nbsp|&nbsp <a href=\"$svnlink/\" target=new><font color=\"blue\">trac</font></a>
     247  </td></tr>";
    247248echo "<tr><td>Current nightly science status</td>
    248249          <td>".getNightlyScienceStatus($czardb, $proj)."</td></tr>";
     
    285286// nebulous dbs
    286287showDatabaseStatus($HOST_NEBULOUS, $USER_NEBULOUS, $PASSWORD_NEBULOUS, $LABEL_NEBULOUS);
    287 showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_LABEL_NEBULOUS);
     288//showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_LABEL_NEBULOUS);
    288289showReplicationsStatus($REPL_HOST_NEBULOUS_SECONDARY, $REPL_USER_NEBULOUS_SECONDARY, $REPL_PASSWORD_NEBULOUS_SECONDARY, $REPL_LABEL_NEBULOUS_SECONDARY);
    289290showReplicationsStatus($REPL_HOST_NEBULOUS_TERTIARY, $REPL_USER_NEBULOUS_TERTIARY, $REPL_PASSWORD_NEBULOUS_TERTIARY, $REPL_LABEL_NEBULOUS_TERTIARY);
     291showReplicationsStatus($REPL_HOST_NEBULOUS_QUATERNARY, $REPL_USER_NEBULOUS_QUATERNARY, $REPL_PASSWORD_NEBULOUS_QUATERNARY, $REPL_LABEL_NEBULOUS_QUATERNARY);
    290292// other dbs
    291293showDatabaseStatus($HOST_PSTAMP, $USER_PSTAMP, $PASSWORD_PSTAMP, $LABEL_PSTAMP);
     
    368370   # rate series plot
    369371   echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=rt&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br><br>";
     372   #for dev version
     373   # google chart
     374   # time series plot
     375   #echo Gettimeseries($czardb, $selectedMode, $selectedLabel, $proj, $selectedStage);
     376   # rate series plot
     377   #echo Getrate($czardb, $selectedMode, $selectedLabel, $proj, $selectedStage);
    370378} else {
    371379   # google chart
     
    16071615    echo "    <div style=\"font-size: 12px; height: 14px; border: 1px solid; background-color: #bbbbbb\"><center>Down | Repair</div>";
    16081616    echo "    <div style=\"font-size: 12px; height: 14px; border: 1px solid; background-color: #ffffff\"><center>Power Off</div>";
    1609     echo "    <div style=\"font-size: 12px; height: 14px; border: 1px solid; background-color: #ffffff\"><center>
    1610                  <a href=\"https://confluence.ipp.ifa.hawaii.edu/display/IKB/IPP+Hardware+Status#IPPHardwareStatus-StorageNodes\" target=new><font color=\"blue\">Notes</font></a></div>";
    16111617    echo "  </div>";
    16121618    echo "</div>";
     
    16211627    echo "     'free', {type: 'string', role: 'style'}, {type: 'string', role: 'tooltip', 'p': {'html': true}}],";
    16221628
    1623     $sql = "SELECT host, format(total,1), format(available,2), format(used,2), writable, readable, format(used/total*100,2) FROM hosts";
     1629    $sql = "SELECT host, format(total,1), format(available,2), format(used,2), writable, readable, format(used/total*100,2) FROM hosts order by host";
    16241630    if ($debug) {echo "$sql<br>";}
    16251631    $qry = $db->query($sql);
     
    18021808}
    18031809
    1804 
    18051810###########################################################################
    18061811#
     
    18151820    $start = $time;
    18161821
     1822    $date = gmdate("Y-m-d");
     1823    $sql = "SELECT MAX(exp_id) FROM rawExp WHERE dateobs >= date_sub('$date', interval 20 day) AND dateobs <= date_sub('$date', interval 10 day)";
     1824    $qry = $db->query($sql);
     1825    if (dberror($qry)) {
     1826        print "*** WARNING: no data in period 10-20 days before requested date (query will be slower) **\n";
     1827        $refExpID = 0;
     1828    }
     1829    $qry->fetchInto($refExpID);
     1830    if ($refExpID[0] = 'NULL') {
     1831        $refExpID[0] = 0;
     1832    }
     1833
    18171834    #Query for the needed data
    18181835    $DQarray = array();
     
    18211838#    $sql.= " WHERE (rawExp.dateobs > utc_date() - INTERVAL 14 hour) and (rawExp.dateobs < utc_date() + INTERVAL 10 hour)";
    18221839    $sql.= " WHERE (rawExp.dateobs > utc_date())";
     1840    $sql.= " AND exp_id > $refExpID[0]";
    18231841    $sql.= " AND exp_type = 'OBJECT' AND camRun.state like 'full' ORDER BY dateobs asc;";
    18241842    if ($debug) {echo "$sql<br>";}
     
    18301848
    18311849    #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];
     1850#    foreach($DQarray as $row) {
     1851#        $zpt[]    = $row[3];
     1852#    }
     1853
     1854#    sort($zpt);
     1855#    $count = sizeof($zpt);   // cache the count
     1856#    $index = floor($count/2);  // cache the index
     1857#    $zpt_med = $zpt[$index];
    18401858
    18411859    #echo "<script type=\"text/javascript\" src=\"https://www.gstatic.com/charts/loader.js\"></script>";
     
    19271945    echo "        data.addColumn('datetime', 'Time');";
    19281946    echo "        data.addColumn('number', 'zeropoint');";
     1947    echo "        data.addColumn({'type': 'string', 'role': 'style'});";
    19291948    echo "        data.addColumn({'type': 'string', 'role': 'tooltip', 'p': {'html': true}});";
    19301949    echo "        data.addColumn({id:'i0', type:'number', role:'interval'});";
     1950    echo "        data.addColumn({id:'i0','type': 'string', 'role': 'style'});";
    19311951    echo "        data.addColumn({id:'i0', type:'number', role:'interval'});";
     1952    echo "        data.addColumn({id:'i0','type': 'string', 'role': 'style'});";
    19321953    echo "   data.addRows([";
    19331954    foreach($DQarray as $row) {
     
    19401961        $zp_low = $zp-$zp_stdev;
    19411962        $zp_high = $zp+$zp_stdev;
     1963        $col_string = '#0000ff';
     1964        $zpt_off = 0.;
    19421965
    19431966        $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]);
    19441967#       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],";
     1968       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'],";
    19461969    }
    19471970
     
    19581981   echo "               alignment: 'center',";
    19591982   echo "              },";
    1960    echo "     lineWidth: 2, ";
    19611983   echo "     series: {";
    1962    echo "         0: { color: '#0000ff', lineWidth: 3 },      ";
     1984   echo "         0: { color: '#0000ff'},      ";
    19631985   echo "              },";
    1964    echo "     intervals: { 'style':'line' },  ";
     1986   echo "     intervals: { color: 'grey','style':'points', pointSize: 1 },  ";
    19651987   echo "     hAxis: {  ";
    19661988   echo "             title: 'Date/Time (HST)',";
     
    19741996   echo "     fontSize: 12,";
    19751997   echo "   };";
    1976    echo "   var chart = new google.visualization.LineChart(document.getElementById('dqzp_div'));";
     1998   echo "   var chart = new google.visualization.ScatterChart(document.getElementById('dqzp_div'));";
    19771999   echo "   chart.draw(data, options);";
    19782000   echo " }";
     
    19972019    echo "        data.addColumn('datetime', 'Time');";
    19982020    echo "        data.addColumn('number', 'zeropoint');";
     2021    echo "        data.addColumn({'type': 'string', 'role': 'style'});";
    19992022    echo "        data.addColumn({'type': 'string', 'role': 'tooltip', 'p': {'html': true}});";
    20002023    echo "        data.addColumn({id:'i0', type:'number', role:'interval'});";
    2001     echo "        data.addColumn({id:'i0', type:'number', role:'interval'});";
     2024    echo "        data.addColumn({id:'i1', type:'number', role:'interval'});";
    20022025    echo "   data.addRows([";
    20032026    foreach($DQarray as $row) {
     
    20082031        $zp    = $row[3];
    20092032        $zp_stdev = $row[4];
    2010         $zp_low = $zp-$zp_stdev;
    2011         $zp_high = $zp+$zp_stdev;
     2033        $zp_low = $zp_stdev;
     2034        $zp_high = $zp_stdev;
     2035        $col_string = '#0000ff';
     2036        $zpt_off = 0.;
     2037
     2038        #if(substr($row[5],0,1) == 'g') {$col_string = 'blue'; $zpt_off = $zp - 24.563;}
     2039        #if(substr($row[5],0,1) == 'r') {$col_string = 'red'; $zpt_off = $zp - 24.740;}
     2040        #if(substr($row[5],0,1) == 'i') {$col_string = '#6a3d9a'; $zpt_off = $zp - 24.611;}
     2041        #if(substr($row[5],0,1) == 'z') {$col_string = 'green'; $zpt_off = $zp - 24.250;}
     2042        #if(substr($row[5],0,1) == 'y') {$col_string = 'cyan'; $zpt_off = $zp - 23.320;}
     2043        #if(substr($row[5],0,1) == 'w') {$col_string = 'grey'; $zpt_off = $zp - 26.300;}
     2044
     2045        #define new zeropoints
     2046        if(substr($row[5],0,1) == 'g') {$col_string = 'blue'; $zpt_off = $zp - 25.013;}
     2047        if(substr($row[5],0,1) == 'r') {$col_string = 'red'; $zpt_off = $zp - 24.840;}
     2048        if(substr($row[5],0,1) == 'i') {$col_string = '#6a3d9a'; $zpt_off = $zp - 24.711;}
     2049        if(substr($row[5],0,1) == 'z') {$col_string = 'green'; $zpt_off = $zp - 24.30;}
     2050        if(substr($row[5],0,1) == 'y') {$col_string = 'cyan'; $zpt_off = $zp - 23.57;}
     2051        if(substr($row[5],0,1) == 'w') {$col_string = 'grey'; $zpt_off = $zp - 26.000;}
    20122052
    20132053        $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]);
    20142054#       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],";
     2055       echo "[new Date($dat[0], $dat[1]-1, $dat[2], $tm[0], $tm[1]), $zpt_off,'$col_string','$tt_string1', $zp_low, $zp_high],";
    20162056    }
    20172057
     
    20282068   echo "               alignment: 'center',";
    20292069   echo "              },";
    2030    echo "     lineWidth: 2, ";
     2070   echo "     pointSize: 3, ";
    20312071   echo "     series: {";
    2032    echo "         0: { color: '#0000ff', lineWidth: 3 },      ";
     2072   echo "         0: { color: '#0000ff'},      ";
    20332073   echo "              },";
    2034    echo "     intervals: { 'style':'line' },  ";
     2074   echo "     intervals: { color: 'grey','style':'points', pointSize: 1 },  ";
    20352075   echo "     hAxis: {  ";
    20362076   echo "             title: 'Date/Time (HST)',";
     
    20392079   echo "     },";
    20402080   echo "     vAxis: {  ";
    2041    echo "                  title: 'Zeropoint (mag)',";
    2042    echo "     viewWindow: {   min: $zpt_med-0.2, max: $zpt_med+0.2    },  ";
     2081   echo "                  title: 'Zeropoint offset (mag)',";
     2082   echo "     viewWindow: {   min: -0.25, max: 0.25    },  ";
    20432083   echo "     },";
    20442084   echo "     chartArea: {left:80, top:50, right:20, bottom:50},";
    20452085   echo "     fontSize: 12,";
    20462086   echo "   };";
    2047    echo "   var chart = new google.visualization.LineChart(document.getElementById('dqzp_zoom_div'));";
     2087   echo "   var chart = new google.visualization.ScatterChart(document.getElementById('dqzp_zoom_div'));";
    20482088   echo "   chart.draw(data, options);";
    20492089   echo " }";
     
    20602100    echo "<center>loading plot in $total_time seconds<br></center>";
    20612101}
    2062 
    20632102
    20642103###########################################################################
     
    29683007
    29693008?>
    2970 
  • branches/eam_branches/ipp-20220316/ippMonitor/raw/ipp.czar.dat

    r40840 r42360  
    1 input     | ipp.menu.dat
     1input      | ipp.menu.dat
    22
    3 menutop   | menutop      | plain   | &nbsp;   |   
     3menutop    | menutop         | plain   | &nbsp;                 |   
    44
    5 menulink   | menuselect      | link    | czartool        | czartool_labels.php
    6 menulink   | menuselect      | link    | mask stats                   | maskStats.php
    7 menulink   | menuselect      | link    | night summary                | nightSummary.php
    8 menutop   | menutop      | plain   | &nbsp;                       |
    9 menulink  | menuselect   | link    | Exposures Status             | exposureStatus.php
    10 menulink  | menuselect   | link    | MOPS Exposures Status        | mopsStatus.php
    11 menulink  | menuselect   | link    | MySql ProcessList            | gpc1MysqlProcessList.php
     5menulink   | menuselect      | link    | czartool               | czartool_labels.php
     6menulink   | menuselect      | link    | storage status         | storage.php
     7menulink   | menuselect      | link    | mask stats             | maskStats.php
     8menulink   | menuselect      | link    | night summary          | nightSummary.php
     9menulink   | menuselect      | link    | skycoverage            | skycoverage.php
     10menulink   | menuselect      | link    | ganglia                | ganglia.php
    1211
     12menutop    | menutop         | plain   | &nbsp;                 |
     13
     14menulink   | menuselect      | link    | Exposures Status       | exposureStatus.php
     15menulink   | menuselect      | link    | MOPS Exposures Status  | mopsStatus.php
     16menulink   | menuselect      | link    | MySql ProcessList      | gpc1MysqlProcessList.php
     17
  • branches/eam_branches/ipp-20220316/ippMonitor/raw/ipp.plots.dat

    r41202 r42360  
    1111menulink  | menuselect      | link    | Simple plot - diff                  | simplePlotDiffImage.php
    1212menulink  | menuselect      | link    | Subset plot - diff                  | subsetPlotDiffImage.php
    13 menulink  | menuselect      | link    | Heather's Plots                     | heathers_plot.php
    1413
    1514menutop   | menutop      | plain   | &nbsp;                                 |
Note: See TracChangeset for help on using the changeset viewer.