Changeset 561


Ignore:
Timestamp:
Sep 30, 2009 12:59:57 PM (13 years ago)
Author:
srkline
Message:

fixed two bugs in mask reading where the 128x128=16384 data length was hard-wired. Now uses pixX*pixY to be generic. (found by JaeHie? when reading 192x192 HFIR data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MaskUtils.ipf

    r431 r561  
    4848//setDataFolder is required here 
    4949//y-values must be flipped to get proper array assignment of the mask 
     50// 
     51// SRK -SEP09 - removed hard-wired 16384 (128x128) from GBLoadWave cmd string 
     52// for general XY compatibility (192x192) = 36864 
    5053// 
    5154Function ReadMCID_MASK(fname) 
     
    5861        SetDataFolder root:Packages:NIST:MSK 
    5962        Killwaves/Z data,data0          //kill the old data, if it exists 
    60         String cmd = "GBLoadWave/N=data/T={72,72}/O/S=4/W=1/U=16384 /Q  \"" + fname +"\"" 
     63         
     64//      String cmd = "GBLoadWave/N=data/T={72,72}/O/S=4/W=1/U=16384 /Q  \"" + fname +"\"" 
     65        String cmd = "GBLoadWave/N=data/T={72,72}/O/S=4/W=1/U=" 
     66        cmd += num2istr(pixelsX*pixelsY) + " /Q  \"" + fname +"\"" 
     67                 
    6168        Execute cmd  
    6269        SetDataFolder root:Packages:NIST:MSK                                            //make sure correct data folder is set 
     
    371378// - does not affect the state of the current mask used for data reduction 
    372379// 
     380// SRK -SEP09 - removed hard-wired 16384 (128x128) from GBLoadWave cmd string 
     381// for general XY compatibility (192x192) = 36864 
     382// 
    373383Function LoadOldMaskButtonProc(ctrlName) : ButtonControl 
    374384        String ctrlName 
     
    386396        SetDataFolder root:myGlobals:DrawMask 
    387397        Killwaves/Z data,data0,tempMask         //kill the old data, if it exists 
    388         String cmd = "GBLoadWave/N=data/T={72,72}/O/S=4/W=1/U=16384 /Q  \"" + fname +"\"" 
     398//      String cmd = "GBLoadWave/N=data/T={72,72}/O/S=4/W=1/U=16384 /Q  \"" + fname +"\"" 
     399        String cmd = "GBLoadWave/N=data/T={72,72}/O/S=4/W=1/U=" 
     400        cmd += num2istr(pixelsX*pixelsY) + " /Q  \"" + fname +"\"" 
     401         
    389402        Execute cmd  
    390403        SetDataFolder root:myGlobals:DrawMask                                   //make sure correct data folder is set 
     
    486499// incoming data is a 2-D wave of any precision data, 0's and 1's 
    487500// 
     501// tested with 192x192 data, and it works correctly (once the reader was corrected) 
     502// - should work with generic XY dimensions 
     503// 
    488504Function WriteMask(data) 
    489505        Wave data 
     
    535551        Killwaves/Z byteWave 
    536552End 
    537  
Note: See TracChangeset for help on using the changeset viewer.