[ddlm-group] Add 'Encoded' data type to DDLm
- To: ddlm-group <ddlm-group@iucr.org>
- Subject: [ddlm-group] Add 'Encoded' data type to DDLm
- From: James Hester <jamesrhester@gmail.com>
- Date: Fri, 3 Apr 2020 18:12:07 +1100
Hello again,
Following on from the regular expression discussion I have been thinking about how to incorporate images into DDLm in a way that follows img_CIF tradition. I have therefore raised an issue at https://github.com/COMCIFS/cif_core/issues/174 , the text of which is reproduced here:
====
The img_CIF dictionary contains dataname _array_data.data
which is defined to be of binary
type in DDL2. binary
type has an associated regular expression which defines a special header for embedding binary into a CIF/CBF file. Non-machine-readable instructions are provided in the imgCIF dictionary on how to convert the contents to an array of integers.
imgCBF files are identical to CIF files except that they can include arbitrary non-ASCII bytes after the same header.
The processing of the compressed encoded data found within an _array_data.data
value is often quite intricate and not particularly enlightening from a scientific point of view (e.g. irrelevant to any other storage format), so I think is best left to libraries specialised for this work rather than rewritten in dREL. One way in which we can avoid writing decompression dREL is to create an 'Encoded' DDLm type which corresponds exactly to the 'binary' type in DDL2. Crucially, we also define a new built-in dREL function 'Decode', which turns a supplied binary or text stream into an array of integers. A small dREL fragment for new data name '_array_data.as_integers' would strip off the headers and provide the parameters for decoding based on the other img_CIF data names.
F +61 (02) 9717 3145
M +61 (04) 0249 4148
_______________________________________________ ddlm-group mailing list ddlm-group@iucr.org http://mailman.iucr.org/cgi-bin/mailman/listinfo/ddlm-group
Reply to: [list | sender only]
- Prev by Date: Re: [ddlm-group] Preparing CIF for multi-block datasets
- Next by Date: Re: [ddlm-group] Preparing CIF for multi-block datasets
- Prev by thread: Re: [ddlm-group] Making ddl2 <-> ddlm translation a reality
- Next by thread: [ddlm-group] Preparing CIF for multi-block datasets
- Index(es):