Index: /trunk/docs/VOimplementation.tex
===================================================================
--- /trunk/docs/VOimplementation.tex	(revision 208)
+++ /trunk/docs/VOimplementation.tex	(revision 209)
@@ -626,22 +626,18 @@
  Field      & Type                 & Null & Key & Default & Comments\\
 \hline      
-%\hline\multicolumn{6}{l}{\textbf{Basic file info}}\\\hline
  filename   & varchar(30)          & YES  & PRI & NULL    & All tables.\\
- fileloc    & varchar(100)         & YES  & PRI & NULL    & Called data\_loc in existing tables\\
- file\_size\_bytes & int(32)       & YES  &     & NULL    &\\
+ src\_name  & varchar(20)          & YES  &     & NULL    & Rename pulsar\_name to src\_name\\
  project\_id & varchar(10)         & YES  &     & NULL    &\\
- hdrver     & varchar(10)          & YES  &     & NULL    &\\
- survey     & varchar(10)          & YES  &     & NULL    &\\
- telescope  & varchar(16)          & YES  &     & NULL    &\\
- site       & varchar(8)           & YES  &     & NULL    &Unclear what this is -- all \texttt{observations} have site=7.\\
-%\hline\multicolumn{6}{l}{\textbf{Where and when}}\\\hline
- src\_name  & varchar(20)          & YES  &     & NULL    & Rename pulsar\_name to src\_name\\
+ raj        & varchar(15)          & YES  &     & NULL    & Text format 12:34:56.78\\
+ decj       & varchar(15)          & YES  &     & NULL    &\\
+ data\_type & varchar(16)          & YES  &     & NULL    &\\
+ obsfreq    & double               & YES  &     & NULL    &\\
+ bw         & double               & YES  &     & NULL    &\\
+ scanlen    & double               & YES  &     & NULL    & Rename \texttt{observations} field length\\
  date       & varchar(16)          & YES  &     & NULL    &\\
  ut         & varchar(16)          & YES  &     & NULL    &\\
  mjd        & double               & YES  &     & NULL    &\\
- raj        & varchar(15)          & YES  &     & NULL    & Text format 12:34:56.78\\
- decj       & varchar(15)          & YES  &     & NULL    &\\
  rajd       & double               & YES  &     & NULL    & Decimal degrees: 188.7365833\\
- decjd      & double               & YES  &     & NULL    &\\
+ decjd     & double               & YES  &     & NULL    &\\
  gl         & decimal(9,4)         & YES  &     & NULL    & Decimal degrees\\
  gb         & decimal(9,4)         & YES  &     & NULL    &\\
@@ -651,20 +647,21 @@
  dm         & decimal(16,10)       & YES  &     & NULL    & Will be NULL for survey data.\\
  period     & decimal(32,24)       & YES  &     & NULL    & Will be NULL for survey data.\\
-%\hline\multicolumn{6}{l}{\textbf{How (setup)}}\\\hline
- cnfg       & varchar(128)         & YES  &     & NULL    & Will be NULL for 70cm data\\
- inst       & varchar(32)          & YES  &     & NULL    & For 70cm, set same as data\_type\\
- data\_type & varchar(16)          & YES  &     & NULL    &\\
- rcvr       & varchar(16)          & YES  &     & NULL    & NULL or ``unknown'' for 70cm? \\
- obsrvr     & varchar(32)          & YES  &     & NULL    &\\
- obsfreq    & double               & YES  &     & NULL    &\\
- chanbw     & double               & YES  &     & NULL    &\\
  nchan      & int (6)              & YES  &     & NULL    &\\
  npol       & int(6)               & YES  &     & NULL    &\\
  nbin       & int(6)               & YES  &     & NULL    &\\
  nsub       & int(6)               & YES  &     & NULL    &number of subintegrations\\
- scanlen    & double               & YES  &     & NULL    & Rename \texttt{observations} field length\\
  tsamp      & double               & YES  &     & NULL    &\\
  nbits      & tinyint(3) unsigned  & YES  &     & NULL    &\\
  nbeam      & tinyint(3) unsigned  & YES  &     & NULL    &\\
+ cnfg       & varchar(128)         & YES  &     & NULL    & Will be NULL for 70cm data\\
+ inst       & varchar(32)          & YES  &     & NULL    & For 70cm, set same as data\_type\\
+ rcvr       & varchar(16)          & YES  &     & NULL    &\\
+ hdrver     & varchar(10)          & YES  &     & NULL    &\\
+ survey     & varchar(10)          & YES  &     & NULL    &\\
+ telescope  & varchar(16)          & YES  &     & NULL    &\\
+ site       & varchar(8)           & YES  &     & NULL    &\\
+ obsrvr     & varchar(32)          & YES  &     & NULL    &\\
+ data\_loc  & varchar(100)         & YES  & PRI & NULL    &\\
+ file\_size\_bytes & int(32)       & YES  &     & NULL    &\\
 \end{tabular}
 \caption{Fields for a table in the mySQL database that unifies the content of the existing tables and the desired content for the PKS70 table.}
Index: /trunk/htdocs/conesearch.php
===================================================================
--- /trunk/htdocs/conesearch.php	(revision 208)
+++ /trunk/htdocs/conesearch.php	(revision 209)
@@ -113,5 +113,5 @@
 // Get the field names to fill the table column headers (FIELD declarations).
 
-$query = "SHOW COLUMNS FROM s70";
+$query = "SHOW COLUMNS FROM ".S70_TABLE;
 $result = mysql_query($query) or die ('Query failed: ' . mysql_error());
 
@@ -143,7 +143,5 @@
 $whereString = trim($whereString, " AND OR");
 
-//$query = "SELECT *,$angsep_str as angsep FROM s70 WHERE $whereString ORDER by angsep";
-
-$query = "(SELECT *,$angsep_str as angsep FROM s70 WHERE $whereString) UNION (SELECT *,$angsep_str as angsep FROM obs WHERE $whereString) ORDER BY angsep";
+$query = "(SELECT *,$angsep_str as angsep FROM ".S70_TABLE." WHERE $whereString) UNION (SELECT *,$angsep_str as angsep FROM ".OBSERVATION_TABLE". WHERE $whereString) ORDER BY angsep";
 
 $result = mysql_query($query) or die('Conesearch Query failed: ' . mysql_error());
Index: /trunk/htdocs/constants.php
===================================================================
--- /trunk/htdocs/constants.php	(revision 208)
+++ /trunk/htdocs/constants.php	(revision 209)
@@ -30,6 +30,9 @@
 // Database table names
 define ('USERS_TABLE', 'users');
-define ('OBSERVATIONS_TABLE', 'observations');
-define ('CALS_TABLE', 'cals');
+//define ('OBSERVATIONS_TABLE', 'observations');
+define ('OBSERVATIONS_TABLE', 'obs');
+//define ('CALS_TABLE', 'cals');
+define ('CALS_TABLE', 'calib');
+define ('S70_TABLE', 's70');
 
 // Field names for the observations table
@@ -160,5 +163,5 @@
 define('PLOT_DIR', "/pulsar/scratch01/data_archive/profile_images");
 define('PAV_CMD', "/pulsar/psr/linux/bin/pav");
-$PLOT_COMMANDS = array (PROFILE_PLOT => FIX_LD_LIB.PAV_CMD." -CDFTp -g ");
+$PLOT_COMMANDS = array (PROFILE_PLOT => FIX_LD_LIB.PAV_CMD." --publn -CDFTp -g ");
 
 // Number of rows to limit by per page
Index: /trunk/htdocs/database.php
===================================================================
--- /trunk/htdocs/database.php	(revision 208)
+++ /trunk/htdocs/database.php	(revision 209)
@@ -21,4 +21,5 @@
   // the @ sign should suppress error messages if the server is down.
 	$link = @mysql_connect(DB_SERVER.":".DB_PORT, DB_USERNAME, DB_PASS); 
+	//	echo "link->".$link."<-\n";
 	if (!$link) {
 	  //die('Could not connect: ' . mysql_error());
Index: /trunk/htdocs/index.php
===================================================================
--- /trunk/htdocs/index.php	(revision 208)
+++ /trunk/htdocs/index.php	(revision 209)
@@ -147,5 +147,5 @@
 // Find out the first and last dates
 //$query = "select min(mjd), max(mjd) from ".OBSERVATIONS_TABLE;
-$query = "select min(t.mjd), max(t.mjd) from ((select mjd from s70) union (select mjd from obs)) as t";
+$query = "select min(t.mjd), max(t.mjd) from ((select mjd from ".S70_TABLE.") union (select mjd from ".OBSERVATIONS_TABLE.")) as t";
 $result = mysql_query($query) or die('Query 1 failed: ' . mysql_error());
 
@@ -183,6 +183,5 @@
 // Get the field names to fill form checkboxes
 
-//$query = "SHOW COLUMNS FROM ".OBSERVATIONS_TABLE;
-$query = "SHOW COLUMNS FROM obs";
+$query = "SHOW COLUMNS FROM ".OBSERVATIONS_TABLE;
 $result = mysql_query($query) or die ('Query 2 failed: ' . mysql_error());
 
@@ -237,5 +236,5 @@
 
 //$query = "select distinct data_type from " . OBSERVATIONS_TABLE . " order by data_type";
-$query = "(select distinct data_type from obs) union (select distinct data_type from s70)";
+$query = "(select distinct data_type from ".OBSERVATIONS_TABLE.") union (select distinct data_type from ".S70_TABLE.")";
 $result = mysql_query($query) or die ('Query 3 failed: ' . mysql_error());
 
Index: /trunk/htdocs/query.php
===================================================================
--- /trunk/htdocs/query.php	(revision 208)
+++ /trunk/htdocs/query.php	(revision 209)
@@ -493,5 +493,5 @@
     $whereString = trim($whereString, " AND OR");
 
-    $query = "( $selectString FROM s70 WHERE $whereString ) UNION ( $selectString FROM obs WHERE $whereString )";
+    $query = "( $selectString FROM ".S70_TABLE." WHERE $whereString ) UNION ( $selectString FROM ".OBSERVATIONS_TABLE." WHERE $whereString )";
 
     $query .= $orderString;
@@ -499,5 +499,5 @@
     $query .= " limit ".MAX_RESULTS; // limit the maximum number of results to be returned.
 
-    $numquery = "select a.num+b.num as num from (select count(*) as num from s70 where $whereString) as a, (select count(*) as num from obs where $whereString) as b";
+    $numquery = "select a.num+b.num as num from (select count(*) as num from ".S70_TABLE." where $whereString) as a, (select count(*) as num from ".OBSERVATIONS_TABLE." where $whereString) as b";
     $numresult = mysql_query($numquery);
     $numrows = mysql_fetch_assoc($numresult);
Index: /trunk/htdocs/utils.php
===================================================================
--- /trunk/htdocs/utils.php	(revision 208)
+++ /trunk/htdocs/utils.php	(revision 209)
@@ -217,5 +217,5 @@
   // Only need to look in the obs table as there are no cals for the s70 data.
   //  Use the full pathname of the file to make sure we get the correct entry.
-  $obsquery = "SELECT src_name,MJD,data_type FROM obs WHERE concat(data_loc,'/',filename)='$pathname'";
+  $obsquery = "SELECT src_name,MJD,data_type FROM ".OBSERVATIONS_TABLE." WHERE concat(data_loc,'/',filename)='$pathname'";
   $result = mysql_query($obsquery) or die('Short Query failed: ' . mysql_error());
   $matches = array();
@@ -230,5 +230,5 @@
   $mjd_min = mjd_add($mjd, $span_mins*-1);
 
-  $query = "SELECT * FROM calib WHERE (MJD > $mjd_min) AND (MJD < $mjd_max) AND src_name LIKE '$src%' AND data_type = '$type' order by MJD";
+  $query = "SELECT * FROM ".CALS_TABLE." WHERE (MJD > $mjd_min) AND (MJD < $mjd_max) AND src_name LIKE '$src%' AND data_type = '$type' order by MJD";
 	
   $result = mysql_query($query) or die('Cal Query failed: ' . mysql_error());
Index: /trunk/htdocs/view_profiles.php
===================================================================
--- /trunk/htdocs/view_profiles.php	(revision 208)
+++ /trunk/htdocs/view_profiles.php	(revision 209)
@@ -314,4 +314,5 @@
       $command = $PLOT_COMMANDS[$plot_type];
       $command .= PROFILE_DIR."/$output_filename[$i]/png -N $num_cols,$num_rows $archives[$i]";
+      //      echo "$command<br>\n";
       exec($command, $output_array);
     }
