Ignore:
Timestamp:
Jul 22, 2013 8:57:37 PM (10 years ago)
Author:
toby
Message:

fix Bob's bug when multiple HKL files are read; pickup shelx spacegroup in CIF; improve file read error messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/imports/G2phase_CIF.py

    r850 r1006  
    113113                        choice[-1] += fmt % cif.get_number_with_esd(
    114114                            cf[blknm].get(key))[0]
    115                     sg = cf[blknm].get("_symmetry_space_group_name_H-M")
     115                    sg = cf[blknm].get("_symmetry_space_group_name_H-M",'')
     116                    if not sg: sg = cf[blknm].get("_space_group_name_H-M_alt",'')
    116117                    if sg: choice[-1] += ', (' + sg.strip() + ')'
    117118                selblk = self.PhaseSelector(
     
    127128                blk = cf[str_blklist[selblk]]
    128129                E = True
    129                 SpGrp = blk.get("_symmetry_space_group_name_H-M")
    130                 # try normalizing the space group, see if we can pick the space group out of a table
     130                SpGrp = blk.get("_symmetry_space_group_name_H-M",'')
     131                if not SpGrp:
     132                    SpGrp = blk.get("_space_group_name_H-M_alt",'')
     133                # try normalizing the space group, to see if we can pick the space group out of a table
    131134                SpGrpNorm = G2spc.StandardizeSpcName(SpGrp)
    132135                if SpGrpNorm:
     
    136139                    E,SGData = G2spc.SpcGroup(SpGrp)
    137140                if E:
    138                     self.warnings += 'ERROR in space group symbol '+SpGrp
    139                     self.warnings += '\nAre there spaces separating axial fields?\n\nError msg: '
    140                     self.warnings += G2spc.SGErrors(E)
     141                    if not SpGrp:
     142                        self.warnings += 'No space group name was found in the CIF.'
     143                        self.warnings += '\nThe space group has been set to "P 1". '
     144                        self.warnings += "Change this in phase's General tab."
     145                    else:
     146                        self.warnings += 'ERROR in space group symbol '+SpGrp
     147                        self.warnings += '\nThe space group has been set to "P 1". '
     148                        self.warnings += "Change this in phase's General tab."
     149                        self.warnings += '\nAre there spaces separating axial fields?\n\nError msg: '
     150                        self.warnings += G2spc.SGErrors(E)
    141151                    SGData = G2IO.SGData # P 1
    142152                self.Phase['General']['SGData'] = SGData
Note: See TracChangeset for help on using the changeset viewer.