예제 #1
0
    def format_html(self, f=None, n_columns=6):
        if (f is None): f = sys.stdout
        title = "Gallery of direct-space asymmetric units"
        iucrcompcomm_jul2003 = web_links.iucrcompcomm_jul2003
        print(html_head_title(title=title), file=f)
        print("""\
<body>
<hr>
<h2>%(title)s</h2>
<hr>
References:
<ul>
<li><a href="http://scripts.iucr.org/cgi-bin/paper?pz5088" target="external"
    >Acta Cryst. (2011). A67, 269-275</a>
<p>
<li><a href="%(iucrcompcomm_jul2003)s" target="external"
    >IUCr Computing Commission Newsletter No. 2, July 2003</a>
</ul>
<hr>""" % vars(),
              file=f)
        plane_group_table().format_html(f, n_columns)
        for point_group in self.point_group_tables:
            point_group.format_html(f, n_columns)
        print("""\
<hr>
<a href="http://cctbx.sourceforge.net/">[cctbx home]</a>
</body>
</html>""",
              file=f)
예제 #2
0
def html_loader(jvx_file_name,
                title="JavaView",
                header=None,
                sub_header=None,
                index_html=None,
                prev_html=None,
                next_html=None,
                alternative_label=None,
                alternative_html=None,
                legend=None,
                f=None,
                jars_url=None):
  if (f is None): f = sys.stdout
  from cctbx.web.asu_gallery import html_head_title
  print(html_head_title(title=title), file=f)
  print('''\
<body>
''', file=f)
  if (header is not None):
    print('<h2>%s</h2>' % header, file=f)
  if (sub_header is not None):
    print('%s' % sub_header, file=f)
    print('<p>', file=f)
  print('''\
<APPLET alt="JavaView applet"
        archive="%(jars_url)s/javaview.jar,%(jars_url)s/jvx.jar"
        name="javaview"
        code="javaview.class"
        width="400"
        height="400">
  <PARAM NAME="Model" VALUE="%(jvx_file_name)s">
</APPLET>
<p>
''' % vars(), file=f)
  if (index_html is not None):
    bracketed_link("Index", index_html, f=f)
  if (prev_html is not None or next_html is not None):
    bracketed_link("Previous", prev_html, f=f)
    bracketed_link("Next", next_html, f=f)
  if (alternative_html is not None):
    bracketed_link(alternative_label, alternative_html, f=f)
  if (legend is not None):
    print('<p>', file=f)
    for line in legend:
      print(line, file=f)
  print('<hr>', file=f)
  print('''\
This visualisation is using
<a href="http://www.javaview.de">JavaView</a>.

</body>
</html>''', file=f)
예제 #3
0
def html_loader(jvx_file_name,
                title="JavaView",
                header=None,
                sub_header=None,
                index_html=None,
                prev_html=None,
                next_html=None,
                alternative_label=None,
                alternative_html=None,
                legend=None,
                f=None,
                jars_url=None):
  if (f is None): f = sys.stdout
  from cctbx.web.asu_gallery import html_head_title
  print >> f, html_head_title(title=title)
  print >> f, '''\
<body>
'''
  if (header is not None):
    print >> f, '<h2>%s</h2>' % header
  if (sub_header is not None):
    print >> f, '%s' % sub_header
    print >> f, '<p>'
  print >> f, '''\
<APPLET alt="JavaView applet"
        archive="%(jars_url)s/javaview.jar,%(jars_url)s/jvx.jar"
        name="javaview"
        code="javaview.class"
        width="400"
        height="400">
  <PARAM NAME="Model" VALUE="%(jvx_file_name)s">
</APPLET>
<p>
''' % vars()
  if (index_html is not None):
    bracketed_link("Index", index_html, f=f)
  if (prev_html is not None or next_html is not None):
    bracketed_link("Previous", prev_html, f=f)
    bracketed_link("Next", next_html, f=f)
  if (alternative_html is not None):
    bracketed_link(alternative_label, alternative_html, f=f)
  if (legend is not None):
    print >> f, '<p>'
    for line in legend:
      print >> f, line
  print >> f, '<hr>'
  print >> f, '''\
예제 #4
0
def write_html(f=None):
    if (f is None): f = sys.stdout
    iucrcompcomm_jul2003 = web_links.iucrcompcomm_jul2003
    title = "ASU Gallery - Guide to notation"
    print >> f, html_head_title(title=title)
    print >> f, """\
<body>

<hr>
<h1>%(title)s</h1>
<hr>
Reference:
<a href="%(iucrcompcomm_jul2003)s"
>IUCr Computing Commission Newsletter No. 2, July 2003</a>
<hr>

Each cut plane of an asymmetric unit is defined by a condition of
the form
<pre>
  h*x+k*y+l*z+c>=0
</pre>
<tt>h</tt>,<tt>k</tt>,<tt>l</tt> are Miller indices and define the
normal vector of the cut plane, <tt>c</tt> is a constant which determines
the distance from the origin. <tt>x</tt>,<tt>y</tt>,<tt>z</tt> are
fractional coordinates in direct space. The expression
<tt>h*x+k*y+l*z+c</tt> is

<ul>
<li>exactly zero for points in the cut plane.
<li>greater than zero for points inside the asymmetric unit.
<li>less than zero for points outside the asymmetric unit.
</ul>

If all points that are exactly in a cut plane are not inside the
asymmetric unit, the condition changes from <tt>h*x+k*y+l*z+c&gt;=0</tt>
to <tt>h*x+k*y+l*z+c&gt;0</tt>.

<p>

To enhance readability the asymmetric unit conditions (shown under the pictures
in the gallery) are simplified by omitting terms with zeros (e.g.
<tt>0*x</tt>) and unit factors (e.g. <tt>x</tt> instead of
<tt>1*x</tt>). The constant term <tt>c</tt> is moved to the right-hand
side. For example:

<pre>
  x>=0
  y<=1/4
  z<1
  x-y<=1/2
</pre>

A point <tt>x</tt>,<tt>y</tt>,<tt>z</tt> is inside the asymmetric unit
only if all conditions are simultaneously true.

<p>

Often a face or edge on the surface of the asymmetric unit is only partially
inside. The dividing lines are defined by face- or edge-specific
sub-conditions. For example:

<pre>
  y<=1/4 [z<=1/2]
</pre>

The first condition defines the face as before. The second condition
in square brackets only applies if <tt>y=1/4</tt>.
This notation is recursive. For example:

<pre>
  y<=1/4 [z<=1/2 [x<=1/4]]
</pre>

The third condition only applies if <tt>y=1/4</tt> and <tt>z=1/2</tt>.

<p>
Some asymmetric units require the combination of conditions with
the boolean operators <i>and</i> or <i>or</i>. For example:

<pre>
  y>=0 [x<=0 | x>=1/4]
  y<=1/4 [z>=1/8 & z<=5/8]
</pre>

In words:

<ul>
<li>If <tt>y</tt> is exactly zero, a point is inside the asymmetric
    unit only if <tt>x</tt> is less than or equal to zero or
    greater than or equal to <tt>1/4</tt>.
<li>If <tt>y</tt> is exactly <tt>1/4</tt>, a point is inside the
    asymmetric unit only if <tt>z</tt> is greater than or equal to
    <tt>1/8</tt> and at the same time less than or equal to <tt>5/8</tt>.
</ul>

The boolean operators may occur at any level in the recursive
hierarchy defined by nested square brackets. An example is the
asymmetric unit of <a href="asu_088.html">space group
I&nbsp;41/a&nbsp;(No.&nbsp;88)</a>.

<hr>
<a href="index.html">Gallery of direct-space asymmetric units</a>

<hr>
</body>
</html>""" % vars()
예제 #5
0
def write_html(f=None):
  if (f is None): f = sys.stdout
  iucrcompcomm_jul2003 = web_links.iucrcompcomm_jul2003
  title = "ASU Gallery - Guide to notation"
  print >> f, html_head_title(title=title)
  print >> f, """\
<body>

<hr>
<h1>%(title)s</h1>
<hr>
Reference:
<a href="%(iucrcompcomm_jul2003)s"
>IUCr Computing Commission Newsletter No. 2, July 2003</a>
<hr>

Each cut plane of an asymmetric unit is defined by a condition of
the form
<pre>
  h*x+k*y+l*z+c>=0
</pre>
<tt>h</tt>,<tt>k</tt>,<tt>l</tt> are Miller indices and define the
normal vector of the cut plane, <tt>c</tt> is a constant which determines
the distance from the origin. <tt>x</tt>,<tt>y</tt>,<tt>z</tt> are
fractional coordinates in direct space. The expression
<tt>h*x+k*y+l*z+c</tt> is

<ul>
<li>exactly zero for points in the cut plane.
<li>greater than zero for points inside the asymmetric unit.
<li>less than zero for points outside the asymmetric unit.
</ul>

If all points that are exactly in a cut plane are not inside the
asymmetric unit, the condition changes from <tt>h*x+k*y+l*z+c&gt;=0</tt>
to <tt>h*x+k*y+l*z+c&gt;0</tt>.

<p>

To enhance readability the asymmetric unit conditions (shown under the pictures
in the gallery) are simplified by omitting terms with zeros (e.g.
<tt>0*x</tt>) and unit factors (e.g. <tt>x</tt> instead of
<tt>1*x</tt>). The constant term <tt>c</tt> is moved to the right-hand
side. For example:

<pre>
  x>=0
  y<=1/4
  z<1
  x-y<=1/2
</pre>

A point <tt>x</tt>,<tt>y</tt>,<tt>z</tt> is inside the asymmetric unit
only if all conditions are simultaneously true.

<p>

Often a face or edge on the surface of the asymmetric unit is only partially
inside. The dividing lines are defined by face- or edge-specific
sub-conditions. For example:

<pre>
  y<=1/4 [z<=1/2]
</pre>

The first condition defines the face as before. The second condition
in square brackets only applies if <tt>y=1/4</tt>.
This notation is recursive. For example:

<pre>
  y<=1/4 [z<=1/2 [x<=1/4]]
</pre>

The third condition only applies if <tt>y=1/4</tt> and <tt>z=1/2</tt>.

<p>
Some asymmetric units require the combination of conditions with
the boolean operators <i>and</i> or <i>or</i>. For example:

<pre>
  y>=0 [x<=0 | x>=1/4]
  y<=1/4 [z>=1/8 & z<=5/8]
</pre>

In words:

<ul>
<li>If <tt>y</tt> is exactly zero, a point is inside the asymmetric
    unit only if <tt>x</tt> is less than or equal to zero or
    greater than or equal to <tt>1/4</tt>.
<li>If <tt>y</tt> is exactly <tt>1/4</tt>, a point is inside the
    asymmetric unit only if <tt>z</tt> is greater than or equal to
    <tt>1/8</tt> and at the same time less than or equal to <tt>5/8</tt>.
</ul>

The boolean operators may occur at any level in the recursive
hierarchy defined by nested square brackets. An example is the
asymmetric unit of <a href="asu_088.html">space group
I&nbsp;41/a&nbsp;(No.&nbsp;88)</a>.

<hr>
<a href="index.html">Gallery of direct-space asymmetric units</a>

<hr>
</body>
</html>""" % vars()