Index: /trunk/htdocs2/Classes/Interfaces/ObsSetMapper.php
===================================================================
--- /trunk/htdocs2/Classes/Interfaces/ObsSetMapper.php	(revision 430)
+++ /trunk/htdocs2/Classes/Interfaces/ObsSetMapper.php	(revision 431)
@@ -16,24 +16,24 @@
     parent::__construct();
     
-    $this->MakeMapping( 'primary_key', 'GetObservationData()->GetObservationHeader()->GetFileID' );
-    $this->MakeMapping( 'file_id', 'GetObservationData()->GetObservationHeader()->GetFileID' );
-    $this->MakeMapping( 'rajd', 'GetObservationData()->GetObservationHeader()->GetCoordinates()->GetRA', 'ToDegrees' );
-    $this->MakeMapping( 'decjd', 'GetObservationData()->GetObservationHeader()->GetCoordinates()->GetDEC', 'ToDegrees' );
-    $this->MakeMapping( 'data_type', 'GetObservationData()->GetObservationHeader()->GetDataType' );
+    $this->MakeMapping( 'primary_key', 'GetObservationHeader()->GetFileID' );
+    $this->MakeMapping( 'file_id', 'GetObservationHeader()->GetFileID' );
+    $this->MakeMapping( 'rajd', 'GetObservationHeader()->GetCoordinates()->GetRA', 'ToDegrees' );
+    $this->MakeMapping( 'decjd', 'GetObservationHeader()->GetCoordinates()->GetDEC', 'ToDegrees' );
+    $this->MakeMapping( 'data_type', 'GetObservationHeader()->GetDataType' );
     $this->MakeMapping( 'filename', 'GetObservationData()->GetDownloadableFile()->GetFilename' );
     $this->MakeMapping( 'data_loc', 'GetObservationData()->GetDownloadableFile()>GetPath' );
-    $this->MakeMapping( 'src_name', 'GetObservationData()->GetObservationHeader()->GetPulsarName' );
-    $this->MakeMapping( 'project_id', 'GetObservationData()->GetObservationHeader()->GetProjectID' );
-    $this->MakeMapping( 'obsfreq', 'GetObservationData()->GetObservationHeader()->GetObsFreq' );
-    $this->MakeMapping( 'mjd', 'GetObservationData()->GetObservationHeader()->GetMJD', 'ToString' );
-    $this->MakeMapping( 'ut', 'GetObservationData()->GetObservationHeader()->GetUT' );
-    $this->MakeMapping( 'date', 'GetObservationData()->GetObservationHeader()->GetDate', 'ToDMYString' );
-    $this->MakeMapping( 'bw', 'GetObservationData()->GetObservationHeader()->GetBW' );
-    $this->MakeMapping( 'scanlen', 'GetObservationData()->GetObservationHeader()->GetScanLen' );
-    $this->MakeMapping( 'distance', 'GetObservationData()->GetObservationHeader()->GetDistance' );
-    $this->MakeMapping( 'nbin', 'GetObservationData()->GetObservationHeader()->GetNBin' );
-    $this->MakeMapping( 'nchan', 'GetObservationData()->GetObservationHeader()->GetNChan' );
-    $this->MakeMapping( 'npol', 'GetObservationData()->GetObservationHeader()->GetNPol' );
-    $this->MakeMapping( 'nsub', 'GetObservationData()->GetObservationHeader()->GetNSub' );
+    $this->MakeMapping( 'src_name', 'GetObservationHeader()->GetPulsarName' );
+    $this->MakeMapping( 'project_id', 'GetObservationHeader()->GetProjectID' );
+    $this->MakeMapping( 'obsfreq', 'GetObservationHeader()->GetObsFreq' );
+    $this->MakeMapping( 'mjd', 'GetObservationHeader()->GetMJD', 'ToString' );
+    $this->MakeMapping( 'ut', 'GetObservationHeader()->GetUT' );
+    $this->MakeMapping( 'date', 'GetObservationHeader()->GetDate', 'ToDMYString' );
+    $this->MakeMapping( 'bw', 'GetObservationHeader()->GetBW' );
+    $this->MakeMapping( 'scanlen', 'GetObservationHeader()->GetScanLen' );
+    $this->MakeMapping( 'distance', 'GetObservationHeader()->GetDistance' );
+    $this->MakeMapping( 'nbin', 'GetObservationHeader()->GetNBin' );
+    $this->MakeMapping( 'nchan', 'GetObservationHeader()->GetNChan' );
+    $this->MakeMapping( 'npol', 'GetObservationHeader()->GetNPol' );
+    $this->MakeMapping( 'nsub', 'GetObservationHeader()->GetNSub' );
 
     $this->MakeMapping( 'children', 'GetCalibrationData' );
Index: /trunk/htdocs2/Classes/Model/CalUpdater.php
===================================================================
--- /trunk/htdocs2/Classes/Model/CalUpdater.php	(revision 430)
+++ /trunk/htdocs2/Classes/Model/CalUpdater.php	(revision 431)
@@ -3,6 +3,6 @@
 
 
-require_once 'Classes/Model/Calibration.php';
-require_once 'Classes/Model/Observation.php';
+require_once 'Classes/Model/CalibrationHeader.php';
+require_once 'Classes/Model/ObservationHeader.php';
 require_once 'Classes/Model/ObservationSet.php';
 require_once 'Classes/General/Pair.php';
@@ -52,5 +52,5 @@
     
     if( count( $this->observation_sets ) == 0 )
-      throw new GZ_Exception( 'obsevation sets is empty', 'CalUpdater::Execute' );
+      throw new GZ_Exception( 'observation sets is empty', 'CalUpdater::Execute' );
     
     if( $this->range->second > count( $this->observation_sets ) )
@@ -62,5 +62,5 @@
       if( $next_observation_set->GetCalibrationData() == null )
       {
-	$next_mjd = $next_observation_set->GetObservationData()->GetObservationHeader()->GetMJD();
+	$next_mjd = $next_observation_set->GetObservationHeader()->GetMJD();
 	$cal_query = new CalQuery();
 	$cal_query->SetDatabase( $this->database );
Index: unk/htdocs2/Classes/Model/Calibration.php
===================================================================
--- /trunk/htdocs2/Classes/Model/Calibration.php	(revision 430)
+++ 	(revision )
@@ -1,31 +1,0 @@
-<?php
-
-
-
-require_once 'Classes/Model/Observation.php';
-
-
-
-/**
- * @class Calibration
- *
- * This class represents a calibration, it contains an array whith the contents of
- * an entry in the cals table of the database that corresponds to this calibration.
- **/
-class Calibration extends Observation
-{
-  // PUBLIC
-
-  public function __construct( Calibration $rhs = null )
-  {
-    parent::__construct( $rhs );
-  }
-  
-  // PRIVATE
-};
-
-
-
-
-
-?>
Index: /trunk/htdocs2/Classes/Model/CalibrationHeader.php
===================================================================
--- /trunk/htdocs2/Classes/Model/CalibrationHeader.php	(revision 431)
+++ /trunk/htdocs2/Classes/Model/CalibrationHeader.php	(revision 431)
@@ -0,0 +1,31 @@
+<?php
+
+
+
+require_once 'Classes/Model/ObservationHeader.php';
+
+
+
+/**
+ * @class CalibrationHeader
+ *
+ * This class represents a calibration, it contains an array whith the contents of
+ * an entry in the cals table of the database that corresponds to this calibration.
+ **/
+class CalibrationHeader extends ObservationHeader
+{
+  // PUBLIC
+
+  public function __construct( CalibrationHeader $rhs = null )
+  {
+    parent::__construct( $rhs );
+  }
+  
+  // PRIVATE
+};
+
+
+
+
+
+?>
Index: /trunk/htdocs2/Classes/Model/ObservationHeader.php
===================================================================
--- /trunk/htdocs2/Classes/Model/ObservationHeader.php	(revision 430)
+++ /trunk/htdocs2/Classes/Model/ObservationHeader.php	(revision 431)
@@ -4,12 +4,12 @@
 
 require_once 'Classes/General/File.php';
-require_once 'Classes/Model/Calibration.php';
+require_once 'Classes/Model/CalibrationHeader.php';
 require_once 'Classes/Interfaces/CalInterface.php';
 
 
 
-class Observation
+class ObservationHeader
 {
-  public function __construct( Observation $rhs = null )
+  public function __construct( ObservationHeader $rhs = null )
   {
     $this->file_id = null;
@@ -25,5 +25,4 @@
     $this->obs_freq = null;
     $this->scan_len = null;
-    $this->calibrations = Array();
     $this->nbin = null;
     $this->npol = null;
@@ -36,5 +35,5 @@
   }
 
-  public function Copy( Observation $rhs )
+  public function Copy( ObservationHeader $rhs )
   {
     $this->file_id = $rhs->file_id;
@@ -50,9 +49,4 @@
     $this->obs_freq = $rhs->obs_freq;
     $this->scan_len = $rhs->scan_len;
-
-    $this->calibrations = Array();
-    foreach( $rhs->calibrations as $next_cal )
-      $this->calibrations[] = new Calibration( $next_cal );
-
     $this->nbin = $rhs->nbin;
     $this->npol = $rhs->npol;
Index: /trunk/htdocs2/Classes/Model/ObservationSet.php
===================================================================
--- /trunk/htdocs2/Classes/Model/ObservationSet.php	(revision 430)
+++ /trunk/htdocs2/Classes/Model/ObservationSet.php	(revision 431)
@@ -3,5 +3,5 @@
 
 
-require_once 'Classes/Model/Observation.php';
+require_once 'Classes/Model/ObservationHeader.php';
 require_once 'Classes/Pulsar/ObservationData2.php';
 
@@ -20,7 +20,6 @@
   public function __construct( ObservationSet $rhs = null )
   {
-    $this->observation = null;
+    $this->observation_data = null;
     $this->calibrations = Array();
-    $this->observation_data = null;
     $this->data_dir = Dir::ConvertPathString( '/pulsar/scratch01/data_archive/' );
 
@@ -30,5 +29,5 @@
   public function Copy( ObservationSet $rhs )
   {
-    $this->observation = new ObservationData2( $rhs->observation );
+    $this->observation_data = new ObservationData2( $rhs->observation_data );
 
     $this->calibrations = Array();
@@ -39,8 +38,8 @@
   // MAIN INTERFACE
   
-  public function SetObservation( Observation $s_observation ) { $this->priv_SetObservation( $s_observation ); }
-  public function GetObservationData() { return $this->observation; }
+  public function SetObservationHeader( ObservationHeader $s_observation ) { $this->priv_SetObservationHeader( $s_observation ); }
+  public function GetObservationData() { return $this->observation_data; }
   
-  public function GetHeader() { return $this->GetObservationData()->GetObservationHeader(); }
+  public function GetObservationHeader() { return $this->observation_data->GetObservationHeader(); }
 
   public function SetCalibrations( Array $s_calibrations ) { $this->priv_SetCalibrations( $s_calibrations ); }
@@ -61,5 +60,5 @@
   // PRIVATE
 
-  private $observation;
+  private $observation_data;
   private $calibrations;
   private $data_dir;
@@ -67,10 +66,10 @@
   private function priv_SetScrunchingParameters( $s_scr_params )
   {
-    $this->observation->SetScrunchingParameters( $s_scr_params );
+    $this->observation_data->SetScrunchingParameters( $s_scr_params );
   }
   
   private function priv_EstimateDownloadableSize()
   {
-    $dl_size = $this->observation->EstimateDownloadableSize();
+    $dl_size = $this->observation_data->EstimateDownloadableSize();
     foreach( $this->calibrations as $next_cal )
       $dl_size += $next_cal->EstimateDownloadableSize();
@@ -81,5 +80,5 @@
   private function priv_GetDownloadableObsFile()
   {
-    return $this->observation->MakeDownloadableFile();
+    return $this->observation_data->MakeDownloadableFile();
   }
   
@@ -96,11 +95,11 @@
   }
 
-  private function priv_SetObservation( Observation $obs_header )
+  private function priv_SetObservationHeader( ObservationHeader $obs_header )
   {
-    $this->observation = new ObservationData2();
-    $this->observation->SetObservationHeader( $obs_header );
-    $this->observation->SetDataDir( Dir::ConvertPathString(DATA_DIR) );
+    $this->observation_data = new ObservationData2();
+    $this->observation_data->SetObservationHeader( $obs_header );
+    $this->observation_data->SetDataDir( Dir::ConvertPathString(DATA_DIR) );
     if( $this->scrunching_parameters != null )
-        $this->observation->SetScrunchingParameters( $this->scrunching_parameters );
+        $this->observation_data->SetScrunchingParameters( $this->scrunching_parameters );
   }
   
Index: /trunk/htdocs2/Classes/Model/ObservationSetFinder.php
===================================================================
--- /trunk/htdocs2/Classes/Model/ObservationSetFinder.php	(revision 430)
+++ /trunk/htdocs2/Classes/Model/ObservationSetFinder.php	(revision 431)
@@ -66,5 +66,5 @@
     {
       $new_obs_set = new ObservationSet();
-      $new_obs_set->SetObservation( $next_observation );
+      $new_obs_set->SetObservationHeader( $next_observation );
       
 //       $calibrations = Array();
Index: /trunk/htdocs2/Classes/Pulsar/ObservationData2.php
===================================================================
--- /trunk/htdocs2/Classes/Pulsar/ObservationData2.php	(revision 430)
+++ /trunk/htdocs2/Classes/Pulsar/ObservationData2.php	(revision 431)
@@ -3,5 +3,5 @@
 
 
-require_once 'Classes/Model/Observation.php';
+require_once 'Classes/Model/ObservationHeader.php';
 require_once 'Classes/Pulsar/ArchiveScruncher.php';
 require_once 'Classes/Pulsar/ScrunchingParameters.php';
@@ -32,5 +32,5 @@
   public function Copy( ObservationData2 $src )
   {
-    $this->observation_header = new Observation( $src->observation_header );
+    $this->observation_header = new ObservationHeader( $src->observation_header );
     $this->data_file = new File( $src->data_file );
     $this->scrunched_file = new File( $src->scrunched_file );
@@ -54,5 +54,5 @@
   public function MakeDownloadableFile() { return $this->priv_MakeDownloableFile(); }
   
-  public function SetObservationHeader( Observation $s_observation_header ) { $this->observation_header = $s_observation_header; }
+  public function SetObservationHeader( ObservationHeader $s_observation_header ) { $this->observation_header = $s_observation_header; }
   public function GetObservationHeader() { return $this->observation_header; }
   
Index: /trunk/htdocs2/Classes/Pulsar/PulsarCatalog.php
===================================================================
--- /trunk/htdocs2/Classes/Pulsar/PulsarCatalog.php	(revision 430)
+++ /trunk/htdocs2/Classes/Pulsar/PulsarCatalog.php	(revision 431)
@@ -26,5 +26,6 @@
     $last_line = exec( $psrcat_cmd, $all_lines, $ret_val );
     
-    // TODO throw exceptions if exec failed
+    if( $ret_val != 0 )
+      throw new GZ_Exception( "Execution of psrcat failed", "PulsarCatalog::GetCoordsForPulsar" );
 
     $last_line = trim( $last_line );
Index: /trunk/htdocs2/Classes/Queries/ConeQuery.php
===================================================================
--- /trunk/htdocs2/Classes/Queries/ConeQuery.php	(revision 430)
+++ /trunk/htdocs2/Classes/Queries/ConeQuery.php	(revision 431)
@@ -7,5 +7,5 @@
 require_once 'Classes/Queries/CalQuery.php';
 require_once 'Classes/Queries/DateRangeQuery.php';
-require_once 'Classes/Model/Observation.php';
+require_once 'Classes/Model/ObservationHeader.php';
 require_once GREEN_ZONE_DIR . 'Utils/GZ_Exception.php';
 
@@ -82,5 +82,5 @@
     foreach( $result_set as $next_row )
     {
-      $new_obs = new Observation();
+      $new_obs = new ObservationHeader();
       $new_obs->FromRecord( $next_row );
       $this->observations[] = $new_obs;
Index: /trunk/htdocs2/Forms/CartForm.php
===================================================================
--- /trunk/htdocs2/Forms/CartForm.php	(revision 430)
+++ /trunk/htdocs2/Forms/CartForm.php	(revision 431)
@@ -135,5 +135,5 @@
     foreach( $this->cart_contents as $next_item )
     {
-      if( in_array( $next_item->GetObservationData()->GetObservationHeader()->GetFileID(), $selected_ids ) )
+      if( in_array( $next_item->GetObservationHeader()->GetFileID(), $selected_ids ) )
       {
         $files[] = $next_item->GetDownloadableObsFile();
@@ -152,5 +152,5 @@
     foreach( $this->cart_contents as $next_item )
     {
-      if( in_array( $next_item->GetObservationData()->GetObservationHeader()->GetFileID(), $selected_ids ) )
+      if( in_array( $next_item->GetObservationHeader()->GetFileID(), $selected_ids ) )
       {
         $files = array_merge( $files, $next_item->GetDownloadableCalFiles() );
@@ -188,5 +188,5 @@
       foreach( $this->cart_contents as $next_cart_item )
       {
-	if( !in_array( $next_cart_item->GetHeader()->GetFileID(), $selected_ids ) )
+	if( !in_array( $next_cart_item->GetObservationHeader()->GetFileID(), $selected_ids ) )
 	   $new_cart_contents[] = $next_cart_item;
       }
Index: /trunk/htdocs2/Forms/QueryForm.php
===================================================================
--- /trunk/htdocs2/Forms/QueryForm.php	(revision 430)
+++ /trunk/htdocs2/Forms/QueryForm.php	(revision 431)
@@ -8,5 +8,5 @@
 require_once 'Classes/Astro/Band.php';
 require_once 'Classes/Astro/MJD.php';
-require_once 'Classes/Model/Observation.php';
+require_once 'Classes/Model/ObservationHeader.php';
 require_once 'Classes/Model/ObsSetParameters.php';
 require_once 'Classes/Queries/DateRangeQuery.php';
@@ -81,5 +81,5 @@
     $this->gz->smarty_assign( $smarty, 'valid_bands', Band::$valid_bands );
     $this->gz->smarty_assign( $smarty, 'bands', $this->parameters->GetBands() );
-    $this->gz->smarty_assign( $smarty, 'valid_data_types', Observation::$valid_data_types );
+    $this->gz->smarty_assign( $smarty, 'valid_data_types', ObservationHeader::$valid_data_types );
     
     $this->gz->smarty_assign( $smarty, 'order_dir', $this->parameters->GetOrderDirection() );
Index: /trunk/htdocs2/Forms/QueryResultsForm.php
===================================================================
--- /trunk/htdocs2/Forms/QueryResultsForm.php	(revision 430)
+++ /trunk/htdocs2/Forms/QueryResultsForm.php	(revision 431)
@@ -254,9 +254,9 @@
     $cart_ids = Array();
     foreach( $this->cart_contents as $next_cart_item )
-      $cart_ids[] = $next_cart_item->GetObservationData()->GetObservationHeader()->GetFileID();
+      $cart_ids[] = $next_cart_item->GetObservationHeader()->GetFileID();
 
     foreach( $this->observation_sets as $next_result )
     {
-      $next_id = $next_result->GetObservationData()->GetObservationHeader()->GetFileID();
+      $next_id = $next_result->GetObservationHeader()->GetFileID();
       if( in_array( $next_id, $selected_ids ) &&
 	  !in_array( $next_id, $cart_ids ) )
@@ -292,5 +292,5 @@
     
     // convert to 1 decimal place
-    $this->download_size = sprintf( "%.1f", $this->download_size );
+    $this->download_size = sprintf( "%.3f", $this->download_size );
     
   }
Index: /trunk/htdocs2/Forms/ViewProfilesAndCalsForm.php
===================================================================
--- /trunk/htdocs2/Forms/ViewProfilesAndCalsForm.php	(revision 430)
+++ /trunk/htdocs2/Forms/ViewProfilesAndCalsForm.php	(revision 431)
@@ -31,5 +31,5 @@
     $this->data_set = Array();
     foreach( $this->last_result as $next_obs_set )
-      if( in_array( $next_obs_set->GetObservation()->GetFileID(), $this->selected_ids ) )
+      if( in_array( $next_obs_set->GetObservationHeader()->GetFileID(), $this->selected_ids ) )
 	$this->data_set[] = $next_obs_set;
     
@@ -82,8 +82,7 @@
     foreach( $this->data_set as $next_obs_set )
     {
-      $next_id = $next_obs_set->GetObservation()->GetFileID();
+      $next_id = $next_obs_set->GetObservationHeader()->GetFileID();
       
-      $next_obs_set->SetupObservationData();
-      $next_obs_set->MakeSourceFile();
+      $src_file = $next_obs_set->GetObservationData()->MakeDataFile();
       
       $plot_dir = Dir::ConvertPathString( WEB_ROOT . '/plots' );
@@ -94,10 +93,9 @@
       if( !$target_plot->Exists() )
       {
-        $src_file = File::ConvertFullPath( DATA_DIR . '/' . $next_obs_set->GetObservation()->GetFile()->GetFilename() );
         $this->MakePlot( $plot_dir, $next_id, $src_file );
         
-        foreach( $next_obs_set->GetCalibrations() as $next_cal )
+        foreach( $next_obs_set->GetCalibrationData() as $next_cal )
         {
-          $this->MakePlot( $plot_dir, $next_cal->GetFileID(), $next_cal->GetFile(), true );
+          $this->MakePlot( $plot_dir, $next_cal->GetFileID(), $next_cal->GetObservationData()->MakeDataFile(), true );
         }
       }
