libcrystfel  0.10.1
Data Structures | Enumerations | Functions
geometry.h File Reference

Data Structures

struct  polarisation
 

Enumerations

enum  PartialityModel {
  PMODEL_UNITY,
  PMODEL_XSPHERE,
  PMODEL_OFFSET,
  PMODEL_RANDOM,
  PMODEL_GGPM
}
 
enum  gparam {
  GPARAM_ASX,
  GPARAM_ASY,
  GPARAM_ASZ,
  GPARAM_BSX,
  GPARAM_BSY,
  GPARAM_BSZ,
  GPARAM_CSX,
  GPARAM_CSY,
  GPARAM_CSZ,
  GPARAM_R,
  GPARAM_DIV,
  GPARAM_DETX,
  GPARAM_DETY,
  GPARAM_CLEN,
  GPARAM_OSF,
  GPARAM_BFAC,
  GPARAM_ANG1,
  GPARAM_ANG2,
  GPARAM_WAVELENGTH,
  GPARAM_EOL
}
 

Functions

RefListpredict_to_res (Crystal *cryst, double max_res)
 
void calculate_partialities (Crystal *cryst, PartialityModel pmodel)
 
double r_gradient (UnitCell *cell, int k, Reflection *refl, struct image *image)
 
void update_predictions (Crystal *cryst)
 
struct polarisation parse_polarisation (const char *text)
 
void polarisation_correction (RefList *list, UnitCell *cell, struct polarisation p)
 
double sphere_fraction (double rlow, double rhigh, double pr)
 
double gaussian_fraction (double rlow, double rhigh, double pr)
 
double x_gradient (int param, Reflection *refl, UnitCell *cell, struct detgeom_panel *p)
 
double y_gradient (int param, Reflection *refl, UnitCell *cell, struct detgeom_panel *p)
 

Detailed Description

Geometry of diffraction

This contains the prediction and partiality calculation functions.

Enumeration Type Documentation

◆ gparam

enum gparam

Enumeration of parameters which may want to be refined

◆ PartialityModel

A PartialityModel describes a geometrical model which can be used to calculate spot partialities and Lorentz correction factors.

Enumerator
PMODEL_UNITY 

Set all partialities and Lorentz factors to 1.

PMODEL_XSPHERE 

Flat sphere model with super-Gaussian spectrum

PMODEL_OFFSET 

Ewald offset model for monochromatic beam

PMODEL_RANDOM 

Randomly assigned partialities

PMODEL_GGPM 

Generalised gaussian prediction model

Function Documentation

◆ calculate_partialities()

void calculate_partialities ( Crystal cryst,
PartialityModel  pmodel 
)
Parameters
crystA Crystal
pmodelA PartialityModel

Calculates the partialities for the reflections in cryst, given the current crystal and image parameters. The crystal's image and reflection lists must be set. The specified PartialityModel will be used.

You must not have changed the crystal or image parameters since you last called predict_to_res or update_predictions, because this function relies on the limiting wavelength values calculated by those functions.

◆ predict_to_res()

RefList* predict_to_res ( Crystal cryst,
double  max_res 
)
Parameters
crystA Crystal
max_resMaximum resolution to predict to (m^-1)

Calculates reflection positions for crys, up to maximum 1/d value max_res

Returns
A list of predicted reflections

◆ update_predictions()

void update_predictions ( Crystal cryst)
Parameters
crystA Crystal

Updates the predicted reflections (positions and excitation errors, but not the actual partialities) of cryst's reflections according to the current state of the crystal (e.g. its unit cell parameters).

If you need to update the partialities as well, call calculate_partialities afterwards.