casinotools.fileformat.casino2 package

Submodules

casinotools.fileformat.casino2.Composition module

class casinotools.fileformat.casino2.Composition.Composition[source]

Bases: casinotools.fileformat.FileReaderWriterTools.FileReaderWriterTools

read(file)[source]
setAtomicFraction(fraction)[source]
setIndex(index)[source]
setWeightFraction(weightFraction)[source]
write(file)[source]

casinotools.fileformat.casino2.Element module

Element data from CASINO v2.

class casinotools.fileformat.casino2.Element.Element(number_xray_layers=500)[source]

Bases: casinotools.fileformat.FileReaderWriterTools.FileReaderWriterTools

getAtomicFraction()[source]
getAtomicNumber()[source]
getAtomicWeight_g_mol()[source]
getComposition()[source]
getDepthXrayDistribution()[source]

Return the depth x-ray distributions.

Note:Remove last value, because it is the accumulator for all out of range values.
getDepthXrayDistributionByLineType(line, line_type='Emitted')[source]

Return the depth x-ray distributions.

Note:Remove last value, because it is the accumulator for all out of range values.
getDepthXrayDistributionLayer(z0_nm, z1_nm)[source]

Return the depth x-ray distributions.

Note:Remove last value, because it is the accumulator for all out of range values.
getDepthXrayDistributionLayerByLineType(z0_nm, z1_nm, line, line_type='Emitted')[source]

Return the depth x-ray distributions.

Note:Remove last value, because it is the accumulator for all out of range values.
getMassDensity_g_cm3()[source]
getRadialXrayDistribution()[source]

Return the radial x-ray distributions.

Note:Remove last value, because it is the accumulator for all out of range values.
getRepetition()[source]
getSymbol()[source]
getTotalXrayIntensities()[source]
getTotalXrayIntensityByLineType(line, type='Emitted')[source]
getWeightFraction()[source]
get_total_xray_intensities_1_esr()[source]
read(file, number_xray_layers, version)[source]
setAtomicFraction(atomic_fraction)[source]
setElement(symbol, weight_fraction=1.0, index=0)[source]
setWeightFraction(weight_fraction)[source]
write(file, number_xray_layers)[source]
casinotools.fileformat.casino2.Element.NUATOM(symbol)[source]

Transcription du symbole atomique.

casinotools.fileformat.casino2.ElementIntensity module

class casinotools.fileformat.casino2.ElementIntensity.ElementIntensity[source]

Bases: casinotools.fileformat.FileReaderWriterTools.FileReaderWriterTools

read(file)[source]

casinotools.fileformat.casino2.File module

CASINO file structure: either sim or .cas.

class casinotools.fileformat.casino2.File.File[source]

Bases: casinotools.fileformat.FileReaderWriterTools.FileReaderWriterTools

extract_version(file_path)[source]
getNumberSimulations()[source]
getOptionSimulationData()[source]
getResultsFirstSimulation()[source]
getResultsSimulation(index)[source]
readFromFileObject(file, isSkipReadingData=False)[source]
readFromFilepath(filepath, isSkipReadingData=False)[source]

Read the casino either .sim or .cas file.

Parameters:filepath – complete filepath to read.
setOptionSimulationData(optionSimulationData)[source]
write(filepath)[source]
casinotools.fileformat.casino2.File.run_profile()[source]
casinotools.fileformat.casino2.File.run_profile2()[source]

casinotools.fileformat.casino2.GenerateSimFile module

class casinotools.fileformat.casino2.GenerateSimFile.GenerateSimFile(templateFilepath)[source]

Bases: object

addElements(symbols, weightFractions=None)[source]
getOptionSimulationData()[source]
save(filepath)[source]
setBeamAngle_deg(beamAngle_deg)[source]
setDirectionCosines(directionCosinesModel)[source]
setElectronElasticCrossSection(crossSectionModel)[source]
setIncidentEnergy_keV(energy_keV)[source]
setIonizationCrossSection(crossSectionModel)[source]
setIonizationPotential(model)[source]
setNumberElectrons(numberElectrons)[source]
setTOA_deg(toa_deg)[source]

casinotools.fileformat.casino2.GraphData module

class casinotools.fileformat.casino2.GraphData.GraphData(size=0, borneInf=0.0, borneSup=0.0, isLog=False, isUneven=False, title='', xTitle='', yTitle='', file=None)[source]

Bases: casinotools.fileformat.FileReaderWriterTools.FileReaderWriterTools

add(value)[source]
getPositions()[source]
getValues()[source]
index2pos(Index)[source]
read(file)[source]

casinotools.fileformat.casino2.MeanIonizationPotential module

class casinotools.fileformat.casino2.MeanIonizationPotential.MeanIonizationPotential(model=0)[source]

Bases: object

computeJ(atomicNumber)[source]

casinotools.fileformat.casino2.Region module

Region data from CASINO v2.

class casinotools.fileformat.casino2.Region.Region(number_xray_layers)[source]

Bases: casinotools.fileformat.FileReaderWriterTools.FileReaderWriterTools

addElement(symbol, weight_fraction=1.0, number_xray_layers=500)[source]
getElement(index)[source]
getElementBySymbol(symbol)[source]
getElements()[source]
getMeanAtomicNumber()[source]
getMeanMassDensity_g_cm3()[source]
getName()[source]
getNumberElements()[source]
getParameters()[source]
isUserMassDensity()[source]
read(file, version)[source]
removeAllElements()[source]
setElement(element_symbol, weight_fraction=1.0, number_xray_layers=500, index_element=0)[source]
setParameters(parameters)[source]
update()[source]
write(file)[source]

casinotools.fileformat.casino2.RegionOptions module

RegionOptions data from CASINO v2.

class casinotools.fileformat.casino2.RegionOptions.RegionOptions(number_xray_layers)[source]

Bases: casinotools.fileformat.FileReaderWriterTools.FileReaderWriterTools

getNumberRegions()[source]
getRegion(index)[source]
getRegions()[source]
read(file, version)[source]
setElement(element_symbol, index_region=0)[source]
setFilmThickness(thickness_nm)[source]
setFilmThicknessInSubstrate(layer_top_position_z_nm, thickness_nm)[source]
setThinFilmThickness(thickness_nm)[source]
write(file)[source]

casinotools.fileformat.casino2.ScatteringEvent module

class casinotools.fileformat.casino2.ScatteringEvent.ScatteringEvent[source]

Bases: casinotools.fileformat.FileReaderWriterTools.FileReaderWriterTools

getSkipOffset()[source]
read(file)[source]

casinotools.fileformat.casino2.SimulationData module

Read one simulation data from a CASINO v2 file.

class casinotools.fileformat.casino2.SimulationData.SimulationData(is_skip_reading_data=False)[source]

Bases: casinotools.fileformat.FileReaderWriterTools.FileReaderWriterTools

getRegionOptions()[source]
getSimulationOptions()[source]
getSimulationResults()[source]
getTotalXrayIntensities()[source]

Returns a dict with the intensities (generated and emitted) of all the lines and elements in the simulation. The dictionary is structured as followed: atomic number, line, EMITTED or GENERATED. The lines can either be LINE_K, LINE_L, LINE_M.

Return type:class:dict
getTrajectoriesData()[source]
getVersion()[source]
get_total_xray_intensities_1_esr()[source]

Returns a dict with the intensities (emitted) of all the lines and elements in the simulation in photon / (electron * steradian). The dictionary is structured as followed: atomic number, line. The lines can either be ATOMLINE_KA1, ATOMLINE_KA2, ATOMLINE_KB1, ATOMLINE_KB2, ATOMLINE_LA, ATOMLINE_LB1, ATOMLINE_LB2, ATOMLINE_LG, ATOMLINE_MA.

Return type:class:dict
read(file)[source]
setRegionsOptions(region_options)[source]
setSimulationOptions(simulation_options)[source]
write(file)[source]

casinotools.fileformat.casino2.SimulationOptions module

class casinotools.fileformat.casino2.SimulationOptions.SimulationOptions[source]

Bases: casinotools.fileformat.FileReaderWriterTools.FileReaderWriterTools

getBeamAngle_deg()[source]
getBseCoefficient()[source]
getDirectionCosines()[source]
getEnergyLossType()[source]
getIncidentEnergy_keV(index=None)[source]
getIonizationCrossSectionType()[source]
getIonizationPotentialType()[source]
getLinescanParameters()[source]
getMaximumDepth_nm()[source]
getMaximumLateralWidth()[source]
getNumberElectrons()[source]
getNumberXRayLayers()[source]
getPartialElectronElasticCrossSection()[source]
getRandomNumberGeneratorType()[source]
getTOA_deg()[source]
getTotalElectronElasticCrossSection()[source]
read(file, version)[source]
setBeamAngle_deg(beamAngle_deg)[source]
setDirectionCosines(directionCosinesModel)[source]
setElasticCrossSectionType(crossSectionModel)[source]
setEnergyLossType(type)[source]
setIncidentEnergy_keV(energy_keV)[source]
setIonizationCrossSectionType(type)[source]
setIonizationPotentialType(type)[source]
setLinescanParameters(start_nm, end_nm, step_nm)[source]

Sets the linescan parameters. If the beam is stationary, use setPosition() instead.

Note

The CASINO v2 code is very bad with naming variables. The POS_NStep is actually the step length and the POS_Step is not used. The correct variable are used in the read and write methods.

Parameters:
  • start_nm – start position (in nm)
  • end_nm – end position (in nm)
  • step_nm – step length (in nm)
setNumberElectrons(numberElectrons)[source]
setPartialElectronElasticCrossSection(crossSectionModel)[source]
setPosition(pos_nm)[source]

Sets the position of the beam.

Parameters:pos_nm – position of the beam (in nm)
setRandomNumberGeneratorType(type)[source]
setTOA_deg(toa_deg)[source]
setTotalElectronElasticCrossSection(crossSectionModel)[source]
setTotalThickness_nm(totalThickness_nm)[source]
write(file)[source]
casinotools.fileformat.casino2.SimulationOptions.getDirectionCosinesString(type)[source]
casinotools.fileformat.casino2.SimulationOptions.getElasticCrossSectionTypeString(type)[source]
casinotools.fileformat.casino2.SimulationOptions.getEnergyLossString(type)[source]
casinotools.fileformat.casino2.SimulationOptions.getIonizationCrossSectionTypeString(type)[source]
casinotools.fileformat.casino2.SimulationOptions.getIonizationPotentialTypeString(type)[source]
casinotools.fileformat.casino2.SimulationOptions.getRandomNumberGeneratorString(type)[source]

casinotools.fileformat.casino2.SimulationResults module

class casinotools.fileformat.casino2.SimulationResults.SimulationResults(isSkipReadingData=False)[source]

Bases: casinotools.fileformat.FileReaderWriterTools.FileReaderWriterTools

getBackscatteredAngleDistribution()[source]
getBackscatteredEnergyDistribution()[source]
getBackscatteredMaximumDepthDistribution()[source]
getBackscatteredMaximumDepthRange(fractionLimit=0.999)[source]
getEnergyAbsorbed_keV()[source]
getMaximumEnergyAbsorbed_keV()[source]
getNumberPointsEnergyAbsorbed()[source]
getNumberPointsEnergyAbsorbedX()[source]
getNumberPointsEnergyAbsorbedY()[source]
getNumberPointsEnergyAbsorbedZ()[source]
getSurfaceRadiusBseDistribution()[source]
getTransmittedEnergyDistribution()[source]
isBackscatteredAngleDistribution()[source]
isBackscatteredEnergyDistribution()[source]
isBackscatteredMaximumDepthDistribution()[source]
isSurfaceRadiusBseDistribution()[source]
isTransmittedEnergyDistribution()[source]
read(file, options, version)[source]

casinotools.fileformat.casino2.TrajectoriesData module

class casinotools.fileformat.casino2.TrajectoriesData.TrajectoriesData(isSkipReadingData=False)[source]

Bases: casinotools.fileformat.FileReaderWriterTools.FileReaderWriterTools

getTrajectories()[source]
read(file)[source]

casinotools.fileformat.casino2.Trajectory module

class casinotools.fileformat.casino2.Trajectory.Trajectory(isSkipReadingData=False)[source]

Bases: casinotools.fileformat.FileReaderWriterTools.FileReaderWriterTools

getScatteringEvents()[source]
isAbsorbed()[source]
isBackscattered()[source]
isTransmitted()[source]
read(file)[source]

casinotools.fileformat.casino2.Version module

Different versions of the CASINO program. Internal version taken from the CASINO C++ source code. External version taken from the CASINO C++ source code and file generated by different version of CASINO.

class casinotools.fileformat.casino2.Version.Version[source]

Bases: object

casinotools.fileformat.casino2.XrayRadial module

class casinotools.fileformat.casino2.XrayRadial.XrayRadial[source]

Bases: object

addData(label, value)[source]
getDataLabels()[source]
getDistances_nm()[source]
getElementSymbol()[source]
getIntensities()[source]
getIntensitiesAbsorbed()[source]
getLine()[source]
setElementSymbol(symbol)[source]
setLabels(labels)[source]
setLine(line)[source]

casinotools.fileformat.casino2.XrayRadialReader module

class casinotools.fileformat.casino2.XrayRadialReader.XrayRadialReader[source]

Bases: object

getData(elementSymbol, line)[source]
getDataLabels()[source]
readTextFile(filepath)[source]

casinotools.fileformat.casino2.test_Composition module

casinotools.fileformat.casino2.test_Element module

casinotools.fileformat.casino2.test_ElementIntensity module

casinotools.fileformat.casino2.test_File module

casinotools.fileformat.casino2.test_GenerateSimFile module

casinotools.fileformat.casino2.test_GraphData module

casinotools.fileformat.casino2.test_MeanIonizationPotential module

class casinotools.fileformat.casino2.test_MeanIonizationPotential.TestMeanIonizationPotential(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

testSkeleton()[source]
test_computeJ()[source]

casinotools.fileformat.casino2.test_Region module

casinotools.fileformat.casino2.test_RegionOptions module

casinotools.fileformat.casino2.test_ScatteringEvent module

casinotools.fileformat.casino2.test_SimulationData module

casinotools.fileformat.casino2.test_SimulationOptions module

casinotools.fileformat.casino2.test_SimulationResults module

casinotools.fileformat.casino2.test_TrajectoriesData module

casinotools.fileformat.casino2.test_Trajectory module

casinotools.fileformat.casino2.test_Version module

class casinotools.fileformat.casino2.test_Version.TestVersion(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

testSkeleton()[source]

casinotools.fileformat.casino2.test_XrayRadial module

class casinotools.fileformat.casino2.test_XrayRadial.TestXrayRadial(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

testSkeleton()[source]

casinotools.fileformat.casino2.test_XrayRadialReader module

casinotools.fileformat.casino2.tests module

Regression testing for the project.

Module contents