Index: /trunk/new-htdocs/conequery-basic.php
===================================================================
--- /trunk/new-htdocs/conequery-basic.php	(revision 84)
+++ /trunk/new-htdocs/conequery-basic.php	(revision 85)
@@ -43,25 +43,25 @@
 
 <?php
-	include_once("../../database.php");
-	include_once("../../utils.php");
-	include_once("loadS70.php");
-
-	// List of request parameters to display
-	$params           = get_param('params', $HTTP_GET_VARS);	
-	// The current state. E.g cart or results
-	// Need to maintain this because other actions could be performed without changing state 
-	$state            = get_param('state', $HTTP_GET_VARS);
-	// The selected action to perform. E.g. add observations to cart, or view profile
-	$actions          = get_param('actions', $HTTP_GET_VARS);
-	// List of checked observations. Note: Not necessarily observations in the cart.
-	// Cart observations are stored in $cart_items variable
-	$selected_obs              = get_param('selected_obs', $HTTP_GET_VARS);
-	// cart_items is an array of numbers that index to the list of 
-	// results in all_results
-	$cart_items          = $_SESSION['cart_items'];
-
-	$raj_degs         = trim(get_param('raj_degs', $HTTP_GET_VARS));
-	$decj_degs        = trim(get_param('decj_degs', $HTTP_GET_VARS));
-	$radius           = trim(get_param('radius', $HTTP_GET_VARS));
+include_once("../../database.php");
+include_once("../../utils.php");
+include_once("loadS70.php");
+
+// List of request parameters to display
+$params           = get_param('params', $HTTP_GET_VARS);	
+// The current state. E.g cart or results
+// Need to maintain this because other actions could be performed without changing state 
+$state            = get_param('state', $HTTP_GET_VARS);
+// The selected action to perform. E.g. add observations to cart, or view profile
+$actions          = get_param('actions', $HTTP_GET_VARS);
+// List of checked observations. Note: Not necessarily observations in the cart.
+// Cart observations are stored in $cart_items variable
+$selected_obs              = get_param('selected_obs', $HTTP_GET_VARS);
+// cart_items is an array of numbers that index to the list of 
+// results in all_results
+$cart_items          = $_SESSION['cart_items'];
+
+$raj_degs         = trim(get_param('raj_degs', $HTTP_GET_VARS));
+$decj_degs        = trim(get_param('decj_degs', $HTTP_GET_VARS));
+$radius           = trim(get_param('radius', $HTTP_GET_VARS));
 
 ///////////////////////////////////////////////////////////////////////////
Index: /trunk/new-htdocs/conequery-vo.php
===================================================================
--- /trunk/new-htdocs/conequery-vo.php	(revision 84)
+++ /trunk/new-htdocs/conequery-vo.php	(revision 85)
@@ -22,65 +22,65 @@
 <VOTABLE version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.ivoa.net/xml/VOTable/VOTable/v1.1">
 <?php
-	include_once("../../database.php");
-	include_once("../../utils.php");
-	include_once("loadS70.php");
-	include_once("xmlFunctions.php");
+include_once("../../database.php");
+include_once("../../utils.php");
+include_once("loadS70.php");
+include_once("xmlFunctions.php");
 
-	$raj_degs         = trim(get_param('RA', $HTTP_GET_VARS));
-	$decj_degs        = trim(get_param('DEC', $HTTP_GET_VARS));
-	$radius           = trim(get_param('SR', $HTTP_GET_VARS));
+$raj_degs         = trim(get_param('RA', $HTTP_GET_VARS));
+$decj_degs        = trim(get_param('DEC', $HTTP_GET_VARS));
+$radius           = trim(get_param('SR', $HTTP_GET_VARS));
 
-	$errorMsg = "";
-	$isError = False;  // Assume the best, that all three parameters are present and appropriate.
-	
-	// If all 3 parameters are present, all is good.
-	if($raj_degs==""){
-	 $isError=True;
-	 $errorMsg .= "RA value not provided.; ";
+$errorMsg = "";
+$isError = False;  // Assume the best, that all three parameters are present and appropriate.
+
+// If a parameter is missing, we have a problem.
+if($raj_degs==""){
+  $isError=True;
+  $errorMsg .= "RA value not provided.; ";
+}
+if($decj_degs==""){           //	if(!isset($decj_degs)){
+  $isError=True;
+  $errorMsg .= "DEC value not provided.; ";
 	}
-	if($decj_degs==""){           //	if(!isset($decj_degs)){
-	 $isError=True;
-	 $errorMsg .= "DEC value not provided.; ";
-	}
-	if($radius==""){		//	if(!isset($radius)){
-	 $isError=True;
-	 $errorMsg .= "SR value not provided.; ";
-	}
+if($radius==""){		//	if(!isset($radius)){
+  $isError=True;
+  $errorMsg .= "SR value not provided.; ";
+}
 
-	// If the parameters are not numeric, this is bad.
-	if(($raj_degs!="") && !is_numeric($raj_degs)){
-	 $isError=True;
-	 $errorMsg .= "RA value not a number.; ";
-	}
-	if(($decj_degs!="") && !is_numeric($decj_degs)){
-	 $isError=True;
-	 $errorMsg .= "DEC value not a number.; ";
-	}
-	if(($radius!="") && !is_numeric($radius)){
-	 $isError=True;
-	 $errorMsg .= "SR value not a number.; ";
-	}
-	
-	// If DEC is out of range, this is bad.
-	if( is_numeric($decj_degs) && (abs($decj_degs) > 90.) ){
-	 $isError = True;
-	 $errorMsg .= "DEC value out of range; ";
-	}
+// If the parameters are not numbers, this is bad.
+if(($raj_degs!="") && !is_numeric($raj_degs)){
+  $isError=True;
+  $errorMsg .= "RA value not a number.; ";
+}
+if(($decj_degs!="") && !is_numeric($decj_degs)){
+  $isError=True;
+  $errorMsg .= "DEC value not a number.; ";
+}
+if(($radius!="") && !is_numeric($radius)){
+  $isError=True;
+  $errorMsg .= "SR value not a number.; ";
+}
 
-	// If SR is negative, this is bad.
-	if( is_numeric($radius) && ($radius < 0.) ){
-	 $isError = True;
-	 $errorMsg .= "SR value is negative; ";
-	}
+// If DEC is out of range, this is bad.
+if( is_numeric($decj_degs) && (abs($decj_degs) > 90.) ){
+  $isError = True;
+  $errorMsg .= "DEC value out of range; ";
+}
 
-	// If there has been an error, report it as a PARAM and exit.
-	if($isError){
-	  echo "<RESOURCE type=\"Error message\">\n";
-	  printf("<PARAM ID=\"ERROR\" datatype=\"char\" value=\"%s\"/>\n",$errorMsg);
-	  echo "</RESOURCE>\n";
-	  echo "</VOTABLE>\n";
-	  exit;
-	}
-	// Else, continue!
+// If SR is negative, this is bad.
+if( is_numeric($radius) && ($radius < 0.) ){
+  $isError = True;
+  $errorMsg .= "SR value is negative; ";
+}
+
+// If there has been an error, report it as a PARAM and exit.
+if($isError){
+  echo "<RESOURCE type=\"Error message\">\n";
+  printf("<PARAM ID=\"ERROR\" datatype=\"char\" value=\"%s\"/>\n",$errorMsg);
+  echo "</RESOURCE>\n";
+  echo "</VOTABLE>\n";
+  exit;
+}
+// Else, continue!
 
 echo "<DESCRIPTION>\n";
@@ -116,7 +116,7 @@
 $fields = array();
 if (mysql_num_rows($result)) {
-	while($row = mysql_fetch_assoc($result)) {
-		array_push($fields, $row);
-	}
+  while($row = mysql_fetch_assoc($result)) {
+    array_push($fields, $row);
+  }
 }
 
@@ -124,42 +124,41 @@
 print_column_headers_VO($result);
 
+$whereString = "";
 
-		$whereString = "";
+////////////////////////////
+// Constraint on boundary
 
-		////////////////////////////
-		// Constraint on boundary
-
-	        $angsep_str = "";
-		if ($radius) {
-
-	               $angsep_str = "degrees( acos( cos(radians(rajd-$raj_degs))*cos(radians(decjd))*cos(radians($decj_degs))+sin(radians(decjd))*sin(radians($decj_degs))) )";
-
-	               $whereString .= "($angsep_str - 0.25*(bmaj+bmin)) < $radius";
-
-		}
+$angsep_str = "";
+if ($radius) {
+  
+  $angsep_str = "degrees( acos( cos(radians(rajd-$raj_degs))*cos(radians(decjd))*cos(radians($decj_degs))+sin(radians(decjd))*sin(radians($decj_degs))) )";
+  
+  $whereString .= "($angsep_str - 0.25*(bmaj+bmin)) < $radius";
+  
+}
 
 
-		// Remove any leading or trailing AND and OR
-		$whereString = trim($whereString, " AND OR");
+// Remove any leading or trailing AND and OR
+$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 ORDER by angsep";
 
-		$result = mysql_query($query) or die('Query failed: ' . mysql_error());
+$result = mysql_query($query) or die('Query failed: ' . mysql_error());
 
-		$all_results = array();
+$all_results = array();
 
-		while ($line = mysql_fetch_assoc($result)) {
-			array_push($all_results, $line );
-		}
-		
-		$_SESSION['results'] = $all_results;
-	
-		mysql_free_result($result);
-	
-		mysql_close($link);
+while ($line = mysql_fetch_assoc($result)) {
+  array_push($all_results, $line );
+}
+
+$_SESSION['results'] = $all_results;
+
+mysql_free_result($result);
+
+mysql_close($link);
 
 ///////////////////////////////////////////////////////////////////////////
 
-	print_data_VO($all_results);
+print_data_VO($all_results);
 
 echo "</TABLE>\n";
Index: /trunk/new-htdocs/loadS70.php
===================================================================
--- /trunk/new-htdocs/loadS70.php	(revision 84)
+++ /trunk/new-htdocs/loadS70.php	(revision 85)
@@ -3,16 +3,44 @@
 function loadS70() {
 
-// LOADS THE S70 DATA FROM THE FILE
-// /DATA/SITAR_1/whi550/VO/PulsarVO/s70v_summary.csv INTO A TEMPORARY
-// TABLE IN THE MYSQL DATABASE. THE LINK NEEDS TO HAVE BEEN MADE WITH
-// ADMIN PRIVILEGES.
+  // LOADS THE S70 DATA FROM THE FILE
+  // /DATA/SITAR_1/whi550/VO/PulsarVO/s70v_summary.csv INTO A TEMPORARY
+  // TABLE IN THE MYSQL DATABASE. THE LINK NEEDS TO HAVE BEEN MADE WITH
+  // ADMIN PRIVILEGES.
 
-	$createTable = "CREATE TEMPORARY TABLE s70 (file_id SMALLINT UNSIGNED AUTO_INCREMENT,filename VARCHAR(30),fileloc VARCHAR(100),hdrver VARCHAR(10),survey VARCHAR(10),src_name VARCHAR(20),raj VARCHAR(15),decj VARCHAR(15),rajd FLOAT,decjd FLOAT,bmaj FLOAT,bmin FLOAT,bpa FLOAT,date_obs VARCHAR(30),obsfreq FLOAT,chanbw FLOAT,nchan FLOAT,scanlen FLOAT,tbin FLOAT,PRIMARY KEY (file_id))";
+  $createTable = "
+CREATE TEMPORARY TABLE s70 (
+file_id SMALLINT UNSIGNED AUTO_INCREMENT,
+filename VARCHAR(30),
+fileloc VARCHAR(100),
+hdrver VARCHAR(10),
+survey VARCHAR(10),
+src_name VARCHAR(20),
+raj VARCHAR(15),
+decj VARCHAR(15),
+rajd DOUBLE,
+decjd DOUBLE,
+bmaj FLOAT,
+bmin FLOAT,
+bpa FLOAT,
+date_obs VARCHAR(30),
+mjd DOUBLE,
+obsfreq DOUBLE,
+chanbw DOUBLE,
+nchan INT,
+scanlen FLOAT,
+tbin FLOAT,
+PRIMARY KEY (file_id))";
 
-	$result = mysql_query($createTable) or die('Query failed: ' . mysql_error());
+  $result = mysql_query($createTable) or die('Query failed: ' . mysql_error());
 
-	$loadTable = "LOAD DATA LOCAL INFILE \"/DATA/SITAR_1/whi550/VO/PulsarVO/s70v_summary.csv\" INTO TABLE s70 FIELDS TERMINATED BY \",\" OPTIONALLY ENCLOSED BY \"\\\"\" IGNORE 1 LINES (filename,fileloc,hdrver,survey,src_name,raj,decj,rajd,decjd,bmaj,bmin,bpa,date_obs,obsfreq,chanbw,nchan,scanlen,tbin)";
+  $loadTable = "
+LOAD DATA LOCAL INFILE \"/DATA/SITAR_1/whi550/VO/PulsarVO/s70v_summary.csv\" 
+INTO TABLE s70 
+FIELDS TERMINATED BY \",\" 
+OPTIONALLY ENCLOSED BY \"\\\"\" 
+IGNORE 1 LINES 
+(filename,fileloc,hdrver,survey,src_name,raj,decj,rajd,decjd,bmaj,bmin,bpa,date_obs,mjd,obsfreq,chanbw,nchan,scanlen,tbin)";
 
-	$result = mysql_query($loadTable) or die('Query failed: ' . mysql_error());
+  $result = mysql_query($loadTable) or die('Query failed: ' . mysql_error());
 
 }
Index: /trunk/new-htdocs/xmlFunctions.php
===================================================================
--- /trunk/new-htdocs/xmlFunctions.php	(revision 84)
+++ /trunk/new-htdocs/xmlFunctions.php	(revision 85)
@@ -9,49 +9,51 @@
 function print_column_headers_VO() {
 
-/// PRINT VOTABLE HEADERS (<FIELD>) FOR EACH OF THE COLUMNS TO BE INCLUDED
+  /// PRINT VOTABLE HEADERS (<FIELD>) FOR EACH OF THE COLUMNS TO BE INCLUDED
 
-	echo "<FIELD name=\"Filename\" ID=\"col1\" ucd=\"meta.id;meta.main\" datatype=\"char\" arraysize=\"30\">\n";
-	echo " <DESCRIPTION>\n  This is the name of the PSRFITS file at this position.\n </DESCRIPTION>\n</FIELD>\n";
-
-	echo "<FIELD name=\"Target Name\" ID=\"col2\" ucd=\"obs.field;meta.id\" datatype=\"char\" arraysize=\"20\">\n";
-	echo " <DESCRIPTION>\n  This is the name of the PSRFITS file at this position.\n </DESCRIPTION>\n</FIELD>\n";
-
-        echo "<FIELD name=\"Survey\" ID=\"col3\" ucd=\"obs;meta.dataset;meta.id\" datatype=\"char\" arraysize=\"10\">\n";
-	echo " <DESCRIPTION>\n  The short code for the survey type: S70=70cm Parkes Southern Pulsar Survey; PM=Parkes Multibeam Pulsar Survey, PH=Parkes High-Latitude Pulsar Survey; blank means not part of a survey or unknown.\n </DESCRIPTION>\n</FIELD>\n";
-
-	echo "<FIELD name=\"RA\" ID=\"col4\" ucd=\"pos.eq.ra;meta.main\" ref=\"J2000\" datatype=\"float\" width=\"10\" precision=\"6\" unit=\"deg\">\n";
-	echo " <DESCRIPTION>\n  The Right Ascension of the central position of the pointing.\n </DESCRIPTION>\n</FIELD>\n";
-
-	echo "<FIELD name=\"DEC\" ID=\"col5\" ucd=\"pos.eq.dec;meta.main\" ref=\"J2000\" datatype=\"float\" width=\"11\" precision=\"6\" unit=\"deg\">\n";
-	echo " <DESCRIPTION>\n  The Declination of the central position of the pointing.\n </DESCRIPTION>\n</FIELD>\n";
-
-	echo "<FIELD name=\"BMAJ\" ID=\"col6\" ucd=\"pos.angResolution;phys.angSize.smajAxis\" datatype=\"float\" width=\"6\" precision=\"4\" unit=\"deg\">\n";
-	echo " <DESCRIPTION>\n  The full-width-half-maximum (FWHM) of the major-axis of the beam.\n </DESCRIPTION>\n</FIELD>\n";
-
-	echo "<FIELD name=\"BMIN\" ID=\"col7\" ucd=\"pos.angResolution;phys.angSize.sminAxis\" datatype=\"float\" width=\"6\" precision=\"4\" unit=\"deg\">\n";
-	echo " <DESCRIPTION>\n  The full-width-half-maximum (FWHM) of the minor-axis of the beam.\n </DESCRIPTION>\n</FIELD>\n";
-
-	echo "<FIELD name=\"BPA\" ID=\"col8\" ucd=\"pos.angResolution;pos.posAng\" datatype=\"float\" width=\"6\" precision=\"4\" unit=\"deg\">\n";
-	echo " <DESCRIPTION>\n  The position angle of the beam.\n </DESCRIPTION>\n</FIELD>\n";
-
-	echo "<FIELD name=\"UT Date/Time of Observations\" ID=\"col9\" ucd=\"time.start\" datatype=\"char\" arraysize=\"30\">\n";
-	echo " <DESCRIPTION>\n  The UT Date and Time of the start of the observations, in FITS DATE-OBS format.\n </DESCRIPTION>\n</FIELD>\n";
-
-	echo "<FIELD name=\"ObsFreq\" ID=\"col10\" ucd=\"em.freq.central\" datatype=\"float\" width=\"9\" precision=\"4\" unit=\"MHz\">\n";
-	echo " <DESCRIPTION>\n  The central observing frequency.\n </DESCRIPTION>\n</FIELD>\n";
-
-	echo "<FIELD name=\"Channel Bandwidth\" ID=\"col11\" ucd=\"spect.binSize;em.freq\" datatype=\"float\" width=\"9\" precision=\"4\" unit=\"MHz\">\n";
-	echo " <DESCRIPTION>\n  The frequency width of each channel.\n </DESCRIPTION>\n</FIELD>\n";
-
-	echo "<FIELD name=\"Number of Channels\" ID=\"col12\" ucd=\"em.bin;meta.number\" datatype=\"int\" width=\"6\">\n";
-	echo " <DESCRIPTION>\n  The number of frequency channels.\n </DESCRIPTION>\n</FIELD>\n";
-
-	echo "<FIELD name=\"Scan length\" ID=\"col13\" ucd=\"obs.exposure;time.duration\" datatype=\"float\" width=\"9\" precision=\"4\" unit=\"s\">\n";
-	echo " <DESCRIPTION>\n  The total length of time taken for this observation.\n </DESCRIPTION>\n</FIELD>\n";
-
-	echo "<FIELD name=\"Sample time\" ID=\"col14\" ucd=\"time.resolution\" datatype=\"float\" width=\"9\" precision=\"4\" unit=\"ms\">\n";
-	echo " <DESCRIPTION>\n  The time for each sample in the observation.\n </DESCRIPTION>\n</FIELD>\n";
-
-
+  echo "<FIELD name=\"Filename\" ID=\"col1\" ucd=\"meta.id;meta.main\" datatype=\"char\" arraysize=\"30\">\n";
+  echo " <DESCRIPTION>\n  This is the name of the PSRFITS file at this position.\n </DESCRIPTION>\n</FIELD>\n";
+  
+  echo "<FIELD name=\"Target Name\" ID=\"col2\" ucd=\"obs.field;meta.id\" datatype=\"char\" arraysize=\"20\">\n";
+  echo " <DESCRIPTION>\n  This is the name of the PSRFITS file at this position.\n </DESCRIPTION>\n</FIELD>\n";
+  
+  echo "<FIELD name=\"Survey\" ID=\"col3\" ucd=\"obs;meta.dataset;meta.id\" datatype=\"char\" arraysize=\"10\">\n";
+  echo " <DESCRIPTION>\n  The short code for the survey type: S70=70cm Parkes Southern Pulsar Survey; PM=Parkes Multibeam Pulsar Survey, PH=Parkes High-Latitude Pulsar Survey; blank means not part of a survey or unknown.\n </DESCRIPTION>\n</FIELD>\n";
+  
+  echo "<FIELD name=\"RA\" ID=\"col4\" ucd=\"pos.eq.ra;meta.main\" ref=\"J2000\" datatype=\"double\" width=\"10\" precision=\"6\" unit=\"deg\">\n";
+  echo " <DESCRIPTION>\n  The Right Ascension of the central position of the pointing.\n </DESCRIPTION>\n</FIELD>\n";
+  
+  echo "<FIELD name=\"DEC\" ID=\"col5\" ucd=\"pos.eq.dec;meta.main\" ref=\"J2000\" datatype=\"double\" width=\"11\" precision=\"6\" unit=\"deg\">\n";
+  echo " <DESCRIPTION>\n  The Declination of the central position of the pointing.\n </DESCRIPTION>\n</FIELD>\n";
+  
+  echo "<FIELD name=\"BMAJ\" ID=\"col6\" ucd=\"pos.angResolution;phys.angSize.smajAxis\" datatype=\"float\" width=\"6\" precision=\"4\" unit=\"deg\">\n";
+  echo " <DESCRIPTION>\n  The full-width-half-maximum (FWHM) of the major-axis of the beam.\n </DESCRIPTION>\n</FIELD>\n";
+  
+  echo "<FIELD name=\"BMIN\" ID=\"col7\" ucd=\"pos.angResolution;phys.angSize.sminAxis\" datatype=\"float\" width=\"6\" precision=\"4\" unit=\"deg\">\n";
+  echo " <DESCRIPTION>\n  The full-width-half-maximum (FWHM) of the minor-axis of the beam.\n </DESCRIPTION>\n</FIELD>\n";
+  
+  echo "<FIELD name=\"BPA\" ID=\"col8\" ucd=\"pos.angResolution;pos.posAng\" datatype=\"float\" width=\"6\" precision=\"4\" unit=\"deg\">\n";
+  echo " <DESCRIPTION>\n  The position angle of the beam.\n </DESCRIPTION>\n</FIELD>\n";
+  
+  echo "<FIELD name=\"UT Date/Time of Observations\" ID=\"col9\" ucd=\"time.start\" datatype=\"char\" arraysize=\"30\">\n";
+  echo " <DESCRIPTION>\n  The UT Date and Time of the start of the observations, in FITS DATE-OBS format.\n </DESCRIPTION>\n</FIELD>\n";
+  
+  echo "<FIELD name=\"MJD\" ID=\"col10\" ucd=\"time.start\" datatype=\"double\" width=\"14\" precision=\"8\">\n";
+  echo " <DESCRIPTION>\n  The Modified Julian Date of the observation.\n </DESCRIPTION>\n</FIELD>\n";
+  
+  echo "<FIELD name=\"ObsFreq\" ID=\"col11\" ucd=\"em.freq.central\" datatype=\"double\" width=\"9\" precision=\"4\" unit=\"MHz\">\n";
+  echo " <DESCRIPTION>\n  The central observing frequency.\n </DESCRIPTION>\n</FIELD>\n";
+  
+  echo "<FIELD name=\"Channel Bandwidth\" ID=\"col12\" ucd=\"spect.binSize;em.freq\" datatype=\"double\" width=\"9\" precision=\"4\" unit=\"MHz\">\n";
+  echo " <DESCRIPTION>\n  The frequency width of each channel.\n </DESCRIPTION>\n</FIELD>\n";
+  
+  echo "<FIELD name=\"Number of Channels\" ID=\"col13\" ucd=\"em.bin;meta.number\" datatype=\"int\" width=\"6\">\n";
+  echo " <DESCRIPTION>\n  The number of frequency channels.\n </DESCRIPTION>\n</FIELD>\n";
+  
+  echo "<FIELD name=\"Scan length\" ID=\"col14\" ucd=\"obs.exposure;time.duration\" datatype=\"float\" width=\"9\" precision=\"4\" unit=\"s\">\n";
+  echo " <DESCRIPTION>\n  The total length of time taken for this observation.\n </DESCRIPTION>\n</FIELD>\n";
+  
+  echo "<FIELD name=\"Sample time\" ID=\"col15\" ucd=\"time.resolution\" datatype=\"float\" width=\"9\" precision=\"4\" unit=\"ms\">\n";
+  echo " <DESCRIPTION>\n  The time for each sample in the observation.\n </DESCRIPTION>\n</FIELD>\n";
+   
 }
 
@@ -68,21 +70,22 @@
 
 function print_data_line_VO($line) {
-/// PRINT VOTABLE HEADERS (<FIELD>) FOR EACH OF THE COLUMNS TO BE INCLUDED
-	echo "<TR>\n ";
-	printf("<TD>%s</TD>",$line['filename']);
-	printf("<TD>%s</TD>",$line['src_name']);
-	printf("<TD>%s</TD>",$line['survey']);
-	printf("<TD>%10.6f</TD>",$line['rajd']);
-	printf("<TD>%+11.6f</TD>",$line['decjd']);
-	printf("<TD>%6.4f</TD>",$line['bmaj']);
-	printf("<TD>%6.4f</TD>",$line['bmin']);
-	printf("<TD>%6.4f</TD>",$line['bpa']);
-	printf("<TD>%s</TD>",$line['date_obs']);
-	printf("<TD>%9.4f</TD>",$line['obsfreq']);
-	printf("<TD>%9.4f</TD>",$line['chanbw']);
-	printf("<TD>%d</TD>",$line['nchan']);
-	printf("<TD>%9.4f</TD>",$line['scanlen']);
-	printf("<TD>%9.4f</TD>",$line['tbin']);
-	echo "\n</TR>\n";
+  /// PRINT VOTABLE HEADERS (<FIELD>) FOR EACH OF THE COLUMNS TO BE INCLUDED
+  echo "<TR>\n ";
+  printf("<TD>%s</TD>",$line['filename']);
+  printf("<TD>%s</TD>",$line['src_name']);
+  printf("<TD>%s</TD>",$line['survey']);
+  printf("<TD>%10.6f</TD>",$line['rajd']);
+  printf("<TD>%+11.6f</TD>",$line['decjd']);
+  printf("<TD>%6.4f</TD>",$line['bmaj']);
+  printf("<TD>%6.4f</TD>",$line['bmin']);
+  printf("<TD>%6.4f</TD>",$line['bpa']);
+  printf("<TD>%s</TD>",$line['date_obs']);
+  printf("<TD>%14.8f</TD>",$line['mjd']);
+  printf("<TD>%9.4f</TD>",$line['obsfreq']);
+  printf("<TD>%9.4f</TD>",$line['chanbw']);
+  printf("<TD>%d</TD>",$line['nchan']);
+  printf("<TD>%9.4f</TD>",$line['scanlen']);
+  printf("<TD>%9.4f</TD>",$line['tbin']);
+  echo "\n</TR>\n";
 }
 
Index: /trunk/sql/create_table_s70.sql
===================================================================
--- /trunk/sql/create_table_s70.sql	(revision 84)
+++ /trunk/sql/create_table_s70.sql	(revision 85)
@@ -12,13 +12,14 @@
 	raj VARCHAR(15),
 	decj VARCHAR(15),
-	rajd FLOAT,
-	decjd FLOAT,
+	rajd DOUBLE,
+	decjd DOUBLE,
 	bmaj FLOAT,
 	bmin FLOAT,
 	bpa FLOAT,
 	date_obs VARCHAR(30),
-	obsfreq FLOAT,
-	chanbw FLOAT,
-	nchan FLOAT,
+	mjd DOUBLE,
+	obsfreq DOUBLE,
+	chanbw DOUBLE,
+	nchan INT,
 	scanlen FLOAT,
 	tbin FLOAT,
@@ -36,3 +37,3 @@
 OPTIONALLY ENCLOSED BY "\""
 IGNORE 1 LINES  -- this ignores the first line in the csv file which contains the column headers.
-(filename,fileloc,hdrver,survey,src_name,raj,decj,rajd,decjd,bmaj,bmin,bpa,date_obs,obsfreq,chanbw,nchan,scanlen,tbin);
+(filename,fileloc,hdrver,survey,src_name,raj,decj,rajd,decjd,bmaj,bmin,bpa,date_obs,mjd,obsfreq,chanbw,nchan,scanlen,tbin);
Index: /trunk/sql/find_bad_declinations.sql
===================================================================
--- /trunk/sql/find_bad_declinations.sql	(revision 85)
+++ /trunk/sql/find_bad_declinations.sql	(revision 85)
@@ -0,0 +1,8 @@
+-- THIS FINDS ALL THE PULSARS WITH DECLINATION BETWEEN 0 AND -1 DEGREES
+-- THE DECJ_DEGREE VALUE IS 0, BUT THIS INDICATES A VALUE BETWEEN 0 AND +1.
+-- NEED TO STORE THE POSITIONS AS DECIMAL DEGREES (BOTH RA AND DEC)
+select pulsar_name,filename,data_type,decj_degree,decj_minute,decj_second 
+from observations 
+where  abs(decj_degree)<1 
+	and (decj_minute>0 or decj_second>0) 
+	and pulsar_name like "%-%";
