Changeset 1920


Ignore:
Timestamp:
Jul 6, 2015 10:38:00 AM (7 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.

Location:
trunk
Files:
18 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
  • trunk/fsource/pack_f.for

    r199 r1920  
    1       SUBROUTINE PACK_F(N,CMPR,M,IMG)
     1      SUBROUTINE PACK_F(N,CMPR,MX,MY,IMG)
    22
    33Cf2py intent(in) N
    44Cf2py intent(in) CMPR
    55Cf2py depend(N) CMPR
    6 Cf2py intent(in) M
     6Cf2py intent(in) MX
     7Cf2py intent(in) MY
    78Cf2py intent(in,out) IMG
    8 Cf2py depend(M) IMG
     9Cf2py depend(MX,MY) IMG
    910
    1011      IMPLICIT NONE
    11       INTEGER*4 BITDECODE(0:7),SETBITS(0:16),IN,N,M,BITNUM
     12      INTEGER*4 BITDECODE(0:7),SETBITS(0:16),IN,N,MX,MY,BITNUM
    1213      INTEGER*4 PIXEL,SPILLBITS,USEDBITS,VALIDS,WINDOW,TOTAL
    13       INTEGER*4 IMG(0:M-1,0:M-1),NEXTINT
     14      INTEGER*4 IMG(0:MX-1,0:MY-1),NEXTINT
    1415      INTEGER*4 SPILL,ROW,COL,PIXNUM,MM1
    1516      INTEGER*2 TMP
     
    2930      ROW = 0
    3031      COL = 0
    31       TOTAL = M**2
    32       MM1 = M-1
     32      TOTAL = MX*MY
     33      MM1 = MX-1
    3334      IN = 0
    3435      DO WHILE (PIXEL .LT. TOTAL)
     
    7980              END IF
    8081
    81               ROW = PIXEL/M
    82               COL = MOD(PIXEL,M)
    83               IF ( PIXEL .GT. M ) THEN
     82              ROW = PIXEL/MX
     83              COL = MOD(PIXEL,MX)
     84              IF ( PIXEL .GT. MX ) THEN
    8485                IF ( COL .EQ. 0 ) THEN
    8586                  TMP = NEXTINT +
Note: See TracChangeset for help on using the changeset viewer.