glassure.calc module

glassure.calc.calculate_pdf(data_config: DataConfig, calculation_config: CalculationConfig) Result

Process the input configuration and return the result.

glassure.calc.create_calculate_pdf_configs(data: Pattern, composition: dict[str, float] | dict[str, int] | str, density: float, bkg: Pattern | None = None, bkg_scaling: float = 1) tuple[DataConfig, CalculationConfig]

Helper function to create a starting glassure input configuration. Automatically sets the q_min and q_max values to the first and last x-value of the data pattern - thus, the whole pattern gets transformed, when using this configuration.

These two inputs can then be used with the calculate_pdf function in the calc module to calculate the structure factor S(q), the pair distribution function F(r) and the pair correlation function g(r).

Parameters:
  • data – The data pattern.

  • composition – The composition of the sample.

  • density – The density of the sample in g/cm^3.

  • bkg – The background pattern. None if no background is present.

  • bkg_scaling – The scaling factor for the background pattern.

Returns:

DataConfig, CalculationConfig

glassure.calc.validate_input(data_config: DataConfig, calculation_config: CalculationConfig)

Validate the input configuration.