Ignore:
Timestamp:
Sep 14, 2010 10:22:42 AM (13 years ago)
Author:
srkline
Message:

Fixed bug in maunUSANS panel where clicking in white space in the file list threw up an open file dialog.

ticket #292: 1D arithmetic panel now properly writes out USANS data, switching to fill in the USANS fields if the USANS_dQv variable is found. Otherwise it is treated as SANS data.

Location:
sans/Dev/trunk/NCNR_User_Procedures
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/WriteModelData_v40.ipf

    r708 r734  
    178178                NVAR/Z dQv = USANS_dQv 
    179179                if(NVAR_Exists(dQv) == 0) 
     180                        SetDataFolder root: 
    180181                        Abort "It's USANS data, and I don't know what the slit height is." 
    181182                endif 
  • sans/Dev/trunk/NCNR_User_Procedures/Common/DataSetHandling.ipf

    r732 r734  
    14421442        //If we are here, the folder (now) exists and the user has agreed to overwrite 
    14431443        //either in the function call or from the alert. 
     1444         
     1445        // here, GetIndexedObjectName copies all of the waves 
     1446        index = 0 
    14441447        do 
    14451448                objName = GetIndexedObjName(basestr,1,index) 
     
    14511454                index+=1 
    14521455        while(1) 
     1456 
     1457// -- for USANS data, we need the slit height. copy all of the "USANS_*" variables 
     1458// may need to augment this for other situations 
     1459        index = 0 
     1460        do 
     1461                objName = GetIndexedObjName(basestr,2,index) 
     1462                if (strlen(objName) == 0) 
     1463                        break 
     1464                endif 
     1465                if(stringmatch(objName,"USANS*") == 1) 
     1466                        objname = ":"+basestr+":"+objname 
     1467                        NVAR tmp = $objName 
     1468                        Variable/G $(ReplaceString(basestr,objName,newName))= tmp 
     1469                endif 
     1470                index+=1 
     1471        while(1) 
     1472         
    14531473 
    14541474        SetDataFolder root: 
  • sans/Dev/trunk/NCNR_User_Procedures/Common/NIST_XML_v40.ipf

    r732 r734  
    10031003/// See WriteModelData_v40.ipf for 6 column equivalent 
    10041004// 
    1005 // this only handles 6-column data, will abort if resolution wave is missing 
     1005// will abort if resolution wave is missing 
     1006// switches for USANS data if the proper global is found, otheriwse treats as SANS data 
    10061007// 
    10071008Function ReWrite1DXMLData(folderStr) 
     
    10381039        endif 
    10391040         
    1040         Duplicate/O qw qbar,sigQ,fs 
    1041         sigq = resw[p][0] 
    1042         qbar = resw[p][1] 
    1043         fs = resw[p][2] 
    1044  
    1045                  
    1046         //Data 
    1047         Wave nf.Q = qw 
    1048         nf.unitsQ = "1/A" 
    1049         Wave nf.I = iw 
    1050         nf.unitsI = "1/cm" 
    1051         Wave nf.Idev = sw 
    1052         nf.unitsIdev = "1/cm" 
    1053         Wave nf.Qdev = sigQ 
    1054         nf.unitsQdev = "1/A" 
    1055         Wave nf.Qmean = qbar 
    1056         nf.unitsQmean = "1/A" 
    1057         Wave nf.Shadowfactor = fs 
    1058         nf.unitsShadowfactor = "none" 
    1059          
    1060          
    1061         //write out the standard header information 
    1062         //fprintf refnum,"FILE: %s\t\t CREATED: %s\r\n",textw[0],textw[1] 
    1063          
    1064         //AJJ to fix with sensible values 
    1065         nf.run = "" 
    1066         nf.nameSASinstrument = "NIST IGOR Procedures" 
    1067         nf.SASnote = "" 
    1068         // 
    1069         nf.sample_ID = baseStr 
    1070         nf.title = baseStr 
    1071         nf.radiation = "neutron" 
    1072         //Do something with beamstop (rw[21]) 
    1073         nf.detector_name = "Re-written data" 
    1074  
    1075         nf.SASprocessnote =  "Modified data written from folder "+baseStr+" on "+(date()+" "+time()) 
    1076          
    1077         nf.nameSASProcess = "NIST IGOR" 
    1078  
    1079         //Close refnum 
     1041         
     1042        // if (USANS) 
     1043        // else (SANS is assumed) 
     1044        // endif 
     1045        NVAR/Z dQv = USANS_dQv          // in current DF 
     1046        if (NVAR_Exists(dQv)) 
     1047                //USANS data, proceed 
     1048                //Use the evil extra column for the resolution "information". Should probably switch to using slit_length in collimation. 
     1049                Duplicate/O qw,dumWave 
     1050                dumWave = - dQv 
     1051                 
     1052                //Data 
     1053                Wave nf.Q = qw 
     1054                nf.unitsQ = "1/A" 
     1055                Wave nf.I = iw 
     1056                nf.unitsI = "1/cm" 
     1057                Wave nf.Idev = sw 
     1058                nf.unitsIdev = "1/cm" 
     1059                // for slit-smeared USANS, set only a 4th column to  -dQv 
     1060                Wave nf.dQl = dumWave 
     1061                nf.unitsdQl= "1/A" 
     1062         
     1063                //AJJ to fix with sensible values 
     1064                nf.run = "" 
     1065                nf.nameSASinstrument = "NIST IGOR Procedures" 
     1066                nf.SASnote = "" 
     1067                // 
     1068                nf.sample_ID = baseStr 
     1069                nf.title = baseStr 
     1070                nf.radiation = "neutron" 
     1071                //Do something with beamstop (rw[21]) 
     1072                nf.detector_name = "Re-written USANS data" 
     1073         
     1074                nf.SASprocessnote =  "Modified data written from folder "+baseStr+" on "+(date()+" "+time()) 
     1075                 
     1076                nf.nameSASProcess = "NIST IGOR" 
     1077                 
     1078        else 
     1079                //assume SANS data 
     1080                Duplicate/O qw qbar,sigQ,fs 
     1081                sigq = resw[p][0] 
     1082                qbar = resw[p][1] 
     1083                fs = resw[p][2] 
     1084         
     1085                         
     1086                //Data 
     1087                Wave nf.Q = qw 
     1088                nf.unitsQ = "1/A" 
     1089                Wave nf.I = iw 
     1090                nf.unitsI = "1/cm" 
     1091                Wave nf.Idev = sw 
     1092                nf.unitsIdev = "1/cm" 
     1093                Wave nf.Qdev = sigQ 
     1094                nf.unitsQdev = "1/A" 
     1095                Wave nf.Qmean = qbar 
     1096                nf.unitsQmean = "1/A" 
     1097                Wave nf.Shadowfactor = fs 
     1098                nf.unitsShadowfactor = "none" 
     1099                 
     1100                 
     1101                //write out the standard header information 
     1102                //fprintf refnum,"FILE: %s\t\t CREATED: %s\r\n",textw[0],textw[1] 
     1103                 
     1104                //AJJ to fix with sensible values 
     1105                nf.run = "" 
     1106                nf.nameSASinstrument = "NIST IGOR Procedures" 
     1107                nf.SASnote = "" 
     1108                // 
     1109                nf.sample_ID = baseStr 
     1110                nf.title = baseStr 
     1111                nf.radiation = "neutron" 
     1112                //Do something with beamstop (rw[21]) 
     1113                nf.detector_name = "Re-written data" 
     1114         
     1115                nf.SASprocessnote =  "Modified data written from folder "+baseStr+" on "+(date()+" "+time()) 
     1116                 
     1117                nf.nameSASProcess = "NIST IGOR" 
     1118 
     1119        endif 
     1120 
    10801121         
    10811122        if(dialog) 
     
    10951136        Print "XML File written: ", GetFileNameFromPathNoSemi(fullPath) 
    10961137        KillWaves/Z tempShortProto 
     1138         
     1139        SetDataFolder root: 
     1140 
    10971141        Return(0) 
    10981142End 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/Main_USANS.ipf

    r693 r734  
    620620        endif 
    621621        //Print fname 
    622         if(strlen(fileWave[ii]) > 0)            //make sure that this is not a click in blank space 
     622        if(strlen(fileWave[ii]) > 0 && ii < numpnts(fileWave))          //make sure that this is not a click in blank space 
    623623                err = LoadBT5File(fname,"RAW") 
    624624                if(err) 
     
    706706        endif            
    707707        //Print fname 
    708         if(strlen(fileWave[ii]) > 0)            //make sure that this is not a click in blank space 
     708        if(strlen(fileWave[ii]) > 0 && ii < numpnts(fileWave))          //make sure that this is not a click in blank space 
    709709                ReadBT5Header(fname) 
    710710        endif 
Note: See TracChangeset for help on using the changeset viewer.