Ignore:
Timestamp:
Jul 22, 2016 4:08:49 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:
3931ea14
Parents:
94f4518
git-author:
Lewis O'Driscoll <lewis.o'driscoll@…> (07/22/16 04:08:38)
git-committer:
Lewis O'Driscoll <lewis.o'driscoll@…> (07/22/16 04:08:49)
Message:

Warn when qax input is wrong and fix loader for single-frame files

File:
1 edited

Legend:

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

    r94f4518 ra3c538e1  
    166166                    self.iq_input.GetPath()) 
    167167                bsl_data = loader.load_bsl_data() 
    168                 qdata = bsl_data.q_axis.data[0] 
     168                qdata = bsl_data.q_axis.data 
    169169                iqdata = bsl_data.data_axis.data 
     170                if len(qdata) > 1: 
     171                    msg = ("Q-Axis file has multiple frames. Only 1 frame is " 
     172                        "allowed for the Q-Axis") 
     173                    wx.PostEvent(self.parent.manager.parent, 
     174                        StatusEvent(status=msg, info="error")) 
     175                    return 
     176                else: 
     177                    qdata = qdata[0] 
    170178                frames = [iqdata.shape[0]] 
    171179                increment = 1 
    172180                single_file = True 
     181                # Standard file has 3 frames: SAS, calibration and WAS 
    173182                if frames[0] > 3: 
     183                    # File has multiple frames 
    174184                    params = self.ask_frame_range(frames[0]) 
    175185                    frames = params['frames'] 
     
    177187                    single_file = params['file'] 
    178188                    if frames == []: return 
     189                else: # Only interested in SAS data 
     190                    frames = [0] 
    179191        except Exception as ex: 
    180192            msg = str(ex) 
Note: See TracChangeset for help on using the changeset viewer.