irradiapy.recoilsdb module

This module contains the RecoilsDB class.

class irradiapy.recoilsdb.RecoilsDB(path)[source]

Bases: Database

SQLite3 database for SPECTRA-PKA to SRIM events, recoils and ions/vacancies.

create_tables()[source]

Create recoils and ions_vacs tables in the database.

Return type:

None

get_nevents()[source]

Get the number of events in the recoils database.

Returns:

Number of events.

Return type:

int

get_nrecoils()[source]

Get the number of recoils in the recoils database.

Returns:

Number of recoils.

Return type:

int

insert_ion_vac(event, atom_numb, x, y, z)[source]

Insert an ion or vacancy into the ions_vacs database.

Parameters:
  • event (int) – Original SPECTRA event index (1-based).

  • atom_numb (int) – Atomic number of the ion (0 for vacancy).

  • x (float) – x-position, in Angstrom.

  • y (float) – y-position in Angstrom.

  • z (float) – z-position in Angstrom.

Return type:

None

insert_recoil(event, atomic_number, recoil_energy, x, y, z, cosx, cosy, cosz)[source]

Insert a recoil into the recoils database.

Parameters:
  • event (int) – Original SPECTRA event index (1-based).

  • atomic_number (int) – Atomic number of the recoil.

  • recoil_energy (float) – Recoil energy in eV.

  • x (float) – x-position, in Angstrom.

  • y (float) – y-position in Angstrom.

  • z (float) – z-position in Angstrom.

  • cosx (float) – x-cosine velocity direction.

  • cosy (float) – y-cosine velocity direction.

  • cosz (float) – z-cosine velocity direction.

Return type:

None

load_target()[source]

Loads the target from the database.

Return type:

list[Component]

process_config_events(spectrapka_events_path, exclude_recoils=None)[source]

Transform SPECTRA-PKA config_event.pka file into a SQLite3 table.

Parameters:
  • spectrapka_events_path (Path) – Path to the SPECTRA-PKA config_event.pka file.

  • exclude_recoils (list[str] | None) – List of symbols of recoils atoms to exclude from processing.

Return type:

None

save_target(target)[source]

Saves the target components into the database.

Parameters:

target (list[Component]) – List of components representing the target material.

Return type:

None

target: list[Component]