You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(29) |
Dec
(24) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(72) |
Feb
(119) |
Mar
(103) |
Apr
(197) |
May
(116) |
Jun
(30) |
Jul
(21) |
Aug
(112) |
Sep
(94) |
Oct
(233) |
Nov
(160) |
Dec
(78) |
2008 |
Jan
(87) |
Feb
(228) |
Mar
(272) |
Apr
(94) |
May
(145) |
Jun
(172) |
Jul
(159) |
Aug
(100) |
Sep
(97) |
Oct
(122) |
Nov
(125) |
Dec
(93) |
2009 |
Jan
(136) |
Feb
(198) |
Mar
(267) |
Apr
(108) |
May
(81) |
Jun
(74) |
Jul
(85) |
Aug
(38) |
Sep
(26) |
Oct
(34) |
Nov
(73) |
Dec
(42) |
2010 |
Jan
(14) |
Feb
(23) |
Mar
(13) |
Apr
(23) |
May
(30) |
Jun
(7) |
Jul
(14) |
Aug
(5) |
Sep
(14) |
Oct
(10) |
Nov
(2) |
Dec
(20) |
2011 |
Jan
(43) |
Feb
(20) |
Mar
(16) |
Apr
(24) |
May
(7) |
Jun
(6) |
Jul
(10) |
Aug
|
Sep
(7) |
Oct
(3) |
Nov
(39) |
Dec
(22) |
2012 |
Jan
(2) |
Feb
(4) |
Mar
(22) |
Apr
(23) |
May
|
Jun
(2) |
Jul
(11) |
Aug
(17) |
Sep
(5) |
Oct
(3) |
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(4) |
Mar
(58) |
Apr
(18) |
May
(1) |
Jun
(4) |
Jul
|
Aug
(1) |
Sep
(4) |
Oct
(1) |
Nov
|
Dec
(3) |
2014 |
Jan
(3) |
Feb
|
Mar
(6) |
Apr
(3) |
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
(10) |
Oct
(2) |
Nov
(8) |
Dec
(3) |
2015 |
Jan
|
Feb
|
Mar
(6) |
Apr
(18) |
May
(6) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
(9) |
Dec
(2) |
2016 |
Jan
(2) |
Feb
(2) |
Mar
(7) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(7) |
2017 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <and...@us...> - 2006-11-22 21:35:47
|
Revision: 428 http://svn.sourceforge.net/fable/?rev=428&view=rev Author: andy_gotz Date: 2006-11-22 13:35:47 -0800 (Wed, 22 Nov 2006) Log Message: ----------- removed unused imports Modified Paths: -------------- gui/trunk/fable.beamline.rcp/src/fable/beamline/rcp/EurothermAction.java This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpw...@us...> - 2006-11-22 21:27:40
|
Revision: 427 http://svn.sourceforge.net/fable/?rev=427&view=rev Author: jpwright Date: 2006-11-22 13:21:18 -0800 (Wed, 22 Nov 2006) Log Message: ----------- Update docs - trying to prepare incremental release Modified Paths: -------------- ImageD11/trunk/ImageD11/doc/ImageD11.blobcorrector.html ImageD11/trunk/ImageD11/doc/ImageD11.connectedpixels.html ImageD11/trunk/ImageD11/doc/ImageD11.hist.html ImageD11/trunk/ImageD11/doc/ImageD11.html ImageD11/trunk/ImageD11/doc/ImageD11.license.html ImageD11/trunk/ImageD11/doc/ImageD11.opendata.html ImageD11/trunk/ImageD11/doc/ImageD11.parameters.html ImageD11/trunk/ImageD11/doc/ImageD11.plot3d.html ImageD11/trunk/ImageD11/doc/ImageD11.refinegrains.html ImageD11/trunk/ImageD11/doc/ImageD11.transform.html ImageD11/trunk/ImageD11/doc/ImageD11.unitcell.html ImageD11/trunk/ImageD11/doc/makedocs.py Added Paths: ----------- ImageD11/trunk/ImageD11/doc/ImageD11.scale.html ImageD11/trunk/ImageD11/doc/index.html Modified: ImageD11/trunk/ImageD11/doc/ImageD11.blobcorrector.html =================================================================== --- ImageD11/trunk/ImageD11/doc/ImageD11.blobcorrector.html 2006-11-22 21:06:49 UTC (rev 426) +++ ImageD11/trunk/ImageD11/doc/ImageD11.blobcorrector.html 2006-11-22 21:21:18 UTC (rev 427) @@ -33,6 +33,7 @@ <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> <td width="100%"><dl> <dt><font face="helvetica, arial"><a href="ImageD11.blobcorrector.html#correctorclass">correctorclass</a> +</font></dt><dt><font face="helvetica, arial"><a href="ImageD11.blobcorrector.html#perfect">perfect</a> </font></dt></dl> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> @@ -44,7 +45,7 @@ <td colspan=2><tt>Applies a spatial distortion to a peak position using a fit2d splinefile<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> -<dl><dt><a name="correctorclass-__init__"><strong>__init__</strong></a>(self, splinefile)</dt><dd><tt>Argument is the name of a fit2d spline file</tt></dd></dl> +<dl><dt><a name="correctorclass-__init__"><strong>__init__</strong></a>(self, splinefile, orientation<font color="#909090">='edf'</font>)</dt><dd><tt>Argument is the name of a fit2d spline file</tt></dd></dl> <dl><dt><a name="correctorclass-correct"><strong>correct</strong></a>(self, x, y)</dt><dd><tt>Transform x,y in raw image coordinates into x,y of an<br> idealised image. Returns a tuple (x,y), expects a<br> @@ -55,6 +56,14 @@ <br> Iterative algorithm...</tt></dd></dl> +<dl><dt><a name="correctorclass-make_pixel_lut"><strong>make_pixel_lut</strong></a>(self, dims)</dt><dd><tt>Generate an x and y image which maps the array indices into<br> +floating point array indices (to be corrected for pixel size later)<br> + <br> +returns (FIXME - get them the right way around!)</tt></dd></dl> + +<dl><dt><a name="correctorclass-make_pos_lut"><strong>make_pos_lut</strong></a>(self, dims)</dt><dd><tt>Generate a look up table of pixel positions in microns<br> +returns ...</tt></dd></dl> + <dl><dt><a name="correctorclass-readfit2dfloats"><strong>readfit2dfloats</strong></a>(self, fp, n, debug<font color="#909090">=0</font>)</dt><dd><tt>Interprets a 5E14.7 formatted fortran line</tt></dd></dl> <dl><dt><a name="correctorclass-readfit2dspline"><strong>readfit2dspline</strong></a>(self, name)</dt><dd><tt>Reads a fit2d spline file into a scipy/fitpack tuple, tck<br> @@ -63,6 +72,26 @@ <dl><dt><a name="correctorclass-test"><strong>test</strong></a>(self, x, y)</dt><dd><tt>Checks that the correct and distort functions are indeed<br> inversely related to each other</tt></dd></dl> +</td></tr></table> <p> +<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> +<tr bgcolor="#ffc8d8"> +<td colspan=3 valign=bottom> <br> +<font color="#000000" face="helvetica, arial"><a name="perfect">class <strong>perfect</strong></a></font></td></tr> + +<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> +<td colspan=2><tt>To use on previously corrected images<br> </tt></td></tr> +<tr><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="perfect-correct"><strong>correct</strong></a>(x, y)</dt></dl> + +<hr> +Data and other attributes defined here:<br> +<dl><dt><strong>splinefile</strong> = 'NO_CORRECTION_APPLIED'</dl> + +<dl><dt><strong>xsize</strong> = 'UNKNOWN'</dl> + +<dl><dt><strong>ysize</strong> = 'UNKNOWN'</dl> + </td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#eeaa77"> Modified: ImageD11/trunk/ImageD11/doc/ImageD11.connectedpixels.html =================================================================== --- ImageD11/trunk/ImageD11/doc/ImageD11.connectedpixels.html 2006-11-22 21:06:49 UTC (rev 426) +++ ImageD11/trunk/ImageD11/doc/ImageD11.connectedpixels.html 2006-11-22 21:21:18 UTC (rev 427) @@ -9,7 +9,7 @@ <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="ImageD11.html"><font color="#ffffff">ImageD11</font></a>.connectedpixels</strong></big></big></font></td ><td align=right valign=bottom ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///C|/python24/lib/site-packages/imaged11/connectedpixels.pyd">c:\python24\lib\site-packages\imaged11\connectedpixels.pyd</a></font></td></tr></table> - <p></p> + <p><tt>C extensions for image analysis, part of ImageD11</tt></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#eeaa77"> @@ -17,8 +17,44 @@ <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr> <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> -<td width="100%"><dl><dt><a name="-blobproperties"><strong>blobproperties</strong></a>(...)</dt><dd><tt>Computes various properties of a blob image (created by connectedpixels)</tt></dd></dl> - <dl><dt><a name="-connectedpixels"><strong>connectedpixels</strong></a>(...)</dt><dd><tt>Assign connected pixels in image (first arg) above threshold (float second arg) to return image of peak number.Optional arguement verbose!=0 prints some info as it runs</tt></dd></dl> - <dl><dt><a name="-roisum"><strong>roisum</strong></a>(...)</dt><dd><tt>Computes average in roi</tt></dd></dl> +<td width="100%"><dl><dt><a name="-bloboverlaps"><strong>bloboverlaps</strong></a>(...)</dt><dd><tt>res = bloboverlaps ( Numeric.array(blob1, 2D, Int), n1 , <br> + Numeric.array(blob2, 2D, Int), n2 , verbose=0) <br> + <br> +returns a disjoint set making the overlaps between blob1 and blob2 <br> +res[0->n1] = peaks in image 1 <br> +res[n2->n2+n1+1] = peaks in image 2</tt></dd></dl> + <dl><dt><a name="-blobproperties"><strong>blobproperties</strong></a>(...)</dt><dd><tt>res = blobproperties ( Numeric.array(data, 2D) , <br> + Numeric.array(blob, 2D, Int) ,<br> + Int np , <br> + Int verbose )<br> + <br> +Computes various properties of a blob image (created by connectedpixels)<br> +data = image data <br> +blob = integer peak assignments from connectedpixels <br> +np = number of peaks to treat <br> +verbose - flag about whether to print<br> + <br> +res = tuple (npix , sum , sumsq , com0 , com1 , com00 , com01 , com11 ) <br> +...where fval = intensity in pixel and sum over pixels in blob of<br> + anpix[peak] =anpix[peak] + 1 ; // # of pixels<br> + asum[peak] =asum[peak] + fval; // total intensity<br> + asumsq[peak] =asumsq[peak] +fval*fval; // total intensity^2<br> + acom0[peak] =acom0[peak] + i*fval; // etc<br> + acom1[peak] =acom1[peak] + j*fval;<br> + acom00[peak] =acom00[peak] + i*i*fval;<br> + acom01[peak] =acom01[peak] + i*j*fval;<br> + acom11[peak] =acom11[peak] + j*j*fval;</tt></dd></dl> + <dl><dt><a name="-connectedpixels"><strong>connectedpixels</strong></a>(...)</dt><dd><tt>nblobs = connectedpixels ( Numeric.array(data, 2D) , <br> + Numeric.array(blob, 2D, Int) ,<br> + float threshold ,<br> + Int verbose )<br> +data is normally an image <br> +blob is an array to receive pixel -> blob assignments<br> +threshold is the value above which a pixel is considered to be in a blob<br> +verbose flags printing on stdout</tt></dd></dl> + <dl><dt><a name="-roisum"><strong>roisum</strong></a>(...)</dt><dd><tt>(float) roisum ( Numeric.array(2D), xl , xh , yl , yh , verbose=0 ) <br> +sum( array[xl:xh , yl:yh] ) where x,y refer to SLOW/FAST indices <br> +... NOT Numeric indices, but slow/fast <br> +Unsure why this was written - can be done with Numeric anyway</tt></dd></dl> </td></tr></table> </body></html> \ No newline at end of file Modified: ImageD11/trunk/ImageD11/doc/ImageD11.hist.html =================================================================== --- ImageD11/trunk/ImageD11/doc/ImageD11.hist.html 2006-11-22 21:06:49 UTC (rev 426) +++ ImageD11/trunk/ImageD11/doc/ImageD11.hist.html 2006-11-22 21:21:18 UTC (rev 427) @@ -33,5 +33,6 @@ <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> <td width="100%"><dl><dt><a name="-hist"><strong>hist</strong></a>(data, verbose<font color="#909090">=0</font>)</dt><dd><tt>Wrapper to ImageD11 histogram generators (c functions)<br> returns histogram if data is a 2D Numeric.UInt16 array</tt></dd></dl> + <dl><dt><a name="-test_dvhist"><strong>test_dvhist</strong></a>()</dt></dl> </td></tr></table> </body></html> \ No newline at end of file Modified: ImageD11/trunk/ImageD11/doc/ImageD11.html =================================================================== --- ImageD11/trunk/ImageD11/doc/ImageD11.html 2006-11-22 21:06:49 UTC (rev 426) +++ ImageD11/trunk/ImageD11/doc/ImageD11.html 2006-11-22 21:21:18 UTC (rev 427) @@ -42,6 +42,7 @@ <a href="ImageD11.data.html">data</a><br> <a href="ImageD11.factors.html">factors</a><br> <a href="ImageD11.findreflections.html">findreflections</a><br> +<a href="ImageD11.fitgrainxy.html">fitgrainxy</a><br> </td><td width="25%" valign=top><a href="ImageD11.grain.html">grain</a><br> <a href="ImageD11.guicommand.html">guicommand</a><br> <a href="ImageD11.guifactors.html">guifactors</a><br> @@ -51,8 +52,8 @@ <a href="ImageD11.guitransformer.html">guitransformer</a><br> <a href="ImageD11.hist.html">hist</a><br> <a href="ImageD11.indexing.html">indexing</a><br> -</td><td width="25%" valign=top><a href="ImageD11.license.html">license</a><br> -<a href="ImageD11.listdialog.html">listdialog</a><br> +<a href="ImageD11.license.html">license</a><br> +</td><td width="25%" valign=top><a href="ImageD11.listdialog.html">listdialog</a><br> <a href="ImageD11.oldstuff.html"><strong>oldstuff</strong> (package)</a><br> <a href="ImageD11.opendata.html">opendata</a><br> <a href="ImageD11.parameters.html">parameters</a><br> @@ -60,10 +61,12 @@ <a href="ImageD11.peakmerge_old.html">peakmerge_old</a><br> <a href="ImageD11.plot3d.html">plot3d</a><br> <a href="ImageD11.rebin2d.html">rebin2d</a><br> -</td><td width="25%" valign=top><a href="ImageD11.refinegrains.html">refinegrains</a><br> -<a href="ImageD11.simplex.html">simplex</a><br> +<a href="ImageD11.refinegrains.html">refinegrains</a><br> +<a href="ImageD11.scale.html">scale</a><br> +</td><td width="25%" valign=top><a href="ImageD11.simplex.html">simplex</a><br> <a href="ImageD11.test_transform.html">test_transform</a><br> <a href="ImageD11.transform.html">transform</a><br> +<a href="ImageD11.twod2threed.html">twod2threed</a><br> <a href="ImageD11.twodplot.html">twodplot</a><br> <a href="ImageD11.ubitool.html">ubitool</a><br> <a href="ImageD11.unitcell.html">unitcell</a><br> Modified: ImageD11/trunk/ImageD11/doc/ImageD11.license.html =================================================================== --- ImageD11/trunk/ImageD11/doc/ImageD11.license.html 2006-11-22 21:06:49 UTC (rev 426) +++ ImageD11/trunk/ImageD11/doc/ImageD11.license.html 2006-11-22 21:21:18 UTC (rev 427) @@ -17,5 +17,5 @@ <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> -<td width="100%"><strong>license</strong> = '<font color="#c040c0">\n\n</font> GNU GENERAL PUBLIC L...icense instead of this License.<font color="#c040c0">\n\n</font> '</td></tr></table> +<td width="100%"><strong>license</strong> = '<font color="#c040c0">\n</font> GNU GENERAL PUBLIC LI...License instead of this License.<font color="#c040c0">\n</font> '</td></tr></table> </body></html> \ No newline at end of file Modified: ImageD11/trunk/ImageD11/doc/ImageD11.opendata.html =================================================================== --- ImageD11/trunk/ImageD11/doc/ImageD11.opendata.html 2006-11-22 21:06:49 UTC (rev 426) +++ ImageD11/trunk/ImageD11/doc/ImageD11.opendata.html 2006-11-22 21:21:18 UTC (rev 427) @@ -68,5 +68,9 @@ TODO : Read in regions of interest<br> <br> PLEASE LEAVE THE STRANGE INTERFACE ALONE - IT IS USEFUL FOR THE BRUKER FORMAT</tt></dd></dl> + <dl><dt><a name="-writebruker"><strong>writebruker</strong></a>(filename, dataobject)</dt><dd><tt>Writes 16-bit + overflow bruker images based on the headerstring<br> +Assumes you've got a good bruker headerstring in the data<br> +object</tt></dd></dl> + <dl><dt><a name="-writedata"><strong>writedata</strong></a>(filename, dataobject)</dt></dl> </td></tr></table> </body></html> \ No newline at end of file Modified: ImageD11/trunk/ImageD11/doc/ImageD11.parameters.html =================================================================== --- ImageD11/trunk/ImageD11/doc/ImageD11.parameters.html 2006-11-22 21:06:49 UTC (rev 426) +++ ImageD11/trunk/ImageD11/doc/ImageD11.parameters.html 2006-11-22 21:21:18 UTC (rev 427) @@ -33,7 +33,7 @@ <dl><dt><a name="parameters-dumbtypecheck"><strong>dumbtypecheck</strong></a>(self)</dt><dd><tt>Eventually parameter types (and units and fixed/varied to be<br> specifieable<br> -For now it just tries to coerce to int, then float, then does nothing</tt></dd></dl> +For now it just tries to coerce to float, then does nothing</tt></dd></dl> <dl><dt><a name="parameters-get_parameters"><strong>get_parameters</strong></a>(self)</dt><dd><tt>Returns a dictionary of <a href="#parameters">parameters</a></tt></dd></dl> Modified: ImageD11/trunk/ImageD11/doc/ImageD11.plot3d.html =================================================================== --- ImageD11/trunk/ImageD11/doc/ImageD11.plot3d.html 2006-11-22 21:06:49 UTC (rev 426) +++ ImageD11/trunk/ImageD11/doc/ImageD11.plot3d.html 2006-11-22 21:21:18 UTC (rev 427) @@ -6,7 +6,7 @@ <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> <tr bgcolor="#7799ee"> <td valign=bottom> <br> -<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="ImageD11.html"><font color="#ffffff">ImageD11</font></a>.plot3d</strong></big></big> (version 1.5, 2006/06/14 13:36:45)</font></td +<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="ImageD11.html"><font color="#ffffff">ImageD11</font></a>.plot3d</strong></big></big> (version 1.6, 2006/06/25 10:05:10)</font></td ><td align=right valign=bottom ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///C|/python24/lib/site-packages/imaged11/plot3d.py">c:\python24\lib\site-packages\imaged11\plot3d.py</a></font></td></tr></table> <p><tt>from example by Tarn Weisner Burton <twb...@us...> in pyopengl</tt></p> @@ -851,8 +851,8 @@ <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> <td width="100%"><strong>__author__</strong> = 'Jon Wright <jpw...@us...> from...n Weisner Burton <twb...@us...>'<br> -<strong>__date__</strong> = '2006/06/14 13:36:45'<br> -<strong>__version__</strong> = '1.5'</td></tr></table><p> +<strong>__date__</strong> = '2006/06/25 10:05:10'<br> +<strong>__version__</strong> = '1.6'</td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#7799ee"> <td colspan=3 valign=bottom> <br> Modified: ImageD11/trunk/ImageD11/doc/ImageD11.refinegrains.html =================================================================== --- ImageD11/trunk/ImageD11/doc/ImageD11.refinegrains.html 2006-11-22 21:06:49 UTC (rev 426) +++ ImageD11/trunk/ImageD11/doc/ImageD11.refinegrains.html 2006-11-22 21:21:18 UTC (rev 427) @@ -81,7 +81,7 @@ <hr> Data and other attributes defined here:<br> -<dl><dt><strong>stepsizes</strong> = {'chi': 0.00017453292519943296, 'distance': 0.10000000000000001, 'tilt-y': 0.0017453292519943296, 'tilt-z': 0.0017453292519943296, 'translation': 0.10000000000000001, 'wavelength': 0.001, 'wedge': 0.00017453292519943296, 'y-center': 0.10000000000000001, 'z-center': 0.10000000000000001}</dl> +<dl><dt><strong>stepsizes</strong> = {'chi': 0.0017453292519943296, 'distance': 0.10000000000000001, 'tilt-y': 0.0017453292519943296, 'tilt-z': 0.0017453292519943296, 'translation': 0.10000000000000001, 'wavelength': 0.001, 'wedge': 0.0017453292519943296, 'y-center': 0.10000000000000001, 'z-center': 0.10000000000000001}</dl> </td></tr></table></td></tr></table> </body></html> \ No newline at end of file Added: ImageD11/trunk/ImageD11/doc/ImageD11.scale.html =================================================================== --- ImageD11/trunk/ImageD11/doc/ImageD11.scale.html (rev 0) +++ ImageD11/trunk/ImageD11/doc/ImageD11.scale.html 2006-11-22 21:21:18 UTC (rev 427) @@ -0,0 +1,80 @@ + +<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><title>Python: module ImageD11.scale</title> +</head><body bgcolor="#f0f0f8"> + +<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> +<tr bgcolor="#7799ee"> +<td valign=bottom> <br> +<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="ImageD11.html"><font color="#ffffff">ImageD11</font></a>.scale</strong></big></big></font></td +><td align=right valign=bottom +><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///C|/python24/lib/site-packages/imaged11/scale.py">c:\python24\lib\site-packages\imaged11\scale.py</a></font></td></tr></table> + <p><tt>Class for scaling images with respect to each other due to moco<br> +style instabilities.<br> + <br> +Depends on there being a large background contribution to work with<br> + <br> + <br> +Mathematically:<br> + y = a * x + b<br> + dy/da = x<br> + dy/db = 1<br> + Least squares problem with:<br> + matrix = ( dy/da*dy/da , dy/da*dy/db)<br> + ( dy/da*dy/db , dy/db*dy/db)<br> + rhs = ( dy/da*y )<br> + ( dy/db*y )<br> + <br> +Has the option to use only pixels in the image to <a href="#scale">scale</a> to which<br> +are above a threshold (eg the central circle on the bruker)</tt></p> +<p> +<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> +<tr bgcolor="#aa55cc"> +<td colspan=3 valign=bottom> <br> +<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> + +<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> +<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="LinearAlgebra.html">LinearAlgebra</a><br> +</td><td width="25%" valign=top><a href="Numeric.html">Numeric</a><br> +</td><td width="25%" valign=top><a href="ImageD11.opendata.html">ImageD11.opendata</a><br> +</td><td width="25%" valign=top></td></tr></table></td></tr></table><p> +<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> +<tr bgcolor="#ee77aa"> +<td colspan=3 valign=bottom> <br> +<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> + +<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> +<td width="100%"><dl> +<dt><font face="helvetica, arial"><a href="ImageD11.scale.html#scale">scale</a> +</font></dt></dl> + <p> +<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> +<tr bgcolor="#ffc8d8"> +<td colspan=3 valign=bottom> <br> +<font color="#000000" face="helvetica, arial"><a name="scale">class <strong>scale</strong></a></font></td></tr> + +<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> +<td width="100%">Methods defined here:<br> +<dl><dt><a name="scale-__init__"><strong>__init__</strong></a>(self, im1, threshold<font color="#909090">=None</font>)</dt><dd><tt>Determines <a href="#scale">scale</a> and offset values for images<br> +with respect to each other<br> +im1 = a * im2 + b<br> +returns a, b</tt></dd></dl> + +<dl><dt><a name="scale-scale"><strong>scale</strong></a>(self, im2)</dt><dd><tt>Fill out RHS and solve<br> +returns the <a href="#scale">scale</a> to apply to the image stored in the class<br> + <br> +You probably want the <a href="#scale">scale</a> to apply to the image you supply<br> +...use <a href="#scale">scale</a> image for that</tt></dd></dl> + +<dl><dt><a name="scale-scaleimage"><strong>scaleimage</strong></a>(self, im2)</dt><dd><tt>Return a copy of the image scaled to match the class</tt></dd></dl> + +</td></tr></table></td></tr></table><p> +<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> +<tr bgcolor="#eeaa77"> +<td colspan=3 valign=bottom> <br> +<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr> + +<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> +<td width="100%"><dl><dt><a name="-testscaleimage"><strong>testscaleimage</strong></a>()</dt></dl> +</td></tr></table> +</body></html> \ No newline at end of file Modified: ImageD11/trunk/ImageD11/doc/ImageD11.transform.html =================================================================== --- ImageD11/trunk/ImageD11/doc/ImageD11.transform.html 2006-11-22 21:06:49 UTC (rev 426) +++ ImageD11/trunk/ImageD11/doc/ImageD11.transform.html 2006-11-22 21:21:18 UTC (rev 427) @@ -56,15 +56,15 @@ Just like range() except it returns an array whose type can be<br> specified by the keyword argument typecode.</tt></dd></dl> <dl><dt><a name="-choose"><strong>choose</strong></a>(...)</dt><dd><tt><a href="#-choose">choose</a>(a, (b1,b2,...))</tt></dd></dl> - <dl><dt><a name="-compute_g_vectors"><strong>compute_g_vectors</strong></a>(tth, eta, omega, wavelength, wedge<font color="#909090">=0.0</font>)</dt><dd><tt>Generates spot positions in reciprocal space from twotheta, wavelength, omega and eta<br> + <dl><dt><a name="-compute_g_vectors"><strong>compute_g_vectors</strong></a>(tth, eta, omega, wavelength, wedge<font color="#909090">=0.0</font>, chi<font color="#909090">=0.0</font>)</dt><dd><tt>Generates spot positions in reciprocal space from twotheta, wavelength, omega and eta<br> Assumes single axis vertical<br> ... unless a wedge angle is specified</tt></dd></dl> - <dl><dt><a name="-compute_lorentz_factors"><strong>compute_lorentz_factors</strong></a>(args)</dt><dd><tt>From Kabsch 1988 J. Appl. Cryst. 21 619<br> + <dl><dt><a name="-compute_lorentz_factors"><strong>compute_lorentz_factors</strong></a>(tth, eta, omega, wavelength, wedge<font color="#909090">=0.0</font>, chi<font color="#909090">=0.0</font>)</dt><dd><tt>From Kabsch 1988 J. Appl. Cryst. 21 619<br> <br> Multiply the intensities by:<br> -Lorentz = | S.(u x S_0)| / |S|.|S_0|<br> +Lorentz = | S.(u x So)| / |S|.|So|<br> S = scattered vector<br> -S_0 = incident vector<br> +So = incident vector<br> u = unit vector along rotation axis</tt></dd></dl> <dl><dt><a name="-compute_polarisation_factors"><strong>compute_polarisation_factors</strong></a>(args)</dt><dd><tt>From Kabsch 1988 J. Appl. Cryst. 21 619<br> <br> @@ -75,7 +75,11 @@ or "probability of finding electric field vector in plane having normal, n"<br> S = scattered vector<br> S_0 = incident vector<br> -n = normal to polarisation plane, typically perpendicular to S_0</tt></dd></dl> +n = normal to polarisation plane, typically perpendicular to S_0<br> + <br> +In ImageD11 we normally expect to find:<br> +x axis along the beam<br> +z axis being up, and parallel to the normal n mentioned above</tt></dd></dl> <dl><dt><a name="-compute_tth_eta"><strong>compute_tth_eta</strong></a>(peaks, yc, ys, ty, zc, zs, tz, dist, detector_orientation<font color="#909090">=((1, 0), (0, 1))</font>, crystal_translation<font color="#909090">=None</font>, omega<font color="#909090">=None</font>, axis_orientation1<font color="#909090">=0.0</font>, axis_orientation2<font color="#909090">=0.0</font>)</dt><dd><tt>Peaks is a 2 d array of x,y<br> yc is the centre in y<br> ys is the y pixel size<br> @@ -95,6 +99,7 @@ z with respect to beam height, z centre<br> omega data needed if crystal translations used</tt></dd></dl> <dl><dt><a name="-cross_correlate"><strong>cross_correlate</strong></a>(...)</dt><dd><tt><a href="#-cross_correlate">cross_correlate</a>(a,v, mode=0)</tt></dd></dl> + <dl><dt><a name="-cross_product"><strong>cross_product</strong></a>(a, b)</dt></dl> <dl><dt><a name="-degrees"><strong>degrees</strong></a>(x)</dt><dd><tt>Convenience function</tt></dd></dl> <dl><dt><a name="-empty"><strong>empty</strong></a>(...)</dt><dd><tt><a href="#-empty">empty</a>((d1,...,dn),typecode='l',savespace=0) will return a new array<br> of shape (d1,...,dn) and given type with all its entries uninitialized. If savespace is<br> @@ -106,7 +111,7 @@ <dl><dt><a name="-reshape"><strong>reshape</strong></a>(...)</dt><dd><tt><a href="#-reshape">reshape</a>(a, (d1, d2, ..., dn)). Change the shape of a to be an n-dimensional array with dimensions given by d1...dn. Note: the size specified for the new array must be exactly equal to the size of the old one or an error will occur.</tt></dd></dl> <dl><dt><a name="-searchsorted"><strong>searchsorted</strong></a> = binarysearch(...)</dt><dd><tt>binarysearch(a,v)</tt></dd></dl> <dl><dt><a name="-take"><strong>take</strong></a>(...)</dt><dd><tt><a href="#-take">take</a>(a, indices, axis=0). Selects the elements in indices from array a along the given axis.</tt></dd></dl> - <dl><dt><a name="-uncompute_g_vectors"><strong>uncompute_g_vectors</strong></a>(g, wavelength, wedge<font color="#909090">=0.0</font>)</dt><dd><tt>Given g-vectors compute tth,eta,omega<br> + <dl><dt><a name="-uncompute_g_vectors"><strong>uncompute_g_vectors</strong></a>(g, wavelength, wedge<font color="#909090">=0.0</font>, chi<font color="#909090">=0.0</font>)</dt><dd><tt>Given g-vectors compute tth,eta,omega<br> assert <a href="#-uncompute_g_vectors">uncompute_g_vectors</a>(compute_g_vector(tth,eta,omega))==tth,eta,omega</tt></dd></dl> <dl><dt><a name="-uncompute_one_g_vector"><strong>uncompute_one_g_vector</strong></a>(gv, wavelength, wedge<font color="#909090">=0.0</font>)</dt><dd><tt>Given g-vectors compute tth,eta,omega<br> assert <a href="#-uncompute_g_vectors">uncompute_g_vectors</a>(compute_g_vector(tth,eta,omega))==tth,eta,omega</tt></dd></dl> Modified: ImageD11/trunk/ImageD11/doc/ImageD11.unitcell.html =================================================================== --- ImageD11/trunk/ImageD11/doc/ImageD11.unitcell.html 2006-11-22 21:06:49 UTC (rev 426) +++ ImageD11/trunk/ImageD11/doc/ImageD11.unitcell.html 2006-11-22 21:21:18 UTC (rev 427) @@ -64,7 +64,7 @@ Argument dsmax is the d* limit (eg 1/d)<br> Default of zero gives only the (000) reflection<br> <br> -assumes [h|k|l] < 20</tt></dd></dl> +assumes [h|k|l] < 200</tt></dd></dl> <dl><dt><a name="unitcell-makerings"><strong>makerings</strong></a>(self, limit, tol<font color="#909090">=0.001</font>)</dt><dd><tt>Makes a list of computed powder rings<br> The tolerance is the difference in d* to decide<br> Added: ImageD11/trunk/ImageD11/doc/index.html =================================================================== --- ImageD11/trunk/ImageD11/doc/index.html (rev 0) +++ ImageD11/trunk/ImageD11/doc/index.html 2006-11-22 21:21:18 UTC (rev 427) @@ -0,0 +1,91 @@ + +<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head><title>Python: package ImageD11</title> +</head><body bgcolor="#f0f0f8"> + +<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> +<tr bgcolor="#7799ee"> +<td valign=bottom> <br> +<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>ImageD11</strong></big></big> (version 0.6.1)</font></td +><td align=right valign=bottom +><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///C|/python24/lib/site-packages/imaged11/__init__.py">c:\python24\lib\site-packages\imaged11\__init__.py</a></font></td></tr></table> + <p><tt>ImageD11 - image analysis software for beamline ID11 at the ESRF<br> + <br> +Copyright (C) 2005 Jon Wright<br> + <br> +This program is free software; you can redistribute it and/or modify<br> +it under the terms of the GNU General Public License as published by<br> +the Free Software Foundation; either version 2 of the License, or<br> +(at your option) any later version.<br> + <br> +This program is distributed in the hope that it will be useful,<br> +but WITHOUT ANY WARRANTY; without even the implied warranty of<br> +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br> +GNU General Public License for more details.<br> + <br> +You should have received a copy of the GNU General Public License<br> +along with this program; if not, write to the Free Software<br> +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</tt></p> +<p> +<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> +<tr bgcolor="#aa55cc"> +<td colspan=3 valign=bottom> <br> +<font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr> + +<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> +<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="ImageD11._hist.html">_hist</a><br> +<a href="ImageD11._splines.html">_splines</a><br> +<a href="ImageD11.bisplev.html">bisplev</a><br> +<a href="ImageD11.blobcorrector.html">blobcorrector</a><br> +<a href="ImageD11.closest.html">closest</a><br> +<a href="ImageD11.connectedpixels.html">connectedpixels</a><br> +<a href="ImageD11.data.html">data</a><br> +<a href="ImageD11.factors.html">factors</a><br> +<a href="ImageD11.findreflections.html">findreflections</a><br> +<a href="ImageD11.fitgrainxy.html">fitgrainxy</a><br> +</td><td width="25%" valign=top><a href="ImageD11.grain.html">grain</a><br> +<a href="ImageD11.guicommand.html">guicommand</a><br> +<a href="ImageD11.guifactors.html">guifactors</a><br> +<a href="ImageD11.guiindexer.html">guiindexer</a><br> +<a href="ImageD11.guimaker.html">guimaker</a><br> +<a href="ImageD11.guipeaksearch.html">guipeaksearch</a><br> +<a href="ImageD11.guitransformer.html">guitransformer</a><br> +<a href="ImageD11.hist.html">hist</a><br> +<a href="ImageD11.indexing.html">indexing</a><br> +<a href="ImageD11.license.html">license</a><br> +</td><td width="25%" valign=top><a href="ImageD11.listdialog.html">listdialog</a><br> +<a href="ImageD11.oldstuff.html"><strong>oldstuff</strong> (package)</a><br> +<a href="ImageD11.opendata.html">opendata</a><br> +<a href="ImageD11.parameters.html">parameters</a><br> +<a href="ImageD11.peakmerge.html">peakmerge</a><br> +<a href="ImageD11.peakmerge_old.html">peakmerge_old</a><br> +<a href="ImageD11.plot3d.html">plot3d</a><br> +<a href="ImageD11.rebin2d.html">rebin2d</a><br> +<a href="ImageD11.refinegrains.html">refinegrains</a><br> +<a href="ImageD11.scale.html">scale</a><br> +</td><td width="25%" valign=top><a href="ImageD11.simplex.html">simplex</a><br> +<a href="ImageD11.test_transform.html">test_transform</a><br> +<a href="ImageD11.transform.html">transform</a><br> +<a href="ImageD11.twod2threed.html">twod2threed</a><br> +<a href="ImageD11.twodplot.html">twodplot</a><br> +<a href="ImageD11.ubitool.html">ubitool</a><br> +<a href="ImageD11.unitcell.html">unitcell</a><br> +<a href="ImageD11.write_graindex_gv.html">write_graindex_gv</a><br> +</td></tr></table></td></tr></table><p> +<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> +<tr bgcolor="#55aa55"> +<td colspan=3 valign=bottom> <br> +<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> + +<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> +<td width="100%"><strong>__author__</strong> = ('Jon Wright',)<br> +<strong>__author_email__</strong> = 'wr...@es...'<br> +<strong>__version__</strong> = '0.6.1'</td></tr></table><p> +<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> +<tr bgcolor="#7799ee"> +<td colspan=3 valign=bottom> <br> +<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr> + +<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td> +<td width="100%">('Jon Wright',)</td></tr></table> +</body></html> \ No newline at end of file Modified: ImageD11/trunk/ImageD11/doc/makedocs.py =================================================================== --- ImageD11/trunk/ImageD11/doc/makedocs.py 2006-11-22 21:06:49 UTC (rev 426) +++ ImageD11/trunk/ImageD11/doc/makedocs.py 2006-11-22 21:21:18 UTC (rev 427) @@ -2,6 +2,7 @@ import pydoc, os, ImageD11,inspect pydoc.writedoc("ImageD11") +os.system("copy ImageD11.html index.html") done=[None] for file in os.listdir(ImageD11.__path__[0]): path = os.path.join(ImageD11.__path__[0], file) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2006-11-22 21:06:50
|
Revision: 426 http://svn.sourceforge.net/fable/?rev=426&view=rev Author: andy_gotz Date: 2006-11-22 13:06:49 -0800 (Wed, 22 Nov 2006) Log Message: ----------- remvoed unused imports Modified Paths: -------------- gui/trunk/fable.beamline.rcp/src/fable/beamline/rcp/BeamlineStatusView.java Modified: gui/trunk/fable.beamline.rcp/src/fable/beamline/rcp/BeamlineStatusView.java =================================================================== --- gui/trunk/fable.beamline.rcp/src/fable/beamline/rcp/BeamlineStatusView.java 2006-11-22 20:59:02 UTC (rev 425) +++ gui/trunk/fable.beamline.rcp/src/fable/beamline/rcp/BeamlineStatusView.java 2006-11-22 21:06:49 UTC (rev 426) @@ -1,11 +1,7 @@ package fable.beamline.rcp; -import org.eclipse.ui.forms.widgets.Form; -import org.eclipse.ui.forms.widgets.FormToolkit; -import org.eclipse.ui.forms.widgets.ScrolledForm; import org.eclipse.ui.part.ViewPart; import org.eclipse.ui.preferences.ScopedPreferenceStore; - import org.eclipse.core.runtime.preferences.ConfigurationScope; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.swt.widgets.Button; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpw...@us...> - 2006-11-22 20:59:06
|
Revision: 425 http://svn.sourceforge.net/fable/?rev=425&view=rev Author: jpwright Date: 2006-11-22 12:59:02 -0800 (Wed, 22 Nov 2006) Log Message: ----------- Merge CVS changes and add 3D peaksearching Modified Paths: -------------- ImageD11/trunk/ImageD11/blobcorrector.py ImageD11/trunk/ImageD11/opendata.py ImageD11/trunk/ImageD11/refinegrains.py ImageD11/trunk/ImageD11/transform.py ImageD11/trunk/ImageD11/unitcell.py ImageD11/trunk/MANIFEST ImageD11/trunk/scripts/fit2dcake.py ImageD11/trunk/scripts/peaksearch.py ImageD11/trunk/scripts/rubber.py ImageD11/trunk/setup.py ImageD11/trunk/src/connectedpixels.c Added Paths: ----------- ImageD11/trunk/scripts/ImageD11_2_shelx.py Modified: ImageD11/trunk/ImageD11/blobcorrector.py =================================================================== --- ImageD11/trunk/ImageD11/blobcorrector.py 2006-11-22 20:49:16 UTC (rev 424) +++ ImageD11/trunk/ImageD11/blobcorrector.py 2006-11-22 20:59:02 UTC (rev 425) @@ -30,6 +30,18 @@ import Numeric as n import bisplev, math + +class perfect: + """ + To use on previously corrected images + """ + splinefile = "NO_CORRECTION_APPLIED" + xsize = "UNKNOWN" + ysize = "UNKNOWN" + def correct(x,y): + return x, y + + class correctorclass: """ Applies a spatial distortion to a peak position using a fit2d splinefile Modified: ImageD11/trunk/ImageD11/opendata.py =================================================================== --- ImageD11/trunk/ImageD11/opendata.py 2006-11-22 20:49:16 UTC (rev 424) +++ ImageD11/trunk/ImageD11/opendata.py 2006-11-22 20:59:02 UTC (rev 425) @@ -153,6 +153,7 @@ else: ar=Numeric.array(Numeric.reshape( Numeric.fromstring(f.read(len),tin) ,(x,y)),typeout) + ar.savespace(1) if(opened):f.close() return(ar) @@ -365,6 +366,7 @@ ar=Numeric.reshape( Numeric.fromstring(datastring,numerictype).byteswapped(), (hd["columns"],hd["rows"]) ) + ar.savespace(1) return data(ar,hd) Modified: ImageD11/trunk/ImageD11/refinegrains.py =================================================================== --- ImageD11/trunk/ImageD11/refinegrains.py 2006-11-22 20:49:16 UTC (rev 424) +++ ImageD11/trunk/ImageD11/refinegrains.py 2006-11-22 20:59:02 UTC (rev 425) @@ -142,7 +142,13 @@ omega = om, axis_orientation1 = self.parameters['wedge'], axis_orientation2 = self.parameters['chi']) - self.gv = transform.compute_g_vectors(tth,eta,om,float(self.parameters['wavelength']), + try: + sign = self.parameters['omegasign'] + except: + sign = 1.0 + # print "Using omegasign=",sign + self.gv = transform.compute_g_vectors(tth,eta,om*sign, + float(self.parameters['wavelength']), self.parameters['wedge'], self.parameters['chi']) self.gv = Numeric.transpose(self.gv) @@ -151,11 +157,12 @@ def refine(self,ubi,quiet=True): from ImageD11 import closest mat=ubi.copy() + #print self.tolerance npks = closest.score_and_refine(mat, self.gv, self.tolerance) if not quiet: print npks - #mat = indexing.refine(ubi,self.gv,self.tolerance,quiet=quiet) - #print ubi, testmatrix,ubi-testmatrix,mat-testmatrix + #tm = indexing.refine(ubi,self.gv,self.tolerance,quiet=quiet) + #print ubi, tm,ubi-tm,mat-tm return mat def gof(self,args): @@ -269,7 +276,7 @@ self.printresult(newguess) def refineubis(self,quiet=True): - + #print quiet for key in self.grains.keys(): g = self.grains[key] grainname = key[0] Modified: ImageD11/trunk/ImageD11/transform.py =================================================================== --- ImageD11/trunk/ImageD11/transform.py 2006-11-22 20:49:16 UTC (rev 424) +++ ImageD11/trunk/ImageD11/transform.py 2006-11-22 20:59:02 UTC (rev 425) @@ -424,18 +424,59 @@ -def compute_lorentz_factors(args): +def compute_lorentz_factors(tth,eta,omega,wavelength,wedge=0.,chi=0.): """ From Kabsch 1988 J. Appl. Cryst. 21 619 Multiply the intensities by: - Lorentz = | S.(u x S_0)| / |S|.|S_0| + Lorentz = | S.(u x So)| / |S|.|So| S = scattered vector - S_0 = incident vector + So = incident vector u = unit vector along rotation axis """ - pass + # So is along +x, the incident beam defines the co-ordinates in ImageD11 + # length is in reciprocal space units, 1/lambda + So = [1./wavelength,0,0] + # + # u vector along rotation axis + # starts as along z + u = [0,0,1] + # rotate by + # g = R . W . k where: + # R = ( cos(omega) , sin(omega), 0 ) + # (-sin(omega) , cos(omega), 0 ) + # ( 0 , 0 , 1 ) + # + W = [[ cos(wedge) , 0 , sin(wedge) ], + [ 0 , 1 , 0 ], + [-sin(wedge) , 0 , cos(wedge) ]] + # + C = [[ 1 , 0 , 0 ], + [ 0 , cos(chi) , sin(chi) ], + [ 0 , -sin(chi) , cos(chi) ]] + u = matrixmultiply(C,matrixmultiply(W,u)) + u_x_So = cross_product(u,So) + # if DEBUG: print "axis orientation",u + # + # S = scattered vectors. Length 1/lambda. + S = [ cos(radians(tth)/2.)*sin(radians(eta))/wavelength, + cos(radians(tth)/2.)*cos(radians(eta))/wavelength, + sin(radians(tth)/2.)/wavelength] + S_dot_u_x_So = dot(S,u_x_So) + mod_S = sqrt(dot(S,S)) + mod_So = sqrt(dot(So,So)) + try: + lorentz = abs(S_dot_u_x_So)/mod_S/mod_So + except: + raise Exception("Please fix this div0 crap in lorentz") + return lorentz +def cross_product(a,b): + assert len(a)==len(b)==3 + return array([a[1]*b[2]-a[2]*b[1], + a[2]*b[0]-a[0]*b[2], + a[0]*b[1]-a[1]*b[0]]) + def compute_polarisation_factors(args): """ From Kabsch 1988 J. Appl. Cryst. 21 619 @@ -448,8 +489,13 @@ S = scattered vector S_0 = incident vector n = normal to polarisation plane, typically perpendicular to S_0 + + In ImageD11 we normally expect to find: + x axis along the beam + z axis being up, and parallel to the normal n mentioned above """ - pass + n = [0,0,1] + if __name__=="__main__": # from indexing import mod_360 Modified: ImageD11/trunk/ImageD11/unitcell.py =================================================================== --- ImageD11/trunk/ImageD11/unitcell.py 2006-11-22 20:49:16 UTC (rev 424) +++ ImageD11/trunk/ImageD11/unitcell.py 2006-11-22 20:59:02 UTC (rev 425) @@ -45,7 +45,12 @@ """ Normalise vector a to unit length """ - return a/Numeric.sqrt(Numeric.dot(a,a)) + try: + return a/Numeric.sqrt(Numeric.dot(a,a)) + except: + l=Numeric.dot(a,a) + print "Length of a is",l + raise @@ -178,7 +183,7 @@ Argument dsmax is the d* limit (eg 1/d) Default of zero gives only the (000) reflection - assumes [h|k|l] < 20 + assumes [h|k|l] < 200 """ if dsmax == self.limit and self.peaks!=None: return self.peaks @@ -187,9 +192,9 @@ hs=ks=ls=1 b=0 peaks=[] - while abs(h)<20: # H - while abs(k)<20: # K - while abs(l)<20: #L + while abs(h)<200: # H + while abs(k)<200: # K + while abs(l)<200: #L ds=self.ds([h,k,l]) if ds < dsmax: if not self.absent(h,k,l): Modified: ImageD11/trunk/MANIFEST =================================================================== --- ImageD11/trunk/MANIFEST 2006-11-22 20:49:16 UTC (rev 424) +++ ImageD11/trunk/MANIFEST 2006-11-22 20:59:02 UTC (rev 425) @@ -5,6 +5,7 @@ ImageD11/data.py ImageD11/factors.py ImageD11/findreflections.py +ImageD11/fitgrainxy.py ImageD11/grain.py ImageD11/guicommand.py ImageD11/guifactors.py @@ -36,12 +37,15 @@ scripts/edfheader.py scripts/fit2dcake.py scripts/peaksearch.py +scripts/mar2bruker.py scripts/plotedf.py +scripts/rubber.py scripts/powderimagetopeaks.py scripts/recoveromega.py scripts/rubber.py scripts/scriptable_gui.py src/bispev.c +src/bispev.f src/closest.c src/connectedpixels.c src/hist.c Added: ImageD11/trunk/scripts/ImageD11_2_shelx.py =================================================================== --- ImageD11/trunk/scripts/ImageD11_2_shelx.py (rev 0) +++ ImageD11/trunk/scripts/ImageD11_2_shelx.py 2006-11-22 20:59:02 UTC (rev 425) @@ -0,0 +1,51 @@ +#!/bliss/users/blissadm/python/bliss_python/suse82/bin/python + + +# ImageD11_v0.4 Software for beamline ID11 +# Copyright (C) 2005 Jon Wright +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + +""" +Script for getting integrated intensities from .flt + .ubi file +from the command line +""" + + + + + +if __name__=="__main__": + import sys + try: + flt = sys.argv[1] + ubi = sys.argv[2] + par = sys.argv[3] + out = sys.argv[4] + from ImageD11.refinegrains import refinegrains + o=refinegrains() + o.loadparameters(par) + o.loadfiltered(flt) + o.readubis(ubi) + o.generate_grains() + o.tolerance = 0.1 # to command line arg + o.refineubis(False) + + + except: + print "Usage: %s fltfile ubifile parfile outfile" + raise Modified: ImageD11/trunk/scripts/fit2dcake.py =================================================================== --- ImageD11/trunk/scripts/fit2dcake.py 2006-11-22 20:49:16 UTC (rev 424) +++ ImageD11/trunk/scripts/fit2dcake.py 2006-11-22 20:59:02 UTC (rev 425) @@ -502,7 +502,7 @@ except: os.environ["DISPLAY"]=":1" array=str(self.mask_pars_values["DIM1_DATA"])+"x"+str(self.mask_pars_values["DIM2_DATA"]) - os.system("fit2d_12_081_i686_linux2.4.20 -dim%s -mac%s"%(array,tmpfilename)) + os.system("/users/wright/bin/fit2d_12_081_i686_linux2.4.20 -dim%s -mac%s"%(array,tmpfilename)) os.system("rm -f %s"%(tmpfilename)) if show is None: os.environ["DISPLAY"]=displaywas Modified: ImageD11/trunk/scripts/peaksearch.py =================================================================== --- ImageD11/trunk/scripts/peaksearch.py 2006-11-22 20:49:16 UTC (rev 424) +++ ImageD11/trunk/scripts/peaksearch.py 2006-11-22 20:59:02 UTC (rev 425) @@ -16,7 +16,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 0211-1307 USA @@ -40,31 +40,284 @@ from ImageD11 import connectedpixels import Numeric -def peaksearch(filename, outputfile, corrector, blobim , thresholds, +class labelimage: + def __init__(self,shape,fileout=sys.stdout,spatial=blobcorrector.perfect): + self.shape=shape + self.bl = Numeric.zeros(shape,Numeric.Int) + self.lastbl = Numeric.zeros(shape,Numeric.Int) + self.np = 0 + self.res = (0,)*10 + self.lastres = [] + self.lastnp=-1 + self.verbose=0 + self.nprop = 9 # number of accumulating properties + self.corrector=corrfunc + self.closed =None + self.finalpeaks=[] + self.outfile=open(fileout,"w") + self.outfile.write("# xc yc omega npixels avg_intensity x_raw y_raw sigx sigy covxy\n") + + def peaksearch(self,data,threshold): + """ + # Call the c extension to do the peaksearch, on entry: + # + # picture = 2D Numeric UInt16 array (of your data) + # blobim = 2D Numeric Int array of same shape as data + # threshold = float - pixels above this number are put into objects + # verbose = 0/1 - whether or not to print anything + # + # One return - np is the number of peaks found (number of + # connnected objects) picture should be unchanged + # blobim should be overwritten with integers giving the peak number for + # that pixel + # or zero if the pixel was below the threshold + # + + """ + self.bl = Numeric.zeros(self.shape,Numeric.Int) + # print "labelimage.peaksearch",data[0,0],threshold + self.np = connectedpixels.connectedpixels(data, self.bl, threshold, + self.verbose) + return self.np + + def properties(self,data,omega=0.): + """ + # Now get the properties of the identified objects, on entry: + # picture = data, as before + # blobim = peak assignments + # np = the number of peaks to find + # verbose = 0/1 - whether to print or not + # + # + # This returns a series of 1D Numeric arrays: + # npi = Number of pixels in objects ... for each blob pixel + # sum 1 + # isum = sum of intensity in blobs + # sum data[i][j] + # sumsq = sum of intensity squared + # sum data[i][j] * data[i][j] + # com0 = sum of intensity multiplied by fast index: + # sum i*data[i][j] + # com1 = sum of intensity multiplied by slow index: + # sum j*data[i][j] + # com00 = sum of intensity multiplied by fast index squared: + # sum i*i*data[i][j] + # com01 = sum of intensity multiplied by fast index and slow index: + # sum i*j*data[i][j] + # com00 = sum of intensity multiplied by slow index squared: + # sum j*j*data[i][j] + # com2 = sum of intensity multiplied by slowest index (normally rotation angle) + # = sum omega*isum + # + + """ + if self.np>0: + res = connectedpixels.blobproperties(data, self.bl, self.np, self.verbose) + try: + self.res = res + (Numeric.ones(res[1].shape[0],Numeric.Float)*omega * res[1],) + except: +# print res,self.np + raise + else: + self.res = (0,)*10 + return self.res + + def mergelast(self): + """ + Merge the last two images searched + """ + if self.lastnp < 0: + # no previous to merge with, just save the current for next time + self.lastbl = self.bl + self.lastnp = self.np + self.lastres = self.res + return + # print "Calling bloboverlaps",self.verbose + ds = connectedpixels.bloboverlaps(self.bl, self.np, self.lastbl, self.lastnp, self.verbose) + # ds is a disjoint set. + # print ds + # already filled out self.res, self.lastres + # + # Move counts in self.lastres forwards to self.res + # Once all checked move non-zeros in self.lastres to self.closed + three_d_debug=False + if three_d_debug: + print len(ds),self.np,self.lastnp,ds + print "np",self.np,"len(self.res[0])",len(self.res[0]) + print "lastnp",self.lastnp,"len(self.lastres[0])",len(self.lastres[0]) + for i in range(self.np+1,len(ds)): +# print i +# if ds[i]==i and i<self.np: +# # this peak is on res and not overlapped, it will, eventually, move to lastres +# continue + if ds[i]!=i: + if three_d_debug: + print "linking ds[i],i",ds[i],i, + assert ds[i] < self.np, "Link on the same image" + # propose to link these two spots... + # print "l",i,ds[i]," ", + # bring the stuff forwards from last + if three_d_debug: + peak1 = [] + peak2 = [] + for j in range(self.nprop): # loop over properties + if three_d_debug: # debug + peak1.append(self.res[j][ds[i]]) + peak2.append(self.lastres[j][i-self.np]) + try: + self.res[j][ds[i]]=self.res[j][ds[i]]+self.lastres[j][i-self.np] + except: + print j,i,ds[i] + print ds + raise Exception("You should not be seeing this error!!") + if three_d_debug: + print "Linking ds[i],[i-self.np]",i,ds[i],i-self.np + print self.to_string(peak1), + print self.to_string(peak2), + else: # this peak is no longer active so write it out + peak = [] + for j in range(self.nprop): # loop over properties + # self.res[property][peak] + try: + peak.append(self.lastres[j][i-self.np]) + except: + print "indices",j,i,i-self.np,self.lastres + raise + self.outputpeak(peak) + # Now get the overlaps on the current frame + # + for i in range(1,self.np): + if ds[i]!=i : + # propose to link these two spots on the current active frame + # print "linking on current not implemented",i,ds[i] + peak1=[]; peak2=[] + # write the correct number in the blob image + # ... expensive - could be done in C?? + self.bl = Numeric.where(self.bl == i, ds[i], self.bl) + for j in range(self.nprop): # loop over properties + try: + self.res[j][ds[i]]=self.res[j][ds[i]]+self.res[j][i] + self.res[j][i]=0 + except: + print j,i,ds[i] + print ds + raise Exception("You should not be seeing this error!!") + temp = self.lastbl + self.lastbl = self.bl + self.bl=temp + self.lastnp = self.np + self.lastres = self.res + + + def outputpeak(self,peak): + self.outfile.write(self.to_string(peak)) + + def to_string(self,peak): + """ + Convert the accumulators to more meaningful things + self.outfile.write("# xc yc omega npixels avg_intensity x_raw y_raw sigx sigy covxy\n") + """ + npi, isum, sumsq, com0, com1, com00, com01, com11, omisum = peak + if npi < 1: + return "" + else: + n = npi + # Average intensity + avg = isum/n + if n==1: + si = sqrt(sumsq - n*avg*avg) + else: + si = sqrt((sumsq - n*avg*avg)/(n-1.)) + # Standard dev on intensity + c0 = com0/isum + # Centre of mass in index 0 + c1 = com1/isum + # Centre of mass in index 1 + # Covariances - try except to allow for zeros + try: + c00 = sqrt((com00/isum - c0*c0)) + except: + c00 = 0. # this means a line of pixels and rounding errors + try: + c11 = sqrt((com11/isum - c1*c1)) + except: + c11 = 0. + try: + c01 = (com01/isum - c0*c1)/c00/c11 + except: + c01 = 0. + # Spatial corrections, + # c0c and c1c are the distortion corrected centre of mass : + c0c, c1c = self.corrector.correct(c0, c1) + om = omisum/isum + if False:# abs(c0c-1229)<2 and abs(c1c-1486)<2: + print "c0c,c1c",c0c,c1c + print peak + print "%f %f %f %d %f %f %f %f %f %f\n"%(c0c, c1c, om, n, avg, c0, c1, c00, c11, c01) + raise Exception("who are you??") + return "%f %f %f %d %f %f %f %f %f %f\n"%(c0c, c1c, om, n, avg, c0, c1, c00, c11, c01) + + + def finalize(self): + """ + Assume we finished the last image + """ + # self.outfile.write("#final frame\n") + for i in range(len(self.lastres[0])): # loop over peaks + peak = [] + for j in range(len(self.lastres)): # loop over properties + # self.res[property][peak] + try: + peak.append(self.lastres[j][i]) + except: + print "indices",j,i,i-self.np,self.lastres + raise + self.outputpeak(peak) + self.outfile.close() + +class timer: + def __init__(self): + self.start = time.time() + self.now = self.start + def tick(self,msg=""): + now = time.time() + print msg,"%.2f/s"%(now-self.now), + self.now = now + def tock(self,msg=""): + self.tick(msg) + print "%.2f/s"%(self.now-self.start) + +def peaksearch(filename, outputfile, corrector, labims , thresholds, dark=None, flood=None): """ Searches for peaks, arguments are: filename : image filename to search for peaks in outputfile : ascii file to receive results corrector : ImageD11.blobcorrector object to correct peak positions - blobim : Numeric.Int array of same shape as data image to hold blob - assignments + labim : Numeric.Int array of same shape as data image to hold blob + assignments (dict[thresholds] of pairs) thresholds : List of threshold values to use (use more than one if you are not sure what to use), any iterable will do, not just list """ - t0 = time.time() + t = timer() f = open(outputfile,"aq") # Open the output file for appending # Assumes an edf file for now - TODO - should be independent data_object = opendata.opendata(filename) picture = data_object.data # picture is (hopefully) a 2D Numeric array of type UInt16 + # t.tick("read") if dark != None: # Slows down timing but avoid overflows - picture = picture.astype(Numeric.Float32)-dark + # print "Subtracting dark,",picture[0,0] + # print picture.shape,picture.typecode(),dark.shape,dark.typecode() + picture.savespace(0) # avoid overflows - very slow and silly + picture = picture.astype(Numeric.Int)-dark + # print "Subtracted dark,",picture[0,0] + # t.tick("dark") if flood != None: picture = picture/flood - print "%s" % (filename), # Progress indicator - # + t.tick(filename+" io/cor") # Progress indicator + #print "datatype for searching", picture.typecode() # # Transfer header information to output file # Also information on spatial correction applied f.write("\n\n# File %s\n" % (filename)) @@ -83,69 +336,39 @@ str(data_object.header[item]).replace("\n"," "))) except KeyError: pass - # Check the blobim matches the data for shape - if blobim.shape != data_object.data.shape: - raise "Incompatible blobimage buffer for file %s" %(filename) # # Now peaksearch at each threshold level for threshold in thresholds: + labelim = labims[threshold] + if labelim.shape != picture.shape: + raise "Incompatible blobimage buffer for file %s" %(filename) # npks = 0 # - # Call the c extension to do the peaksearch, on entry: + # Do the peaksearch + np = labelim.peaksearch(picture,threshold) # - # picture = 2D Numeric UInt16 array (of your data) - # blobim = 2D Numeric Int array of same shape as data - # threshold = float - pixels above this number are put into objects - # verbose = 0/1 - whether or not to print anything - # - np = connectedpixels.connectedpixels(picture, blobim, threshold, - verbose=0) - # - # One return - np is the number of peaks found (number of - # connnected objects) picture should be unchanged - # blobim should be overwritten with integers giving the peak number for - # that pixel - # or zero if the pixel was below the threshold - # - # Now get the properties of the identified objects, on entry: - # picture = data, as before - # blobim = peak assignments - # np = the number of peaks to find - # verbose = 0/1 - whether to print or not - # - npi, isum, sumsq, com0, com1, com00, com01, com11 = \ - connectedpixels.blobproperties(picture, blobim, np, verbose=0) - # - # This returns a series of 1D Numeric arrays: - # npi = Number of pixels in objects ... for each blob pixel - # sum 1 - # isum = sum of intensity in blobs - # sum data[i][j] - # sumsq = sum of intensity squared - # sum data[i][j] * data[i][j] - # com0 = sum of intensity multiplied by fast index: - # sum i*data[i][j] - # com1 = sum of intensity multiplied by slow index: - # sum j*data[i][j] - # com00 = sum of intensity multiplied by fast index squared: - # sum i*i*data[i][j] - # com01 = sum of intensity multiplied by fast index and slow index: - # sum i*j*data[i][j] - # com00 = sum of intensity multiplied by slow index squared: - # sum j*j*data[i][j] - # + try: + omega = float(data_object.header["Omega"]) + except: # Might have imagenumber or something?? + omega = 0. + props = labelim.properties(picture,omega) + npi, isum, sumsq, com0, com1, com00, com01, com11, omisum = props + # omisum is omega * isum # Now write results out for this threshold level f.write("\n#Threshold level %f\n" % (threshold)) f.write( "# Number_of_pixels Average_counts x y xc yc sig_x sig_y cov_xy\n") outstrfmt = "%d %f %f %f %f %f %f %f %f\n" for i in range(len(npi)): # Loop over peaks - if npi[i]>1: # Throw out one pixel peaks (div zero) + if npi[i]>=1: # Throw out one pixel peaks (div zero) npks = npks+1 n = npi[i] # Average intensity avg = isum[i]/n - si = sqrt((sumsq[i] - n*avg*avg)/(n-1.)) + if n>2: + si = sqrt((sumsq[i] - n*avg*avg)/(n-1.)) + else: + si = sqrt((sumsq[i] - n*avg*avg)/n) # Standard dev on intensity c0 = com0[i]/isum[i] # Centre of mass in index 0 @@ -171,11 +394,12 @@ except: c0c, c1c = c0, c1 f.write(outstrfmt % (n, avg, c0, c1, c0c, c1c, c00, c11, c01)) + labelim.mergelast() # called here!!! print "T=%-5d n=%-5d;" % (int(threshold),npks), # Close the output file f.close() # Finish progress indicator for this file - print " time %f/s" % (time.time()-t0) + t.tock() sys.stdout.flush() return npks # Number of peaks found @@ -230,13 +454,8 @@ corrfunc = blobcorrector.correctorclass(options.spline) else: print "Avoiding spatial correction" - class dummy: - splinefile = "NO_CORRECTION_APPLIED" - xsize = "UNKNOWN" - ysize = "UNKNOWN" - def correct(x,y): - return x, y - corrfunc = dummy() + corfunc = blobcorrector.perfect() + # List comprehension - convert remaining args to floats thresholds_list = [float(t) for t in options.thresholds] # Generate list of files to process @@ -248,21 +467,27 @@ files = ["%s.%04d" % (stem,i) for i in range(first,last+1)] corrfunc.orientation = "bruker" if options.spline.find("spatial2k.spline")>0: - if raw_input("Are you sure abuot the spline??")!="y": + if raw_input("Are you sure about the spline??")!="y": sys.exit() # Make a blobimage the same size as the first image to process if len(files)==0: raise "No files found for stem %s" % (stem) - blobar=Numeric.zeros(opendata.opendata(files[0]).data.shape,Numeric.Int) + li_objs={} # label image objects, dict of + s = opendata.opendata(files[0]).data.shape # data array shape + # Create label images + for t in thresholds_list: + mergefile="%s_merge_t%d"%(options.outfile,t) + li_objs[t]=labelimage(shape=s,fileout=mergefile,spatial=corrfunc) # Not sure why that was there (I think if glob was used) # files.sort() if options.dark!=None: - darkimage=(opendata.opendata(options.dark).data - \ + print "Using dark (background)",options.dark,"with added offset",options.darkoffset + darkimage= (opendata.opendata(options.dark).data.astype(Numeric.Int)-\ options.darkoffset).astype(Numeric.UInt16) else: darkimage=None if options.flood!=None: - floodimage=opendata.opendata(options.flood).data + floodimage=opendata.opendata(options.flood).data.astype(Numeric.Float32) # Check flood normalisation m1 = floodimage.shape[0]/6 m2 = floodimage.shape[1]/6 @@ -275,8 +500,10 @@ start = time.time() print "File being treated in -> out, elapsed time" for filein in files: - peaksearch(filein, outfile, corrfunc, blobar, \ + peaksearch(filein, outfile, corrfunc, li_objs, \ thresholds_list,dark=darkimage,flood=floodimage) + for t in thresholds_list: + li_objs[t].finalize() except: # print "Usage: %s filename outputfile first last spline threshold [threshold...]" % (sys.argv[0]) print Modified: ImageD11/trunk/scripts/rubber.py =================================================================== --- ImageD11/trunk/scripts/rubber.py 2006-11-22 20:49:16 UTC (rev 424) +++ ImageD11/trunk/scripts/rubber.py 2006-11-22 20:59:02 UTC (rev 425) @@ -39,7 +39,11 @@ image[DEFAULT_HEIGHT-1-ys[x],len_x-x-1] = 0 image = transpose(image) elif image.typecode() != 'b': - image = 255 * (image - themin) / (themax-themin) + try: + image.savespace(0) + image = 255 * (image - themin) / (themax-themin) + except: + print "Exception",themax,themin image = where(image<256,image,255) image = where(image>0,image,0).astype('b') @@ -77,7 +81,7 @@ class rubber(Frame): - def __init__(self, datafile=None, master=None): + def __init__(self, datafile=None, bkgfile=None, master=None): self.master=master Frame.__init__(self, master) if datafile==None: @@ -94,7 +98,15 @@ if type(datafile)==type(array([10,11,12])): self.data=datafile self.datafile="unknown0000.edf" + self.data.savespace(0) + if type(bkgfile)==type("string"): + self.bkgfile=bkgfile + bkgobj=opendata(bkgfile) + self.bkg=bkgobj.data + self.data=self.data-self.bkg + print "Got your background from",bkgfile,self.bkg.shape + Pack.config(self,expand=1,fill=BOTH) self.b=Frame(self) Button(self.b,text="Quit",command=self.close).pack(side=RIGHT) @@ -253,7 +265,13 @@ dataobj=opendata(self.datafile) self.status.config(text=self.datafile) self.data=dataobj.data + self.data.savespace(0) try: + self.data=self.data-self.bkg + except: + print "Failed to subtract bkg",self.bkg.shape,self.data.shape + pass + try: self.omega=float(dataobj.header["Omega"]) except: self.omega = None @@ -500,7 +518,9 @@ import sys from ImageD11.opendata import opendata -if len(sys.argv)>1: +if len(sys.argv)>2: + test = rubber(sys.argv[1],bkgfile=sys.argv[2]) +elif len(sys.argv)>2: test = rubber(sys.argv[1]) else: test = rubber() Modified: ImageD11/trunk/setup.py =================================================================== --- ImageD11/trunk/setup.py 2006-11-22 20:49:16 UTC (rev 424) +++ ImageD11/trunk/setup.py 2006-11-22 20:59:02 UTC (rev 425) @@ -68,7 +68,7 @@ # See the distutils docs... setup(name='ImageD11', - version='0.6.1', + version='0.7.1', author='Jon Wright', author_email='wr...@es...', description='ImageD11', @@ -77,6 +77,7 @@ ext_modules = [cl,cp,bl,ch], packages = ["ImageD11"], scripts = ["scripts/peaksearch.py", + "scripts/ImageD11_2_shelx.py", "scripts/fit2dcake.py", "scripts/edfheader.py", "scripts/recoveromega.py", Modified: ImageD11/trunk/src/connectedpixels.c =================================================================== --- ImageD11/trunk/src/connectedpixels.c 2006-11-22 20:49:16 UTC (rev 424) +++ ImageD11/trunk/src/connectedpixels.c 2006-11-22 20:59:02 UTC (rev 425) @@ -405,7 +405,7 @@ /* return PyArray_Return(results); */ /* Py_DECREF(results);*/ /* Py_DECREF(dataarray);*/ - return Py_BuildValue("i", np); + return Py_BuildValue("i", np+1);/* why the plus one?? */ } @@ -571,13 +571,130 @@ } +static char bloboverlaps_doc[] =\ +" res = bloboverlaps ( Numeric.array(blob1, 2D, Int), n1 , \n"\ +" Numeric.array(blob2, 2D, Int), n2 , verbose=0) \n"\ +" \n"\ +" returns a disjoint set making the overlaps between blob1 and blob2 \n"\ +" res[0->n1] = peaks in image 1 \n"\ +" res[n2->n2+n1+1] = peaks in image 2 \n"; + + +static PyObject * bloboverlaps (PyObject *self, PyObject *args, PyObject *keywds) +{ + PyArrayObject *b1=NULL,*b2=NULL, *res=NULL; /* in (not modified) */ + int i,j,s,f, verbose ; /* loop vars, flag */ + int p1,p2,n1,n2; /* peak num and npeaks in each */ + int *link , percent, safelyneed; + static char *kwlist[] = {"blob1","n1","blob2","n2","verbose", NULL}; + if(!PyArg_ParseTupleAndKeywords(args,keywds, "O!iO!i|i",kwlist, + &PyArray_Type, &b1, /* blobs */ + &n1, + &PyArray_Type, &b2, /* blobs */ + &n2, + &verbose)) /* threshold and optional verbosity */ + return NULL; + if(verbose!=0)printf("Welcome to bloboverlaps\n"); + + /* Check array is two dimensional and int - results from connectedpixels above */ + + if(b1->nd != 2 && b1->descr->type_num != PyArray_INT){ + PyErr_SetString(PyExc_ValueError, + "Blob1 array must be 2d and integer, first arg problem"); + return NULL; + } + if(b2->nd != 2 && b2->descr->type_num != PyArray_INT){ + PyErr_SetString(PyExc_ValueError,"Blob2 array must be 2d and integer, second arg problem"); + return NULL; + } + if (b1->strides[0]!=b2->strides[0] || + b1->strides[1]!=b2->strides[1] || + b1->dimensions[0]!=b2->dimensions[0] || + b1->dimensions[1]!=b2->dimensions[1] ){ + PyErr_SetString(PyExc_ValueError, + "Blob1 and Blob2 array be similar (dims & strides)"); + return NULL; + } + /* Decide on fast/slow loop - inner versus outer */ + if(b1->strides[0] > b1->strides[1]) { + f=1; s=0;} + else { + f=0; s=1; + } + if (verbose!=0){ + printf("Fast index is %d, slow index is %d, ",f,s); + printf("strides[0]=%d, strides[1]=%d\n",b1->strides[0],b2->strides[1]); + } + /* Initialise a disjoint set in link + * image 1 has peak[i]=i ; i=1->n1 + * image 2 has peak[i]=i+n1 ; i=1->n2 + * link to hold 0->n1-1 ; n1->n2+n2-1 */ + safelyneed=n1+n2+1; + res = (PyArrayObject *)PyArray_FromDims(1,&safelyneed,PyArray_INT); + link = (int *) res->data; + if(!res){ /* max length */ + PyErr_SetString(PyExc_ValueError, + "Failed to malloc link array"); + return NULL; + } + + for(i=0;i<n1+n2+1;i++){link[i]=i;} /* first image */ + /* flag the start of image number 2 */ + link[n1]=-99999; /* Should never be touched by anyone */ + + /* results lists of pairs of numbers */ + if(verbose!=0){ + printf("Scanning image, n1=%d n2=%d\n",n1,n2); + } + percent = b1->dimensions[s] / 100.; + for( i = 0 ; i <= (b1->dimensions[s]-1) ; i++ ){ /* i,j is looping along the indices data array */ + if(verbose!=0 && (i%percent == 0) )printf("."); + for( j = 0 ; j <= (b1->dimensions[f]-1) ; j++ ){ + p1=* (int *) (b1->data + i*b1->strides[s] + j*b1->strides[f]); + if (p1==0){ continue; } + p2=* (int *) (b2->data + i*b2->strides[s] + j*b2->strides[f]); + if (p2==0){ continue; } + /* Link contains the peak that this peak is */ + if(link[p1]<0 || link[p2+n1]<0){ + printf("Whoops p1=%d p2=%d p2+n1=%d link[p1]=%d link[p2+n1]=%d",p1,p2,p2+n1,link[p1],link[p2+n1]); + return NULL; + } + /* printf("link[60]=%d %d %d ",link[60],p1,p2+n1);*/ + dset_makeunion(link,p1,p2+n1); + /* printf("link[60]=%d ",link[60]); */ + if(verbose>2)printf("link[p1=%d]=%d link[p2+n1=%d]=%d\n",p1,link[p1],p2+n1,link[p2+n1]); + } /* j */ + } /* i */ + if(verbose!=0){ + printf("\n"); + for(i=0;i<n1+n2;i++){ + if(i!=link[i]){ + printf("Link found!! %d %d\n",i,link[i]); + } + } + } + return Py_BuildValue("O", PyArray_Return(res)); +} + + + + + + + + + + + static PyMethodDef connectedpixelsMethods[] = { {"connectedpixels", (PyCFunction) connectedpixels, METH_VARARGS | METH_KEYWORDS, connectedpixels_doc}, {"blobproperties", (PyCFunction) blobproperties, METH_VARARGS | METH_KEYWORDS, blobproperties_doc}, + {"bloboverlaps", (PyCFunction) bloboverlaps, METH_VARARGS | METH_KEYWORDS, + bloboverlaps_doc}, {"roisum", (PyCFunction) roisum, METH_VARARGS | METH_KEYWORDS, roisum_doc}, {NULL, NULL, 0, NULL} /* setinel */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2006-11-22 20:49:16
|
Revision: 424 http://svn.sourceforge.net/fable/?rev=424&view=rev Author: andy_gotz Date: 2006-11-22 12:49:16 -0800 (Wed, 22 Nov 2006) Log Message: ----------- removed unused imports Modified Paths: -------------- gui/trunk/fable.beamline.rcp/src/fable/beamline/rcp/DiodemuxView.java Modified: gui/trunk/fable.beamline.rcp/src/fable/beamline/rcp/DiodemuxView.java =================================================================== --- gui/trunk/fable.beamline.rcp/src/fable/beamline/rcp/DiodemuxView.java 2006-11-22 10:22:46 UTC (rev 423) +++ gui/trunk/fable.beamline.rcp/src/fable/beamline/rcp/DiodemuxView.java 2006-11-22 20:49:16 UTC (rev 424) @@ -1,19 +1,17 @@ package fable.beamline.rcp; import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.window.ApplicationWindow; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; + import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Layout; import org.eclipse.swt.widgets.Listener; import org.eclipse.ui.part.ViewPart; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Andy G. <and...@es...> - 2006-11-22 16:22:35
|
this is a test to see if this mailing list works |