Changeset 1203


Ignore:
Timestamp:
Sep 5, 2019 3:00:05 PM (3 years ago)
Author:
srkline
Message:

Corrected attenuator table for VSANS to include the range 4.52->19. Patching of the attenuation factor is disabled since the factor is always calculated rather than read from the file.

Added a few help links in preparation for the full help file integration

Added a "super" white beam distribution definition and a single model function for testing of this new mode. Still need the normalization and mean wavelength for the distribution + a way to identify it in the file metadata.

Location:
sans/Dev/trunk/NCNR_User_Procedures
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VSANS_Includes.ipf

    r1146 r1203  
    125125// VSANS Analysis functions (under Analysis trunk, not Reduction) 
    126126#include "V_WB_BroadPeak" 
     127#include "V_SWB_BroadPeak" 
    127128#include "V_WB_GaussSpheres" 
    128129#include "V_WB_Beaucage" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Attenuation.ipf

    r1153 r1203  
    169169        numAtt = V_getAtten_number(fname) 
    170170        lambda = V_getWavelength(fname) 
    171          
     171 
     172        if(lambda < 4.52 || lambda > 19) 
     173                Abort "Wavelength out of range for attenuation table" 
     174        endif 
     175                 
    172176        // TODO -- need to switch on "type" 
    173177        //  == velocity_selector || ?? for white beam || graphite 
    174178//      monoType = V_getMonochromatorType(fname) 
    175179 
    176         monoType = V_DeduceMonochromatorType(fname) 
     180        monoType = V_IdentifyMonochromatorType(fname) 
    177181        print monoType 
    178182 
     
    194198        endswitch 
    195199         
    196          
    197200        Wave w = V_getAttenIndex_table(fname)           // N=(x,17) 
    198201        Variable num = DimSize(w,0) 
     
    230233        numAtt = V_getAtten_number(fname) 
    231234        lambda = V_getWavelength(fname) 
    232          
     235 
     236        if(lambda < 4.52 || lambda > 19) 
     237                Abort "Wavelength out of range for attenuation error table" 
     238        endif 
     239                 
    233240        // TODO -- need to switch on "type" 
    234241        //  == velocity_selector || ?? for white beam || crystal 
    235242//      monoType = V_getMonochromatorType(fname) 
    236243         
    237         monoType = V_DeduceMonochromatorType(fname) 
     244        monoType = V_IdentifyMonochromatorType(fname) 
    238245        print monoType 
    239246        // set a fake wavelength for the interpolation or get out 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_EventModeProcessing.ipf

    r1116 r1203  
    561561                case 2: // mouse up 
    562562                        // click code here 
    563                         DisplayHelpTopic/Z "Event Mode Data" 
     563                        DisplayHelpTopic/Z "VSANS Event Mode Data" 
    564564                        break 
    565565                case -1: // control being killed 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_EventMode_Utils.ipf

    r1114 r1203  
    10691069        SetVariable ERSelSlice,proc=V_ChangeSliceViewSetVar 
    10701070 
    1071         Button ToSTOButton,pos={305,45},size={100,20},proc=V_EVR_LoadAndSTO,title="to STO" 
     1071        Button ToSTOButton,pos={305,45},size={100,20},proc=V_EVR_LoadAndSTO,title="Load to STO" 
    10721072        Button ToSTOButton,help={"Load the event file and copy to STO"} 
    10731073 
     
    12401240// locates the time bins and shows the time bin table (and plot?) 
    12411241// 
     1242// Can't show the plot of counts/bin since there would be 8 of these now, one for 
     1243// each panel. Could show a total count per slice, but the numbers (binCount) is currently 
     1244// not written to the Event_ file. 
     1245// 
     1246// the macro that is called from the main Event panel shows the total counts/bin for the carriage 
     1247// that is active. Maybe this would be OK, but then there are still two sets of data, one for 
     1248// Front and one for Middle... 
     1249// 
    12421250Function V_EVR_TimeBins(PathButton) : ButtonControl 
    12431251        String PathButton 
     
    12471255 
    12481256        edit binEnd,timeWidth 
     1257         
     1258//      DoWindow/F V_EventBarGraph 
     1259//      if(V_flag == 0) 
     1260//              PauseUpdate; Silent 1           // building window... 
     1261//              String fldrSav0= GetDataFolder(1) 
     1262//              SetDataFolder root:Packages:NIST:VSANS:Event: 
     1263//              Display /W=(110,705,610,1132)/N=V_EventBarGraph /K=1 binCount vs binEndTime 
     1264//              SetDataFolder fldrSav0 
     1265//              ModifyGraph mode=5 
     1266//              ModifyGraph marker=19 
     1267//              ModifyGraph lSize=2 
     1268//              ModifyGraph rgb=(0,0,0) 
     1269//              ModifyGraph msize=2 
     1270//              ModifyGraph hbFill=2 
     1271//              ModifyGraph gaps=0 
     1272//              ModifyGraph usePlusRGB=1 
     1273//              ModifyGraph toMode=0 
     1274//              ModifyGraph useBarStrokeRGB=1 
     1275//              ModifyGraph standoff=0 
     1276//              SetAxis left 0,* 
     1277//              Label bottom "\\Z14Time (seconds)" 
     1278//              Label left "\\Z14Number of Events" 
     1279//      endif 
     1280         
    12491281         
    12501282        return(0) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf

    r1150 r1203  
    465465// transmission value for the attenuator in the beam 
    466466// use this, but if something wrong, the tables are present 
     467// (and something is wrong -- NICE always writes out "1" for the atten factor (and error) 
     468//-- so I am forced to use the tables every time 
     469// 
    467470Function V_getAttenuator_transmission(fname) 
    468471        String fname 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Instrument_Resolution.ipf

    r1130 r1203  
    212212                BS = VC_beamstopDiam(type[0,1])*10 // convert cm to mm 
    213213        else 
    214                 BS = V_DeduceBeamstopDiameter(folderStr,type)           //returns diameter in [mm] 
     214                BS = V_IdentifyBeamstopDiameter(folderStr,type)         //returns diameter in [mm] 
    215215        endif 
    216216//      BS = V_getBeamStopC2_size(folderStr)            // Units are [mm]  
     
    512512// 
    513513// TODO: the values in the file are incorrect!!! BS = 1000 mm diameter!!! 
    514         BS = V_DeduceBeamstopDiameter(folderStr,type)           //returns diameter in [mm] 
     514        BS = V_IdentifyBeamstopDiameter(folderStr,type)         //returns diameter in [mm] 
    515515//      BS = V_getBeamStopC2_size(folderStr)            // Units are [mm]  
    516516//      BS = 25.4                       //TODO hard-wired value 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MainPanel.ipf

    r1131 r1203  
    244244Proc V_HelpMainButtonProc(ctrlName) : ButtonControl 
    245245        String ctrlName 
    246         DisplayHelpTopic/Z/K=1 "VSANS Data Reduction Tutorial" 
     246        DisplayHelpTopic/Z/K=1 "VSANS Data Reduction Documentation" 
    247247        if(V_flag !=0) 
    248                 DoAlert 0,"The VSANS Data Reduction Tutorial Help file could not be found" 
     248                DoAlert 0,"The VSANS Data Reduction Help file could not be found" 
    249249        endif 
    250250End 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MaskUtils.ipf

    r1188 r1203  
    167167                case 2: // mouse up 
    168168                        // click code here 
    169                         DoAlert 0, "Draw Mask Help not written yet..." 
     169                        DisplayHelpTopic/Z/K=1 "VSANS Data Reduction Documentation[Drawing a Mask]" 
     170                        if(V_flag !=0) 
     171                                DoAlert 0,"The VSANS Data Reduction Help file could not be found" 
     172                        endif 
    170173                        break 
    171174                case -1: // control being killed 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Menu.ipf

    r1151 r1203  
    151151 
    152152Function VSANSHelp() 
    153         DisplayHelpTopic/Z/K=1 "VSANS Data Reduction Tutorial" 
     153        DisplayHelpTopic/Z/K=1 "VSANS Data Reduction Documentation" 
    154154        if(V_flag !=0) 
    155                 DoAlert 0,"The VSANS Data Reduction Tutorial Help file could not be found, because it has not yet been written" 
     155                DoAlert 0,"The VSANS Data Reduction Help file could not be found" 
    156156        endif 
    157157End 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_PatchFiles.ipf

    r1151 r1203  
    455455        SelWave[][0] = 2^5              // checkboxes 
    456456        SelWave[][2] = 2^1              // 3rd column editable 
    457          
     457 
     458// 
     459// TODO - the attenuation factor is always calculated from the table. How do I devise a method to  
     460// overrride this behavior if a factor needs to be forced to a new value (old table, lambda out of range, etc.)? 
     461//       
     462// currently, this simply prevents anyone from "patching" the header, which really doesn't work as intended 
     463// 
     464        SelWave[0][0] += 2^7            // disable the checkbox for attenuator 
     465        SelWave[1][0] += 2^7            // disable the checkbox for attenuator_err 
    458466         
    459467        listWave[0][1] = "attenuator_transmission" 
     
    498506        listWave[13][1] = "beam stop diameter (Middle) [mm]" 
    499507//      listWave[13][2] = num2str(V_getBeamStopC2_size(fname))   
    500         listWave[13][2] = num2str(V_DeduceBeamstopDiameter(fname,"MR"))  
     508        listWave[13][2] = num2str(V_IdentifyBeamstopDiameter(fname,"MR"))        
    501509         
    502510        listWave[14][1] = "beam stop diameter (Back) [mm]" 
    503511//      listWave[14][2] = num2str(V_getBeamStopC3_size(fname))   
    504         listWave[14][2] = num2str(V_DeduceBeamstopDiameter(fname,"B"))   
     512        listWave[14][2] = num2str(V_IdentifyBeamstopDiameter(fname,"B"))         
    505513 
    506514        listWave[15][1] = "sample aperture(2) to gate valve [cm]" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_Comparisons.ipf

    r1147 r1203  
    423423//  for properly handling this error condition 
    424424// 
    425 Function/S V_DeduceMonochromatorType(fname) 
     425Function/S V_IdentifyMonochromatorType(fname) 
    426426        String fname 
    427427         
     
    447447// if there is no beamtop in front of the specified detector, return 0.01mm 
    448448// 
    449 Function V_DeduceBeamstopDiameter(folderStr,detStr) 
     449Function V_IdentifyBeamstopDiameter(folderStr,detStr) 
    450450        String folderStr,detStr 
    451451         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_WhiteBeamDistribution.ipf

    r1095 r1203  
    11#pragma TextEncoding = "MacRoman" 
    22#pragma rtGlobals=3             // Use modern global access method and strict wave access. 
    3  
    4  
    5  
    6  
    73 
    84 
     
    2521// result when compared to the AgBeh data 
    2622// 
     23 
     24 
     25// 9/2019 
     26// added an empirical functional form for the "Super" white beam mode where the deflector is out 
     27// and the wavelength is not cut off at the higher wavelength, but extends to 20  
     28// 
     29// Integral = 30955 (cts*A) for middle fit 
     30// 
     31 
     32 
     33 
     34 
     35 
    2736 
    2837Function V_WhiteBeamDist_top(lam) 
     
    128137End 
    129138 
     139 
     140// 
     141// 
     142// 
     143Function V_SuperWhiteBeamDist_mid(lam) 
     144        Variable lam 
     145         
     146        if(lam < 3.37) 
     147                return(0) 
     148        endif 
     149         
     150        if(lam < 3.72) 
     151                return(-33536 + 9919*lam) 
     152        endif 
     153         
     154        if(lam < 3.88) 
     155                return(28941 - 6848*lam) 
     156        endif 
     157         
     158//// the "middle" of the spikes  
     159        if(lam < 4.16) 
     160                return(-1.0111e5 + 26689*lam) 
     161        endif 
     162         
     163        if(lam < 20) 
     164                return(5 - 10081*exp(-( (lam-4.161)/0.9788 )) + 19776*exp(-( (lam-4.161)/1.921 )) ) 
     165        endif 
     166 
     167//       anything larger than 20, return 0       
     168        return(0) 
     169         
     170End 
     171 
     172 
Note: See TracChangeset for help on using the changeset viewer.