Changeset 18


Ignore:
Timestamp:
Apr 3, 2013 8:43:11 PM (9 years ago)
Author:
ilavsky
Message:

And yet another fixes for weight calibration. Got the weight correction probably right and fixed calculation of linear absorption coefficient. Still some fixes to behavior needed, but now the test cases seem to work (1g/cm3, 10g/cm3 etc).

Location:
User Procedures/Indra 2
Files:
2 edited

Legend:

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

    r17 r18  
    10811081        Make/O/T/N=1 T_Constraints
    10821082        T_Constraints[0] = {"K3>1.3"}
     1083        variable V_FitError=0
    10831084        FuncFit/Q/NTHR=0  IN3_ModifiedGauss W_coef PD_Intensity [PeakCenterFitStartPoint,PeakCenterFitEndPoint]  /X=Ar_encoder /D /W=PD_error /I=1 /C=T_Constraints     //Gauss
     1085        if(V_FitError>0)
     1086                abort "Peak profiel fitting function error. Please select wider range of data or change fitting function (Guass is good choice)"
     1087        endif
    10841088        NVAR BeamCenter
    10851089        NVAR MaximumIntensity
  • User Procedures/Indra 2/IN3_SupportFnct.ipf

    r17 r18  
    299299        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 weight of sample [g/in 1 cm2 of beam area]
     301               
     302                //Kfactor = Kfactor*SampleThickness*0.1 * SampleDensity         //SampleWeightInBeam should be in g and be weight of sample [g/in 1 cm2 of beam area]
     303                Kfactor = Kfactor*SampleWeightInBeam                                                    //SampleWeightInBeam should be in g and be weight of sample in [g/cm2 of beam area]
    302304                ASBParameters=ReplaceStringByKey("CalibrationUnit",ASBParameters,"cm2/g","=")
    303305        else                                            //prior system, nothing selected.
     
    11131115                        //SampleWeightInBeam = BeamExposureArea * SampleThickness * SampleDensity       
    11141116                        // this should be normalized to 1mm2 of beam area as the empty normalizes everything to mm2
    1115                         SampleWeightInBeam = SampleDensity * (SampleThickness/10)       //this is V in cm3 * thickness converted to cm         
     1117                        SampleWeightInBeam = SampleThickness*0.1 * SampleDensity        //this is g/cm * thickness converted to cm     
     1118                else
     1119                        SampleDensity = SampleWeightInBeam /  (SampleThickness /10)
    11161120                endif
    11171121        else   
     
    11191123                        SampleThickness = -10*(1/SampleFilledFraction) *( ln(SampleTransmission)/SampleLinAbsorption )
    11201124                else
    1121                         SampleLinAbsorption =  -10*(1/SampleFilledFraction) *( ln(SampleTransmission)/SampleThickness )
     1125                        SampleLinAbsorption =  -ln(SampleTransmission) / (SampleThickness/(10*(1/SampleFilledFraction)))
    11221126                endif
    11231127        endif   
Note: See TracChangeset for help on using the changeset viewer.