LS Package
LS Package
Lions SAXS package
contains all the necessary for SAXS treatment
and SAXS modelization
LSneutron Module
-
pySAXS.LS.LSneutron.PeneDepth(S, N, lamda, rho)[source]
-
pySAXS.LS.LSneutron.ScaLengthDensity(S, N, rho)[source]
return the electron density and the scattering length density
-
pySAXS.LS.LSneutron.getMolMass(S, N)[source]
This function returns the molar mass a chemical formula
in the form ‘C 6 H 6 O 2 N 1’
-
pySAXS.LS.LSneutron.getTotalScaLen(S, N)[source]
-
pySAXS.LS.LSneutron.getTotalXS(S, N, lamda)[source]
LSsca Module
pySAXS python routines for small angle xray scattering.
This is the core of pySAXS
containing usefull function for SAXS data treatment,
tested and optimized amplitude and form factor
-
pySAXS.LS.LSsca.Cubedre(a, L)[source]
return the 3D coordinates of the 6 submits of a cube
-
pySAXS.LS.LSsca.Dalpha(par)[source]
This function returns a modified lognormal distribution for the
array r with an averaga size rm and a standard deviation sigma
-
pySAXS.LS.LSsca.Decaedre(a, b)[source]
returne the 3D cartesian coordinates of the seven sumits of decahedra
-
pySAXS.LS.LSsca.Dexpon(par)[source]
This function returns a modified lognormal distribution for the
array r with an averaga size rm and a standard deviation sigma
-
pySAXS.LS.LSsca.Dgauss(par)[source]
This function returns a gaussian distribution for the array r with an
averaga size rm and a standard deviation sigma.
-
pySAXS.LS.LSsca.Dlognormal(par)[source]
This function returns a modified lognormal distribution for the
array r with an averaga size rm and a standard deviation sigma
-
pySAXS.LS.LSsca.Doublet_Multiplet(a)[source]
-
pySAXS.LS.LSsca.Dshultz(r, rav, z)[source]
This function returns a shultz distribution for the array r with rav,
z as parameter
-
pySAXS.LS.LSsca.F1(q, R)[source]
This function returns a scattering amplitude of a sphere of radius R for q
-
pySAXS.LS.LSsca.F2(q, R1, R2)[source]
This function returns a scattering amplitude of an empty shell of internal
radius R2 and external radius R2 for q
-
pySAXS.LS.LSsca.F3(q, R, rho)[source]
This function returns the scattering amplitude of spherically symetric
shells of internal radius Ri and scattering length density rhoi for q
-
pySAXS.LS.LSsca.F3elli(q, R, e, rho)[source]
-
pySAXS.LS.LSsca.FaceTri(R)[source]
return the 5 faces of the triedre
-
pySAXS.LS.LSsca.FacesDeca(R)[source]
return the faces of the decaedra R
-
pySAXS.LS.LSsca.FacesHexa(R)[source]
return the faces of the hexaedre_cyl R, fonctionne pour le deforme egalement
-
pySAXS.LS.LSsca.FacesHexa_creux_def(R, Rin)[source]
return the faces of the hexaedre_cyl R
-
pySAXS.LS.LSsca.FacesTetraedre(R)[source]
returns the faces of the tetraedre
-
pySAXS.LS.LSsca.Facescube(R)[source]
return the 6 faces of the Cubedre
-
pySAXS.LS.LSsca.Faceshexaedre(R)[source]
returns the 6 faces of the hexaedre
-
pySAXS.LS.LSsca.Facesoctaedre(R)[source]
returns the faces of the octaedre
-
pySAXS.LS.LSsca.Guinier(q, I0, Rg)[source]
Guinier function
-
pySAXS.LS.LSsca.Hexaedre(a)[source]
returns the 3D coordinates of the 8 summits of an hexaedre side length a
-
pySAXS.LS.LSsca.Hexaedre_cyl(a, L)[source]
return the 3D coordinates of the 12 submits of an hexaedre_cyl
-
pySAXS.LS.LSsca.Hexaedre_def(a, b, L)[source]
return the 3D coordinates of the 12 submits of an hexaedre_cyl deforme (a,b) au lieu de (a,a)
-
pySAXS.LS.LSsca.Idqc(q, rho1, rho2, rho3, al1, al2, al3, Phi1, Phi2, RG0, RGsig, R1, sigR1, R3, sigR3, taoL, taoS, scale, reduc)[source]
-
pySAXS.LS.LSsca.Multiplet(q, L, rho, R)[source]
-
pySAXS.LS.LSsca.Normale(Face)[source]
returns the oriented and normalized normal to the face
-
pySAXS.LS.LSsca.Octaedre(a)[source]
returns the 3D coordinates of the 6 summits of a octaaedre of side length a
-
pySAXS.LS.LSsca.P1(q, R)[source]
This function returns the form factor of a sphere of radius R for q
-
pySAXS.LS.LSsca.P11(q, R, L)[source]
-
pySAXS.LS.LSsca.P11_int(q, R, L)[source]
-
pySAXS.LS.LSsca.P1Sqdist(q, type, rm, sigma, eta, tao)[source]
This function returns the form factor of a dsitribution of spheres of
radius R for q
-
pySAXS.LS.LSsca.P1dist(q, Dfunc, par)[source]
This function returns the form factor of a dsitribution of spheres of
radius R for q
-
pySAXS.LS.LSsca.P2(q, R1, R2)[source]
This function returns the form factor of an empty shell of internal radius
R2 and external radius R2 for q
-
pySAXS.LS.LSsca.P3(q, R, rho)[source]
This function returns the form factor of spherically symetric shells of
internal radius Ri and scattering length density rhoi for q
-
pySAXS.LS.LSsca.P3elli(q, R, e, rho)[source]
This function returns the form factor of spherically symetric shells of
internal radius Ri and scattering length density rhoi for q
-
pySAXS.LS.LSsca.P5(q, R, e)[source]
This function returns the form factor of an ellipsoid of revolution with
semi-axes R, R and e*R for q
-
pySAXS.LS.LSsca.P5_conc_int(q, R, e, rho)[source]
-
pySAXS.LS.LSsca.P5_int(q, R, e)[source]
-
pySAXS.LS.LSsca.P5conc(q, R, e, rho)[source]
This function returns the form factor of an concentric ellipsoid
of revolutions with semi-axes R, R and e*R for q
-
pySAXS.LS.LSsca.P5dist(q, type, rm, sigma, e)[source]
This function returns the form factor of a dsitribution of ellipses with
semi-axes R, R and e*R for q
-
pySAXS.LS.LSsca.PS(a, b)[source]
return the scalar product of two vetors
-
pySAXS.LS.LSsca.PV(u, v)[source]
return the vector orthogonal to u and v
-
pySAXS.LS.LSsca.Pcyl(q, R, L)[source]
Optimized version of P11 OS
This function calculates the P(q) of a cylinder of length L and radius R
-
pySAXS.LS.LSsca.Pcylcos(q, R, L)[source]
Optimized version of P11 OS
This function calculates the P(q) of a cylinder of length L and radius R
-
pySAXS.LS.LSsca.Pcylcouche(q, rho, R, L)[source]
This function calculates the scaled by volume square and scattering length density P(q)
of a cylinder of inner length L1 and radius R1 and outer length L2 and radius R2.
It is thus more versatile than Pcylcreux
-
pySAXS.LS.LSsca.Pcylcreux(q, Ri, Ro, L)[source]
This function calculates the P(q) normalized to one at q=0 of an hollow cylinder of length L inner radius Ri and outer radius Ro
-
pySAXS.LS.LSsca.Pcylcreuxcan(q, a, Ri, Ro, L)[source]
-
pySAXS.LS.LSsca.Pcylcreuxqcq(q, Ri, L, alp, b, x0, delt)[source]
contient une erreur en date du 30 avril 2009 connue mais a corriger
This function calculates the P(q) normalized to one at q=0 of an hollow cylinder of length L inner radius Ri and outer radius Ro
-
pySAXS.LS.LSsca.Pcylh(q, R, L)[source]
Optimized version of P11 OS
This function calculates the P(q) of a cylinder of length L and radius R with two hemispheres of redaisu R as cap ends
is associated with dPcylh
-
pySAXS.LS.LSsca.Pcylmulti(q, R, rho, L, rhos)[source]
This function calculates at the absolute scale the P(q) of a cylinder of length L and and multilayers R of density Rho the last one being solvent
-
pySAXS.LS.LSsca.Pcylvb(q, R, L)[source]
This function calculates the P(q) normalized to one at q=0 of a cylinder of length L and radius R
-
pySAXS.LS.LSsca.PdqHexa3(q, R, L, N)[source]
-
pySAXS.LS.LSsca.PdqHexacoq(q, Ri, Ro, L, N)[source]
-
pySAXS.LS.LSsca.Pdqhexa(q, a, N)[source]
-
pySAXS.LS.LSsca.Pdqocta(q, a, N)[source]
-
pySAXS.LS.LSsca.Pdqpoly(q1, FacePoly, sign, N)[source]
-
pySAXS.LS.LSsca.Pdqtetra(q, a, N)[source]
-
pySAXS.LS.LSsca.PolyGauss_ana_Norm(q, par)[source]
This fucntion calculates the normalized P(q) of a gaussian distribution of spheres centered in par[0] with an extension par[1]
q array of q (A-1)
par[0] Mean radius(A)
par[1] Gaussian standard deviation (A)
-
pySAXS.LS.LSsca.PolySphere_int(q, Dfunc, par)[source]
-
pySAXS.LS.LSsca.Porod(q, B)[source]
Porod function
q**-4*B*1e-32
-
pySAXS.LS.LSsca.Ppara(q, a, b, c)[source]
This function calculates the P(q) normalized to one at q=0 of a parallelepiped a,b,c (not finished 21/10/2009. this function makes use of dPpara
which makes the integral over alpha
-
pySAXS.LS.LSsca.ProjSommets(Face)[source]
-
pySAXS.LS.LSsca.Qlogspace(qmin, qmax, np)[source]
This function returns an array of np q values evenlly separated in
log scale between qmin and qmax
-
pySAXS.LS.LSsca.R(R, L, x, alp, b, x0)[source]
-
pySAXS.LS.LSsca.SHexa(R, L)[source]
-
pySAXS.LS.LSsca.SS(f, p)[source]
This function returns the specific surface of a distribution of
spheres
f function to compute the distribution
p array of parameter
-
pySAXS.LS.LSsca.Scyl(R, L)[source]
-
pySAXS.LS.LSsca.SqSticky(q, R, eta, tao)[source]
This function computes the Baxter structure factor
eta is the volume fraction
tao is the sticky factor
R is the radius in A
q is an array of scattering vectors A-1
-
pySAXS.LS.LSsca.Surf(S)[source]
-
pySAXS.LS.LSsca.TFS(Sommets, a, b, qx, qy)[source]
returns the ff of polygon for a matrix qx,qy
-
pySAXS.LS.LSsca.TFSpi(Sommets, a, b, qx, qy)[source]
returns the ff of polygon for a matrix qx,qy
-
pySAXS.LS.LSsca.TFSs(Sommets, a, b, qx, qy)[source]
returns the ff of polygon for a scalar qx qy
-
pySAXS.LS.LSsca.Tetra1_Multiplet(b)[source]
b is the distance between spheres
-
pySAXS.LS.LSsca.Tetra2_Multiplet(c)[source]
c is the distance between the core and the satellites
-
pySAXS.LS.LSsca.Tetra_Multiplet(a)[source]
semble suspect
-
pySAXS.LS.LSsca.Tetraedre(a)[source]
returns the 3D coordinates of the 4 summits of a tetraedreof side length a
-
pySAXS.LS.LSsca.Triedre(a, L)[source]
return the 3D coordinates of the 6 submits of a triedre
-
pySAXS.LS.LSsca.Triplet_Multiplet(a)[source]
-
pySAXS.LS.LSsca.VHexa(R, L)[source]
-
pySAXS.LS.LSsca.Vcyl(R, L)[source]
-
pySAXS.LS.LSsca.Vcylcreuxcan(a, Ri, Ro, L)[source]
-
pySAXS.LS.LSsca.Vcylcreuxqcq(Ri, L, alp, b, x0, delt)[source]
-
pySAXS.LS.LSsca.amplitude_multiplet(q, L, rho, R)[source]
-
pySAXS.LS.LSsca.angle(teta, phi)[source]
-
pySAXS.LS.LSsca.dPcylb(qi, R, L, al)[source]
-
pySAXS.LS.LSsca.dPcylh(qi, R, L, al)[source]
Subfunction of Pcylh
-
pySAXS.LS.LSsca.dPpara(q, a, b, c, beta)[source]
Side function of Ppara
-
pySAXS.LS.LSsca.ddPcylh(qi, R, al)[source]
Sub-sub-function of dPcylh
-
pySAXS.LS.LSsca.distance(A, B)[source]
-
pySAXS.LS.LSsca.f(x, y)[source]
-
pySAXS.LS.LSsca.fP11_int(x, q, R, L)[source]
-
pySAXS.LS.LSsca.fP5_conc_int(x, q, R, e, rho)[source]
-
pySAXS.LS.LSsca.fP5_int(x, q, R, e)[source]
-
pySAXS.LS.LSsca.fPolySphere_int(R, q, Dfunc, Arg)[source]
-
pySAXS.LS.LSsca.fcan(x, y, z)[source]
-
pySAXS.LS.LSsca.fcanb(x, y, z)[source]
-
pySAXS.LS.LSsca.getRmoydist(R, D)[source]
This function returns the form factor of a dsitribution of spheres of
radius R for q
-
pySAXS.LS.LSsca.getV(R)[source]
This function returns a the volume of a sphere with radius r
-
pySAXS.LS.LSsca.getVelli(R, e)[source]
This function returns a the volume of a sphere with radius r
-
pySAXS.LS.LSsca.pente(Sommets)[source]
-
pySAXS.LS.LSsca.qvectors(q, teta, phi)[source]
-
pySAXS.LS.LSsca.qvectorspi(q, teta, phi)[source]
LSusaxs Module
pySAXS routines for ultra small angle xray scattering.
Lake deconvolution
background substraction,...
version LSusaxs replacing LSreg by OT 7-2012
version 0.1 22/03/2006
version OS 20/11/2009
-
pySAXS.LS.LSusaxs.BackgroundCorrection(I, bkg)[source]
-
pySAXS.LS.LSusaxs.CalTransmission(mu_p, rho_p, mu_S, rho_S, phim_p, rho_soln, t)[source]
Calculates the transmission value for given sample parameters—
-
pySAXS.LS.LSusaxs.FitGauss(q, I, n, a0, a1, a2, tol=1e-15, it=2000)[source]
-
pySAXS.LS.LSusaxs.GoodnessOfFit(xexp, yexp, fmodel, par)[source]
This calculates the goodness of a fit
-
pySAXS.LS.LSusaxs.InterpolateForCommonvalue(qexp, Iexp, qrock, Irock)[source]
-
pySAXS.LS.LSusaxs.Qscalemod(dq, q, step)[source]
-
pySAXS.LS.LSusaxs.QtoTheta(q, wavelength)[source]
-
pySAXS.LS.LSusaxs.ThetatoQ(Theta, wavelength)[source]
-
pySAXS.LS.LSusaxs.TrCorrectedProf(qexp, Iexp, qrock, Irock, thickness, central_area, T)[source]
Transmission corrected profile
-
pySAXS.LS.LSusaxs.TransmissionValue(nsamp, nrock)[source]
calculate transmission : nsamp/nrock
-
pySAXS.LS.LSusaxs.USAXS_count_convolute(q, Iabs, N0dX, thick, wavelength)[source]
This subroutine calculates the counts that will be observed on USAXS for a particular model with q,I in cm-1
-
pySAXS.LS.LSusaxs.ZeroCentre(q, I)[source]
-
pySAXS.LS.LSusaxs.calculate_res_func_USAXS(filename, c, step, boun)[source]
This routine calculates the resolution function for the USAXS
c is the slit length
step is the step size for the V(beta) profile
boun is the extreme left/right beta value for the V(beta) for which it shoule calculate the V(beta)
-
pySAXS.LS.LSusaxs.file_resfunc = 'C:\\Python27\\lib\\site-packages\\pySAXS\\saxsdata\\usaxs_res_func.dat'
- def ReadUSAXSData(filename):
- return SPio.array_import.read_array(filename,columns=(0,-2),lines=(1,-1))
- def WriteUSAXSdata(filename,data):
- return SPio.array_import.write_array(filename,data,separator=’ ‘)
-
pySAXS.LS.LSusaxs.gaussian(par, x)[source]
-
pySAXS.LS.LSusaxs.interpolate_res_func(x, resx=None, resy=None)[source]
Interpolated resolution function obtained from res_func.dat file
if resx and resy are not None, use this datas
-
pySAXS.LS.LSusaxs.lake(qexp, Iexp, it, type, ns, m, resx, resy)[source]
Deconvolution subroutine based on Lake method
-
pySAXS.LS.LSusaxs.porod(par, q)[source]
-
pySAXS.LS.LSusaxs.read_res_function()[source]
read the resolution function from the specified filename
-
pySAXS.LS.LSusaxs.residuals(par, y, x)[source]
-
pySAXS.LS.LSusaxs.select(q, I, n)[source]
Selects the q,I for n points around the maximum
-
pySAXS.LS.LSusaxs.smooth(y, ns)[source]
-
pySAXS.LS.LSusaxs.somme(q, I)[source]
This gives the sum(I*delta q)
SAXSparametersOLD Module
project : pySAXS
description : class for radial average parameters
authors : Olivier Tache
Last changes :
Replaced by SAXSparameterXML
08-03-2007 OT : port to pySAXS library
-
class pySAXS.LS.SAXSparametersOLD.SAXSparametersOLD(printout=None)[source]
- Radial Average Parameters -
wave_length=1.542
detector_to_sample=1
pixel_size=1
q_by_pixel=-1
exposition_time=1
backgd_by_s=0 #par seconde
backgd_by_pix=0 #par pixel
comment=””
transmission=-1
thickness=-1
K=1
monitor=1
-
calculBack()[source]
calculate background
-
calculDeltaOmega()[source]
calculate DeltaOmega
-
calculTotalFlux()[source]
calculate Flux
-
calculTransm()[source]
calculate Transmission
-
calculate_All()[source]
calculate all the function defined in paramsDesc
-
calculate_i(n, b=None, deviation=None, bdeviation=None)[source]
Calculate i in cm-1 from parameters
n : raw intensity
b : empty cell to substract
deviation : absolute deviation for i
bdeviation : absolute deviation for background
———————————–
DeltaOmega=(pixel size / distance sample detector)^2
Flux = (monitor/transmission)*K
Intensity=(n-background)/(time * DeltaOmega * Transmission * Thickness * Flux)
if empty cell (b) then Final Intensity=( Intensity(with Thickness=1) - empty cell)/thickness
-
calculate_q(n)[source]
calculate q in A-1 from parameters
n : pixel number
———————————-
q=(4*pi/lambda)*sin(theta/2)
with tan(theta)=d/D
D : sample detector distance
d : pixel number (n) * pixel size
-
calculate_q_by_pix()[source]
calculate q by pix in A-1 from parameters (RAP)
-
load(file_name)[source]
-
order()[source]
return a list with dictionnary key ordered
-
printTXT(txt='', par='')[source]
-
save(file_name)[source]
-
save_printable(file_name)[source]
SAXSparametersXML Module
project : pySAXS
description : class for radial average parameters
authors : Olivier Tache
Last changes :
2012 : replacing the old SAXSparameters
IMPORTANT HERE :
THE INITIALS PARAMETERS FOR ABSOLUTE SCALE
-
class pySAXS.LS.SAXSparametersXML.SAXSparameters(printout=None)[source]
Radial Average Parameters -
-
calculBack()[source]
calculate background
-
calculDeltaOmega()[source]
calculate DeltaOmega
-
calculTotalFlux()[source]
calculate Flux
-
calculTransm()[source]
calculate Transmission
-
calculate_All()[source]
calculate all the functions defined
-
calculate_i(n, b=None, deviation=None, bdeviation=None)[source]
Calculate i in cm-1 from parameters
n : raw intensity
b : empty cell to substract
deviation : absolute deviation for i
bdeviation : absolute deviation for background
———————————–
DeltaOmega=(pixel size / distance sample detector)^2
Flux = (monitor/transmission)*K
Intensity=(n-background)/(time * DeltaOmega * Transmission * Thickness * Flux)
if empty cell (b) then Final Intensity=( Intensity(with Thickness=1) - empty cell)/thickness
-
calculate_q(n)[source]
calculate q in A-1 from parameters
n : pixel number
———————————-
q=(4*pi/lambda)*sin(theta/2)
with tan(theta)=d/D
D : sample detector distance
d : pixel number (n) * pixel size
-
calculate_q_by_pix()[source]
calculate q by pix in A-1 from parameters (RAP)
-
eval_function(formula)[source]
return the evaluated value
-
get(variable)[source]
return the value of the specified variable
-
getFromXML(xmlElement)[source]
get parameters from xml element
-
goodCalculation()[source]
modify some parameter for good calculation :
- backg=dbackgd_by_pix+backgd_by_s*time
- transmission=TransmittedFlux/IncidentFlux
- DeltaOmega=(pixel_size/D)**2
- flux=IncidentFlux*K
-
importOLD(filename)[source]
let us to import a old parameter file
-
load(file_name)[source]
load from a pickle (binary) file
-
openXML(filename)[source]
read from a xml file
-
order()[source]
return a list with dictionnary key ordered
-
printTXT(txt='', par='')[source]
-
save(file_name)[source]
save in a pickle (binary) file
-
saveXML(filename)[source]
save in a xml file
-
save_printable(file_name)[source]
save in a txt file
-
set(variable, value)[source]
change the value of the specified variable
-
xml()[source]
return an xml object
-
xmlString()[source]
return a xml string
-
class pySAXS.LS.SAXSparametersXML.parameter(name, value=None, description='', order=-1, formula=None, datatype=None, parent=None)[source]
class for parameters
-
eval()[source]
if self.evaluationFunction<>None:
self.value=self.evaluationFunction()
return self.value
-
get()[source]
return the value of the parameter
-
getfromXML(xmlElement)[source]
initialization given by xml element
-
set(value)[source]
set the value of the parameter
-
xml()[source]
return an element xml
<time description=’time(s)’ order=‘2’ formula=’e=mc**2’ datatype=’float’>1.25</time>
absorption Module
-
pySAXS.LS.absorption.getAllMu()[source]
This function returns a big table with all NIST xray absorption data.
For practical script it is not useful!
-
pySAXS.LS.absorption.getAtomsSymbole(S)[source]
Transform a string containing a chimical formula (‘C 1 O 2’) in two array
- list of atoms
- numeric array of atoms number
7-13-2012 by OT
-
pySAXS.LS.absorption.getAtomsSymboleOLD(S)[source]
Ceci est une fonction qui transforme une chaine de caracteres de formule
chimique en deux tableaux l’un de chaine de caractere avec les symboles
chimiques l’autre avec le nombre d’atome en question.
version lourdo bugger pour le moment
-
pySAXS.LS.absorption.getElectronDensity(S, rho)[source]
return the electron density and the scattering length density
-
pySAXS.LS.absorption.getElectronNumber(S)[source]
-
pySAXS.LS.absorption.getMasseFormula(S, NRJ=8.028, ISEN=1)[source]
This function returns the molar mass a chemical formula
in the form ‘C 6 H 6 O 2 N 1’
TODO improve getAtomsSymbole
-
pySAXS.LS.absorption.getMasseName(S)[source]
This function returns the molar mass of the atom with name S
(ie ‘Carbon’ , ‘Gold’)
-
pySAXS.LS.absorption.getMasseSymbole(S)[source]
This function returns the molar mass of the atom with symble S
(ie ‘C’ fo carbon, ‘Au’ for gold)
-
pySAXS.LS.absorption.getMasseZ(Z)[source]
This function returns the molar mass of the atom with atomic number Z
-
pySAXS.LS.absorption.getMuFormula(S, NRJ=8.028, ISEN=1)[source]
This function returns the mass attenuation coefficient for a chemical
formula in the form ‘C 6 H 6 O 2 N 1’
7-13-2012 by OT improved for formula with fraction ‘Si 1.2 Al 0.8’
-
pySAXS.LS.absorption.getMuName(S, NRJ=8.028, ISEN=1)[source]
This function returns the xray absorption coefficient of the atom with
name S (ie ‘Carbon’ , ‘Gold’) by default NRJ is 8.028 keV and mass-energy
absorption coefficient are return. To get the mass absorption coefficient
ISEN has to be 0
-
pySAXS.LS.absorption.getMuSymbole(S, NRJ=8.028, ISEN=1)[source]
This function returns the xray absorption coefficient of the atom with
symbole S (ie ‘C’ fo carbon, ‘Au’ for gold) by default NRJ is 8.03 keV
and mass-energy absorption coefficient are return. To get the mass
absorption coefficient ISEN has to be 0
-
pySAXS.LS.absorption.getMuZ(Z, NRJ=8.028, ISEN=1)[source]
This function returns the xray absorption coefficient of the atom with
name S (ie ‘Carbon’ , ‘Gold’) by default NRJ is 8.028 keV and mass-energy
absorption coefficient is returned. To get the mass absorption coefficient
ISEN has to be 0
-
pySAXS.LS.absorption.setAtomsSymbole(atomS, atomN)[source]
Ceci est une fonction qui transforme une liste de symbole chimique
et de nombre en une chaine de caractere.
absorptionXRL Module
This module use the xraylib library
and provide high level functions for
absorption factors for chemical compounds
August 2012 by OT
based on work by AT
-
pySAXS.LS.absorptionXRL.getAngstFromSource(source='Cu')[source]
return the KA LINE (most used) energy in ANGSTROM from the x-ray source
>>> getAngstFromSource(‘Cu’)
1.5418904085842968
-
pySAXS.LS.absorptionXRL.getAtomsFormula(S)[source]
Transform a string containing a chemical formula (‘C 1 O 2’) in two array
- list of atoms
- numeric array of atoms number
7-13-2012 by OT
>>> getAtomsFormula(‘C 1 O 2’)
[‘C’,’O’] [1,2]
-
pySAXS.LS.absorptionXRL.getElectronDensity(S, rho)[source]
return the electron density and the scattering length density
-
pySAXS.LS.absorptionXRL.getElectronNumber(S)[source]
-
pySAXS.LS.absorptionXRL.getEnergyFromSource(source='Cu')[source]
return the KA LINE (most used) energy from the x-ray source
>>> getEnergyFromSource(‘Cu’)
8.04105057076251
>>> getEnergyFromSource(‘Mo’)
17.443217030477935
-
pySAXS.LS.absorptionXRL.getFormulaAtoms(atomS, atomN)[source]
transform a compound list and number in string
>>> AtomsToCompound([‘H’,’O’],[2,1])
‘H 2 O 1’
-
pySAXS.LS.absorptionXRL.getMasseFormula(S, energy=8.028)[source]
This function returns the molar mass a chemical formula
in the form ‘C 6 H 6 O 2 N 1’
-
pySAXS.LS.absorptionXRL.getMasseSymbol(S)[source]
returns the molar mass (atomic weight) of the atom with atomic number Z
(ie ‘C’ fo carbon, ‘Au’ for gold)
-
pySAXS.LS.absorptionXRL.getMasseZ(Z)[source]
returns the molar mass (atomic weight) of the atomic number Z
-
pySAXS.LS.absorptionXRL.getMuFormula(S, energy=8.028)[source]
This function returns the mass attenuation coefficient for a chemical
formula in the form ‘C 6 H 6 O 2 N 1’
-
pySAXS.LS.absorptionXRL.getMuName(name, energy=8.028)[source]
This function returns the xray absorption coefficient of the atom with
name S (ie ‘Carbon’ , ‘Gold’) by default energy is 8.028 keV and mass-energy
absorption coefficient are return. To get the mass absorption coefficient
-
pySAXS.LS.absorptionXRL.getMuSymbol(S, energy=8.028)[source]
This function returns the xray absorption coefficient of the atom with
symbole S (ie ‘C’ fo carbon, ‘Au’ for gold) by default energy is 8.03 keV
and mass-energy absorption coefficient are return. To get the mass
absorption coefficient ISEN has to be 0
-
pySAXS.LS.absorptionXRL.getMuZ(Z, energy=8.028)[source]
return Mu from Atomic number Z
>>> getMuZ(4)
0.8719998598098755
-
pySAXS.LS.absorptionXRL.getNameZ(Z)[source]
return the name from a Z
>>> getNameZ(29)
‘Copper’
-
pySAXS.LS.absorptionXRL.getTransmission(formula, thickness=1.0, density=1.0, energy=8.03)[source]
return the transmission of a compound
thickness in cm
>>> getTransmission(‘H 2 O 1’,0.1,density=1.0,energy=8.03)
0.376802369048
-
pySAXS.LS.absorptionXRL.getZName(name)[source]
return the Atomic Number Z from compound name
>>> getZName(“Copper”)
29
invariant Module
calculation of invariant
-
class pySAXS.LS.invariant.invariant(q, i, printout=None, radius=300.0, verbose=True)[source]
class for calculation of invariant
from data in i(q)
-
calculate(radius=None, qmin=None, qmax=None, extrapolation=None)[source]
calculate invariant and particle volume
-
calculateI0()[source]
calculate I0
I0 = Istar * exp(qmini ** 2 * radius ** 2 / 3.0)
Istar is interpolation at qmin
-
getInvariant()[source]
return the calculate value
use calculate() function before
-
getVolume()[source]
return the calculate volume for a particule
use calculate() function before
-
printTXT(txt='', par='')[source]
for printing messages
rap Module
project : pySAXS
description : class for radial average parameters
authors : Olivier Tache
Last changes :
08-03-2007 OT : port to pySAXS library
-
class pySAXS.LS.rap.RAP[source]
- Radial Average Parameters -
beam_x : x beam position
beam_y : y beam position
roi_xmin, roi_ymin, roi_xmax, roi_ymax : #les points a masquer
masks_list=[] : un tableau de roi
geom_corr_x , geom_corr_y :correction geometrique
wave_length=1.542
detector_to_sample=1
pixel_size=1
q_by_pixel=-1
exposition_time=1
backgd_by_s=0 #par seconde
backgd_by_pix=0 #par pixel
comment=””
transmission=-1
thickness=-1
K=1
monitor=1
-
Set_BeamXY(x, y)[source]
-
Set_ROI(xmin, ymin, xmax, ymax)[source]
-
calculate_q_by_pix()[source]
calculate q by pix in A-1 from parameters (RAP)
-
load(file_name)[source]
-
mask_add(polygon)[source]
ajoute un masque dans la liste des masques
-
mask_delete_all()[source]
efface la liste des masques
-
mask_remove(i)[source]
retire de la liste des masques l’element i
-
save(file_name)[source]
-
save_printable(file_name)[source]
-
pySAXS.LS.rap.Rad_Read(filename)[source]
Open the averaged data from a rgr file
return qraw,q,iraw,i,n
-
pySAXS.LS.rap.Rad_Save(p, q, n, iq, filename)[source]
Save the averaged data in a rgr file wich can be opened by MS excel
-
pySAXS.LS.rap.calculate_q(q, par)[source]
calculate q in A-1 from parameters (RAP)