Ignore:
Timestamp:
Jul 21, 2016 4:09:56 AM (8 years ago)
Author:
lewis
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
df332d8
Parents:
7c8ddb83
Message:

Write run_name to SASentry.name instead of Run.name to agree with Mantid output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/file_converter/converter_panel.py

    r7c8ddb83 rd112c30  
    7474    def convert_to_cansas(self, data, filename): 
    7575        reader = CansasReader() 
    76         reader.write(filename, data) 
     76        reader.write(filename, data, 
     77            sasentry_attrs={ 'name': self.run_name }) 
    7778 
    7879    def extract_data(self, filename): 
     
    127128        data.filename = output_path.split('\\')[-1] 
    128129 
    129         if self.run is not None: 
    130             run = self.run 
    131             run_name = self.run_name 
    132  
    133             if not isinstance(run, list) and run is not None: 
    134                 self.run = [run] 
    135             else: 
    136                 run = run[0] 
    137  
    138             if not isinstance(run_name, dict): 
    139                 if run_name is not None: 
    140                     self.run_name = { run: run_name } 
    141                 else: 
    142                     self.run_name = {} 
    143             elif run_name != {}: 
    144                 self.run_name[run] = run_name.values()[0] 
    145         else: 
     130        if self.run is None: 
    146131            self.run = [] 
    147             self.run_name = {} 
     132        elif not isinstance(self.run, list): 
     133            self.run = [self.run] 
    148134 
    149135        metadata = { 
    150136            'title': self.title, 
    151137            'run': self.run, 
    152             'run_name': self.run_name, 
    153138            'intrument': self.instrument, 
    154139            'detector': [self.detector], 
Note: See TracChangeset for help on using the changeset viewer.