COMCIFS / Powder_Dictionary

CIF definitions for powder diffraction
4 stars 4 forks source link

Improve calibration metadata in pdCIF files #53

Closed rowlesmr closed 1 year ago

rowlesmr commented 1 year ago

Originating from https://github.com/COMCIFS/Powder_Dictionary/pull/46#issuecomment-1367387642

I think once this (in conjunctionwith #46) is fleshed out, it will deprecate PD_CALIB, PD_CALIB_STD, and potentially PD_CALIB_OFFSET

Intensity

PD_CALIB_INTENSITY is a Loop category for intensity scaling. Its Loop as you need to be able to loop over all detectors. It's keyed on _pd_calib_intensity.id and _pd_calib_intensity.detector_id.

The category consists of:

Wavelength

PD_CALIB_WAVELENGTH is a Loop category for denoting the reference material from which the wavelength was determined (see also _diffrn_radiation_wavelength_determination). Its Loop as you may have multiple phases and diffractograms used in the calibration. It's keyed on _pd_calib_wavelength.id.

The category consists of:

Angle / x-ordinate

But how do we deal with angle? There currently exists PD_CALIB_OFFSET, but this can only record a constant offset of 2Th; you can't record TOF, energy, position etc offsets, or offsets that vary with x-ordinate (eg specimen displacement)

PD_CALIB_ANGLE (is a horrible name, as it should also work for TOF, ED, ...) is a Loop category for for angle calibration. Its Loop as you need to be able to loop over all detectors. It's keyed on _pd_calib_angle.id and _pd_calib_angle.detector_id.

The category consists of:

rowlesmr commented 1 year ago

being addressed in #55

rowlesmr commented 1 year ago

OK, rereading PD_CALIB_OFFSET, and we can deal with non-constant offsets (eg specimen displacement) by enumerating a constand offset for every data point.

X-coordinate

But how do we deal with the x-coordinate? There currently exists PD_CALIB_OFFSET, but this can only record a constant offset of 2Th (need to loop for non-constant offsets), and you can't record TOF or position offsets.

PD_CALIB_XCOORD is a Loop category for for x-coordinate calibration. Its Loop as you need to be able to loop over all detectors, as well as looping to provide an offset to every data point. It's keyed on _pd_calib_angle.id and _pd_calib_angle.detector_id. Does _pd_calib_xcoord.point_id also need to be in there? It is able to record calibrations for 2theta, position, and TOF.

The category consists of these basic data items:

and these specific data items:

I haven't included the equivalent of _pd_calib.2theta_off_min/max in here. Should they be replicated for each x-coordinate?

Alternatively, have a different PD_CALIB_* for each 2theta, position, TOF, and channel num.

rowlesmr commented 1 year ago

Sort of related to angle calibrations is how to record specimen displacements.

  1. Do we need to?
  2. I think there are three displacements (units of mm): edit - reading back, even these definitions are inadequate...
    • Equatorial - Displacement perpendicular to the beam, in the plane of diffraction; ie specimen displacement in Bragg-Brentano
    • Lateral - Displacement parallel to the beam; ie increasing/decreasing the effective specimen-detector distance. You can get this with capillaries in Debye-Scherrer
    • Axial - Displacement perpendicular to the beam, and perpendicular to the plane of diffraction. (if equatorial is up/down, and lateral is left/right, axial is toward/away from you)
  3. These displacements also need to have specimen-detector distances recorded. I think that appropriate data items would be
    • _pd_instr.detector_circle_radius
    • _pd_instr.dist_spec_anal
    • _pd_instr.dist_spec_detc
    • _pd_instr.dist_spec_vdetc
  4. Where to put such displacements? I think PD_SPEC is the best place. I don't think the PD_INSTR is appropriate. PD_PROC_LS doesn't seem right, as although it is often a refined parameter, it does refer to a "real" thing. PD_SPEC is a Set category; do we need to be able to provide displacements per detector_id? if so, then we'd need to make something like PD_SPEC_DISPLACEMENT or PD_CALIB_DISPLACEMENT .
  5. Can we provide something like a _pd_spec.displacement_geometry to allow for the automated calculation of corrected 2theta values ? With an enumerated choice: "bragg-brentano", "debye-scherrer", "seeman-bohlin", ... , "other". Other would require _pd_calibration.conversion_eqn to be defined.

(I promise to stop thinking of things now... :))

rowlesmr commented 1 year ago

see also #91 #92 #93