COMCIFS / Powder_Dictionary

CIF definitions for powder diffraction
4 stars 4 forks source link

create PD_PHASE_LIST and PD_DIFFRACTOGRAM_LIST #86

Closed rowlesmr closed 1 year ago

rowlesmr commented 1 year ago

In this PR

Creation of two new Loop categories, PD_PHASE_LIST and PD_DIFFRACTOGRAM_LIST, to deal with cases when we need to loop _pd_phase.ids and _pd_diffractogram.ids. See also #74.

The behaviour is analagous to _pd_block.id with PD_PHASE_BLOCK or PD_BLOCK_DIFFRACTOGRAM.

_pd_phase_block.phase_id and _pd_block_diffractogram.diffractogram_id (which is where these ID values were previously able to be looped) have been removed to disconnect the different methodologies of linking with block pointers and the new way..

The structure is:

These two categories would allow for the looping of phase and diffractogram ids in data blocks where necessary, such as in a block containing a diffractogram with many phases.

In a future PR (or commit to this PR)

Further to the creation of these two categories, other categories that have _categoryname.phase_id and/or _categoryname.diffractogram_id should also have _categoryname.phase_list_id and/or _categoryname.diffractogram_list_id to be able reference a _pd_phase_list.id or _pd_diffractogram_list.id. This should allow for shorter arbitrary labels to be (re)used to refer to the long, unique phase/diffractogram_id (exactly analagous to the OG _pd_phase_id and _pd_refln.phase_id)

Something like:

data_DIFFPATT_1
_pd_diffractogram.id    DIFFPAT_1_LONG_UNIQUE_STRING

loop_
_pd_phase_list.id  
_pd_phase_list.phase_id
1   # the idea is that this value can repeat in different blocks
ALUMINA_A_BIG_LONG_STRING_THAT_IS_GLOBALLY_UNIQUE  # this must be unique at least in the data collection, preferablly in the entire world.
2  
SILICON_ANOTHER_STRING_THAT_IS_SUPPOSED_TO_BE_ALONE

loop_
_pd_phase_mass.phase_list_id
_pd_phase_mass.percent
1   72.11
2   27.89

loop_
_refln.index_h
_refln.index_k
_refln.index_l
_pd_refln.phase_list_id  # this would have _pd_refln_phase_id as an alias
_refln.d_spacing
0    0   12 1 1.082702
1    0  -14 1 0.905365
2    2    0 2 1.920168
3    1    1 2 1.637525
#...

 loop_
_pd_meas.2theta_scan
_pd_proc.intensity_total
_pd_calc.intensity_total
5.001    63.364    35.994
5.004    78.007    36.200
5.007    78.318    36.404
#...

Question

If I want to be able to reuse the same _pd_phase_list.id value in different blocks to refer to different (or even the same) phases, does there need to be some key based on the block?

rowlesmr commented 1 year ago

I don't think this is workable in it's current incarnation.