Changeset 17


Ignore:
Timestamp:
Apr 3, 2013 7:55:59 PM (9 years ago)
Author:
ilavsky
Message:

Yet more weight calibration modifications.

Location:
User Procedures
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • User Procedures/Indra 2/IN3_Calculations.ipf

    r15 r17  
    505505        if (cmpstr("CalculateThickness",ctrlName)==0)
    506506                NI3_TabPanelControl("",0)
    507                 IN3_CalculateSampleThickness()
     507                IN3_CalcSampleWeightOrThickness()
    508508        endif
    509509        if (cmpstr("CalculateWeight",ctrlName)==0)
    510510                NI3_TabPanelControl("",0)
    511                 IN3_CalculateSampleThickness()
     511                IN3_CalcSampleWeightOrThickness()
    512512        endif
    513513
     
    13601360        SetVariable SampleDensity,win=USAXSDataReduction, disable=(tab!=0 || IsBlank || !CalibrateToWeight || CalibrateArbitrary), frame=CalculateWeight, noedit=!CalculateWeight
    13611361        SetVariable SampleFilledFraction,win=USAXSDataReduction, disable=(tab!=0 || IsBlank || !CalibrateToVolume || CalibrateArbitrary),noedit=!CalculateThickness, frame=CalculateThickness
    1362         SetVariable BeamExposureArea, win=USAXSDataReduction, disable=(tab!=0 || IsBlank || CalibrateArbitrary), noedit=!(CalculateWeight&&CalibrateToWeight), frame=!CalculateWeight
     1362        //SetVariable BeamExposureArea, win=USAXSDataReduction, disable=(tab!=0 || IsBlank || CalibrateArbitrary), noedit=!(CalculateWeight&&CalibrateToWeight), frame=!CalculateWeight
    13631363
    13641364
  • User Procedures/Indra 2/IN3_Main.ipf

    r16 r17  
    226226        SetVariable SampleDensity,limits={0,Inf,0},variable= root:Packages:Indra3:SampleDensity, noedit=!CalculateWeight, frame=CalculateWeight
    227227
    228         SetVariable SampleWeightInBeam,pos={5,410},size={300,22},title="Sample weight [g/mm2 bm area] ="
     228        SetVariable SampleWeightInBeam,pos={5,410},size={300,22},title="Sample weight [g/cm2 bm area] ="
    229229        SetVariable SampleWeightInBeam,font="Times New Roman",fSize=14,proc=IN3_ParametersChanged, bodyWidth=100
    230230        SetVariable SampleWeightInBeam,limits={0,Inf,0},variable= root:Packages:Indra3:SampleWeightInBeam, noedit=CalculateWeight, frame=!CalculateWeight
     
    234234        SetVariable SampleFilledFraction,limits={0,Inf,0},variable= root:Packages:Indra3:SampleFilledFraction, noedit=!CalculateThickness, frame=CalculateThickness
    235235
    236         SetVariable BeamExposureArea,pos={5,435},size={280,22},title="Beam area [mm2]  =", help={"Calculated area of the beam from slit positions, do not change unless it is error"}
    237         SetVariable BeamExposureArea,font="Times New Roman",fSize=14,proc=IN3_ParametersChanged, bodyWidth=100
    238         SetVariable BeamExposureArea,limits={0,Inf,0},variable= root:Packages:Indra3:BeamExposureArea, noedit=!CalculateWeight, frame=CalculateWeight
     236        //SetVariable BeamExposureArea,pos={5,435},size={280,22},title="Beam area [mm2]  =", help={"Calculated area of the beam from slit positions, do not change unless it is error"}
     237        //SetVariable BeamExposureArea,font="Times New Roman",fSize=14,proc=IN3_ParametersChanged, bodyWidth=100
     238        //SetVariable BeamExposureArea,limits={0,Inf,0},variable= root:Packages:Indra3:BeamExposureArea, noedit=!CalculateWeight, frame=CalculateWeight
    239239
    240240
  • User Procedures/Indra 2/IN3_Rwave.ipf

    r12 r17  
    1212                // 2 - changed Q parameters, recalcualte just the Q vales...
    1313       
     14       
    1415        string oldDf=GetDataFolder(1)
    1516        setDataFolder root:Packages:Indra3
     
    3031        if(StepFrom<=3 && !IsBlank)
    3132                        // calculate transmission (can be done, we have the data now) and scale the data to it...
    32                 //IN3_CorrectQandTransmission()
    33                 IN3_CalculateSampleThickness()
     33                IN3_CalcSampleWeightOrThickness()
    3434        endif
    3535        if(StepFrom<=4 && !IsBlank)
    3636        // subtract sample and Blank to create SMR data...
    37                 IN3_CalculateCalibration()
    3837                IN3_CalculateMSAXSCorrection()
    3938                IN3_CalculateTransmission(1)
     39                IN3_CalcSampleWeightOrThickness()
     40                IN3_CalculateCalibration()
    4041                IN3_RecalcSubtractSaAndBlank()
    4142                //and store Q position for starting next time
     
    123124        setDataFolder root:Packages:Indra3
    124125
    125         Wave ar_encoder
     126        Wave/Z ar_encoder       
     127        if(!WaveExists(ar_encoder))
     128                abort
     129        endif
    126130        SVAR MeasurementParameters
    127131        SVAR specComment
  • User Procedures/Indra 2/IN3_SupportFnct.ipf

    r16 r17  
    297297                Kfactor = Kfactor*1*0.1
    298298                ASBParameters=ReplaceStringByKey("CalibrationUnit",ASBParameters,"Arbitrary","=")
    299         else                            //use weight. Assume the weight in the beam is already scaled per beam area?
     299        elseif(CalibrateToWeight)                       //use weight. Assume the weight in the beam is already scaled per beam area?
    300300                //first calculate the amount of sample in the beam...
    301                 Kfactor = Kfactor * SampleWeightInBeam          //SampleWeightInBeam should be in g and be real weight of sample [g/in beam area], not unit weight [g/cm2]
     301                Kfactor = Kfactor * SampleWeightInBeam          //SampleWeightInBeam should be in g and be weight of sample [g/in 1 cm2 of beam area]
    302302                ASBParameters=ReplaceStringByKey("CalibrationUnit",ASBParameters,"cm2/g","=")
     303        else                                            //prior system, nothing selected.
     304                Kfactor = Kfactor*SampleThickness*0.1
     305                ASBParameters=ReplaceStringByKey("CalibrationUnit",ASBParameters,"cm2/cm3","=")
    303306        endif   
    304307        ASBParameters=ReplaceNumberByKey("Kfactor",ASBParameters,Kfactor,"=")
     
    10871090//***********************************************************************************************************************************
    10881091
    1089 Function IN3_CalculateSampleThickness()
     1092Function IN3_CalcSampleWeightOrThickness()
    10901093
    10911094        NVAR CalibrateToWeight = root:Packages:Indra3:CalibrateToWeight
     
    11101113                        //SampleWeightInBeam = BeamExposureArea * SampleThickness * SampleDensity       
    11111114                        // this should be normalized to 1mm2 of beam area as the empty normalizes everything to mm2
    1112                         SampleWeightInBeam = SampleDensity * (0.01 * SampleThickness/10)        //this is V in cm3 - 1mm2 * thickness - converted to cm         
     1115                        SampleWeightInBeam = SampleDensity * (SampleThickness/10)       //this is V in cm3 * thickness converted to cm         
    11131116                endif
    11141117        else   
  • User Procedures/Irena/IR1_DataManipulation.ipf

    r10 r17  
    890890                                TempEInterp2[0,BinarySearch(ResultsQ, TempQ2[0] )]=0
    891891                        endif
    892                         if ((BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)-1] )!=numpnts(ResultsQ)-1)&&(BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)-1] )!=-2))
    893                                 TempIntInterp2[BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)])+1,inf]=NaN
    894                                 TempEInterp2[BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)])+1,inf]=NaN
     892                        if ((BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)-1] )!=numpnts(ResultsQ)-1)&&(BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)-1] )!=-2) )
     893                                TempIntInterp2[BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)-1])+1,  ]=NaN
     894                                TempEInterp2[BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)-1])+1,  ]=NaN
    895895                        endif
    896896                        ResultsInt =  TempIntInterp2 -TempInt1
     
    912912                        endif
    913913                        if ((BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)-1] )!=numpnts(ResultsQ)-1)&&(BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)-1] )!=-2))
    914                                 TempIntInterp2[BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)-1])+1,inf]=NaN
     914                                TempIntInterp2[BinarySearch(ResultsQ, TempQ2[numpnts(TempQ2)-1])+1, ]=NaN
    915915                        endif
    916916                        ResultsInt =  TempIntInterp2 - TempInt1
Note: See TracChangeset for help on using the changeset viewer.