Ignore:
Timestamp:
Jul 23, 2008 1:11:58 PM (14 years ago)
Author:
srkline
Message:

Several changes:

New version of ILL_DataReadWrite. Some changes added to Lionel's work to get the transmission calculation working corectly.

Changes to the wrapper to get the cursors on/off working correctly, as well as USANS matrix recalculation during normal fitting and during Global fitting. It may ask to recalculate the matrix occasionally when using the full data set - even though it really doesn't need to - but this is as a precaution.

Re-worked the header of the GRASP-export ASCII data to much more closely match the VAX output. I couldn't find any problem with the data block, so maybe GRASP was having trouble with the header.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models/Packages/GlobalFit/GlobalFit2_NCNR_v40.ipf

    r393 r394  
    34003400        if (V_value) 
    34013401                GFUI_AddMaskWavesToDataSets(DataSets)  //SRK - if masking, recalculate the matrix for the USANS data if necessary 
     3402        else 
     3403                // if masking is not selected, be sure to reset the USANS matrices (if any) to their original, full dimensions 
     3404                // new function 
     3405                GFUI_ResetUSANSMatrices(DataSets)  //SRK - if NOT masking, reset any USANS matrices 
    34023406        endif 
    34033407         
     
    40764080//                      return -1 
    40774081 
     4082                // this will signal the AAOFitFunction to use the full matrix without recalculation 
     4083 
    40784084                        DataSets[i][startingNCols] = "No Mask" 
    40794085                        //eSRK 
    40804086                endif 
     4087        endfor 
     4088         
     4089        return 0 
     4090end 
     4091 
     4092// if masking is not checked at all, make sure that the full matrix is used for the USANS data sets 
     4093// force a recalculate 
     4094// set all of the data sets to "no mask", even the SANS data 
     4095// SRK July 2008 
     4096static Function GFUI_ResetUSANSMatrices(DataSets) 
     4097        Wave/T DataSets 
     4098         
     4099        Wave/T/Z MaskingListWave=root:Packages:NewGlobalFit:MaskingListWave 
     4100         
     4101        Variable startingNCols = DimSize(DataSets, 1) 
     4102        Redimension/N=(-1, startingNCols+1) DataSets 
     4103        SetDimLabel 1, startingNCols, Masks, DataSets 
     4104         
     4105        Variable numSets = DimSize(DataSets, 0) 
     4106        Variable i 
     4107        Variable pt1,pt2,mPt1,mPt2 
     4108        String str,noteStr,DF 
     4109         
     4110        for (i = 0; i < NumSets; i += 1) 
     4111 
     4112                str=DataSets[i][0]              //this seems to work 
     4113                DF=ParseFilePath(1, str, ":", 1, 0) 
     4114// 
     4115                str=str[0,strlen(str)-3]                //remove the "_i" = DataFolder:name 
     4116                WAVE resW = $(str+"_res") 
     4117                if((dimsize(resW,1) > 4))       //USANS, NxN 
     4118                        // always force a recalculation, even though the weights_saved exists 
     4119                        // seems easier than shuffling. 
     4120                        Wave data = $(str+"_i") 
     4121                        Variable len=numpnts(data) 
     4122                        USANS_RE_CalcWeights(ParseFilePath(0, str, ":", 1, 0),0,len-1) 
     4123                         
     4124//                      noteStr = note(resW)             
     4125//                      mPt1 = NumberByKey("P1",noteStr,"=",";") 
     4126//                      mPt2 = NumberByKey("P2",noteStr,"=",";") 
     4127//                      Wave/Z mw = $(DataSets[i][startingNCols]) 
     4128//       
     4129//                      //find the first 1,  then find the zero 
     4130//                      pt1 = 0 
     4131//                      do 
     4132//                              if(mw[pt1]==1) 
     4133//                                      break 
     4134//                              endif 
     4135//                              pt1+=1 
     4136//                      while(pt1<numpnts(mw)) 
     4137//                       
     4138//                      pt2 = pt1 
     4139//                      do 
     4140//                              if(mw[pt2]==0) 
     4141//                                      break 
     4142//                              endif 
     4143//                              pt2+=1 
     4144//                      while(pt2<numpnts(mw)) 
     4145//                      pt2 -= 1 
     4146//                      if((mPt1 != pt1) || (mPt2 != pt2) ) 
     4147//                              // need to recalculate 
     4148//                              USANS_RE_CalcWeights(ParseFilePath(0, str, ":", 1, 0),pt1,pt2) 
     4149//                      endif 
     4150                endif 
     4151         
     4152                DataSets[i][startingNCols] = "No Mask"          //no mask for any data set 
     4153 
    40814154        endfor 
    40824155         
Note: See TracChangeset for help on using the changeset viewer.