Changeset 1920 for trunk/GSASIIIO.py


Ignore:
Timestamp:
Jul 6, 2015 10:38:00 AM (6 years ago)
Author:
vondreele
Message:

modify the pack-f.for code to read rectangular MAR images (NX != NY pixels) Recompiled the Windows 32 & 64 bit fortran sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r1916 r1920  
    530530        if 'FORMAT' in line[0:6]:
    531531            items = line.split()
    532             size = int(items[1])
    533             Npix = size*size
     532            sizex = int(items[1])
     533            Npix = int(items[3])
     534            sizey = int(Npix/sizex)
    534535    pos = 4096
    535     data['size'] = [size,size]
     536    data['size'] = [sizex,sizey]
    536537    File.seek(pos)
    537538    line = File.read(8)
     
    543544    raw = File.read()
    544545    File.close()
    545     image = np.zeros(shape=(size,size),dtype=np.int32)
    546     image = np.flipud(pf.pack_f(len(raw),raw,size,image).T)  #transpose to get it right way around & flip
     546    image = np.zeros(shape=(sizex,sizey),dtype=np.int32)
     547   
     548    image = np.flipud(pf.pack_f(len(raw),raw,sizex,sizey,image).T)  #transpose to get it right way around & flip
    547549    if imageOnly:
    548550        return image
Note: See TracChangeset for help on using the changeset viewer.