COMCIFS / Powder_Dictionary

CIF definitions for powder diffraction
4 stars 4 forks source link

Improve calibration metadata in pdCIF files #55

Closed rowlesmr closed 1 year ago

rowlesmr commented 1 year ago

Originally from #46, then a new issue in #53, now a PR.

This initial commit creates PD_CALIB_INTENSITY

rowlesmr commented 1 year ago

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:

rowlesmr commented 1 year ago

Create PD_CALIB_WAVELENGTH

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:

rowlesmr commented 1 year ago

X-coordinate

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/many calibration points. It's keyed on _pd_calib_xcoord.id and _pd_calib_xcoord.detector_id. It is able to record calibrations for 2theta, position, and TOF. The enumeration default of _pd_calib_xcoord.id = _pd_calib_xcoord.point_id

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?

jamesrhester commented 1 year ago

I'm working through in my head how these categories might be applied to our bespoke setup on the CW neutron Echidna powder diffractometer. As a refresher, Echidna has 128 He3 tube detectors that each scan 1.25 degrees. The detectors are vertically position sensitive, so that we obtain a 2D map after scanning has finished.

Meanwhile, these would benefit from being split into 3 PR requests, one for each type of calibration, as they involve radically different processes. Not sure how easy that is to do.

Wavelength

We collect a standard as usual for most powder instruments, so no particular issues here.

Intensity

We scan the diffraction of a solid V cylinder, which produces a flood field. The inverse of the resulting 2D map is multiplied by the raw data. This is the process covered by _array_intensities.gain from imgCIF. Any area detectors on instruments will also have this type of gain correction applied, so I think we need to be more specific about when to use the intensity calibration described above and when to use imgCIF. I think the conclusion is that these data names apply only where the raw data consist of a single value per x coordinate for both the calibration measurement and data measurement.

X-coord

This is quite complicated for us so if this could be a separate PR that would be great.

rowlesmr commented 1 year ago

I'm working through in my head how these categories might be applied to our bespoke setup on the CW neutron Echidna powder diffractometer.

That's how I try and do everything.

I can split these out into three PRs: wavelength, intensity, and x-coord.

I think the conclusion is that these data names apply only where the raw data consist of a single value per x coordinate for both the calibration measurement and data measurement.

That argument is sound for me; if you've got area data, use an area format. If it's linear, then you can use pdCIF categories. Maybe this can be expanded to the definition of the PD_DATA intensity-type data items.

.

The reasoning behind this (large!) change was to try and consolidate what each calibration category was doing. PD_CALIB was recording the relative sensitivity of each detector id, as well as the internal standard mass percentage for QPA. PD_CALIB_STD refers to an external standard used for either (or both) intensity or angular calibrations. PD_CALIB_OFFSET records offsets in 2Th only. PD_CALIBRATION is a human-readable equation to convert from detector_id/pd_meas.position to 2th/q/E, which I haven't touched (apart from formalising how to convert from d to TOF).

rowlesmr commented 1 year ago

Discussion to carry on in #91 #92 #93