Changeset 878


Ignore:
Timestamp:
Mar 26, 2013 1:26:05 PM (11 years ago)
Author:
vondreele
Message:

another bad finally

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r877 r878  
    558558        if not os.path.exists(instfile): # no such file
    559559            return {}
     560        fp = 0
    560561        try:
    561562            fp = open(instfile,'Ur')
     
    565566        except IOError:
    566567            print('Error reading file:'+str(instfile))
    567         finally:       
     568        if fp:       
    568569            fp.close()
    569570
    570         try:
    571             ibanks = int(Iparm.get('INS   BANK  ').strip())
    572         except:
    573             ibanks = 1
     571        ibanks = int(Iparm.get('INS   BANK  ','1').strip())
    574572        hType = Iparm['INS   HTYPE '].strip()
    575573        if ibanks == 1: # there is only one bank here, return it
     
    639637                v = Iparm['INS  1PRCF11'].split()
    640638                data.extend([float(v[0]),float(v[1]),float(v[2])])                  #get GU, GV & GW - always here
    641                 azm = Iparm.get('INS  1DETAZM')
    642                 if azm is None: #not in this Iparm file
    643                     azm = 0.0
    644                 else:
    645                     azm = float(azm)
     639                azm = float(Iparm.get('INS  1DETAZM','0.0'))
    646640                v = Iparm['INS  1PRCF12'].split()
    647641                if v1[0] == 3:
Note: See TracChangeset for help on using the changeset viewer.