Index: /trunk/htdocs2/Classes/Interfaces/ObsSetMapper.php
===================================================================
--- /trunk/htdocs2/Classes/Interfaces/ObsSetMapper.php	(revision 408)
+++ /trunk/htdocs2/Classes/Interfaces/ObsSetMapper.php	(revision 409)
@@ -21,6 +21,6 @@
     $this->MakeMapping( 'decjd', 'GetObservation()->GetCoordinates()->GetDEC', 'ToDegrees' );
     $this->MakeMapping( 'data_type', 'GetObservation()->GetDataType' );
-    $this->MakeMapping( 'filename', 'GetDataFile()->GetFilename' );
-    $this->MakeMapping( 'data_loc', 'GetDataFile()->GetPath' );
+    $this->MakeMapping( 'filename', 'GetFinalObsFile()->GetFilename' );
+    $this->MakeMapping( 'data_loc', 'GetFinalObsFile()->GetPath' );
     $this->MakeMapping( 'src_name', 'GetObservation()->GetPulsarName' );
     $this->MakeMapping( 'project_id', 'GetObservation()->GetProjectID' );
Index: /trunk/htdocs2/Classes/Model/Observation.php
===================================================================
--- /trunk/htdocs2/Classes/Model/Observation.php	(revision 408)
+++ /trunk/htdocs2/Classes/Model/Observation.php	(revision 409)
@@ -6,5 +6,4 @@
 require_once 'Classes/Model/Calibration.php';
 require_once 'Classes/Interfaces/CalInterface.php';
-require_once 'Classes/Pulsar/ObservationData.php';
 
 
Index: /trunk/htdocs2/Classes/Model/ObservationSet.php
===================================================================
--- /trunk/htdocs2/Classes/Model/ObservationSet.php	(revision 408)
+++ /trunk/htdocs2/Classes/Model/ObservationSet.php	(revision 409)
@@ -46,9 +46,9 @@
   
   //! Get the adjusted filename, this will include scrunching parameters if set
-  public function GetDataFile() { return $this->priv_GetDataFile(); }
+  //public function GetDataFile() { return $this->priv_GetDataFile(); }
   
   public function SetScrunchingParameters( ScrunchingParameters $s_scr_params ) { $this->priv_SetScrunchingParameters( $s_scr_params ); }
   
-  public function GetScrunchingParameters() { return $this->observation_data->GetScrunchingParameters(); }
+  //public function GetScrunchingParameters() { return $this->observation_data->GetScrunchingParameters(); }
   
   public function SetupObservationData() { $this->priv_SetupObservationData(); }
@@ -56,9 +56,13 @@
   public function EstimateDownloadableSize() { return $this->priv_EstimateDownloadableSize(); }
   
-  public function MakeSourceFile() { $this->priv_MakeSourcefile(); }
+  public function GetSourceFile() { $this->priv_GetSourcefile(); }
+//   
+//   public function MakeDownloadables() { $this->priv_MakeDownloadables(); }
   
-  public function MakeDownloadables() { $this->priv_MakeDownloadables(); }
-  
-  public function GetDownloadFiles() { return $this->priv_GetDownloadFiles(); }
+  //! Get the obs file, this will be in the data directory and be added/scrunched etc as required
+  public function GetFinalObsFile() { return $this->priv_GetFinalObsFile(); }
+
+  //! Get the cal files, these will be in the data directory and be added if required.
+  public function GetFinalCalFiles() { return $this->priv_GetFinalCalFiles(); }
   
   // PRIVATE
@@ -68,14 +72,4 @@
   private $observation_data;
   private $data_dir;
-  
-  private function priv_GetDataFile()
-  {
-    if( $this->observation_data != null )
-      $file = new File( $this->observation_data->GetDataFile() );
-    else
-      $file = new File( $this->observation->GetFile() );
-    
-    return $file;
-  }
   
   private function priv_SetScrunchingParameters( $s_scr_params )
@@ -89,8 +83,4 @@
     $this->observation_data = new ObservationData2();
     $this->observation_data->SetObservationHeader( $this->observation );
-//     $this->observation_data->SetNBin( $this->observation->GetNBin() );
-//     $this->observation_data->SetNPol( $this->observation->GetNPol() );
-//     $this->observation_data->SetNChan( $this->observation->GetNChan() );
-//     $this->observation_data->SetNSub( $this->observation->GetNSub() );
     $this->observation_data->SetDataDir( $this->data_dir );
   }
@@ -111,5 +101,5 @@
   
   //! Make the source file, don't need the full downloadable files if we are plotting
-  private function priv_MakeSourceFile()
+  private function priv_GetSourceFile()
   {
     $this->observation_data->GetDataFile();
@@ -153,4 +143,26 @@
     return $data_files;
   }
+  
+  private function priv_GetFinalObsFile()
+  {
+    if( $this->observation_data != null )
+      $file = new File( $this->observation_data->GetDataFile() );
+    else
+      $file = new File( $this->observation->GetFile() );
+    
+    return $file;
+  }
+  
+  private function priv_GetFinalCalFiles()
+  {
+    $data_files = Array();
+    foreach( $this->calibrations as $next_cal )
+    {
+      $cal_data_path = $this->data_dir->GetPath();
+      $cal_data_path .= '/' . $next_cal->GetFile()->GetFilename();
+      $data_files[] =  File::ConvertFullPath( $cal_data_path );
+    }
+    return $data_files;
+  }
 
 };
Index: /trunk/htdocs2/Forms/CartForm.php
===================================================================
--- /trunk/htdocs2/Forms/CartForm.php	(revision 408)
+++ /trunk/htdocs2/Forms/CartForm.php	(revision 409)
@@ -109,20 +109,6 @@
   }
   
-  private function DownloadObservations()
-  {
-    $files_to_tar = Array();
-    
-    $selected_ids = $this->obs_table->GetSelectedIDs();
-    
-    foreach( $this->cart_contents as $next_item )
-    {
-      if( in_array( $next_item->GetObservation()->GetFileID(), $selected_ids ) )
-      {
-        $next_item->MakeDownloadables();
-        $download_files = $next_item->GetDownloadFiles();
-        foreach( $download_files as $next_file )
-          $files_to_tar[] = $next_file;
-      }
-    }
+  private function TarFiles( $contents )
+  {
     $now = date( 'Ymdhms' );
     $tar_file = File::ConvertFullPath( DATA_DIR . '/' . $now . '.tar' );
@@ -131,5 +117,5 @@
     $tar_builder->SetTarFile( $tar_file );
     $tar_builder->SetSrcDir( Dir::ConvertPathString( DATA_DIR ) );
-    foreach( $files_to_tar as $next_file )
+    foreach( $contents as $next_file )
       $tar_builder->AddFile( $next_file );
     $tar_builder->Execute();
@@ -141,12 +127,55 @@
   }
   
+  private function GetObsFiles()
+  {
+    $files = Array();
+    
+    $selected_ids = $this->obs_table->GetSelectedIDs();
+    
+    foreach( $this->cart_contents as $next_item )
+    {
+      if( in_array( $next_item->GetObservation()->GetFileID(), $selected_ids ) )
+      {
+        $files[] = $next_item->GetFinalObsFile();
+      }
+    }
+    
+    return $files;
+  }
+  
+  private function GetCalFiles()
+  {
+    $files = Array();
+    
+    $selected_ids = $this->obs_table->GetSelectedIDs();
+    
+    foreach( $this->cart_contents as $next_item )
+    {
+      if( in_array( $next_item->GetObservation()->GetFileID(), $selected_ids ) )
+      {
+        $files = array_merge( $files, $next_item->GetFinalCalFiles() );
+      }
+    }
+    
+    return $files;
+  }
+  
+  private function DownloadObservations()
+  {
+    $this->TarFiles( $this->GetObsFiles() );
+  }
+  
   private function DownloadCalibrations()
   {
-    echo 'downloaing calibrations <br> ';
+    $this->TarFiles( $this->GetCalFiles() );
   }
   
   private function DownloadObsAndCals()
   {
-    echo 'downloading observations and cals <br> ';
+    $obs_files = $this->GetObsFiles();
+    
+    $cal_files = $this->GetCalFiles();
+    
+    $this->TarFiles( array_merge( $obs_files, $cal_files ) );
   }
   
