Changeset 1156


Ignore:
Timestamp:
Nov 27, 2013 10:01:41 AM (8 years ago)
Author:
vondreele
Message:

Read 32-bit CHESS tiff files?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r1148 r1156  
    244244    if dType == 'UnsignedShort':       
    245245        image = np.array(ar.array('H',File.read(imSize)),dtype=np.int32)
     246    elif dType == 'UnsignedInt':
     247        image = np.array(ar.array('L',File.read(imSize)),dtype=np.int32)       
    246248    image = np.reshape(image,(sizexy[1],sizexy[0]))
    247249    data = {'pixelSize':pixSize,'wavelength':wave,'distance':dist,'center':cent,'size':sizexy}
     
    455457            Value = st.unpack(byteOrd+nVal*'f',File.read(nVal*4))
    456458        IFD[Tag] = [Type,nVal,Value]
    457         #print Tag,IFD[Tag]
     459        print Tag,IFD[Tag]
    458460    sizexy = [IFD[256][2][0],IFD[257][2][0]]
    459461    [nx,ny] = sizexy
     
    501503                    print 'Read GE-detector tiff file: ',filename
    502504                image = np.array(ar.array('H',File.read(2*Npix)),dtype=np.int32)
     505            elif IFD[258][2][0] == 32:
     506                print sizexy
     507                tifType = 'CHESS'
     508                pixy = (200,200)
     509                File.seek(8)
     510                if not imageOnly:
     511                    print 'Read CHESS-detector tiff file: ',filename
     512                image = np.array(ar.array('L',File.read(4*Npix)),dtype=np.int32)
    503513           
    504514    elif 262 in IFD and IFD[262][2][0] > 4:
Note: See TracChangeset for help on using the changeset viewer.