Index: /trunk/sql/angsep_query-s70.sql
===================================================================
--- /trunk/sql/angsep_query-s70.sql	(revision 135)
+++ /trunk/sql/angsep_query-s70.sql	(revision 136)
@@ -8,4 +8,5 @@
 -- The old query of RA=0 and DEC=-49 should pick up four files.
 --SET @qra=0., @qdec=-49.;
+SET @qra=180., @qdec=-1.;
 SET @ngpra=192.859508, @ngpdec=27.128336, @ascnode=32.932; -- base coords for galactic coord transformation.
 SELECT filename, raj, decj, 0.5*(bmaj+bmin) as beamsize, obsfreq, scanlen,
Index: /trunk/sql/create_new_obs_table.sql
===================================================================
--- /trunk/sql/create_new_obs_table.sql	(revision 135)
+++ /trunk/sql/create_new_obs_table.sql	(revision 136)
@@ -3,29 +3,71 @@
 
 -- if the table exists, drop it so we can reload it
-DROP TEMPORARY TABLE IF EXISTS newobs;
+DROP TEMPORARY TABLE IF EXISTS newobs2;
 
-DROP TEMPORARY TABLE IF EXISTS temptab;
+--DROP TEMPORARY TABLE IF EXISTS temptab;
 
--- version of mysql is <4.1 so cannot use CREATE ... LIKE ...
-CREATE TEMPORARY TABLE temptab
-   SELECT  pulsar_name,filename,raj_hour, raj_minute, raj_second, decj_degree, decj_minute, decj_second, 
+SET @ngpra=192.859508, @ngpdec=27.128336, @ascnode=32.932; -- base coords for galactic coord transformation.
+
+-- CREATE TEMPORARY TABLE newobs2 LIKE observations;
+-- 
+-- ALTER TABLE newobs2
+--   ADD COLUMN rajd (raj_hour+raj_minute/60.+raj_second/3600.)*15 
+
+--CREATE TEMPORARY TABLE newobs2
+--  SELECT pulsar_name,filename,raj_hour, raj_minute, raj_second, decj_degree, decj_minute, decj_second,
+--        (raj_hour+raj_minute/60.+raj_second/3600.)*15 as rajd,
+--        case when pulsar_name like "%-%" then -1.*(abs(decj_degree)+decj_minute/60.+decj_second/3600.)
+--             when (decj_degree<0.)   then -1.*(abs(decj_degree)+decj_minute/60.+decj_second/3600.)
+--             else abs(decj_degree)+decj_minute/60.+decj_second/3600. end as decjd,
+--        dm, period, bw, cnfg, data_loc, data_type, freq, inst, MJD, npol, nchan, nbin, nsub,
+--        rcvr, site, file_size_bytes, length, obsrvr, date, ut, tsamp, nbeam
+--  FROM observations;	
+CREATE TEMPORARY TABLE newobs2
+  SELECT *,
         (raj_hour+raj_minute/60.+raj_second/3600.)*15 as rajd,
         case when pulsar_name like "%-%" then -1.*(abs(decj_degree)+decj_minute/60.+decj_second/3600.)
              when (decj_degree<0.)   then -1.*(abs(decj_degree)+decj_minute/60.+decj_second/3600.)
-             else abs(decj_degree)+decj_minute/60.+decj_second/3600. end as decjd,
-         dm, period, bw, cnfg, data_loc, data_type, freq, inst, MJD, npol, nchan, nbin, nsub, 
-	 rcvr, site, file_size_bytes, length, obsrvr, date, ut, tsamp, nbeam
-   FROM observations;
+             else abs(decj_degree)+decj_minute/60.+decj_second/3600. end as decjd
+  FROM observations;	
 
-SET @ngpra=192.859508, @ngpdec=27.128336, @ascnode=32.932; -- base coords for galactic coord transformation.
+INSERT INTO TABLE newobs2 (gl1,gb1)
+ SELECT glnew, gbnew
+ FROM newobs2
+ WHERE case when degrees( atan2( ( sin(radians(decjd))*cos(radians(@ngpdec)) - cos(radians(decjd))*sin(radians(@ngpdec))*cos(radians(rajd-@ngpra)) ) , ( cos(radians(decjd))*sin(radians(rajd-@ngpra)) ) ) ) + @ascnode > 0 
+         then degrees( atan2( ( sin(radians(decjd))*cos(radians(@ngpdec)) - cos(radians(decjd))*sin(radians(@ngpdec))*cos(radians(rajd-@ngpra)) ) , ( cos(radians(decjd))*sin(radians(rajd-@ngpra)) ) ) ) + @ascnode
+	 else degrees( atan2( ( sin(radians(decjd))*cos(radians(@ngpdec)) - cos(radians(decjd))*sin(radians(@ngpdec))*cos(radians(rajd-@ngpra)) ) , ( cos(radians(decjd))*sin(radians(rajd-@ngpra)) ) ) ) + @ascnode + 360. end case as glnew,
+	(degrees( asin( cos(radians(decjd))*cos(radians(@ngpdec))*cos(radians(rajd-@ngpra)) + sin(radians(decjd))*sin(radians(@ngpdec))))) ) as gbnew;
 
-CREATE TEMPORARY TABLE newobs
-   SELECT *,
-        case when degrees( atan2( ( sin(radians(decjd))*cos(radians(@ngpdec)) - cos(radians(decjd))*sin(radians(@ngpdec))*cos(radians(rajd-@ngpra)) ) , ( cos(radians(decjd))*sin(radians(rajd-@ngpra)) ) ) ) + @ascnode > 0 
-	     then degrees( atan2( ( sin(radians(decjd))*cos(radians(@ngpdec)) - cos(radians(decjd))*sin(radians(@ngpdec))*cos(radians(rajd-@ngpra)) ) , ( cos(radians(decjd))*sin(radians(rajd-@ngpra)) ) ) ) + @ascnode
-	     else degrees( atan2( ( sin(radians(decjd))*cos(radians(@ngpdec)) - cos(radians(decjd))*sin(radians(@ngpdec))*cos(radians(rajd-@ngpra)) ) , ( cos(radians(decjd))*sin(radians(rajd-@ngpra)) ) ) ) + @ascnode + 360. end as gl,
-	(degrees( asin( cos(radians(decjd))*cos(radians(@ngpdec))*cos(radians(rajd-@ngpra)) + sin(radians(decjd))*sin(radians(@ngpdec))))) as gb
-    FROM temptab
-;
+    
+
+--        case when degrees( atan2( ( sin(radians(decjd))*cos(radians(@ngpdec)) - cos(radians(decjd))*sin(radians(@ngpdec))*cos(radians(rajd-@ngpra)) ) , ( cos(radians(decjd))*sin(radians(rajd-@ngpra)) ) ) ) + @ascnode > 0 
+--	     then degrees( atan2( ( sin(radians(decjd))*cos(radians(@ngpdec)) - cos(radians(decjd))*sin(radians(@ngpdec))*cos(radians(rajd-@ngpra)) ) , ( cos(radians(decjd))*sin(radians(rajd-@ngpra)) ) ) ) + @ascnode
+--	     else degrees( atan2( ( sin(radians(decjd))*cos(radians(@ngpdec)) - cos(radians(decjd))*sin(radians(@ngpdec))*cos(radians(rajd-@ngpra)) ) , ( cos(radians(decjd))*sin(radians(rajd-@ngpra)) ) ) ) + @ascnode + 360. end as gl,
+--	(degrees( asin( cos(radians(decjd))*cos(radians(@ngpdec))*cos(radians(rajd-@ngpra)) + sin(radians(decjd))*sin(radians(@ngpdec))))) as gb
+--
+--  FROM observations;	
+
+
+-- version of mysql is <4.1 so cannot use CREATE ... LIKE ...
+--CREATE TEMPORARY TABLE temptab
+--   SELECT  pulsar_name,filename,raj_hour, raj_minute, raj_second, decj_degree, decj_minute, decj_second, 
+--        (raj_hour+raj_minute/60.+raj_second/3600.)*15 as rajd,
+--        case when pulsar_name like "%-%" then -1.*(abs(decj_degree)+decj_minute/60.+decj_second/3600.)
+--             when (decj_degree<0.)   then -1.*(abs(decj_degree)+decj_minute/60.+decj_second/3600.)
+--             else abs(decj_degree)+decj_minute/60.+decj_second/3600. end as decjd,
+--         dm, period, bw, cnfg, data_loc, data_type, freq, inst, MJD, npol, nchan, nbin, nsub, 
+--	 rcvr, site, file_size_bytes, length, obsrvr, date, ut, tsamp, nbeam
+--   FROM observations;
+--
+--SET @ngpra=192.859508, @ngpdec=27.128336, @ascnode=32.932; -- base coords for galactic coord transformation.
+--
+--CREATE TEMPORARY TABLE newobs
+--   SELECT *,
+--        case when degrees( atan2( ( sin(radians(decjd))*cos(radians(@ngpdec)) - cos(radians(decjd))*sin(radians(@ngpdec))*cos(radians(rajd-@ngpra)) ) , ( cos(radians(decjd))*sin(radians(rajd-@ngpra)) ) ) ) + @ascnode > 0 
+--	     then degrees( atan2( ( sin(radians(decjd))*cos(radians(@ngpdec)) - cos(radians(decjd))*sin(radians(@ngpdec))*cos(radians(rajd-@ngpra)) ) , ( cos(radians(decjd))*sin(radians(rajd-@ngpra)) ) ) ) + @ascnode
+--	     else degrees( atan2( ( sin(radians(decjd))*cos(radians(@ngpdec)) - cos(radians(decjd))*sin(radians(@ngpdec))*cos(radians(rajd-@ngpra)) ) , ( cos(radians(decjd))*sin(radians(rajd-@ngpra)) ) ) ) + @ascnode + 360. end as gl,
+--	(degrees( asin( cos(radians(decjd))*cos(radians(@ngpdec))*cos(radians(rajd-@ngpra)) + sin(radians(decjd))*sin(radians(@ngpdec))))) as gb
+--    FROM temptab
+--;
 
 --DROP TEMPORARY TABLE IF EXISTS temptab;
Index: /trunk/sql/create_table_s70.sql
===================================================================
--- /trunk/sql/create_table_s70.sql	(revision 135)
+++ /trunk/sql/create_table_s70.sql	(revision 136)
@@ -10,4 +10,6 @@
 	survey VARCHAR(10),
 	src_name VARCHAR(20),
+	telescope VARCHAR(16),
+	data_type VARCHAR(16),
 	raj VARCHAR(15),
 	decj VARCHAR(15),
@@ -27,6 +29,4 @@
 	tsamp DOUBLE,
 	nbits INT,
---	period DECIMAL(32,24),
---	dm DECIMAL(16,10),
 	PRIMARY KEY (file_id)
 );
@@ -37,10 +37,10 @@
 -- them
 LOAD DATA LOCAL
-INFILE "/DATA/SITAR_1/whi550/VO/PulsarVO/s70v_summary.csv"
+INFILE "/DATA/SITAR_1/whi550/VO/PulsarVO/s70v_summary_sf.csv"
 INTO TABLE s70
 FIELDS TERMINATED BY ","
 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,gl,gb,bmaj,bmin,bpa,date_obs,mjd,obsfreq,chanbw,nchan,scanlen,tsamp,nbits);
+(filename,fileloc,hdrver,survey,src_name,telescope,data_type,raj,decj,rajd,decjd,gl,gb,bmaj,bmin,bpa,date_obs,mjd,obsfreq,chanbw,nchan,scanlen,tsamp,nbits);
 
 -- -- add gl and gb columns to the table.
Index: /trunk/sql/find_bad_declinations.sql
===================================================================
--- /trunk/sql/find_bad_declinations.sql	(revision 135)
+++ /trunk/sql/find_bad_declinations.sql	(revision 136)
@@ -16,5 +16,5 @@
 where  abs(decj_degree)<1 
 	and (decj_minute>0 or decj_second>0) 
-order by pulsar_name
+order by raj
 ;
 
Index: /trunk/src/pvo-block.hh
===================================================================
--- /trunk/src/pvo-block.hh	(revision 135)
+++ /trunk/src/pvo-block.hh	(revision 136)
@@ -42,6 +42,6 @@
       /** Constructor for particular survey. */
       DataBlock(Header::SURVEY surveyType);
-      DataBlock::DataBlock(const DataBlock& b);
-      DataBlock &DataBlock::operator= (const DataBlock& b);
+      DataBlock(const DataBlock& b);
+      DataBlock& operator= (const DataBlock& b);
       virtual ~DataBlock(); ///< Destructor
 
