Index: /trunk/docs/VOimplementation.tex
===================================================================
--- /trunk/docs/VOimplementation.tex	(revision 148)
+++ /trunk/docs/VOimplementation.tex	(revision 149)
@@ -607,4 +607,5 @@
  fileloc    & varchar(100)         & YES  & PRI & NULL    & Called data\_loc in existing tables\\
  file\_size\_bytes & int(32)       & YES  &     & NULL    &\\
+ project\_id & varchar(10)         & YES  &     & NULL    &\\
  hdrver     & varchar(10)          & YES  &     & NULL    &\\
  survey     & varchar(10)          & YES  &     & NULL    &\\
Index: /trunk/new-htdocs/conequery-vo.php
===================================================================
--- /trunk/new-htdocs/conequery-vo.php	(revision 148)
+++ /trunk/new-htdocs/conequery-vo.php	(revision 149)
@@ -101,5 +101,5 @@
 //
 
-$link = db_connect_admin();
+$link = db_connect();
 
 loadS70();
Index: /trunk/new-htdocs/xmlFunctions.php
===================================================================
--- /trunk/new-htdocs/xmlFunctions.php	(revision 148)
+++ /trunk/new-htdocs/xmlFunctions.php	(revision 149)
@@ -13,45 +13,48 @@
   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=\"Filename\" ID=\"col2\" ucd=\"\" datatype=\"double\" width=\"10\" precision=\"4\" unit=\"deg\">\n";
+  echo " <DESCRIPTION>\n The angular separation from the queried position.\n </DESCRIPTION>\n</FIELD>\n";
   
-  echo "<FIELD name=\"Target Name\" ID=\"col2\" ucd=\"obs.field;meta.id\" datatype=\"char\" arraysize=\"20\">\n";
+  echo "<FIELD name=\"Target Name\" ID=\"col3\" 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 "<FIELD name=\"Survey\" ID=\"col4\" ucd=\"obs;meta.dataset;meta.id\" datatype=\"char\" arraysize=\"10\">\n";
   echo " <DESCRIPTION>\n  The short code for the survey type: PKS70=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 "<FIELD name=\"RA\" ID=\"col5\" 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 "<FIELD name=\"DEC\" ID=\"col6\" 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 "<FIELD name=\"BMAJ\" ID=\"col7\" 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 "<FIELD name=\"BMIN\" ID=\"col8\" 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 "<FIELD name=\"BPA\" ID=\"col9\" 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 "<FIELD name=\"UT Date/Time of Observations\" ID=\"col10\" 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 "<FIELD name=\"MJD\" ID=\"col11\" 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 "<FIELD name=\"ObsFreq\" ID=\"col12\" 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 "<FIELD name=\"Channel Bandwidth\" ID=\"col13\" 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 "<FIELD name=\"Number of Channels\" ID=\"col14\" 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 "<FIELD name=\"Scan length\" ID=\"col15\" 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=\"s\">\n";
+  echo "<FIELD name=\"Sample time\" ID=\"col16\" ucd=\"time.resolution\" datatype=\"float\" width=\"9\" precision=\"4\" unit=\"s\">\n";
   echo " <DESCRIPTION>\n  The time for each sample in the observation.\n </DESCRIPTION>\n</FIELD>\n";
    
@@ -73,4 +76,5 @@
   echo "<TR>\n ";
   printf("<TD>%s</TD>",$line['filename']);
+  printf("<TD>%6.4f</TD>",$line['angsep']);
   printf("<TD>%s</TD>",$line['src_name']);
   printf("<TD>%s</TD>",$line['survey']);
Index: /trunk/sql/angsep_query-larger.sql
===================================================================
--- /trunk/sql/angsep_query-larger.sql	(revision 149)
+++ /trunk/sql/angsep_query-larger.sql	(revision 149)
@@ -0,0 +1,30 @@
+use psrchive;
+-- Use the following file to create a temporary tables 
+source /DATA/SITAR_1/whi550/VO/PulsarVO/sql/create_larger_s70_table.sql;
+source /DATA/SITAR_1/whi550/VO/PulsarVO/sql/create_larger_obs_table.sql;
+--
+-- Performing a conesearch around position RA=0.=00:00:00 and DEC=-43.=-43:00:00 for the S70 data
+-- This should pick up three files from the new batch added on June 26.
+-- The old query of RA=0 and DEC=-49 should pick up four files.
+--SET @qra=0., @qdec=-49.;
+SET @qra=326.4, @qdec=-7.8;
+
+(
+SELECT filename, raj, decj, 0.5*(bmaj+bmin) as beamsize, obsfreq, scanlen,
+(degrees( acos( cos(radians(rajd-@qra))*cos(radians(decjd))*cos(radians(@qdec))+sin(radians(decjd))*sin(radians(@qdec)) ) )) as angsep,gl,gb,src_name,survey
+FROM bigobs
+WHERE (degrees( acos( cos(radians(rajd-@qra))*cos(radians(decjd))*cos(radians(@qdec))+sin(radians(decjd))*sin(radians(@qdec)) ) ) - 0.25*(bmaj+bmin) 
+) <  1.
+)
+UNION
+(
+SELECT filename, raj, decj, 0.5*(bmaj+bmin) as beamsize, obsfreq, scanlen,
+(degrees( acos( cos(radians(rajd-@qra))*cos(radians(decjd))*cos(radians(@qdec))+sin(radians(decjd))*sin(radians(@qdec)) ) )) as angsep,gl,gb,src_name,survey
+FROM bigS70
+WHERE (degrees( acos( cos(radians(rajd-@qra))*cos(radians(decjd))*cos(radians(@qdec))+sin(radians(decjd))*sin(radians(@qdec)) ) ) - 0.25*(bmaj+bmin) 
+) <  1.
+)
+ORDER by angsep
+--limit 5
+;
+-- period;
Index: /trunk/sql/create_larger_obs_table.sql
===================================================================
--- /trunk/sql/create_larger_obs_table.sql	(revision 148)
+++ /trunk/sql/create_larger_obs_table.sql	(revision 149)
@@ -75,7 +75,10 @@
 	NULL as gl, 
 	NULL as gb,
-	NULL as bmaj,
-	NULL as bmin,
-	NULL as bpa,
+--	NULL as bmaj,
+--	NULL as bmin,
+--	NULL as bpa,
+	(1.2*(299792458./o.freq)/64.) as BMAJ,
+	(1.2*(299792458./o.freq)/64.) as BMIN,
+	0. as BPA,
 	o.dm, 
 	o.period, 
