Index: trunk/ippMonitor/raw/czartool_labels.php
===================================================================
--- trunk/ippMonitor/raw/czartool_labels.php	(revision 42180)
+++ trunk/ippMonitor/raw/czartool_labels.php	(revision 42272)
@@ -207,6 +207,6 @@
 $ganglia = "http://ganglia.pan-starrs.ifa.hawaii.edu";
 $svnlink = "https://svn.pan-starrs.ifa.hawaii.edu/trac/ipp";
-$conflink = "https://confluence.ipp.ifa.hawaii.edu";
-$jiralink = "https://jira.ipp.ifa.hawaii.edu";
+$conflink = "https://panstarrs.atlassian.net";
+$jiralink = "https://panstarrs.atlassian.net";
 $hsttime1 = date("Y-m-d H:i:s", strtotime("$lastUpdateTime"));
 $utctime1 = gmdate("Y-m-d H:i:s", strtotime("$lastUpdateTime"));
@@ -241,7 +241,7 @@
   &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>";
 echo "<tr><td>Documentations for IPP</td>
-          <td><a href=\"$conflink/pages/viewrecentblogposts.action?key=IPPCZAR\" target=new><font color=\"blue\">Czarblog</font></a>
-  &nbsp|&nbsp <a href=\"$conflink/display/IPPCZAR/IPP-Czaring+Home\" target=new><font color=\"blue\">Confluence</font></a>
-  &nbsp|&nbsp <a href=\"$jiralink/projects/IPP/issues/filter=allissues\" target=new><font color=\"blue\">Jira</font></a>
+          <td><a href=\"$conflink/wiki/spaces/IPPCZAR/pages/679903282/Czarblog+Roll\" target=new><font color=\"blue\">Czarblog</font></a>
+  &nbsp|&nbsp <a href=\"$conflink/wiki/spaces/IPPCZAR/overview\" target=new><font color=\"blue\">Confluence</font></a>
+  &nbsp|&nbsp <a href=\"$jiralink/issues/?filter=-4\" target=new><font color=\"blue\">Jira</font></a>
   &nbsp|&nbsp <a href=\"$svnlink/\" target=new><font color=\"blue\">trac</font></a></td></tr>";
 echo "<tr><td>Current nightly science status</td> 
@@ -288,4 +288,5 @@
 showReplicationsStatus($REPL_HOST_NEBULOUS_SECONDARY, $REPL_USER_NEBULOUS_SECONDARY, $REPL_PASSWORD_NEBULOUS_SECONDARY, $REPL_LABEL_NEBULOUS_SECONDARY);
 showReplicationsStatus($REPL_HOST_NEBULOUS_TERTIARY, $REPL_USER_NEBULOUS_TERTIARY, $REPL_PASSWORD_NEBULOUS_TERTIARY, $REPL_LABEL_NEBULOUS_TERTIARY);
+showReplicationsStatus($REPL_HOST_NEBULOUS_QUATERNARY, $REPL_USER_NEBULOUS_QUATERNARY, $REPL_PASSWORD_NEBULOUS_QUATERNARY, $REPL_LABEL_NEBULOUS_QUATERNARY);
 // other dbs
 showDatabaseStatus($HOST_PSTAMP, $USER_PSTAMP, $PASSWORD_PSTAMP, $LABEL_PSTAMP);
@@ -364,8 +365,8 @@
    # gnuplots
    # time series plot
-#   echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br><br>";
-#   echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=log\"><br><br>";
+   echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br><br>";
+   echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=log\"><br><br>";
    # rate series plot
-#   echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=rt&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br><br>";
+   echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=rt&label=$selectedLabel&proj=$proj&stage=$selectedStage&plottype=linear\"><br><br>";
    #for dev version
    # google chart
@@ -382,11 +383,10 @@
 }
 
-
 # data quality timeseries
 echo getDataQuality($projectdb);
 # storage timeseries
-echo getSpaces($czardb);
+#echo getSpaces($czardb);
 # storage plot
-echo getHosts($czardb);
+#echo getHosts($czardb);
 
 # timer for main page end
@@ -1727,5 +1727,4 @@
 
     $sql = "select format(used/total*100,1), usable from cluster_space order by timestamp desc limit 1;";
-
     if ($debug) {echo "$sql<br>";}
     $qry = $db->query($sql);
@@ -1810,5 +1809,4 @@
 }
 
-
 ###########################################################################
 #
@@ -1823,4 +1821,16 @@
     $start = $time;
 
+    $date = gmdate("Y-m-d");
+    $sql = "SELECT MAX(exp_id) FROM rawExp WHERE dateobs >= date_sub('$date', interval 20 day) AND dateobs <= date_sub('$date', interval 10 day)";
+    $qry = $db->query($sql);
+    if (dberror($qry)) {
+        print "*** WARNING: no data in period 10-20 days before requested date (query will be slower) **\n";
+        $refExpID = 0;
+    }
+    $qry->fetchInto($refExpID);
+    if ($refExpID[0] = 'NULL') {
+        $refExpID[0] = 0;
+    }
+
     #Query for the needed data
     $DQarray = array();
@@ -1829,4 +1839,5 @@
 #    $sql.= " WHERE (rawExp.dateobs > utc_date() - INTERVAL 14 hour) and (rawExp.dateobs < utc_date() + INTERVAL 10 hour)";
     $sql.= " WHERE (rawExp.dateobs > utc_date())";
+    $sql.= " AND exp_id > $refExpID[0]";
     $sql.= " AND exp_type = 'OBJECT' AND camRun.state like 'full' ORDER BY dateobs asc;";
     if ($debug) {echo "$sql<br>";}
@@ -2070,5 +2081,5 @@
    echo "     vAxis: {  ";
    echo "                  title: 'Zeropoint offset (mag)',";
-   echo "     viewWindow: {   min: -0.5, max: 0.5    },  ";
+   echo "     viewWindow: {   min: -0.25, max: 0.25    },  ";
    echo "     },";
    echo "     chartArea: {left:80, top:50, right:20, bottom:50},";
