Changeset 2409


Ignore:
Timestamp:
Aug 4, 2016 2:19:34 PM (5 years ago)
Author:
vondreele
Message:

fix GE image importer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/imports/G2img_GE.py

    r2309 r2409  
    121121    more = False
    122122    File = open(filename,'rb')
    123     if '.sum' in filename or '.cor' in filename:
    124         head = ['GE detector sum or cor data from APS 1-ID',]
     123    if '.sum' in filename:
     124        head = ['GE detector sum data from APS 1-ID',]
    125125        sizexy = [2048,2048]
    126126        Npix = sizexy[0]*sizexy[1]
    127127        image = np.array(ar.array('f',File.read(4*Npix)),dtype=np.int32)
    128     elif '.avg' in filename:
    129         head = ['GE detector avg or ge* data from APS 1-ID',]
     128    elif '.avg' or '.cor' in filename in filename:
     129        File.seek(0,2)
     130        last = File.tell()
     131        pos = last-2*(2048**2)
     132        File.seek(pos)
     133        head = ['GE detector avg or cor data from APS 1-ID',]
    130134        sizexy = [2048,2048]
    131135        Npix = sizexy[0]*sizexy[1]
Note: See TracChangeset for help on using the changeset viewer.