LS Package — pySAXS 77.September2012 documentation

### Navigation

- index
- modules |
- next |
- previous |
- pySAXS 77.September2012 documentation »
- pySAXS »
- pySAXS Package »

# 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)

`pySAXS.LS.LSneutron.` `ScaLengthDensity`(S, N, rho)

  return the electron density and the scattering length density

`pySAXS.LS.LSneutron.` `getMolMass`(S, N)

  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)

`pySAXS.LS.LSneutron.` `getTotalXS`(S, N, lamda)

## `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)

  return the 3D coordinates of the 6 submits of a cube

`pySAXS.LS.LSsca.` `Dalpha`(par)

  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)

  returne the 3D cartesian coordinates of the seven sumits of decahedra

`pySAXS.LS.LSsca.` `Dexpon`(par)

  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)

  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)

  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)

`pySAXS.LS.LSsca.` `Dshultz`(r, rav, z)

  This function returns a shultz distribution for the array r with rav, z as parameter

`pySAXS.LS.LSsca.` `F1`(q, R)

  This function returns a scattering amplitude of a sphere of radius R for q

`pySAXS.LS.LSsca.` `F2`(q, R1, R2)

  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)

  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)

`pySAXS.LS.LSsca.` `FaceTri`(R)

  return the 5 faces of the triedre

`pySAXS.LS.LSsca.` `FacesDeca`(R)

  return the faces of the decaedra R

`pySAXS.LS.LSsca.` `FacesHexa`(R)

  return the faces of the hexaedre_cyl R, fonctionne pour le deforme egalement

`pySAXS.LS.LSsca.` `FacesHexa_creux_def`(R, Rin)

  return the faces of the hexaedre_cyl R

`pySAXS.LS.LSsca.` `FacesTetraedre`(R)

  returns the faces of the tetraedre

`pySAXS.LS.LSsca.` `Facescube`(R)

  return the 6 faces of the Cubedre

`pySAXS.LS.LSsca.` `Faceshexaedre`(R)

  returns the 6 faces of the hexaedre

`pySAXS.LS.LSsca.` `Facesoctaedre`(R)

  returns the faces of the octaedre

`pySAXS.LS.LSsca.` `Guinier`(q, I0, Rg)

  Guinier function

`pySAXS.LS.LSsca.` `Hexaedre`(a)

  returns the 3D coordinates of the 8 summits of an hexaedre side length a

`pySAXS.LS.LSsca.` `Hexaedre_cyl`(a, L)

  return the 3D coordinates of the 12 submits of an hexaedre_cyl

`pySAXS.LS.LSsca.` `Hexaedre_def`(a, b, L)

  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)

`pySAXS.LS.LSsca.` `Multiplet`(q, L, rho, R)

`pySAXS.LS.LSsca.` `Normale`(Face)

  returns the oriented and normalized normal to the face

`pySAXS.LS.LSsca.` `Octaedre`(a)

  returns the 3D coordinates of the 6 summits of a octaaedre of side length a

`pySAXS.LS.LSsca.` `P1`(q, R)

  This function returns the form factor of a sphere of radius R for q

`pySAXS.LS.LSsca.` `P11`(q, R, L)

`pySAXS.LS.LSsca.` `P11_int`(q, R, L)

`pySAXS.LS.LSsca.` `P1Sqdist`(q, type, rm, sigma, eta, tao)

  This function returns the form factor of a dsitribution of spheres of radius R for q

`pySAXS.LS.LSsca.` `P1dist`(q, Dfunc, par)

  This function returns the form factor of a dsitribution of spheres of radius R for q

`pySAXS.LS.LSsca.` `P2`(q, R1, R2)

  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)

  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)

  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)

  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)

`pySAXS.LS.LSsca.` `P5_int`(q, R, e)

`pySAXS.LS.LSsca.` `P5conc`(q, R, e, rho)

  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)

  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)

  return the scalar product of two vetors

`pySAXS.LS.LSsca.` `PV`(u, v)

  return the vector orthogonal to u and v

`pySAXS.LS.LSsca.` `Pcyl`(q, R, L)

  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)

  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)

  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)

  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)

`pySAXS.LS.LSsca.` `Pcylcreuxqcq`(q, Ri, L, alp, b, x0, delt)

  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)

  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)

  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)

  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)

`pySAXS.LS.LSsca.` `PdqHexacoq`(q, Ri, Ro, L, N)

`pySAXS.LS.LSsca.` `Pdqhexa`(q, a, N)

`pySAXS.LS.LSsca.` `Pdqocta`(q, a, N)

`pySAXS.LS.LSsca.` `Pdqpoly`(q1, FacePoly, sign, N)

`pySAXS.LS.LSsca.` `Pdqtetra`(q, a, N)

`pySAXS.LS.LSsca.` `PolyGauss_ana_Norm`(q, par)

  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)

`pySAXS.LS.LSsca.` `Porod`(q, B)

  Porod function q**-4*B*1e-32

`pySAXS.LS.LSsca.` `Ppara`(q, a, b, c)

  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)

`pySAXS.LS.LSsca.` `Qlogspace`(qmin, qmax, np)

  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)

`pySAXS.LS.LSsca.` `SHexa`(R, L)

`pySAXS.LS.LSsca.` `SS`(f, p)

  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)

`pySAXS.LS.LSsca.` `SqSticky`(q, R, eta, tao)

  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)

`pySAXS.LS.LSsca.` `TFS`(Sommets, a, b, qx, qy)

  returns the ff of polygon for a matrix qx,qy

`pySAXS.LS.LSsca.` `TFSpi`(Sommets, a, b, qx, qy)

  returns the ff of polygon for a matrix qx,qy

`pySAXS.LS.LSsca.` `TFSs`(Sommets, a, b, qx, qy)

  returns the ff of polygon for a scalar qx qy

`pySAXS.LS.LSsca.` `Tetra1_Multiplet`(b)

  b is the distance between spheres

`pySAXS.LS.LSsca.` `Tetra2_Multiplet`(c)

  c is the distance between the core and the satellites

`pySAXS.LS.LSsca.` `Tetra_Multiplet`(a)

  semble suspect

`pySAXS.LS.LSsca.` `Tetraedre`(a)

  returns the 3D coordinates of the 4 summits of a tetraedreof side length a

`pySAXS.LS.LSsca.` `Triedre`(a, L)

  return the 3D coordinates of the 6 submits of a triedre

`pySAXS.LS.LSsca.` `Triplet_Multiplet`(a)

`pySAXS.LS.LSsca.` `VHexa`(R, L)

`pySAXS.LS.LSsca.` `Vcyl`(R, L)

`pySAXS.LS.LSsca.` `Vcylcreuxcan`(a, Ri, Ro, L)

`pySAXS.LS.LSsca.` `Vcylcreuxqcq`(Ri, L, alp, b, x0, delt)

`pySAXS.LS.LSsca.` `amplitude_multiplet`(q, L, rho, R)

`pySAXS.LS.LSsca.` `angle`(teta, phi)

`pySAXS.LS.LSsca.` `dPcylb`(qi, R, L, al)

`pySAXS.LS.LSsca.` `dPcylh`(qi, R, L, al)

  Subfunction of Pcylh

`pySAXS.LS.LSsca.` `dPpara`(q, a, b, c, beta)

  Side function of Ppara

`pySAXS.LS.LSsca.` `ddPcylh`(qi, R, al)

  Sub-sub-function of dPcylh

`pySAXS.LS.LSsca.` `distance`(A, B)

`pySAXS.LS.LSsca.` `f`(x, y)

`pySAXS.LS.LSsca.` `fP11_int`(x, q, R, L)

`pySAXS.LS.LSsca.` `fP5_conc_int`(x, q, R, e, rho)

`pySAXS.LS.LSsca.` `fP5_int`(x, q, R, e)

`pySAXS.LS.LSsca.` `fPolySphere_int`(R, q, Dfunc, Arg)

`pySAXS.LS.LSsca.` `fcan`(x, y, z)

`pySAXS.LS.LSsca.` `fcanb`(x, y, z)

`pySAXS.LS.LSsca.` `getRmoydist`(R, D)

  This function returns the form factor of a dsitribution of spheres of radius R for q

`pySAXS.LS.LSsca.` `getV`(R)

  This function returns a the volume of a sphere with radius r

`pySAXS.LS.LSsca.` `getVelli`(R, e)

  This function returns a the volume of a sphere with radius r

`pySAXS.LS.LSsca.` `pente`(Sommets)

`pySAXS.LS.LSsca.` `qvectors`(q, teta, phi)

`pySAXS.LS.LSsca.` `qvectorspi`(q, teta, phi)

## `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)

`pySAXS.LS.LSusaxs.` `CalTransmission`(mu_p, rho_p, mu_S, rho_S, phim_p, rho_soln, t)

  Calculates the transmission value for given sample parameters—

`pySAXS.LS.LSusaxs.` `FitGauss`(q, I, n, a0, a1, a2, tol=1e-15, it=2000)

`pySAXS.LS.LSusaxs.` `GoodnessOfFit`(xexp, yexp, fmodel, par)

  This calculates the goodness of a fit

`pySAXS.LS.LSusaxs.` `InterpolateForCommonvalue`(qexp, Iexp, qrock, Irock)

`pySAXS.LS.LSusaxs.` `Qscalemod`(dq, q, step)

`pySAXS.LS.LSusaxs.` `QtoTheta`(q, wavelength)

`pySAXS.LS.LSusaxs.` `ThetatoQ`(Theta, wavelength)

`pySAXS.LS.LSusaxs.` `TrCorrectedProf`(qexp, Iexp, qrock, Irock, thickness, central_area, T)

  Transmission corrected profile

`pySAXS.LS.LSusaxs.` `TransmissionValue`(nsamp, nrock)

  calculate transmission : nsamp/nrock

`pySAXS.LS.LSusaxs.` `USAXS_count_convolute`(q, Iabs, N0dX, thick, wavelength)

  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)

`pySAXS.LS.LSusaxs.` `calculate_res_func_USAXS`(filename, c, step, boun)

  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)

`pySAXS.LS.LSusaxs.` `interpolate_res_func`(x, resx=None, resy=None)

  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)

  Deconvolution subroutine based on Lake method

`pySAXS.LS.LSusaxs.` `porod`(par, q)

`pySAXS.LS.LSusaxs.` `read_res_function`()

  read the resolution function from the specified filename

`pySAXS.LS.LSusaxs.` `residuals`(par, y, x)

`pySAXS.LS.LSusaxs.` `select`(q, I, n)

  Selects the q,I for n points around the maximum

`pySAXS.LS.LSusaxs.` `smooth`(y, ns)

`pySAXS.LS.LSusaxs.` `somme`(q, I)

  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)

  > - 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`()

    calculate background

  `calculDeltaOmega`()

    calculate DeltaOmega

  `calculTotalFlux`()

    calculate Flux

  `calculTransm`()

    calculate Transmission

  `calculate_All`()

    calculate all the function defined in paramsDesc

  `calculate_i`(n, b=None, deviation=None, bdeviation=None)

    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)

    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`()

    calculate q by pix in A-1 from parameters (RAP)

  `load`(file_name)
  `order`()

    return a list with dictionnary key ordered

  `printTXT`(txt='', par='')
  `save`(file_name)
  `save_printable`(file_name)

## `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)

  Radial Average Parameters -

  `calculBack`()

    calculate background

  `calculDeltaOmega`()

    calculate DeltaOmega

  `calculTotalFlux`()

    calculate Flux

  `calculTransm`()

    calculate Transmission

  `calculate_All`()

    calculate all the functions defined

  `calculate_i`(n, b=None, deviation=None, bdeviation=None)

    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)

    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`()

    calculate q by pix in A-1 from parameters (RAP)

  `eval_function`(formula)

    return the evaluated value

  `get`(variable)

    return the value of the specified variable

  `getFromXML`(xmlElement)

    get parameters from xml element

  `goodCalculation`()

    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)

    let us to import a old parameter file

  `load`(file_name)

    load from a pickle (binary) file

  `openXML`(filename)

    read from a xml file

  `order`()

    return a list with dictionnary key ordered

  `printTXT`(txt='', par='')
  `save`(file_name)

    save in a pickle (binary) file

  `saveXML`(filename)

    save in a xml file

  `save_printable`(file_name)

    save in a txt file

  `set`(variable, value)

    change the value of the specified variable

  `xml`()

    return an xml object

  `xmlString`()

    return a xml string

class `pySAXS.LS.SAXSparametersXML.` `parameter`(name, value=None, description='', order=-1, formula=None, datatype=None, parent=None)

  class for parameters

  `eval`()

    if self.evaluationFunction<>None: self.value=self.evaluationFunction() return self.value

  `get`()

    return the value of the parameter

  `getfromXML`(xmlElement)

    initialization given by xml element

  `set`(value)

    set the value of the parameter

  `xml`()

    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`()

  This function returns a big table with all NIST xray absorption data. For practical script it is not useful!

`pySAXS.LS.absorption.` `getAtomsSymbole`(S)

  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)

  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)

  return the electron density and the scattering length density

`pySAXS.LS.absorption.` `getElectronNumber`(S)

`pySAXS.LS.absorption.` `getMasseFormula`(S, NRJ=8.028, ISEN=1)

  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)

  This function returns the molar mass of the atom with name S (ie ‘Carbon’ , ‘Gold’)

`pySAXS.LS.absorption.` `getMasseSymbole`(S)

  This function returns the molar mass of the atom with symble S (ie ‘C’ fo carbon, ‘Au’ for gold)

`pySAXS.LS.absorption.` `getMasseZ`(Z)

  This function returns the molar mass of the atom with atomic number Z

`pySAXS.LS.absorption.` `getMuFormula`(S, NRJ=8.028, ISEN=1)

  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)

  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)

  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)

  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)

  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')

  return the KA LINE (most used) energy in ANGSTROM from the x-ray source >>> getAngstFromSource(‘Cu’) 1.5418904085842968

`pySAXS.LS.absorptionXRL.` `getAtomsFormula`(S)

  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)

  return the electron density and the scattering length density

`pySAXS.LS.absorptionXRL.` `getElectronNumber`(S)

`pySAXS.LS.absorptionXRL.` `getEnergyFromSource`(source='Cu')

  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)

  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)

  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)

  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)

  returns the molar mass (atomic weight) of the atomic number Z

`pySAXS.LS.absorptionXRL.` `getMuFormula`(S, energy=8.028)

  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)

  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)

  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)

  return Mu from Atomic number Z >>> getMuZ(4) 0.8719998598098755

`pySAXS.LS.absorptionXRL.` `getNameZ`(Z)

  return the name from a Z >>> getNameZ(29) ‘Copper’

`pySAXS.LS.absorptionXRL.` `getTransmission`(formula, thickness=1.0, density=1.0, energy=8.03)

  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)

  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)

  class for calculation of invariant from data in i(q)

  `calculate`(radius=None, qmin=None, qmax=None, extrapolation=None)

    calculate invariant and particle volume

  `calculateI0`()

    calculate I0 I0 = Istar * exp(qmini ** 2 * radius ** 2 / 3.0) Istar is interpolation at qmin

  `getInvariant`()

    return the calculate value use calculate() function before

  `getVolume`()

    return the calculate volume for a particule use calculate() function before

  `printTXT`(txt='', par='')

    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`
  - 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)
  `Set_ROI`(xmin, ymin, xmax, ymax)
  `calculate_q_by_pix`()

    calculate q by pix in A-1 from parameters (RAP)

  `load`(file_name)
  `mask_add`(polygon)

    ajoute un masque dans la liste des masques

  `mask_delete_all`()

    efface la liste des masques

  `mask_remove`(i)

    retire de la liste des masques l’element i

  `save`(file_name)
  `save_printable`(file_name)

`pySAXS.LS.rap.` `Rad_Read`(filename)

  Open the averaged data from a rgr file return qraw,q,iraw,i,n

`pySAXS.LS.rap.` `Rad_Save`(p, q, n, iq, filename)

  Save the averaged data in a rgr file wich can be opened by MS excel

`pySAXS.LS.rap.` `calculate_q`(q, par)

  calculate q in A-1 from parameters (RAP)

### Navigation

- index
- modules |
- next |
- previous |
- pySAXS 77.September2012 documentation »
- pySAXS »
- pySAXS Package »