Changeset 5364

Show
Ignore:
Timestamp:
27/07/10 09:28:03 (6 weeks ago)
Author:
Martyn Gigg
Message:

Implemented run parameter reading for ISIS Nexus and Raw loading routines. Re #1416

Location:
trunk/Code/Mantid
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/Code/Mantid/DataHandling/inc/MantidDataHandling/LoadRawHelper.h

    r5357 r5364  
    1313// Forward declaration 
    1414//---------------------------------------------------------------------- 
     15class ISISRAW; 
    1516class ISISRAW2; 
    1617 
     
    5455      /// Destructor 
    5556      ~LoadRawHelper(); 
     57      ///Opens Raw File 
     58      FILE* openRawFile(const std::string & fileName); 
     59      /// Read in run parameters Public so that LoadRaw2 can use it 
     60      void loadRunParameters(API::MatrixWorkspace_sptr localWorkspace, ISISRAW * const = NULL) const; 
    5661    protected: 
    5762      /// Overwrites Algorithm method. 
    5863      void init(); 
    59       ///Opens Raw File 
    60       FILE* openRawFile(const std::string & fileName); 
    6164      ///checks the file is an ascii file 
    6265      bool isAscii(FILE* file) const; 
     
    104107      void runLoadLog(const std::string& fileName,DataObjects::Workspace2D_sptr,int period=1); 
    105108 
    106       /// Read in run parameters 
    107       void loadRunParameters(API::MatrixWorkspace_sptr localWorkspace) const; 
    108109 
    109110      ///gets the monitor spectrum list from the workspace 
  • trunk/Code/Mantid/DataHandling/src/LoadRaw.cpp

    r5348 r5364  
    33//---------------------------------------------------------------------- 
    44#include "MantidDataHandling/LoadRaw.h" 
     5#include "MantidDataHandling/LoadRawHelper.h" 
    56#include "MantidDataObjects/Workspace2D.h" 
    67#include "MantidKernel/UnitFactory.h" 
     
    7778      // Retrieve the filename from the properties 
    7879      m_filename = getPropertyValue("Filename"); 
    79       if( isAscii(m_filename) ) 
    80       { 
    81         g_log.error() << "File \"" << m_filename << "\" is not a valid RAW file.\n"; 
    82         throw std::invalid_argument("Incorrect file type encountered."); 
    83       } 
     80 
     81      LoadRawHelper *helper = new LoadRawHelper; 
     82      FILE* file = helper->openRawFile(m_filename); 
     83      ISISRAW iraw; 
     84      iraw.ioRAW(file, true); 
     85 
     86      std::string title(iraw.hdr.hd_run, 69); 
     87      // Insert some spaces to tidy the string up a bit 
     88      title.insert(5, " "); 
     89      title.insert(26, " "); 
     90      title.insert(51, " "); 
     91      g_log.information("**** Run title: "+title+ "***"); 
    8492       
    85       ISISRAW iraw(NULL); 
    86       if (iraw.readFromFile(m_filename.c_str()) != 0) 
    87       { 
    88         g_log.error("Unable to open file " + m_filename); 
    89         throw Exception::FileError("Unable to open File:" , m_filename); 
    90       } 
    91  
    9293      // Read in the number of spectra in the RAW file 
    9394      m_numberOfSpectra = iraw.t_nsp1; 
     
    139140               (WorkspaceFactory::Instance().create("Workspace2D",total_specs,lengthIn,lengthIn-1)); 
    140141      localWorkspace->getAxis(0)->unit() = UnitFactory::Instance().create("TOF"); 
     142      localWorkspace->setTitle(title); 
     143      // Run parameters 
     144      helper->loadRunParameters(localWorkspace, &iraw); 
     145      delete helper; 
     146      helper = NULL; 
     147 
    141148 
    142149      // Loop over the number of periods in the raw file, putting each period in a separate workspace 
  • trunk/Code/Mantid/DataHandling/src/LoadRaw2.cpp

    r5348 r5364  
    44#include "MantidDataHandling/LoadRaw2.h" 
    55#include "MantidDataHandling/ManagedRawFileWorkspace2D.h" 
     6#include "MantidDataHandling/LoadRawHelper.h" 
    67#include "MantidDataObjects/Workspace2D.h" 
    78#include "MantidAPI/XMLlogfile.h" 
     
    8687      // Retrieve the filename from the properties 
    8788      m_filename = getPropertyValue("Filename"); 
    88  
    89       if( isAscii(m_filename) ) 
    90       { 
    91         g_log.error() << "File \"" << m_filename << "\" is not a valid RAW file.\n"; 
    92         throw std::invalid_argument("Incorrect file type encountered."); 
    93       } 
    94  
    95       //ISISRAW iraw(NULL); 
    96       FILE* file = fopen(m_filename.c_str(),"rb"); 
    97       if (file == NULL) 
    98       { 
    99         g_log.error("Unable to open file " + m_filename); 
    100         throw Exception::FileError("Unable to open File:" , m_filename); 
    101       } 
     89      LoadRawHelper *helper = new LoadRawHelper; 
     90      FILE* file = helper->openRawFile(m_filename); 
    10291      isisRaw->ioRAW(file, true); 
    103       const std::string title(isisRaw->hdr.hd_title); 
     92       
     93      std::string title(isisRaw->hdr.hd_run, 69); 
     94      // Insert some spaces to tidy the string up a bit 
     95      title.insert(5, " "); 
     96      title.insert(26, " "); 
     97      title.insert(51, " "); 
    10498      g_log.information("**** Run title: "+title+ "***"); 
    10599 
     
    196190      localWorkspace->setTitle(title); 
    197191      localWorkspace->getAxis(0)->unit() = UnitFactory::Instance().create("TOF"); 
    198  
    199       //if (dhdr.d_comp == 0) throw std::runtime_error("Oops.."); 
     192      // Run parameters 
     193      helper->loadRunParameters(localWorkspace, isisRaw.get()); 
     194      delete helper; 
     195      helper = NULL; 
     196 
    200197      // Loop over the number of periods in the raw file, putting each period in a separate workspace 
    201198      for (int period = 0; period < m_numberOfPeriods; ++period) { 
     
    205202            localWorkspace =  boost::dynamic_pointer_cast<DataObjects::Workspace2D> 
    206203                (WorkspaceFactory::Instance().create(localWorkspace)); 
    207             //localWorkspace->newInstrumentParameters(); ???? 
    208204        } 
    209205 
     
    316312} 
    317313 
    318     /** 
    319      * Check if a file is a text file 
    320      * @param filename The file path to check 
    321      * @returns true if the file an ascii text file, false otherwise 
    322      */ 
    323     bool LoadRaw2::isAscii(const std::string & filename) const 
    324     { 
    325       FILE* file = fopen(filename.c_str(), "rb"); 
    326       char data[256]; 
    327       int n = fread(data, 1, sizeof(data), file); 
    328       char *pend = &data[n]; 
    329       /* 
    330        * Call it a binary file if we find a non-ascii character in the  
    331        * first 256 bytes of the file. 
    332        */ 
    333       for( char *p = data;  p < pend; ++p ) 
    334       { 
    335         unsigned long ch = (unsigned long)*p; 
    336         if( !(ch <= 0x7F) ) 
    337         { 
    338           return false; 
    339         } 
    340          
    341       } 
    342       return true; 
    343     } 
    344  
    345314    /// Validates the optional 'spectra to read' properties, if they have been set 
    346315    void LoadRaw2::checkOptionalProperties() 
  • trunk/Code/Mantid/DataHandling/src/LoadRaw3.cpp

    r5357 r5364  
    8484  //open the raw file 
    8585  FILE* file=openRawFile(m_filename); 
    86  
    87   // Need to check that the file is not a text file as the ISISRAW routines don't deal with these very well, i.e  
    88   // reading continues until a bad_alloc is encountered. 
    89   if( isAscii(file) ) 
    90   { 
    91     g_log.error() << "File \"" << m_filename << "\" is not a valid RAW file.\n"; 
    92         fclose(file); 
    93     throw std::invalid_argument("Incorrect file type encountered."); 
    94   } 
    9586 
    9687  bool bLoadlogFiles = getProperty("LoadLogFiles"); 
  • trunk/Code/Mantid/DataHandling/src/LoadRawHelper.cpp

    r5357 r5364  
    8080        throw Exception::FileError("Unable to open File:", fileName); 
    8181      } 
     82      // Need to check that the file is not a text file as the ISISRAW routines don't deal with these very well, i.e  
     83      // reading continues until a bad_alloc is encountered. 
     84      if( isAscii(file) ) 
     85      { 
     86        g_log.error() << "File \"" << fileName << "\" is not a valid RAW file.\n"; 
     87        fclose(file); 
     88        throw std::invalid_argument("Incorrect file type encountered."); 
     89      } 
     90       
    8291      return file; 
    8392 
     
    8998    void LoadRawHelper::readTitle(FILE* file,std::string & title) 
    9099    { 
    91       ioRaw(file,true ); 
     100      ioRaw(file, true); 
    92101      // This reads in the HDR_STRUCT run, user, title, date & time fields 
    93102      std::string header(isisRaw->hdr.hd_run, 69); 
     
    691700     * @param localWorkspace The workspace to attach the information to 
    692701     */ 
    693     void LoadRawHelper::loadRunParameters(API::MatrixWorkspace_sptr localWorkspace) const 
    694     { 
     702    void LoadRawHelper::loadRunParameters(API::MatrixWorkspace_sptr localWorkspace, ISISRAW * const rawFile) const 
     703    { 
     704      ISISRAW * localISISRaw(NULL); 
     705      if( !rawFile ) 
     706      { 
     707        localISISRaw = isisRaw.get(); 
     708      } 
     709      else 
     710      { 
     711        localISISRaw = rawFile; 
     712      }       
     713 
    695714      API::Run& runDetails = localWorkspace->mutableRun(); 
    696715      // Run header is what we have set as the workspace title 
     
    698717      runDetails.addProperty("run_header", run_header); 
    699718      // Run title is stored in a different attribute 
    700       runDetails.addProperty("run_title", std::string(isisRaw->r_title,80)); 
     719      runDetails.addProperty("run_title", std::string(localISISRaw->r_title,80)); 
    701720       
    702721      // Data details on run not the workspace 
    703       runDetails.addProperty("nspectra", static_cast<int>(isisRaw->t_nsp1)); 
    704       runDetails.addProperty("nchannels", static_cast<int>(isisRaw->t_ntc1)); 
    705       runDetails.addProperty("nperiods", static_cast<int>(isisRaw->t_nper)); 
     722      runDetails.addProperty("nspectra", static_cast<int>(localISISRaw->t_nsp1)); 
     723      runDetails.addProperty("nchannels", static_cast<int>(localISISRaw->t_ntc1)); 
     724      runDetails.addProperty("nperiods", static_cast<int>(localISISRaw->t_nper)); 
    706725 
    707726      // RPB struct info 
    708       runDetails.addProperty("r_dur", isisRaw->rpb.r_dur);      // actual run duration 
    709       runDetails.addProperty("r_durunits", isisRaw->rpb.r_durunits);    // scaler for above (1=seconds) 
    710       runDetails.addProperty("r_dur_freq",isisRaw->rpb.r_dur_freq);  // testinterval for above (seconds) 
    711       runDetails.addProperty("r_dmp", isisRaw->rpb.r_dmp);       // dump interval 
    712       runDetails.addProperty("r_dmp_units", isisRaw->rpb.r_dmp_units);  // scaler for above 
    713       runDetails.addProperty("r_dmp_freq",isisRaw->rpb.r_dmp_freq);     // interval for above 
    714       runDetails.addProperty("r_freq",isisRaw->rpb.r_freq);     // 2**k where source frequency = 50 / 2**k 
    715       runDetails.addProperty("r_gd_prtn_chrg", static_cast<double>(isisRaw->rpb.r_gd_prtn_chrg));  // good proton charge (uA.hour) 
    716       runDetails.addProperty("r_tot_prtn_chrg", static_cast<double>(isisRaw->rpb.r_tot_prtn_chrg)); // total proton charge (uA.hour) 
    717       runDetails.addProperty("r_goodfrm",isisRaw->rpb.r_goodfrm);       // good frames 
    718       runDetails.addProperty("r_rawfrm", isisRaw->rpb.r_rawfrm);        // raw frames 
    719       runDetails.addProperty("r_dur_wanted",isisRaw->rpb.r_dur_wanted); // requested run duration (units as for "duration" above) 
    720       runDetails.addProperty("r_dur_secs",isisRaw->rpb.r_dur_secs );    // actual run duration in seconds 
    721       runDetails.addProperty("r_mon_sum1", isisRaw->rpb.r_mon_sum1);    // monitor sum 1 
    722       runDetails.addProperty("r_mon_sum2",isisRaw->rpb.r_mon_sum2);     // monitor sum 2 
    723       runDetails.addProperty("r_mon_sum3",isisRaw->rpb.r_mon_sum3);     // monitor sum 3 
    724       runDetails.addProperty("r_enddate",std::string(isisRaw->rpb.r_enddate, 11)); // format DD-MMM-YYYY 
    725       runDetails.addProperty("r_endtime", std::string(isisRaw->rpb.r_endtime, 8)); // format HH-MM-SS 
    726       runDetails.addProperty("r_prop",isisRaw->rpb.r_prop); // RB (proposal) number 
     727      runDetails.addProperty("dur", localISISRaw->rpb.r_dur);   // actual run duration 
     728      runDetails.addProperty("durunits", localISISRaw->rpb.r_durunits); // scaler for above (1=seconds) 
     729      runDetails.addProperty("dur_freq",localISISRaw->rpb.r_dur_freq);  // testinterval for above (seconds) 
     730      runDetails.addProperty("dmp", localISISRaw->rpb.r_dmp);       // dump interval 
     731      runDetails.addProperty("dmp_units", localISISRaw->rpb.r_dmp_units);       // scaler for above 
     732      runDetails.addProperty("dmp_freq",localISISRaw->rpb.r_dmp_freq);  // interval for above 
     733      runDetails.addProperty("freq",localISISRaw->rpb.r_freq);  // 2**k where source frequency = 50 / 2**k 
     734      runDetails.addProperty("gd_prtn_chrg", static_cast<double>(localISISRaw->rpb.r_gd_prtn_chrg));  // good proton charge (uA.hour) 
     735      runDetails.addProperty("tot_prtn_chrg", static_cast<double>(localISISRaw->rpb.r_tot_prtn_chrg)); // total proton charge (uA.hour) 
     736      runDetails.addProperty("goodfrm",localISISRaw->rpb.r_goodfrm);    // good frames 
     737      runDetails.addProperty("rawfrm", localISISRaw->rpb.r_rawfrm);     // raw frames 
     738      runDetails.addProperty("dur_wanted",localISISRaw->rpb.r_dur_wanted); // requested run duration (units as for "duration" above) 
     739      runDetails.addProperty("dur_secs",localISISRaw->rpb.r_dur_secs ); // actual run duration in seconds 
     740      runDetails.addProperty("mon_sum1", localISISRaw->rpb.r_mon_sum1); // monitor sum 1 
     741      runDetails.addProperty("mon_sum2",localISISRaw->rpb.r_mon_sum2);  // monitor sum 2 
     742      runDetails.addProperty("mon_sum3",localISISRaw->rpb.r_mon_sum3);  // monitor sum 3 
     743      runDetails.addProperty("enddate",std::string(localISISRaw->rpb.r_enddate, 11)); // format DD-MMM-YYYY 
     744      runDetails.addProperty("endtime", std::string(localISISRaw->rpb.r_endtime, 8)); // format HH-MM-SS 
     745      runDetails.addProperty("rb_proposal",localISISRaw->rpb.r_prop); // RB (proposal) number 
    727746 
    728747    } 
  • trunk/Code/Mantid/Nexus/inc/MantidNexus/LoadISISNexus.h

    r5318 r5364  
    9999            void loadData(int, int, int&, DataObjects::Workspace2D_sptr ); 
    100100            void runLoadInstrument(DataObjects::Workspace2D_sptr); 
    101             //     void runLoadInstrumentFromNexus(DataObjects::Workspace2D_sptr); 
    102101            void loadMappingTable(DataObjects::Workspace2D_sptr); 
    103             void loadProtonCharge(DataObjects::Workspace2D_sptr); 
     102            void loadRunDetails(DataObjects::Workspace2D_sptr localWorkspace); 
     103            template<class TYPE> 
     104            TYPE getEntryValue(const std::string & name); 
     105            template<class TYPE> 
     106            TYPE getNXData(const std::string & name); 
     107 
    104108            void loadLogs(DataObjects::Workspace2D_sptr,int period = 1); 
    105109 
     
    167171            static double dblSqrt(double in); 
    168172        }; 
     173       
     174      /** 
     175       * Get a value from the nexus file. The name should be relative and the parent group already opened. 
     176       * @param name The name of the NX entry 
     177       * @returns The value of entry 
     178       */ 
     179      template<class TYPE> 
     180      TYPE LoadISISNexus::getEntryValue(const std::string & name) 
     181      { 
     182        openNexusData(name); 
     183        TYPE value; 
     184        getNexusData(&value); 
     185        closeNexusData(); 
     186        return value; 
     187      } 
     188 
     189      /** 
     190       * Get the first entry from an NX data group 
     191       * @param name The group name 
     192       * @returns The data value 
     193       */ 
     194      template<class TYPE> 
     195      TYPE LoadISISNexus::getNXData(const std::string & name) 
     196      { 
     197        openNexusData(name); 
     198        TYPE value[1]; 
     199        getNexusData(value); 
     200        closeNexusData(); 
     201        return value[0]; 
     202      } 
     203 
     204 
     205 
    169206 
    170207    } // namespace NeXus 
  • trunk/Code/Mantid/Nexus/src/LoadISISNexus.cpp

    r5348 r5364  
    1414 
    1515#include "Poco/Path.h" 
    16  
     16#include <Poco/DateTimeFormatter.h> 
     17#include <Poco/DateTimeParser.h> 
     18#include <Poco/DateTimeFormat.h> 
     19 
     20#include "boost/lexical_cast.hpp" 
    1721#include <cmath> 
    1822#include <sstream> 
     
    146150      localWorkspace->getAxis(0)->unit() = UnitFactory::Instance().create("TOF"); 
    147151      localWorkspace->setYUnit("Counts"); 
     152      const std::string title = getNexusString("title"); 
     153      localWorkspace->setTitle(title); 
    148154 
    149155      Progress prog(this,0.,1.,total_specs*m_numberOfPeriods); 
     
    158164            runLoadInstrument(localWorkspace ); 
    159165            loadMappingTable(localWorkspace ); 
    160             loadProtonCharge(localWorkspace); 
     166            loadRunDetails(localWorkspace); 
    161167            loadLogs(localWorkspace ); 
    162168          } 
     
    167173          runLoadInstrument(localWorkspace ); 
    168174          loadMappingTable(localWorkspace ); 
    169           loadProtonCharge(localWorkspace); 
     175          loadRunDetails(localWorkspace); 
    170176          loadLogs(localWorkspace ); 
    171177        } 
     
    174180          localWorkspace =  boost::dynamic_pointer_cast<DataObjects::Workspace2D> 
    175181            (WorkspaceFactory::Instance().create(localWorkspace)); 
    176           //localWorkspace->newInstrumentParameters(); ??? 
    177182 
    178183          loadLogs(localWorkspace ,period); 
     
    334339      } 
    335340 
    336       //boost::shared_array<char> nxname( new char[NX_MAXNAMELEN] ); 
    337       //boost::shared_array<char> nxclass( new char[NX_MAXNAMELEN] ); 
    338       //int nxdatatype; 
    339  
    340       //int stat = NX_OK; 
    341       //while(stat != NX_EOD) 
    342       //{ 
    343       //    stat=NXgetnextentry(m_fileID,nxname.get(),nxclass.get(),&nxdatatype); 
    344       //    std::cerr<<nxname.get()<<"  "<<nxclass.get()<<"  "<<nxdatatype<<"\n"; 
    345       //} 
    346       //std::cerr<<'\n'; 
    347341    } 
    348342 
     
    573567    } 
    574568 
    575     /**  Loag the proton charge from the file. 
     569    /**  Loag the run details from the file 
    576570    *   Group /raw_data_1 must be open. 
     571    * @param localWorkspace The workspace details to use 
    577572    */ 
    578     void LoadISISNexus::loadProtonCharge(DataObjects::Workspace2D_sptr ws) 
    579     { 
    580       openNexusData("proton_charge"); 
    581       { 
    582         getNexusData(&m_proton_charge); 
    583         ws->mutableRun().setProtonCharge(m_proton_charge); 
    584       } 
     573    void LoadISISNexus::loadRunDetails(DataObjects::Workspace2D_sptr localWorkspace) 
     574    { 
     575      API::Run & runDetails = localWorkspace->mutableRun(); 
     576      m_proton_charge = getEntryValue<double>("proton_charge"); 
     577      runDetails.setProtonCharge(m_proton_charge); 
     578      int run_number = getEntryValue<int>("run_number"); 
     579      runDetails.addProperty("run_number", boost::lexical_cast<std::string>(run_number)); 
     580 
     581 
     582      openNexusGroup("isis_vms_compat","IXvms"); 
     583      char header[80]; 
     584      openNexusData("HDR"); 
     585      getNexusData(&header); 
    585586      closeNexusData(); 
     587      runDetails.addProperty("run_header", std::string(header,80)); 
     588      runDetails.addProperty("run_title", localWorkspace->getTitle()); 
     589       
     590 
     591      runDetails.addProperty("nspectra", getNXData<int>("NSP1")); 
     592      runDetails.addProperty("nchannels", getNXData<int>("NTC1")); 
     593      runDetails.addProperty("nperiods", getNXData<int>("NPER")); 
     594 
     595      int rpb_int[32]; 
     596      openNexusData("IRPB"); 
     597      getNexusData(&rpb_int[0]); 
     598      closeNexusData(); 
     599 
     600      double rpb_dbl[32]; 
     601      openNexusData("RRPB"); 
     602      getNexusData(&rpb_dbl[0]); 
     603      closeNexusData(); 
     604       
     605      runDetails.addProperty("dur", rpb_int[0]);        // actual run duration 
     606      runDetails.addProperty("durunits", rpb_int[1]);   // scaler for above (1=seconds) 
     607      runDetails.addProperty("dur_freq", rpb_int[2]);  // testinterval for above (seconds) 
     608      runDetails.addProperty("dmp", rpb_int[3]);       // dump interval 
     609      runDetails.addProperty("dmp_units", rpb_int[4]);  // scaler for above 
     610      runDetails.addProperty("dmp_freq", rpb_int[5]);   // interval for above 
     611      runDetails.addProperty("freq", rpb_int[6]);       // 2**k where source frequency = 50 / 2**k 
     612      runDetails.addProperty("gd_prtn_chrg", rpb_dbl[7]);  // good proton charge (uA.hour) 
     613      runDetails.addProperty("tot_prtn_chrg", rpb_dbl[8]); // total proton charge (uA.hour) 
     614      runDetails.addProperty("goodfrm",rpb_int[9]);     // good frames 
     615      runDetails.addProperty("rawfrm", rpb_int[10]);    // raw frames 
     616      runDetails.addProperty("dur_wanted", rpb_int[11]); // requested run duration (units as for "duration" above) 
     617      runDetails.addProperty("dur_secs", rpb_int[12]);  // actual run duration in seconds 
     618      runDetails.addProperty("mon_sum1", rpb_int[13]);  // monitor sum 1 
     619      runDetails.addProperty("mon_sum2", rpb_int[14]);  // monitor sum 2 
     620      runDetails.addProperty("mon_sum3",rpb_int[15]);   // monitor sum 3 
     621       
     622      closeNexusGroup(); // isis_vms_compat 
     623 
     624      //std::string end_time_iso = getNXData<>("end_time"); 
     625      char strvalue[19]; 
     626      openNexusData("end_time"); 
     627      getNexusData(&strvalue); 
     628      closeNexusData(); 
     629      std::string end_time_iso(strvalue, 19); 
     630      std::string end_date(""), end_time(""); 
     631      try 
     632      { 
     633        Poco::DateTime end_time_output; 
     634        int timezone_diff(0); 
     635        Poco::DateTimeParser::parse(Poco::DateTimeFormat::ISO8601_FORMAT, end_time_iso, end_time_output, timezone_diff); 
     636        end_date = Poco::DateTimeFormatter::format(end_time_output, "%d-%m-%Y", timezone_diff); 
     637        end_time = Poco::DateTimeFormatter::format(end_time_output, "%H:%M:%S", timezone_diff); 
     638      } 
     639      catch(Poco::SyntaxException&) 
     640      { 
     641        end_date = "\?\?-\?\?-\?\?\?\?"; 
     642        end_time = "\?\?-\?\?-\?\?"; 
     643        g_log.warning() << "Cannot parse end time from entry in Nexus file.\n"; 
     644      } 
     645       
     646      runDetails.addProperty("enddate", end_date); 
     647      runDetails.addProperty("endtime", end_time); 
     648      runDetails.addProperty("rb_proposal",rpb_int[21]); // RB (proposal) number 
    586649 
    587650      openNexusGroup("sample","NXsample"); 
    588651      std::string sample_name = getNexusString("name"); 
    589       ws->mutableSample().setName(sample_name); 
     652      localWorkspace->mutableSample().setName(sample_name); 
    590653      closeNexusGroup(); 
    591654    } 
  • trunk/Code/Mantid/Nexus/src/LoadISISNexus2.cpp

    r5357 r5364  
    619619        int timezone_diff(0); 
    620620        Poco::DateTimeParser::parse(Poco::DateTimeFormat::ISO8601_FORMAT, end_time_iso, end_time_output, timezone_diff); 
    621         end_date = Poco::DateTimeFormatter::format(end_time_output, "%DD-%MM-%YYYY", timezone_diff); 
    622         end_time = Poco::DateTimeFormatter::format(end_time_output, "%HH-%MM-%SS", timezone_diff); 
     621        end_date = Poco::DateTimeFormatter::format(end_time_output, "%d-%m-%Y", timezone_diff); 
     622        end_time = Poco::DateTimeFormatter::format(end_time_output, "%H:%M:%S", timezone_diff); 
    623623      } 
    624624      catch(Poco::SyntaxException&) 
     
    631631      runDetails.addProperty("enddate", end_date); 
    632632      runDetails.addProperty("endtime", end_time); 
    633       runDetails.addProperty("prop",rpb_int[21]); // RB (proposal) number 
     633      runDetails.addProperty("rb_proposal",rpb_int[21]); // RB (proposal) number 
    634634      vms_compat.close(); 
    635635