pyIBA.IDF#

class pyIBA.IDF(filepath='')#

If a file path is given, the information is loaded from an existing file (i.e. it calls load_file()). Otherwise, it creates a blank object (i.e. it call new_file()).

Args:

filepath (str, optional, default = ‘’): Path to the IDF file, if ‘’ the IDF object is blank

__init__(filepath='')#

Initializes an IDF object. If a file path is given, the information is loaded from an existing file. Otherwise, it creates a blank object.

Parameters:

filepath (str, optional, default = '') – Path to the IDF file, if ‘’ the IDF object is blank

Methods

__init__([filepath])

Initializes an IDF object.

append_simulation_entry(total_simulations[, ...])

Change the total number of simulation entries of spectrum = spectra_id.

append_spectrum_entry(total_spectra)

Change the total number of spectra.

change_node_value(value, parent, keyword[, ...])

Changes the value of the XML node.

copy()

create_element(parent, keyword)

Creates a XML node

create_tree(tree[, prefix])

Creates a tree of parents in the XML, starting from the 'sample' element.

create_tree_on_parent(tree, parent[, ...])

Creates a tree of parents in the XML, starting from the parent element.

delete_spectrum([spectra_id])

Deletes spectrum[spectra_id]

export_ndf_inputs([path_dir])

get_NDF_run_option(option_name[, ...])

get_PIXE_file([spectra_id])

get_SIMS_data([spectra_id])

get_SIMS_data_fit([spectra_id, simulation_id])

get_SIMS_particles(spectra_id)

get_all_spectra_filenames()

Gets the list with the names of all spectra

get_angles_fitparam([spectra_id, simulation_id])

get_beam_energy([spectra_id])

Gets the beam energy and the FWHM in keV

get_beam_energy_fit_result([spectra_id, ...])

get_beam_energy_fitparam([spectra_id, ...])

get_beam_energy_spread_fit_result([...])

get_beam_energy_spread_fitparam([...])

get_beam_particles([spectra_id])

Gets the beam particles of spectrum[spectra_id = 0]

get_charge([spectra_id])

Gets the charge of the experiment

get_charge_fit_result([spectra_id, ...])

get_charge_fitparam([spectra_id, simulation_id])

get_dataxy([spectra_id])

Gets the spectral data regarding spectrum[spectra_id].

get_dataxy_fit([spectra_id, simulation_id])

get_detector([spectra_id])

Gets the detector solid angle

get_detector_foil([spectra_id, simulation_id])

get_detector_solid_angle_fit_result([...])

get_detector_solid_angle_fitparam([...])

get_elemental_dataxy_fit([spectra_id, ...])

get_elements()

Gets the elements in the sample (see also self.set_elements())

get_elements_fit_result([spectra_id, ...])

get_elements_molecules_concentrations(...)

Deprecated, will be removed soon

get_energy_calibration([spectra_id, reaction_id])

Gets the energy calibration parameters.

get_energy_calibration_fit_result([...])

get_energy_calibration_fitparam([...])

get_exit_angle_fitparam([spectra_id, ...])

get_fit_results_entry([spectra_id, ...])

get_geo_parameters([spectra_id])

Gets the entire set of parameters in a dictionary with the following format.

get_geometry_type([spectra_id])

Gets the experiment geometry along with the angles.

get_idf_text()

get_incident_angle_fit_result([spectra_id, ...])

get_incident_angle_fitparam([spectra_id, ...])

get_max_concentration(molecule_entry)

Gets the maximum concentration from the XML molecule entry.

get_max_depth(molecule_entry)

Gets the maximum element depth from the XML molecule entry.

get_max_thickness()

Gets the maximum possible thickness of the sample

get_min_concentration(molecule_entry)

Gets the minimum concentration from the XML molecule entry.

get_min_depth(molecule_entry)

Gets the minimum element depth from the XML molecule entry.

get_min_thickness()

Gets the minimum possible thickness of the sample

get_model_adhoc_correction([spectra_id, ...])

get_model_doublescatter([spectra_id, ...])

get_model_energyloss([spectra_id, simulation_id])

get_model_pileup([spectra_id, simulation_id])

get_model_straggling([spectra_id, simulation_id])

get_nelements()

Ĝets the number of elements in the sample

get_nlayers()

Gets the number of layers of the sample

get_notes()

get_nspectra_in_simulation_group(...)

get_number_of_simulations([spectra_id])

Gets the total number of simulations in spectrum[spectra_id].

get_number_of_spectra()

Gets the total number of spectra in the IDF file.

get_profile()

Gets the depth profile of the sample.

get_profile_fit_result([spectra_id, ...])

get_reactions([spectra_id])

Gets the reaction list of spectrum[spectra_id]

get_rutherford_cross([spectra_id, simulation_id])

get_scattering_angle_fit_result([...])

get_scattering_angle_fitparam([spectra_id, ...])

get_section(parent, keyword[, ...])

For internal use

get_simulation([spectra_id, simulation_id])

Gets the XML entry regarding simulation[simulation_id] of spectrum[spectra_ID].

get_simulation_group([spectra_id, simulation_id])

get_spectrum([spectra_id])

Gets the XML entry regarding spectrum[spectra_ID].

get_spectrum_file_name([spectra_id])

Gets the name of the spectrum.

get_technique([spectra_id])

Gets the experimental technique of spectrum[spectra_id]

get_user()

Function to get the user's name from the IDF object.

get_window_max([spectra_id, simulation_id])

get_window_min([spectra_id, simulation_id])

load_file(filename)

Loads data from a IDF file into an IDF object.

load_pixe_data_from_file(file_name[, spectra_id])

new_file()

Creates a new IDF file.

print_idf_file([mode])

Prints the XML contents of the IDF file.

remove_nodes(parent, keyword)

Removes a XML node

remove_results_from_IDF([spectra_id])

remove_simulation_entry(spectra_id, ...)

Deletes simulation[spectra_id, simulation_id]

save_idf(filename)

Saves the IDF state into a file

set_NDF_run_option(option_name, option[, ...])

set_PIXE_data_fit_result(xray_lines, xray_area)

set_SIMS_calibration(calibration_dic[, ...])

set_SIMS_data(data_list[, spectra_id])

set_SIMS_data_fit(data_list[, spectra_id])

set_SIMS_from_file(file_name[, ...])

set_beam_energy(energy[, spectra_id])

Sets the beam energy

set_beam_energy_fit_result(energy[, ...])

set_beam_energy_fitparam(energy_change[, ...])

set_beam_energy_spread(fwhm[, spectra_id])

Sets the FWHM of the beam

set_beam_energy_spread_fit_result(FWHM[, ...])

set_beam_energy_spread_fitparam(fwhm_change)

set_beam_particles(particle[, spectra_id])

Sets the beam particle of spectrum[spectra_id = 0]

set_charge(charge[, spectra_id])

Sets the charge

set_charge_fit_result(charge[, spectra_id])

set_charge_fitparam(charge[, spectra_id, ...])

set_data_from_geo_file(geo_file[, ...])

set_data_from_prf_file(prf_file[, ...])

set_data_from_spc_file(spc_file)

set_data_from_str_file(str_file[, ...])

set_detector_foil(material, thickness[, ...])

set_detector_solid_angle(angle[, spectra_id])

Sets the detector solid angle

set_detector_solid_angle_fit_result(angle[, ...])

set_detector_solid_angle_fitparam(angle_change)

set_elemental_spectrum_data_fit_result(data)

set_elements(elements)

Sets the elements of the sample.

set_elements_fit_result(elements_dic[, ...])

set_elements_result([spectra_id])

set_energy_calibration(m, b[, append, ...])

Set energy calibration assuming a linear relation between energy and channels:

set_energy_calibration_file(file_path[, ...])

Adds an energy calibration file to IDF.

set_energy_calibration_fit_result(m, b[, ...])

set_energy_calibration_fitparam(m_change, ...)

set_exit_angle(angle[, spectra_id])

Sets the exit angle

set_exit_angle_fitparam(angle_change[, ...])

set_geo_parameters(params[, spectra_id])

Sets the entire set of parameters to IDF from a dictioanry params (see also get_geo_parameters())

set_geometry_result([spectra_id])

set_geometry_type(geometry_type[, spectra_id])

Sets the experiment geometry (IBM, Cornell, General)

set_incident_angle(angle[, spectra_id])

Sets the incident angle

set_incident_angle_fit_result(angle[, ...])

set_incident_angle_fitparam(angle_change[, ...])

set_max_thickness(value)

Sets the maximum possible thickness of the sample

set_min_thickness(value)

Sets the minimum thickness of the sample

set_model_adhoc_correction(element, parameters)

set_model_doublescatter(model, parameters[, ...])

set_model_energyloss(model[, spectra_id, ...])

set_model_pileup(model, parameters[, ...])

set_model_straggling(model, parameters[, ...])

set_models_from_geo_file(geo_file[, ...])

set_note(note[, append])

Sets a note related to the the IDF file.

set_profile(profile_dic)

Sets the depth profile of the sample.

set_profile_fit_result(profile_dic[, ...])

set_profile_result([spectra_id])

set_reactions(reactions_dic[, append, mode, ...])

Sets the reaction list associated with the chosen technique (see self.set_technique()).

set_reactions_list(reactions[, spectra_id])

Sets an entire list of reactions to the specified spectrum.

set_rutherford_cross(rutherford_bol, ...[, ...])

set_scattering_angle(angle[, spectra_id])

Sets the scattering angle

set_scattering_angle_fit_result(angle[, ...])

set_scattering_angle_fitparam(angle_change)

set_simulation_group(simulation_group[, ...])

set_spectra_result([spectra_id])

set_spectrum_data(data_x, data_y[, ...])

Sets the xx, yy data of spectrum[spectra_ID]

set_spectrum_data_fit_result(data_x, data_y)

set_spectrum_data_from_file(file_name[, ...])

Read the spectrum data from the file and sets it on the IDF file.

set_spectrum_file_name(file_name[, spectra_id])

Sets the name of the spectrum for identification proposes (e.g plot legends)

set_technique(technique[, spectra_id])

Sets the experimental technique of the spectrum[spectra_id]

set_user(user)

set_window_max(window_max[, spectra_id, ...])

set_window_min(window_min[, spectra_id, ...])

unify_geo_parameters([master_id, target_id])

Copies the geometry parameters from one spectrum (with index master_id) to all other spectra in the IDF file.

write_dataxy([name, mode, spectra_id, ...])

write_geo([spectra_id, path_dir])

write_prf([path_dir])

write_spc([path_dir])

write_str([path_dir])