Changeset 3786


Ignore:
Timestamp:
Jan 17, 2019 2:31:32 PM (3 years ago)
Author:
vondreele
Message:

fix problem of import ElementTable? inside spyder
allow import o q-steped powder data from a cif file
fix problem of indexing after load incommensurate phase in Unit cells

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIElem.py

    r3605 r3786  
    2222import atmdata
    2323import GSASIImath as G2mth
     24import ElementTable as ET
     25
    2426
    2527getElSym = lambda sym: sym.split('+')[0].split('-')[0].capitalize()
     
    163165
    164166    '''
    165     import ElementTable as ET
    166167    Elements = []
    167168    for elem in ET.ElTable:
     
    188189def GetAtomInfo(El,ifMag=False):
    189190    'reads element information from atmdata.py'
    190     import ElementTable as ET
    191191    Elem = ET.ElTable
    192192    if ifMag:
  • trunk/GSASIIpwdGUI.py

    r3783 r3786  
    33353335            SGData = G2spc.SpcGroup(SGData['SpGrp'])[1]
    33363336        G2frame.dataWindow.RunSubGroups.Enable(True)
     3337        ssopt.update({'Use':False,'ssSymb':'(abg)','ModVec':[0.1,0.1,0.1],'maxH':1})
    33373338        if 'SuperSg' in Phase['General'] or SGData.get('SGGray',False):
    33383339            ssopt.update({'SGData':SGData,'ssSymb':Phase['General']['SuperSg'],'ModVec':Phase['General']['SuperVec'][0],'Use':True,'maxH':1})
     
    33473348                    caption='Unusable super space group',style=wx.ICON_EXCLAMATION)
    33483349            G2frame.dataWindow.RunSubGroups.Enable(False)
    3349         ssopt.update({'Use':False,'ssSymb':'(abg)','ModVec':[0.1,0.1,0.1],'maxH':1})
    33503350        SpGrp = SGData['SpGrp']
    33513351        if 'mono' in SGData['SGSys']:
  • trunk/imports/G2pwd_CIF.py

    r3783 r3786  
    2121import CifFile as cif # PyCifRW from James Hester
    2222import GSASIIpath
     23asind = lambda x: 180.*np.arcsin(x)/np.pi
    2324GSASIIpath.SetVersionNumber("$Revision$")
    2425
     
    5657            #'_pd_proc_energy_incident',
    5758            #'_pd_proc_energy_detection',
    58             #'_pd_proc_recip_len_q',
     59            '_pd_proc_recip_len_q',
    5960            #'_pd_proc_wavelength',
    6061        )
     
    226227            xi,yi,sui,modi = res
    227228
    228         # now read in the values
    229         # x-values
     229            # now read in the values
     230            # x-values
     231            self.powderentry[0] = filename
     232            #self.powderentry[1] = pos # bank offset (N/A here)
     233            #self.powderentry[2] = 1 # xye file only has one bank
     234            self.idstring = os.path.basename(filename) + ': ' + blk
     235            if cf[blk].get('_diffrn_radiation_probe'):
     236                if cf[blk]['_diffrn_radiation_probe'] == 'neutron':
     237                    self.instdict['type'] = 'PNC'
     238                    #if cf[blk].get('_pd_meas_time_of_flight'): self.instdict['type'] = 'PNT' # not supported yet
     239                else:
     240                    self.instdict['type'] = 'PXC'
     241            if cf[blk].get('_diffrn_radiation_wavelength'):
     242                val = cf[blk]['_diffrn_radiation_wavelength']
     243                wl = []
     244                if type(val) is list:
     245                    for v in val:
     246                        w,e = cif.get_number_with_esd(v)
     247                        if w: wl.append(w)
     248                else:
     249                    w,e = cif.get_number_with_esd(val)
     250                    if w: wl.append(w)
     251                if wl:
     252                    if len(wl) > 1:
     253                        self.instdict['wave'] = wl
     254                    else:
     255                        self.instdict['wave'] = wl[0]
     256            if cf[blk].get('_diffrn_ambient_temperature'):
     257                val = cf[blk]['_diffrn_ambient_temperature']
     258                w,e = cif.get_number_with_esd(val)
     259                if w:
     260                    self.Sample['Temperature'] = w
    230261        xcf = xch[xi]
    231262        if type(xcf) is tuple:
     
    241272                    vl.append(v)
    242273            x = np.array(vl)
     274            if 'recip_len_q' in xcf and 'wave' in self.instdict:
     275                wl = self.instdict['wave']
     276                x = 2.*asind(wl*x/(4.*np.pi))
    243277        # y-values
    244278        ycf = ych[yi]
     
    315349                np.zeros(N), # obs-calc profiles
    316350            ]
    317         self.powderentry[0] = filename
    318         #self.powderentry[1] = pos # bank offset (N/A here)
    319         #self.powderentry[2] = 1 # xye file only has one bank
    320         self.idstring = os.path.basename(filename) + ': ' + blk
    321         if cf[blk].get('_diffrn_radiation_probe'):
    322             if cf[blk]['_diffrn_radiation_probe'] == 'neutron':
    323                 self.instdict['type'] = 'PNC'
    324                 #if cf[blk].get('_pd_meas_time_of_flight'): self.instdict['type'] = 'PNT' # not supported yet
    325             else:
    326                 self.instdict['type'] = 'PXC'
    327         if cf[blk].get('_diffrn_radiation_wavelength'):
    328             val = cf[blk]['_diffrn_radiation_wavelength']
    329             wl = []
    330             if type(val) is list:
    331                 for v in val:
    332                     w,e = cif.get_number_with_esd(v)
    333                     if w: wl.append(w)
    334             else:
    335                 w,e = cif.get_number_with_esd(val)
    336                 if w: wl.append(w)
    337             if wl:
    338                 if len(wl) > 1:
    339                     self.instdict['wave'] = wl
    340                 else:
    341                     self.instdict['wave'] = wl[0]
    342         if cf[blk].get('_diffrn_ambient_temperature'):
    343             val = cf[blk]['_diffrn_ambient_temperature']
    344             w,e = cif.get_number_with_esd(val)
    345             if w:
    346                 self.Sample['Temperature'] = w
    347351        return True
Note: See TracChangeset for help on using the changeset viewer.