[NeXus-tech] [Fwd: Re: dimensions]
Peterson, Peter F. (pf9)
petersonpf at ornl.gov
Thu Feb 19 20:03:17 GMT 2009
Pete,
There are a couple of things that will make this easier. Leaving off the
indices that aren't being linked/specified (what you have as a ':' in the
example) would be clearer (I think). Otherwise we should come up with a
different tag/attribute that makes the meaning of the ':' clearer. The other
thing that will make dimensions clearer/cleaner is to get inheritance like
what Mark has suggested so the rank of the data is fixed. TOFRAW is hideous
because of these two issues. Are we nearing a stage where inheritance makes
sense.
P^2
On 2/19/09 2:53 PM, "Pete Jemian" <prjemian at gmail.com> wrote:
>
> perhaps:
> ---------------------------------% clip here
> %---------------------------------
> <field name="final_wavelength" type="NX_FLOAT" units="NX_LENGTH">
> <doc>Wavelength on leaving beamline component</doc>
> <dimensions size="1">
> <dim index="1">:</dim>
> </dimensions>
> </field>
> <field name="final_beam_divergence" type="NX_FLOAT" units="NX_ANGLE">
> <doc>Divergence FWHM of beam leaving this component</doc>
> <dimensions size="2"><!-- [2,:] -->
> <dim index="1">2</dim>
> <dim index="2">:</dim>
> </dimensions>
> </field>
> <field name="flux" type="NX_FLOAT" units="NX_FLUX">
> <doc>flux incident on beam plane area</doc>
> <dimensions size="1">
> <dim index="1">i</dim>
> </dimensions>
> </field>
> ---------------------------------% clip here
> %---------------------------------
>
>
>
> Pete Jemian wrote:
>> Regarding the definition of dimensions, so far, so good.
>> Now, here is part of (revised) NXbeam.nxdl.xml:
>>
>> ---------------------------------% clip here
>> %---------------------------------
>> <field name="final_wavelength_spread" type="NX_FLOAT" units="NX_LENGTH">
>> <doc>Wavelength spread FWHM of beam leaving this component</doc>
>> <dimensions size="[:]" />
>> </field>
>> <field name="final_beam_divergence" type="NX_FLOAT" units="NX_ANGLE">
>> <doc>Divergence FWHM of beam leaving this component</doc>
>> <dimensions size="2"><!-- [2,:] --></dimensions>
>> </field>
>> <field name="flux" type="NX_FLOAT" units="NX_FLUX">
>> <doc>flux incident on beam plane area</doc>
>> <dimensions size="i" />
>> </field>
>> ---------------------------------% clip here
>> %---------------------------------
>>
>> How do we handle this? (So far, it is valid by the changes in NXDL rules.)
>> Also, we need better documentation strings than given below.
>>
>>
>> (Here is just the revised part of nxdl.xsd):
>> ---------------------------------% clip here
>> %---------------------------------
>> <xs:complexType name="dimsType">
>> <!--
>> Here is a model:
>> <field name="data">
>> <dimensions size="3"/>
>> ...
>> </field><field name="time-of-flight">
>> <dimensions size="1">
>> <dim index="1" ref="data" refindex="3" incr="1"/>
>> </dimensions>
>> ...
>> </field>
>>
>> In old terms this would make data[i,j,k] and time-of-flight[k+1].
>> We need to get to the stage where people
>> don't need to read a manual to understand an existing NXDL.
>> -->
>> <xs:annotation>
>> <xs:documentation>dimensions of a data element in a NeXus
>> file</xs:documentation>
>> </xs:annotation>
>> <xs:sequence>
>> <xs:element name="dim" minOccurs="0" maxOccurs="unbounded">
>> <xs:complexType>
>> <xs:attribute name="index" type="nx:NX_CHAR">
>> <xs:annotation>
>> <xs:documentation>Number indicating which
>> subscript is being referenced,
>> ranging from 1 up to RANK (rank of the data
>> structure). For example,
>> given an array A[i,j,k], index="1" would refer
>> to the "i" subscript.</xs:documentation>
>> </xs:annotation>
>> </xs:attribute>
>> <xs:attribute name="ref" type="nx:NX_CHAR">
>> <xs:annotation>
>> <xs:documentation>Name of the data structure being
>> referenced
>> indirectly.</xs:documentation>
>> </xs:annotation>
>> </xs:attribute>
>> <xs:attribute name="refindex" type="nx:NX_CHAR">
>> <xs:annotation>
>> <xs:documentation>Index within the data structure
>> being
>> referenced indirectly.</xs:documentation>
>> </xs:annotation>
>> </xs:attribute>
>> <xs:attribute name="incr" type="nx:NX_CHAR">
>> <xs:annotation>
>> <xs:documentation>What is this?</xs:documentation>
>> </xs:annotation>
>> </xs:attribute>
>> </xs:complexType>
>> </xs:element>
>> </xs:sequence>
>> <xs:attribute name="size" type="nx:NX_CHAR">
>> <xs:annotation>
>> <xs:documentation>Rank (number of dimensions) of the data
>> structure.
>> For example: a[5] has size="1" while b[8,5,6,4] has
>> size="4".
>> See
>> http://en.wikipedia.org/wiki/Rank_(computer_programming)
>> for more details.</xs:documentation>
>> </xs:annotation>
>> </xs:attribute>
>> </xs:complexType>
>> ---------------------------------% clip here
>> %---------------------------------
>>
>> Pete
>>
>>
>>
>>
>>
More information about the NeXus-tech
mailing list