Ignore:
Timestamp:
Oct 9, 2009 6:00:42 PM (11 years ago)
Author:
prjemian
Message:

manual is nearly complete for v1.0 release, still a few problems to resolve (table+figure, code examples), refs #19

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 1dwg/trunk/doc/src/cansas1d_casestudy_collagen.xml

    r138 r140  
    1717    <section> 
    1818        <title>Overview</title> 
     19        <indexterm significance="preferred"> 
     20            <primary>case study</primary> 
     21            <secondary>SAXS of dry chick collagen</secondary> 
     22        </indexterm> 
    1923        <para> To demonstrate how to get SAS data into the XML standard format, consider this set of 
    2024            SAXS data collected at the National Synchrotron Light Source, Brookhaven National 
     
    3438                                        <imagedata 
    3539                                            fileref="../../graphics/cs-collagen-data-table-Excel.jpg" 
    36                                             width="200pt" scalefit="1"/> 
     40                                            width="150pt" scalefit="1"/> 
    3741                                    </imageobject> 
    3842                                    <caption> 
     
    4650                                        <imagedata 
    4751                                            fileref="../../graphics/cs-collagen-saxs-chart-excel.jpg" 
    48                                             width="200pt" scalefit="1"/> 
     52                                            width="150pt" scalefit="1"/> 
    4953                                    </imageobject> 
    5054                                    <caption> 
     
    5862            </table> 
    5963        </para> 
    60         <para> The raw data was collected on a linear position-sensitive detector and reduced to 
     64        <para> The raw data  
     65            was collected on a linear position-sensitive detector and reduced to 
    6166            columns of <emphasis role="bold">Q</emphasis>, <emphasis role="bold">I</emphasis>, and 
    6267                <emphasis role="bold">Iesd</emphasis> (estimated standard deviation of <emphasis 
    6368                role="bold">I</emphasis>). </para> 
    6469        <para> The only metadata available for this data (without resorting to digging through piles 
    65             of old notebooks) was obtained from two file headers: </para> 
     70            of old notebooks) was obtained from two file headers:  
     71            <link 
     72                xlink:href="http://svn.smallangles.net/trac/canSAS/browser/1dwg/trunk/examples/collagen/COLLAGEN.ASC" 
     73                ><citetitle>collagen.asc</citetitle> 
     74            </link><footnote><para><link 
     75                xlink:href="http://svn.smallangles.net/trac/canSAS/browser/1dwg/trunk/examples/collagen/COLLAGEN.ASC" 
     76                ><literal>http://svn.smallangles.net/trac/canSAS/browser/1dwg/trunk/examples/collagen/COLLAGEN.ASC</literal> 
     77            </link></para></footnote> 
     78            and 
     79            <link 
     80                xlink:href="http://svn.smallangles.net/trac/canSAS/browser/1dwg/trunk/examples/collagen/collagen.saxs" 
     81                ><citetitle>collagen.saxs</citetitle> 
     82            </link><footnote><para><link 
     83                xlink:href="http://svn.smallangles.net/trac/canSAS/browser/1dwg/trunk/examples/collagen/collagen.saxs" 
     84                ><literal>http://svn.smallangles.net/trac/canSAS/browser/1dwg/trunk/examples/collagen/collagen.saxs</literal> 
     85            </link></para></footnote> 
     86            as shown. 
     87        </para> 
    6688        <para> 
    67             <link 
    68                 xlink:href="http://svn.smallangles.net/trac/canSAS/browser/1dwg/trunk/examples/collagen/COLLAGEN.ASC"> 
    69                 <citetitle>collagen.asc</citetitle> 
    70             </link> 
     89            <example> 
     90                <title>First few lines from file <citetitle>collagen.asc</citetitle></title> 
    7191            <programlisting>Sep 19 1994     01:41:02 am     Elt: 00090 Seconds  
    7292ID: No spectrum identifier defined 
    7393Memory Size: 8192 Chls  Conversion Gain: 1024  Adc Offset: 0000 Chls        </programlisting> 
    74         </para> 
    75         <para> 
    76             <link 
    77                 xlink:href="http://svn.smallangles.net/trac/canSAS/browser/1dwg/trunk/examples/collagen/collagen.saxs"> 
    78                 <citetitle>collagen.saxs</citetitle> 
    79             </link> 
    80             <programlisting>dry chick collagen, d = 673 A 
     94            </example> 
     95            <example> 
     96                <title>Full listing of file <citetitle>collagen.saxs</citetitle></title> 
     97                <programlisting>dry chick collagen, d = 673 A 
    81986531 eV, X6B</programlisting> 
    82         </para> 
    83         <para> But, the data can fulfill the minimum requirements of the 1D standard file format and 
    84             also make an excellent example of a minimal canSAS reduced 1-D SAS data file in XML. 
     99            </example> 
     100        </para> 
     101        <para> But, there is enough information to fulfill the minimum  
     102            requirements of the 1D standard file format and 
     103            also make an excellent example of a minimal  
     104            canSAS reduced 1-D SAS data file in XML. 
    85105        </para> 
    86106    </section> 
     
    90110            <title>make the basic XML file</title> 
    91111            <para> It is easiest to copy a template rather than start from an empty file. Copy the 
    92                     <link xlink:href="http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xml"> 
    93                     <citetitle>cansas1d.xml</citetitle> 
    94                 </link> file into your working directory and rename it to <emphasis role="bold" 
    95                     >collagen.xml</emphasis>. </para> 
     112                    <link xlink:href="http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xml" 
     113                        ><citetitle>cansas1d.xml</citetitle></link><footnote><para 
     114                            ><link xlink:href="http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xml"> 
     115                                <literal>http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xml</literal> 
     116                            </link></para></footnote>  
     117                file into your working directory and rename it to  
     118                <literal>collagen.xml</literal>. </para> 
    96119        </section> 
    97120        <section> 
    98121            <title>modify collagen.xml</title> 
    99122            <para> It is easier to see the metadata in the XML file before you enter the SAXS data 
    100                 into the file. With the brief metadata available, most lines can be eliminated. This 
    101                 will result in a file that looks like </para> 
    102             <programlisting>&lt;?xml version="1.0"?> 
    103 &lt;?xml-stylesheet type="text/xsl" href="example.xsl" ?> 
    104 &lt;SASroot version="1.0" 
    105     xmlns="cansas1d/1.0" 
    106     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    107     xsi:schemaLocation="cansas1d/1.0 http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xsd" 
    108     > 
    109     &lt;SASentry> 
    110     &lt;Title>dry chick collagen, d = 673 A, 6531 eV, X6B&lt;/Title> 
    111         &lt;Run /> 
    112         &lt;SASdata> 
    113             &lt;!-- Idata lines will go here --> 
    114         &lt;/SASdata> 
    115         &lt;SASsample> 
    116             &lt;ID>dry chick collagen, d = 673 A, 6531 eV, X6B&lt;/ID> 
    117         &lt;/SASsample> 
    118         &lt;SASinstrument> 
    119             &lt;name>X6B, NSLS, BNL&lt;/name> 
    120             &lt;SASsource> 
    121                 &lt;radiation>X-ray synchrotron&lt;/radiation> 
    122                 &lt;wavelength unit="A"> 
    123                     1.898 
    124                     &lt;!-- = 12398/6531 -->  
    125                 &lt;/wavelength> 
    126             &lt;/SASsource> 
    127             &lt;SAScollimation /> 
    128             &lt;SASdetector> 
    129                 &lt;name>X6B PSD&lt;/name> 
    130             &lt;/SASdetector> 
    131         &lt;/SASinstrument> 
    132         &lt;SASnote> 
    133             Sep 19 1994     01:41:02 am     Elt: 00090 Seconds  
    134             ID: No spectrum identifier defined 
    135             Memory Size: 8192 Chls  Conversion Gain: 1024  Adc Offset: 0000 Chls 
    136              
    137             dry chick collagen, d = 673 A 
    138             6531 eV, X6B 
    139         &lt;/SASnote> 
    140     &lt;/SASentry> 
    141 &lt;/SASroot></programlisting> 
     123                into the file. With the brief metadata available, most of the other  
     124                lines in <citetitle>cansas1d.xml</citetitle> can be eliminated. This 
     125                will result in a file that looks like the next example.</para> 
     126            <example> 
     127                <title><literal>collagen.xml</literal> with metadata but before data lines are added.</title> 
     128                <programlisting language="xml" linenumbering="numbered"> 
     129                    <textobject> 
     130                        <textdata fileref="example-collagen-predata.xml"/> 
     131                    </textobject> 
     132                </programlisting> 
     133            </example> 
    142134        </section> 
    143135        <section> 
     
    147139                develop a bit of Excel Macro code to clarify our procedure. </para> 
    148140            <section> 
    149                 <title>Excel macros used</title> 
    150                 <para> Within Excel, with the SAXS data in columns as shown in the Excel table 
     141                <title>Using Excel macros to reformat the SAXS data</title> 
     142                <para> Within Excel,  
     143                    <indexterm> 
     144                        <primary>binding</primary> 
     145                        <secondary>Microsoft Excel</secondary> 
     146                    </indexterm> 
     147                    with the SAXS data in columns as shown in the Excel table 
    151148                    above, let's define the macros for our use. In Excel, type <emphasis role="bold" 
    152149                        >&lt;alt>&lt;F11></emphasis> to open the macro editing window. </para> 
    153                 <programlisting>Function XML_tag(tag, attr, content) As String 
    154   If attr = "" Then 
    155     XML = "&lt;" &amp; tag &amp; ">" 
    156   Else 
    157   XML = "&lt;" &amp; tag &amp; " " &amp; attr &amp; ">" 
    158   End If 
    159   XML = XML &amp; content 
    160   XML = XML &amp; "&lt;/" &amp; tag &amp; ">" 
    161   XML_tag = XML 
    162 End Function 
    163  
    164 Function SAS_Idata_tag(element, unit, content) As String 
    165 XML = XML_tag(element, "unit=""" &amp; unit &amp; """", content) 
    166   SAS_Idata_tag = XML 
    167 End Function 
    168  
    169 Function Idata_tag(Q, Q_unit, I, I_unit, Idev, Idev_unit) As String 
    170   XML = SAS_Idata_tag("Q", Q_unit, Q) 
    171   XML = XML &amp; SAS_Idata_tag("I", I_unit, I) 
    172   XML = XML &amp; SAS_Idata_tag("Idev", Idev_unit, Idev) 
    173   Idata_tag = XML_tag("Idata", "", XML) 
    174 End Function</programlisting> 
    175                 <para> Your window will look similar to this one when you copy/paste the above code: 
    176                      (Yes, my spreadsheet is called MyFirstMacro.xls) </para> 
     150                <example> 
     151                    <title>Microsoft Excel macro to format the <literal>Idata</literal> lines.</title> 
     152                    <programlisting> 
     153                        <textobject> 
     154                            <textdata fileref="example-excel-macro.txt"/> 
     155                        </textobject> 
     156                    </programlisting> 
     157                </example> 
     158                <para> Your window will look similar to this one when you copy/paste the above example code: 
     159                    (Yes, my spreadsheet is called <citetitle>MyFirstMacro.xls</citetitle>) </para> 
    177160                <mediaobject> 
    178161                    <imageobject> 
     
    193176                <title>construct the Idata lines in XML</title> 
    194177                <para> move to spreadsheet cell <literal>E5</literal> and enter this 
    195                     formula <programlisting>=IDATA_tag(A5,$A$4,B5,$B$4,C5,$C$4)</programlisting> 
     178                    formula  
     179                    <informalexample> 
     180                        <programlisting>=IDATA_tag(A5,$A$4,B5,$B$4,C5,$C$4)</programlisting> 
     181                    </informalexample> 
    196182                </para> 
    197183                <para> Copy it down all rows in column <emphasis role="bold">E</emphasis> through 
Note: See TracChangeset for help on using the changeset viewer.