Changeset 3522


Ignore:
Timestamp:
Aug 1, 2018 12:36:58 PM (3 years ago)
Author:
vondreele
Message:

fix array overflow problem in histogram2d.for
clean up some stuff in ImageIntegrate?

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r3362 r3522  
    628628    selected for the inner ring.
    629629    '''
    630     import copy
    631630    import ImageCalibrants as calFile
    632631    print ('Image calibration:')
     
    971970    NST = np.zeros(shape=(numAzms,numChans),order='F',dtype=np.float32)
    972971    H0 = np.zeros(shape=(numAzms,numChans),order='F',dtype=np.float32)
     972    H2 = np.linspace(lutth[0],lutth[1],numChans+1)
    973973    Nx,Ny = data['size']
    974974    nXBlks = (Nx-1)//blkSize+1
     
    10181018                    numAzms,numChans,LRazm,lutth,Dazm,dtth,NST,H0)
    10191019            times[3] += time.time()-t0
    1020             del tax; del tay; del taz; del tad; del tabs
     1020#            del tax; del tay; del taz; del tad; del tabs
     1021    print('End integration loops')
    10211022    t0 = time.time()
    1022     H2 = np.array([tth for tth in np.linspace(lutth[0],lutth[1],numChans+1)])
    1023     NST = np.array(NST,dtype=np.float)
     1023#    H2 = np.array([tth for tth in np.linspace(lutth[0],lutth[1],numChans+1)])
     1024#    NST = np.array(NST,dtype=np.float32)
    10241025    #prepare masked arrays of bins with pixels for interpolation setup
    10251026    H2msk = [ma.array(H2[:-1],mask=np.logical_not(nst)) for nst in NST]
  • trunk/fsource/histogram2d.for

    r451 r3522  
    3737     1    ( Y(K).GE.YLIM(0) .AND. Y(K).LT.YLIM(1) )) THEN
    3838          DDX = (X(K)-XLIM(0))/DX
    39           I = INT(DDX)
     39          I = MIN(MAX(0,INT(DDX)),NXBINS-1)
    4040          DDY = (Y(K)-YLIM(0))/DY
    41           J = INT(DDY)
     41          J = MIN(MAX(0,INT(DDY)),NYBINS-1)
    4242          NST(I,J) = NST(I,J)+1.0
    4343          HST(I,J) = HST(I,J)+Z(K)
Note: See TracChangeset for help on using the changeset viewer.