Changeset be88076 in sasview


Ignore:
Timestamp:
Aug 23, 2016 10:39:36 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:
97e90b7
Parents:
7fce2bc
Message:

Correctly read and write run_name

Location:
src/sas
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py

    rac3353d rbe88076  
    185185                    elif key == u'run': 
    186186                        self.current_datainfo.run.append(data_point) 
     187                        try: 
     188                            run_name = value.attrs['name'] 
     189                            run_dict = {data_point: run_name} 
     190                            self.current_datainfo.run_name = run_dict 
     191                        except: 
     192                            pass 
    187193                    elif key == u'title': 
    188194                        self.current_datainfo.title = data_point 
  • src/sas/sasgui/perspectives/file_converter/converter_panel.py

    rd3e1870 rbe88076  
    284284            self.run = [self.run] 
    285285 
     286        run_name = None 
     287        if len(self.run) > 0: 
     288            run_number = self.run[0] 
     289            run_name = { run_number: self.run_name } 
     290 
    286291        if self.title is None: 
    287292            self.title = '' 
     
    290295            'title': self.title, 
    291296            'run': self.run, 
     297            'run_name': run_name, 
    292298            'instrument': self.instrument, 
    293299            'detector': [self.detector], 
     
    370376                for key, value in metadata.iteritems(): 
    371377                    setattr(dataset[0], key, value) 
    372                 if self.run != []: 
    373                     run_number = self.run[0] 
    374                     dataset[0].run_name[run_number] = self.run_name 
    375378 
    376379                w = NXcanSASWriter() 
Note: See TracChangeset for help on using the changeset viewer.