Changeset 475


Ignore:
Timestamp:
Feb 7, 2012 3:21:36 PM (10 years ago)
Author:
toby
Message:

fix .EXP import with short SH record, more diagnostics on EXP/PDB read

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/G2importphase.py

    r469 r475  
    11# a set of short routines to read in phases from various file formats
    22#
     3import sys
     4import traceback
    35import GSASIIIO as G2IO
    46
     
    2123            self.Phase = G2IO.ReadPDBPhase(filename)
    2224            return True
    23         except:
     25        except Exception as detail:
     26            print 'PDB read error:',detail # for testing
    2427            return False
    2528
     
    4649            self.Phase = G2IO.ReadEXPPhase(ParentFrame, filename)
    4750            return True
    48         except:
     51        except Exception as detail:
     52            print 'GSAS .EXP read error:',detail # for testing
     53            traceback.print_exc(file=sys.stdout)
    4954            return False
  • trunk/GSASIIIO.py

    r473 r475  
    14181418            E,SGData = G2spc.SpcGroup(SpGrp)
    14191419        elif 'OD    ' in key:
    1420             SHdata = EXPphase[key].split()
    1421             textureData['Order'] = int(SHdata[0])
    1422             textureData['Model'] = shModels[int(SHdata[2])]
    1423             textureData['Sample omega'] = [False,float(SHdata[6])]
    1424             textureData['Sample chi'] = [False,float(SHdata[7])]
    1425             textureData['Sample phi'] = [False,float(SHdata[8])]
    1426             shNcof = int(SHdata[1])
     1420            SHdata = EXPphase[key].split() # may not have all 9 values
     1421            SHvals = 9*[0]
     1422            for i in range(9):
     1423                try:
     1424                    float(SHdata[i])
     1425                    SHvals[i] = SHdata[i]
     1426                except:
     1427                    pass
     1428            textureData['Order'] = int(SHvals[0])
     1429            textureData['Model'] = shModels[int(SHvals[2])]
     1430            textureData['Sample omega'] = [False,float(SHvals[6])]
     1431            textureData['Sample chi'] = [False,float(SHvals[7])]
     1432            textureData['Sample phi'] = [False,float(SHvals[8])]
     1433            shNcof = int(SHvals[1])
    14271434    Atoms = []
    14281435    if Ptype == 'nuclear':
Note: See TracChangeset for help on using the changeset viewer.