cansas1d documentation: Difference between revisions
m (→overview) |
(moved items from working group page to documentation) |
||
Line 1: | Line 1: | ||
= Disclaimer = | |||
This description is meant to inform the community how to layout | This description is meant to inform the community how to layout | ||
Line 7: | Line 7: | ||
of the standard. | of the standard. | ||
= General Layout of the XML Data = | |||
== overview == | |||
[[Image:cansas1d-v1-1-SASroot.png|thumb|block diagram at SASroot level]] | [[Image:cansas1d-v1-1-SASroot.png|thumb|block diagram at SASroot level]] | ||
Line 26: | Line 26: | ||
on the [[cansas1d_definition_of_terms]] page. | on the [[cansas1d_definition_of_terms]] page. | ||
===block diagrams=== | === block diagrams === | ||
There are block diagrams available to describe the standard: | There are block diagrams available to describe the standard: | ||
*[[media:cansas1d-v1-1-SASroot.png | SASroot]] | *[[media:cansas1d-v1-1-SASroot.png | SASroot]] | ||
Line 42: | Line 42: | ||
* [[media:cansas1d-v1-9-full.png | full block diagram]] | * [[media:cansas1d-v1-9-full.png | full block diagram]] | ||
=== required XML file header === | |||
===required XML file header=== | |||
<pre> | <pre> | ||
<?xml version="1.0"?> | <?xml version="1.0"?> | ||
Line 54: | Line 53: | ||
</pre> | </pre> | ||
===alternative XML file header (referencing a stylesheet)=== | === alternative XML file header (referencing a stylesheet) === | ||
<pre> | <pre> | ||
<?xml version="1.0"?> | <?xml version="1.0"?> | ||
Line 66: | Line 65: | ||
</pre> | </pre> | ||
===XML layout for multiple experiments=== | === XML layout for multiple experiments === | ||
Each experiment is described with a single '''SASentry''' element. | Each experiment is described with a single '''SASentry''' element. | ||
Line 90: | Line 89: | ||
</pre> | </pre> | ||
== Rules == | |||
==Rules== | |||
[[Image:Q-geometry.jpg|thumb|definition of Q geometry for small-angle scattering]] | [[Image:Q-geometry.jpg|thumb|definition of Q geometry for small-angle scattering]] | ||
Line 101: | Line 95: | ||
[[Image:Translation-orientation-geometry-2.jpg|thumb|definition of translation and orientation geometry]] | [[Image:Translation-orientation-geometry-2.jpg|thumb|definition of translation and orientation geometry]] | ||
# canSAS1d/1.0 XML data files will adhere to the standard if they can successfully [[cansas1d_documentation#Validation_of_XML_against_the_Schema | validate]] against the established XML Schema ([http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xsd http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xsd]) | |||
# Q=(4 π / λ) sin(θ) <br> where λ is the wavelength of the radiation and 2θ is the angle through which the detected radiation has been scattered. | # Q=(4 π / λ) sin(θ) <br> where λ is the wavelength of the radiation and 2θ is the angle through which the detected radiation has been scattered. | ||
# units to be given in standard SI abbreviations (eg, m, cm, mm, nm, K) with the following exceptions: | # units to be given in standard SI abbreviations (eg, m, cm, mm, nm, K) with the following exceptions: | ||
Line 111: | Line 106: | ||
##none=no units are relevant (such as dimensionless) | ##none=no units are relevant (such as dimensionless) | ||
# where reciprocal units need to be quoted the format shall be "1/abbreviation" | # where reciprocal units need to be quoted the format shall be "1/abbreviation" | ||
# axes: | # axes: | ||
##z is along the flight path (positive value in the direction of the detector) | ##z is along the flight path (positive value in the direction of the detector) | ||
Line 120: | Line 114: | ||
##pitch is about x | ##pitch is about x | ||
##yaw is about y | ##yaw is about y | ||
# Unicode characters MUST NOT be used | |||
# Binary data is not supported | |||
Note: translation and orientation geometry used by canSAS are consistent with: | Note: translation and orientation geometry used by canSAS are consistent with: | ||
Line 128: | Line 124: | ||
#http://webhost5.nts.jhu.edu/reza/book/kinematics/kinematics.htm | #http://webhost5.nts.jhu.edu/reza/book/kinematics/kinematics.htm | ||
==Validation of XML against the Schema | = Documentation and Definitions = | ||
* '''Documentation''': [[cansas1d_documentation]] | |||
* '''Definitions''': [[cansas1d_definition_of_terms]] | |||
* '''Block diagrams''': [[cansas1d_documentation#block_diagrams]] | |||
== XML Schema == | |||
* '''XML Schema''': defines the rules for the XML file format ([http://svn.smallangles.net/trac/canSAS/browser/1dwg/trunk/cansas1d.xsd TRAC], [http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xsd SVN]) | |||
* [[xsd-documentation.xsl | XSL stylesheet]] (used to extract information shown on the [[cansas1d_definition_of_terms | Schema documentation page]]) | |||
== XML Stylesheets == | |||
Stylesheets could be used to strip out the metadata or to convert into another file format. No examples have yet been described here. | |||
== Examples and Case Studies == | |||
* [[cansas1d.xml | basic example]]: Note that, for clarity, only one row of data is shown. This is probably a very good example to use as a starting point for creating XML files with a text editor. | |||
* [[bimodal-test1.xml]]: Simulated SAS data to test size distribution calculation routines. | |||
* [[cansas1d_casestudy_collagen | dry chick collagen]]: illustrates the minimum information necessary to meet the requirements of the standard format | |||
* [[cansas1d_casestudy_af1410 | AF1410 steel]]: SANS study using magnetic contrast variation (with multiple samples and multiple data sets for each sample) | |||
* [[cansas1d-template.xml]]: This is used to test all the rules in the XML Schema. This is probably not av very good example to use as a starting point for creating XML files with a text editor since it tests many of the special-case rules. | |||
== Support tools for Visualization & Analysis software == | |||
=== IgorPro === | |||
An import/export tool for [http://www.wavemetrics.com/ IgorPro] has been created | |||
([http://svn.smallangles.net/trac/canSAS/browser/1dwg/trunk/IgorPro/cansasXML.ipf cansasXML.ipf]). | |||
You can check out the <nowiki>IgorPro</nowiki> working directory from the SVN server (see below). | |||
As of 2008-03-14, | |||
* test suite of XML files developed | |||
* the support can import the XML files into IgorPro | |||
* Development of a GUI (to support the [http://usaxs.xor.aps.anl.gov/staff/ilavsky/irena.html Irena] package) has begun | |||
* Development to add export capabilities (from IgorPro) back to the cansas1d/1.0 format has begun | |||
== Software respoitories == | |||
* '''TRAC''': [http://svn.smallangles.net/trac/canSAS http://svn.smallangles.net/trac/canSAS] | |||
* '''Subversion''': [http://svn.smallangles.net/svn/canSAS/1dwg http://svn.smallangles.net/svn/canSAS/1dwg] | |||
= Validation of XML against the Schema = | |||
# open browser to: http://www.xmlvalidation.com/ | # open browser to: http://www.xmlvalidation.com/ | ||
# paste content of candidate XML file (with reference in the header to the XML Schema as shown above) into the form | # paste content of candidate XML file (with reference in the header to the XML Schema as shown above) into the form |
Revision as of 17:37, 14 March 2008
Disclaimer
This description is meant to inform the community how to layout the information within the XML files. However, should the information in this document and the canSAS 1D SAS XML Schema differ, the XML Schema will be deemed to have the most correct description of the standard.
General Layout of the XML Data
overview
After an XML header, the root element of the file is SASroot which contains one or more SASentry elements, each of which describes a single experiment (data set, time-slice, step in a series, new sample, etc.). Details of the SASentry element are also shown in the next figure. Refer to the block diagram at SASroot level for an alternative depiction. See cansas1d.xml for an example XML file. Examples and Case Studies and other background information are available on the canSAS 1D Data Formats Working Group page and its discussion page. Details about each specific field (XPath string, XML elements and attributes) are described on the cansas1d_definition_of_terms page.
block diagrams
There are block diagrams available to describe the standard:
- SASroot
- SASentry (data set, time-slice, step in a series, new sample, etc.)
- Title (for this particular SASentry)
- Run (run number or ID number of experiment)
- SASdata (this is where the reduced 1-D SAS data is stored)
- SASsample
- SASinstrument
- SASprocess (for each processing or analysis step)
- SASnote (anything at all)
- SASentry (data set, time-slice, step in a series, new sample, etc.)
- full block diagram
required XML file header
<?xml version="1.0"?> <SASroot version="1.0" xmlns="http://www.smallangles.net/cansas1d" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.smallangles.net/cansas1d/ http://www.smallangles.net/cansas1d/1.0/cansas1d.xsd" >
alternative XML file header (referencing a stylesheet)
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="example.xsl" ?> <SASroot version="1.0" xmlns="http://www.smallangles.net/cansas1d" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.smallangles.net/cansas1d/ http://www.smallangles.net/cansas1d/1.0/cansas1d.xsd" >
XML layout for multiple experiments
Each experiment is described with a single SASentry element. The brief example below shows how multiple experiments can be included in a single XML file. (For the sake of brevity, the data for each experiment has been omitted from the example below.)
<?xml version="1.0"?> <SASroot version="1.0" xmlns="http://www.smallangles.net/cansas1d" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.smallangles.net/cansas1d/ http://www.smallangles.net/cansas1d/1.0/cansas1d.xsd" > <SASentry name="071121.dat#S22"> <!-- contents of the first experiment in the file go here --> </SASentry> <SASentry name="name attribute is optional"> <!-- any number of additional experiments can be included, as desired --> </SASentry> </SASroot>
Rules
- canSAS1d/1.0 XML data files will adhere to the standard if they can successfully validate against the established XML Schema (http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xsd)
- Q=(4 π / λ) sin(θ)
where λ is the wavelength of the radiation and 2θ is the angle through which the detected radiation has been scattered. - units to be given in standard SI abbreviations (eg, m, cm, mm, nm, K) with the following exceptions:
- um=micrometres
- C=celsius
- A=Angstroms
- percent=%.
- fraction
- a.u.=arbitrary units
- none=no units are relevant (such as dimensionless)
- where reciprocal units need to be quoted the format shall be "1/abbreviation"
- axes:
- z is along the flight path (positive value in the direction of the detector)
- x is orthogonal to z in the horizontal plane (positive values increase to the right when viewed towards the incoming radiation)
- y is orthogonal to z and x in the vertical plane (positive values increase upwards)
- orientation (angles):
- roll is about z
- pitch is about x
- yaw is about y
- Unicode characters MUST NOT be used
- Binary data is not supported
Note: translation and orientation geometry used by canSAS are consistent with:
- http://en.wikipedia.org/wiki/Cartesian_coordinate_system
- http://en.wikipedia.org/wiki/Right-hand_rule
- http://www.nexusformat.org/Coordinate_Systems
- http://mcstas.risoe.dk/documentation/tutorial/node6.html
- http://webhost5.nts.jhu.edu/reza/book/kinematics/kinematics.htm
Documentation and Definitions
- Documentation: cansas1d_documentation
- Definitions: cansas1d_definition_of_terms
- Block diagrams: cansas1d_documentation#block_diagrams
XML Schema
- XML Schema: defines the rules for the XML file format (TRAC, SVN)
- XSL stylesheet (used to extract information shown on the Schema documentation page)
XML Stylesheets
Stylesheets could be used to strip out the metadata or to convert into another file format. No examples have yet been described here.
Examples and Case Studies
- basic example: Note that, for clarity, only one row of data is shown. This is probably a very good example to use as a starting point for creating XML files with a text editor.
- bimodal-test1.xml: Simulated SAS data to test size distribution calculation routines.
- dry chick collagen: illustrates the minimum information necessary to meet the requirements of the standard format
- AF1410 steel: SANS study using magnetic contrast variation (with multiple samples and multiple data sets for each sample)
- cansas1d-template.xml: This is used to test all the rules in the XML Schema. This is probably not av very good example to use as a starting point for creating XML files with a text editor since it tests many of the special-case rules.
Support tools for Visualization & Analysis software
IgorPro
An import/export tool for IgorPro has been created (cansasXML.ipf). You can check out the IgorPro working directory from the SVN server (see below).
As of 2008-03-14,
- test suite of XML files developed
- the support can import the XML files into IgorPro
- Development of a GUI (to support the Irena package) has begun
- Development to add export capabilities (from IgorPro) back to the cansas1d/1.0 format has begun
Software respoitories
Validation of XML against the Schema
- open browser to: http://www.xmlvalidation.com/
- paste content of candidate XML file (with reference in the header to the XML Schema as shown above) into the form
- press <validate>
- paste content of cansas1d.xsd XSD file into form and press <continue validation>
- check the results