COMCIFS / Powder_Dictionary

CIF definitions for powder diffraction
4 stars 4 forks source link

Category keys and links for `PD_CHAR`, `PD_PREP`, and `PD_SPEC` #127

Closed rowlesmr closed 1 year ago

rowlesmr commented 1 year ago

Set in motion by #114

Added category keys for the Set categories PD_CHAR, PD_PREP, and PD_SPEC

Added linking keys to join PD_CHAR to PD_PREP and PD_PREP to PD_SPEC.

There is now:

to compliment the existing

Now you can have one material (PD_CHAR) making multiple samples (PD_PREP) and each sample making multiple specimens (PD_SPEC), and it should all link together.

rowlesmr commented 1 year ago

I don't know if this last commit is a good idea or not, but it adds _pd_prep.char_id as a category key to PD_PREP and _pd_spec.prep.id as a category key to PD_SPEC.

This results in _pd_char.id* being a fundamental-type in the id heirachy (along with phase, diffractogram, instr, and instr_detector id)

* rather than those mentioned and _pd_prep.id and _pd_spec.id.

jamesrhester commented 1 year ago

Making pd_prep.char_id a key allows you to identify a sample using the same _pd_prep.id identifier for different materials. That's a choice you can make if you want. So instead of:

loop_
_pd_prep.id
_pd_prep.char_id
_pd_prep.stuff
1 1 'stuff'
2 1 'stuff'
3 2 'stuff'
4 2 'stuff'

for 4 samples from 2 materials, you could do

loop_
_pd_prep.id
_pd_prep.char_id
_pd_prep.stuff
1 1 'stuff'
2 1 'stuff'
1 2 'stuff'
2 2 'stuff'

That's a perfectly valid choice to make, happy for this to be merged.

rowlesmr commented 1 year ago

I was thinking more along the lines of now I only need a properly unique char.id, and the prep and spec.ids can live inside that space, but yes.

loop_
_pd_char.id
_pd_char.thing
044c5d72-00bd-4ae6-9cd6-b42c4ea70d1a   'a material thing'

loop_
_pd_prep.id
_pd_prep.char_id
_pd_prep.stuff
1 044c5d72-00bd-4ae6-9cd6-b42c4ea70d1a 'stuff1'
2 044c5d72-00bd-4ae6-9cd6-b42c4ea70d1a 'stuff2'
3 044c5d72-00bd-4ae6-9cd6-b42c4ea70d1a 'stuff3'
4 044c5d72-00bd-4ae6-9cd6-b42c4ea70d1a 'stuff4'

loop_
_pd_spec.id
_pd_spec.prep_id
_pd_spec.stuff
a 1 'stuffa'
b 1 'stuffb'
c 2 'stuffc'
d 2 'stuffd'
e 3 'stuffe'
f 3 'stufff'
g 4 'stufgf'
h 4 'stuffh'