Changeset 887 for trunk


Ignore:
Timestamp:
Apr 13, 2013 10:07:33 PM (12 years ago)
Author:
toby
Message:

xfer lambda & T from GPX histograms; remove Cancel from selection of default parameter set

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/GSASII.py

    r886 r887  
    821821                ParentFrame=self,
    822822                title=head,
    823                 header='Select default inst parms',)
     823                header='Select default inst parms',
     824                useCancel=False)
    824825            if res is None: continue
    825826            rd.instfile = ''
  • TabularUnified trunk/GSASIIIO.py

    r886 r887  
    11801180    def BlockSelector(self, ChoiceList, ParentFrame=None,
    11811181                      title='Select a block',
    1182                       size=None, header='Block Selector'):
     1182                      size=None, header='Block Selector',
     1183                      useCancel=True):
    11831184        ''' Provide a wx dialog to select a block if the file contains more
    11841185        than one set of data and one must be selected
    11851186        '''
    1186         dlg = wx.SingleChoiceDialog(ParentFrame,title, header,ChoiceList,)
     1187        if useCancel:
     1188            dlg = wx.SingleChoiceDialog(
     1189                ParentFrame,title, header,ChoiceList)
     1190        else:
     1191            dlg = wx.SingleChoiceDialog(
     1192                ParentFrame,title, header,ChoiceList,
     1193                style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.OK|wx.CENTRE)
    11871194        if size: dlg.SetSize(size)
    11881195        if dlg.ShowModal() == wx.ID_OK:
     
    14391446        self.idstring = ''
    14401447        self.Sample = G2pdG.SetDefaultSample()
     1448        self.GSAS = None     # used in TOF
     1449        self.clockWd = None  # used in TOF
    14411450        self.repeat_instparm = True # Should a parm file be
    14421451        #                             used for multiple histograms?
  • TabularUnified trunk/imports/G2pwd_GPX.py

    r886 r887  
    108108            self.powderentry[2] = selblk+1
    109109            self.idstring = data[0][0][5:]
    110             # could pull out wavelength from data[4][1] here
    111             # and save it as self.instdict['wave'] = wl
    112             # likewise for dataset type as self.instdict['type'] = 'SNC' etc
    113             # and self.Sample['Temperature'] for T
     110            # pull out wavelength
     111            try:
     112                if len(data[4][1]) == 2: # current GPX file
     113                    if data[4][1][0].get('Lam'):
     114                        self.instdict['wave'] = [data[4][1][0].get('Lam')[1]]
     115                    elif data[4][1][0].get('Lam1') and data[4][1][0].get('Lam2'):
     116                        self.instdict['wave'] = [
     117                            data[4][1][0].get('Lam1')[1],
     118                            data[4][1][0].get('Lam2')[1]
     119                            ]
     120                elif len(data[4][1]) == 4: # original GPX file
     121                    pos = data[4][1][3].index('Lam')
     122                    self.instdict['wave'] = [data[4][1][1][pos],]
     123            except:
     124                pass
     125            # pull out temperature
     126            try:
     127                if data[5][1].get('Temperature'):
     128                    self.Sample['Temperature'] = data[5][1]['Temperature']
     129            except:
     130                pass
    114131            self.repeat_instparm = False # prevent reuse of iparm when several hists are read
    115132            return True
Note: See TracChangeset for help on using the changeset viewer.