Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2000 
_{Jan}
(8) 
_{Feb}
(49) 
_{Mar}
(48) 
_{Apr}
(28) 
_{May}
(37) 
_{Jun}
(28) 
_{Jul}
(16) 
_{Aug}
(16) 
_{Sep}
(44) 
_{Oct}
(61) 
_{Nov}
(31) 
_{Dec}
(24) 

2001 
_{Jan}
(56) 
_{Feb}
(54) 
_{Mar}
(41) 
_{Apr}
(71) 
_{May}
(48) 
_{Jun}
(32) 
_{Jul}
(53) 
_{Aug}
(91) 
_{Sep}
(56) 
_{Oct}
(33) 
_{Nov}
(81) 
_{Dec}
(54) 
2002 
_{Jan}
(72) 
_{Feb}
(37) 
_{Mar}
(126) 
_{Apr}
(62) 
_{May}
(34) 
_{Jun}
(124) 
_{Jul}
(36) 
_{Aug}
(34) 
_{Sep}
(60) 
_{Oct}
(37) 
_{Nov}
(23) 
_{Dec}
(104) 
2003 
_{Jan}
(110) 
_{Feb}
(73) 
_{Mar}
(42) 
_{Apr}
(8) 
_{May}
(76) 
_{Jun}
(14) 
_{Jul}
(52) 
_{Aug}
(26) 
_{Sep}
(108) 
_{Oct}
(82) 
_{Nov}
(89) 
_{Dec}
(94) 
2004 
_{Jan}
(117) 
_{Feb}
(86) 
_{Mar}
(75) 
_{Apr}
(55) 
_{May}
(75) 
_{Jun}
(160) 
_{Jul}
(152) 
_{Aug}
(86) 
_{Sep}
(75) 
_{Oct}
(134) 
_{Nov}
(62) 
_{Dec}
(60) 
2005 
_{Jan}
(187) 
_{Feb}
(318) 
_{Mar}
(296) 
_{Apr}
(205) 
_{May}
(84) 
_{Jun}
(63) 
_{Jul}
(122) 
_{Aug}
(59) 
_{Sep}
(66) 
_{Oct}
(148) 
_{Nov}
(120) 
_{Dec}
(70) 
2006 
_{Jan}
(460) 
_{Feb}
(683) 
_{Mar}
(589) 
_{Apr}
(559) 
_{May}
(445) 
_{Jun}
(712) 
_{Jul}
(815) 
_{Aug}
(663) 
_{Sep}
(559) 
_{Oct}
(930) 
_{Nov}
(373) 
_{Dec}

S  M  T  W  T  F  S 







1
(3) 
2
(1) 
3

4

5
(4) 
6
(5) 
7
(2) 
8
(2) 
9
(2) 
10
(3) 
11
(3) 
12
(1) 
13

14

15
(1) 
16
(2) 
17
(7) 
18
(1) 
19
(3) 
20

21
(1) 
22

23

24

25
(1) 
26
(5) 
27

28
(5) 
29
(3) 
30
(1) 






From: Rob <europax@ho...>  20010930 16:32:17

Thanks Peauru for the info. I tried to install the FreeBSD vtk port, but it won't compile. It ran for an hour and then crashed. I did install it on windows so we'll see how that works today. I've been focusing most of my effort to port Animabob to Cygwin. I am very impressed with Cygwin so far as its XFree86 was easy to set up with no XFree86config. I also found the OpenDX port to Cygwin, so I'll play with that a little as well. Rob. Pearu Peterson wrote: > > On Fri, 28 Sep 2001, Nathaniel Gray wrote: > > > Nope. Grace is only for 2d plots AFAIK. See their website for more info. > > You might want to check out VTK and OpenDX, both of which have entries in the > > Rob, have you tried Mayavi (http://mayavi.sourceforge.net) that is > fully 3D capable. And see http://cens.ioc.ee/projects/pyvtk/ that is > prototype software to create VTK files from Python objects. > > Regards, > Pearu > > The following fragment is from Mayavi README.txt: > > The MayaVi Data Visualizer > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > MayaVi is a free, easy to use scientific data visualizer. It is > written in Python and uses the amazing Visualization Toolkit (VTK) for > the graphics. It provides a GUI written using. MayaVi is free and > distributed under the GNU GPL. It is also cross platform and should > run on any platform where both Python and VTK are available (which is > almost any *nix, Mac OSX or Windows). > <snip>  The Numeric Python EM Project http://www.members.home.net/europax 
From: Pearu Peterson <pearu@ce...>  20010929 06:52:30

On Fri, 28 Sep 2001, Nathaniel Gray wrote: > Nope. Grace is only for 2d plots AFAIK. See their website for more info. > You might want to check out VTK and OpenDX, both of which have entries in the Rob, have you tried Mayavi (http://mayavi.sourceforge.net) that is fully 3D capable. And see http://cens.ioc.ee/projects/pyvtk/ that is prototype software to create VTK files from Python objects. Regards, Pearu The following fragment is from Mayavi README.txt: The MayaVi Data Visualizer ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ MayaVi is a free, easy to use scientific data visualizer. It is written in Python and uses the amazing Visualization Toolkit (VTK) for the graphics. It provides a GUI written using. MayaVi is free and distributed under the GNU GPL. It is also cross platform and should run on any platform where both Python and VTK are available (which is almost any *nix, Mac OSX or Windows). <snip> 
From: Nathaniel Gray <n8gray@ca...>  20010929 00:31:17

Nope. Grace is only for 2d plots AFAIK. See their website for more info. You might want to check out VTK and OpenDX, both of which have entries in the Vaults of Parnassus. I've never tried either one but both look like industrial strength volume visualization packages and both have python bindings. n8 On Friday 28 September 2001 05:23 pm, Rob wrote: > Can it do any 3d volume rendering? I've heard of grace, but know > nothing about it. Rob. > > Nathaniel Gray wrote: > > __________________________________________________________________ > > > > Announcing: gracePlot.py v0.5 > > > > An interactive, userfriendly python interface to the > > Grace plotting package. > > > > __________________________________________________________________ > >  Nathaniel Gray California Institute of Technology Computation and Neural Systems  
From: Rob <europax@ho...>  20010929 00:24:17

Can it do any 3d volume rendering? I've heard of grace, but know nothing about it. Rob. Nathaniel Gray wrote: > > __________________________________________________________________ > > Announcing: gracePlot.py v0.5 > > An interactive, userfriendly python interface to the > Grace plotting package. > > __________________________________________________________________ > > * WHAT IS IT? > > gracePlot.py is a highlevel interface to the Grace plotting package available > at: http://plasmagate.weizmann.ac.il/Grace/ The goal of gracePlot is to > offer the user an interactive plotting capability similar to that found in > commercial packages such as Matlab and Mathematica, including GUI support for > modifying plots and a userfriendly, pythonic interactive commandline > interface. > > * WHAT FEATURES DOES IT OFFER? > > Since this package is in the early stages of development it does not yet > provide highlevel commandline access to all of Grace's plotting > functionality. It does, however, offer: > * Line Plots (with or without errorbars) > * Histograms (with or without errorbars) > * Multiple graphs (sets of axes) per plot > * Multiple simultaneous plots (grace sessions) > * Overlaid graphs, using a 'hold' command similar to Matlab's > * Legends, titles, axis labels, and axis limits > * Integration with Numerical Python and Scientific Python's Histogram > object > > Note that all advanced features and customizations are available through the > Grace UI, so you can compose rough plots in Python and then polish them up in > Grace. > > * HOW DO I USE IT? > > Here is an example session that creates a plot with two sets of axes, putting > a line plot in one and a histogram in the other: > Python 2.1.1 (#2, Jul 31 2001, 14:10:42) > [GCC 2.96 20000731 (LinuxMandrake 8.0 2.960.48mdk)] on linux2 > Type "copyright", "credits" or "license" for more information. > >>> from gracePlot import gracePlot > >>> p = gracePlot() # A grace session opens > >>> p.plot( [1,2,3,4,5], [10, 4, 2, 4, 10], [1, 0.7, 0.5, 1, 2], > ... symbols=1 ) # A plot with errorbars & symbols > >>> p.title('Funding: Ministry of Silly Walks') > >>> p.ylabel('Funding (Pounds\S10\N)') > >>> p.multi(2,1) # Multiple plots: 2 rows, 1 column > >>> p.xlimit(0, 6) # Set limits of xaxis > >>> p.focus(1,0) # Set current graph to row 1, column 0 > >>> p.histoPlot( [7, 15, 18, 20, 21], x_min=1, > ... dy=[2, 3.5, 4.6, 7.2, 8.8]) # A histogram w/errorbars > >>> p.xlabel('Silliness Index') > >>> p.ylabel('Applications/yr') > >>> p.xlimit(0, 6) # Set limits of xaxis > > The result of this session can be found at: > http://www.idyll.org/~n8gray/code/index.html > > * WHERE DO I GET IT? > > gracePlot is available here: > http://www.idyll.org/~n8gray/code/index.html > > ___________________________________________________________ > > Cheers, > n8 > >  > Nathaniel Gray > > California Institute of Technology > Computation and Neural Systems >  > > _______________________________________________ > Numpydiscussion mailing list > Numpydiscussion@... > https://lists.sourceforge.net/lists/listinfo/numpydiscussion  The Numeric Python EM Project http://www.members.home.net/europax 
From: Nathaniel Gray <n8gray@ca...>  20010928 23:40:46

__________________________________________________________________ Announcing: gracePlot.py v0.5 An interactive, userfriendly python interface to the Grace plotting package. __________________________________________________________________ * WHAT IS IT? gracePlot.py is a highlevel interface to the Grace plotting package available at: http://plasmagate.weizmann.ac.il/Grace/ The goal of gracePlot is to offer the user an interactive plotting capability similar to that found in commercial packages such as Matlab and Mathematica, including GUI support for modifying plots and a userfriendly, pythonic interactive commandline interface. * WHAT FEATURES DOES IT OFFER? Since this package is in the early stages of development it does not yet provide highlevel commandline access to all of Grace's plotting functionality. It does, however, offer: * Line Plots (with or without errorbars) * Histograms (with or without errorbars) * Multiple graphs (sets of axes) per plot * Multiple simultaneous plots (grace sessions) * Overlaid graphs, using a 'hold' command similar to Matlab's * Legends, titles, axis labels, and axis limits * Integration with Numerical Python and Scientific Python's Histogram object Note that all advanced features and customizations are available through the Grace UI, so you can compose rough plots in Python and then polish them up in Grace. * HOW DO I USE IT? Here is an example session that creates a plot with two sets of axes, putting a line plot in one and a histogram in the other: Python 2.1.1 (#2, Jul 31 2001, 14:10:42) [GCC 2.96 20000731 (LinuxMandrake 8.0 2.960.48mdk)] on linux2 Type "copyright", "credits" or "license" for more information. >>> from gracePlot import gracePlot >>> p = gracePlot() # A grace session opens >>> p.plot( [1,2,3,4,5], [10, 4, 2, 4, 10], [1, 0.7, 0.5, 1, 2], ... symbols=1 ) # A plot with errorbars & symbols >>> p.title('Funding: Ministry of Silly Walks') >>> p.ylabel('Funding (Pounds\S10\N)') >>> p.multi(2,1) # Multiple plots: 2 rows, 1 column >>> p.xlimit(0, 6) # Set limits of xaxis >>> p.focus(1,0) # Set current graph to row 1, column 0 >>> p.histoPlot( [7, 15, 18, 20, 21], x_min=1, ... dy=[2, 3.5, 4.6, 7.2, 8.8]) # A histogram w/errorbars >>> p.xlabel('Silliness Index') >>> p.ylabel('Applications/yr') >>> p.xlimit(0, 6) # Set limits of xaxis The result of this session can be found at: http://www.idyll.org/~n8gray/code/index.html * WHERE DO I GET IT? gracePlot is available here: http://www.idyll.org/~n8gray/code/index.html ___________________________________________________________ Cheers, n8  Nathaniel Gray California Institute of Technology Computation and Neural Systems  
From: Rob <europax@ho...>  20010928 14:10:07

Hi Janko, yes I would love to have it. Thank you! I once installed Viz5D, but didn't quite know what to do with it. One thing though, the Windows version requires an X11 server, but thats better than no program at all :) I also installed OpenDX, the FreeBSD port version, but everytime I try to do anything it core dumps. I also want to look into VRML. Rob. Janko Hauser wrote: > > I would try vis5d, which is a very nice out of the box viewer of > 5DData. I have a module which can write vis5dfiles directly from > numpydata. The module is not polished, so if there is interest I > would send it privatly to you. > > http://vis5d.sourceforge.net/ > > http://www.ssec.wisc.edu/~billh/vis5d.html > > HTH, > > __Janko > > Rob writes: > > I've been using the "brick of bytes" format for my FDTD outputs, but > > unfortunately I can' find any type of 3d viewer for Windows. I am now > > using the X11/OpenGL based Animabob, which creates a movie of the series > > of dumped files. > > > > I am thinking of trying some other type of file format and viewer. I am > > wondering what others use to view 3d fields or data? Of course if it > > used Numpy and Python all the better. > > > > Thanks, Rob. > > > > > >  > > The Numeric Python EM Project > > > > http://www.members.home.net/europax > > > > _______________________________________________ > > Numpydiscussion mailing list > > Numpydiscussion@... > > https://lists.sourceforge.net/lists/listinfo/numpydiscussion  The Numeric Python EM Project http://www.members.home.net/europax 
From: Rob <europax@ho...>  20010928 03:47:52

I've been using the "brick of bytes" format for my FDTD outputs, but unfortunately I can' find any type of 3d viewer for Windows. I am now using the X11/OpenGL based Animabob, which creates a movie of the series of dumped files. I am thinking of trying some other type of file format and viewer. I am wondering what others use to view 3d fields or data? Of course if it used Numpy and Python all the better. Thanks, Rob.  The Numeric Python EM Project http://www.members.home.net/europax 
From: Rob <europax@ho...>  20010928 03:11:14

I fixed my code by turning the one dimensional arrays into 3 dimensional ones. This is much faster and totally sliced. But there still must be a way thats even faster. Rob. Rob wrote: > > I've been working on this for so long I may be missing the obvious. > Here is a snippet of code that I would like to at least get rid of one > more indexing operation. The problem is the presence of the one > dimensional array constants which are functions of x,y, or z depending > on their location: (you may recognize this as some FDTD code) Any > ideas? > > Thanks, Rob. > > ####################################/ > # Update the interior of the mesh: > # all vector H vector components > # > > ## for az in range(0,nz): > for ay in range(0,ny): > for ax in range(0,nx): > > dstore[ax,ay,0:nz]=Bx[ax,ay,0:nz] > > Bx[ax,ay,0:nz] = Bx[ax,ay,0:nz] * C1[0:nz] + ( ( > (Ey[ax,ay,1:(nz+1)]Ey[ax,ay,0:nz] ) / dz  > (Ez[ax,ay+1,0:nz]Ez[ax,ay,0:nz]) / dy ) * C2[0:nz] ) > > Hx[ax,ay,0:nz]= Hx[ax,ay,0:nz] * C3[ay] + ( ( > Bx[ax,ay,0:nz] * C5[ax]  dstore[ax,ay,0:nz] * C6[ax] ) * > C4h[ay] ) > > dstore[ax,ay,0:nz]=By[ax,ay,0:nz] > > By[ax,ay,0:nz] = By[ax,ay,0:nz] * C1[ax] + ( ( > (Ez[ax+1,ay,0:nz]Ez[ax,ay,0:nz]) / dx  > (Ex[ax,ay,1:(nz+1)]Ex[ax,ay,0:nz]) / dz ) * C2[ax] ) > > Hy[ax,ay,0:nz]= Hy[ax,ay,0:nz] * C3[0:nz] + ( ( > By[ax,ay,0:nz] * C5[ay]  dstore[ax,ay,0:nz] * C6[ay] ) * > C4h[0:nz] ) > > dstore[ax,ay,0:nz]=Bz[ax,ay,0:nz] > > Bz[ax,ay,0:nz] = Bz[ax,ay,0:nz] * C1[ay] + ( ( > (Ex[ax,ay+1,0:nz]Ex[ax,ay,0:nz] ) / dy  > (Ey[ax+1,ay,0:nz]Ey[ax,ay,0:nz] ) / dx ) * C2[ay] ) > > Hz[ax,ay,0:nz]= Hz[ax,ay,0:nz] * C3[ax] + ( ( > Bz[ax,ay,0:nz] * C5[0:nz]  dstore[ax,ay,0:nz] * C6[0:nz] > ) * C4h[ax] ) > > >  > The Numeric Python EM Project > > http://www.members.home.net/europax > > _______________________________________________ > Numpydiscussion mailing list > Numpydiscussion@... > https://lists.sourceforge.net/lists/listinfo/numpydiscussion  The Numeric Python EM Project http://www.members.home.net/europax 
From: Rob <europax@ho...>  20010928 01:06:59

I've been working on this for so long I may be missing the obvious. Here is a snippet of code that I would like to at least get rid of one more indexing operation. The problem is the presence of the one dimensional array constants which are functions of x,y, or z depending on their location: (you may recognize this as some FDTD code) Any ideas? Thanks, Rob. ####################################/ # Update the interior of the mesh: # all vector H vector components # ## for az in range(0,nz): for ay in range(0,ny): for ax in range(0,nx): dstore[ax,ay,0:nz]=Bx[ax,ay,0:nz] Bx[ax,ay,0:nz] = Bx[ax,ay,0:nz] * C1[0:nz] + ( ( (Ey[ax,ay,1:(nz+1)]Ey[ax,ay,0:nz] ) / dz  (Ez[ax,ay+1,0:nz]Ez[ax,ay,0:nz]) / dy ) * C2[0:nz] ) Hx[ax,ay,0:nz]= Hx[ax,ay,0:nz] * C3[ay] + ( ( Bx[ax,ay,0:nz] * C5[ax]  dstore[ax,ay,0:nz] * C6[ax] ) * C4h[ay] ) dstore[ax,ay,0:nz]=By[ax,ay,0:nz] By[ax,ay,0:nz] = By[ax,ay,0:nz] * C1[ax] + ( ( (Ez[ax+1,ay,0:nz]Ez[ax,ay,0:nz]) / dx  (Ex[ax,ay,1:(nz+1)]Ex[ax,ay,0:nz]) / dz ) * C2[ax] ) Hy[ax,ay,0:nz]= Hy[ax,ay,0:nz] * C3[0:nz] + ( ( By[ax,ay,0:nz] * C5[ay]  dstore[ax,ay,0:nz] * C6[ay] ) * C4h[0:nz] ) dstore[ax,ay,0:nz]=Bz[ax,ay,0:nz] Bz[ax,ay,0:nz] = Bz[ax,ay,0:nz] * C1[ay] + ( ( (Ex[ax,ay+1,0:nz]Ex[ax,ay,0:nz] ) / dy  (Ey[ax+1,ay,0:nz]Ey[ax,ay,0:nz] ) / dx ) * C2[ay] ) Hz[ax,ay,0:nz]= Hz[ax,ay,0:nz] * C3[ax] + ( ( Bz[ax,ay,0:nz] * C5[0:nz]  dstore[ax,ay,0:nz] * C6[0:nz] ) * C4h[ax] )  The Numeric Python EM Project http://www.members.home.net/europax 
From: John J. Lee <jjl@po...>  20010926 21:09:22

On Wed, 26 Sep 2001, Chris Barker wrote: [...] > OK, Tim Hochberg was nice enough to point out to me that abs() works on > NumPy arrays. However, it does not work on other sequences, so maybe we > need this: > > def abs(a): > return abs(asarray(a)) Numeric.absolute, as Robert Kern pointed out, maybe that hasn't arrived in your mailbox... John 
From: Robert Kern <kern@ca...>  20010926 19:00:12

On Wed, Sep 26, 2001 at 11:58:21AM 0700, Chris Barker wrote: > Hi all, > > I was recently surprised to find that there are no round(0 or abs() > Ufuncs with Numeric. I'm imagining that they might exist under other > names, around and absolute.  Robert Kern kern@... "In the fields of hell where the grass grows high Are the graves of dreams allowed to die."  Richard Harter 
From: Chris Barker <chrishbarker@ho...>  20010926 18:59:16

Chris Barker wrote: > I was recently surprised to find that there are no round() or abs() > Ufuncs with Numeric. I'm imagining that they might exist under other > names, but if not, I submit my versions for critique (lightly tested) OK, Tim Hochberg was nice enough to point out to me that abs() works on NumPy arrays. However, it does not work on other sequences, so maybe we need this: def abs(a): return abs(asarray(a)) Chris  Christopher Barker, Ph.D. ChrisHBarker@...    http://members.home.net/barkerlohmann @@ @@ @@ @@@ @@@ @@@ Oil Spill Modeling  @  @  @ Water Resources Engineering    Coastal and Fluvial Hydrodynamics   
From: Chris Barker <chrishbarker@ho...>  20010926 18:34:57

Hi all, I was recently surprised to find that there are no round(0 or abs() Ufuncs with Numeric. I'm imagining that they might exist under other names, but if not, I submit my versions for critique (lightly tested) Chris from Numeric import * def Uabs(a): """ A Ufunc version of the Python abs() function """ a = asarray(a) if a.typecode() == 'D' or a.typecode() == 'F':# for complex numbers return sqrt(a.imag**2 + a.real**2) else: return where(a < 0, a, a) def Uround(a,n=0): """ A Ufunc version of the Python round() function. It should behave in the same way Note: I think this is the right thing to do for negative numbers, but not totally sure. (Uround(0.5) = 0, but Uround(0.5000001) = 1) It won't work for complex numbers """ a = asarray(a) n = asarray(n) return floor((a * 10.**n) + 0.5) / 10.**n  Christopher Barker, Ph.D. ChrisHBarker@...    http://members.home.net/barkerlohmann @@ @@ @@ @@@ @@@ @@@ Oil Spill Modeling  @  @  @ Water Resources Engineering    Coastal and Fluvial Hydrodynamics   
From: Gerard Vermeulen <gvermeul@la...>  20010926 12:17:46

Announcing PyQwt0.29.91 FAST and EASY data plotting for Python, NumPy and Qt PyQwt is a set of Python bindings for the Qwt C++ class library. The Qwt library extend the Qt framework with widgets for Scientific and Engineering applications. It contains QwtPlot, a 2d plotting widget, and widgets for data input/output such as and QwtCounter, QwtKnob, QwtThermo and QwtWheel. PyQwt requires and extends PyQt, a set of Python bindings for Qt. PyQwt requires NumPy. NumPy extends the Python language with new data types that make Python an ideal language for numerical computing and experimentation (like MatLab, but better). The home page of PyQwt is http://gerard.vermeulen.free.fr NEW in PyQwt0.29.91: 1. compatible with PyQt2.5/sip2.5 and PyQt2.4/sip2.4. 2. compatible with NumPy20.2.0, and lower. 3. *.exe installer for Windows (requires Qt2.3.0NC). 4. build instructions for Windows and other versions of Qt. 5. HTML documentation with installation instructions and a reference listing the Python calls to PyQwt that are different from the corresponding C++ calls to Qwt. 6. fixed reference counting bug in the methods with NumPy arrays as arguments. 7. new methods: QwtPlot.axisMargins() QwtPlot.closestCurve() QwtPlot.curveKeys() QwtPlot.markerKeys() QwtPlot.title() QwtPlot.titleFont() QwtScale.labelFormat() QwtScale.map() 8. changed methods: QwtCurve.verifyRange()  cleaned up interface QwtPlot.adjust()  is now fully implemented QwtPlot.enableLegend()  (de)selects all items or a single item 9. removed methods (incompatible with Python, because unsafe, even in C++): QwtCurve.setRawData() QwtPlot.setCurveRawData() QwtSpline.copyValues() Gerard Vermeulen 
From: Henry Harpending <harpend@xm...>  20010925 22:19:25

I often find myself wanting to append a number to a vector. After fumbling experimentation I use def comma(ar,inint): "comma(array,integer) returns array with integer appended" t=array([inint,]) return(concatenate((ar,t),1)) which is used like the comma in apl, i.e. ar < ar, inint. This seems klutzy to me. Is there a simpler way to do it? If ar were a list, ar.append(inint) works, but no such luck after ar has become an array. Thanks, Henry Harpending, University of Utah 
From: Rob <europax@ho...>  20010921 00:53:14

I just announced a ham radio type FDTD simulation to the ham newsgroups. I couldn't resist trying out a ham type antenna, instead of all the waveguide stuff I've been doing. Rob.  The Numeric Python EM Project http://www.members.home.net/europax 
From: Mike Romberg <romberg@fs...>  20010919 18:49:48

>>>>> " " == Herbert L Roitblat <roitblat@...> writes: > Konrad's solution is MUCH more elegant. > Message  From: "Konrad Hinsen" <hinsen@...> [snip] >> How about this: >> >> b = 0*a b[:1, :1] = a[1:, 1:] >> I think it looks cleaner as well. I've managed to create a function (with the help of the tips on this list) which can offset a 2d array in either or both the x and y dimensions. I strongly suspect that someone who *gets* python and numeric slicing better than I, can come up with a cleaner approach. def getindicies(o, l): if o > 0: s1 = o; e1 = l; s2 = 0; e2 = l  o elif o < 0: s1 = 0; e1 = l + o; s2 = o; e2 = l else: s1 = 0; e1 = l; s2 = 0; e2 = l return s1, e1, s2, e2 # return a 2d array whose dimensions match a with the data offset # controlled by x and y. def offset(a, x, y): sy1, ey1, sy2, ey2 = getindicies(y, a.shape[0]) sx1, ex1, sx2, ex2 = getindicies(x, a.shape[1]) b = zeros(a.shape) b[sy1:ey1,sx1:ex1] = a[sy2:ey2,sx2:ex2] return b a = array(((1, 2, 3), (4, 5, 6), (7, 8, 9))) # no offset print offset(a, 0, 0) # offset by 1 column in x print offset(a, 1, 0) # offset by 1 column (opposite dir) in x print offset(a, 1, 0) # offset by 2 columns in x print offset(a, 2, 0) # offset by 2 columns in y print offset(a, 0, 2) Thanks, Mike Romberg (romberg@...) 
From: Herbert L. Roitblat <roitblat@ha...>  20010919 17:13:16

Konrad's solution is MUCH more elegant. HLR  Original Message  From: "Konrad Hinsen" <hinsen@...> To: <roitblat@...> Cc: <chrishbarker@...>; <romberg@...>; <numpydiscussion@...> Sent: Tuesday, September 18, 2001 10:05 PM Subject: Re: [Numpydiscussion] Offset 2D arrays > > This will work: > > b=zeros ((3,3)) > > b[:2,:2] = b[:2,:2] + a[1:,1:] > > > > You need to know the size of a to use this scheme. > > How about this: > > b = 0*a > b[:1, :1] = a[1:, 1:] > > Works for any shape and type of a. > > Konrad. >  >   > Konrad Hinsen  EMail: hinsen@... > Centre de Biophysique Moleculaire (CNRS)  Tel.: +332.38.25.56.24 > Rue Charles Sadron  Fax: +332.38.63.15.17 > 45071 Orleans Cedex 2  Deutsch/Esperanto/English/ > France  Nederlands/Francais >   > 
From: Konrad Hinsen <hinsen@cn...>  20010919 08:06:06

> This will work: > b=zeros ((3,3)) > b[:2,:2] = b[:2,:2] + a[1:,1:] > > You need to know the size of a to use this scheme. How about this: b = 0*a b[:1, :1] = a[1:, 1:] Works for any shape and type of a. Konrad.   Konrad Hinsen  EMail: hinsen@... Centre de Biophysique Moleculaire (CNRS)  Tel.: +332.38.25.56.24 Rue Charles Sadron  Fax: +332.38.63.15.17 45071 Orleans Cedex 2  Deutsch/Esperanto/English/ France  Nederlands/Francais  
From: Herbert L. Roitblat <roitblat@ha...>  20010918 17:56:25

This will work: b=zeros ((3,3)) b[:2,:2] = b[:2,:2] + a[1:,1:] You need to know the size of a to use this scheme.  Original Message  From: "Chris Barker" <chrishbarker@...> To: "Mike Romberg" <romberg@...> Cc: <numpydiscussion@...> Sent: Monday, September 17, 2001 2:03 PM Subject: Re: [Numpydiscussion] Offset 2D arrays > Mike Romberg wrote: > > > > I am attempting to create 2D arrays which are offset copies of a > > given starting array. For example if I have a 2D array like this: > > > have any ideas? > > This is not quite as clean as i would like, but this will work: > > >>> a = array([[1, 2, 3], > ... [4, 5, 6], > ... [7, 8, 9]]) > >>> m,n = a.shape > >>> b[:m1,:n1] = a[1:,1:] > >>> b > array([[5, 6, 0], > [8, 9, 0], > [0, 0, 0]]) > >>> > > if b does not have to be the same shape as a, then it is really easy: > > >>> b = a[1:,1:] > > Chris > > >  > Christopher Barker, > Ph.D. > ChrisHBarker@...    > http://members.home.net/barkerlohmann @@ @@ @@ > @@@ @@@ @@@ > Oil Spill Modeling  @  @  @ > Water Resources Engineering    > Coastal and Fluvial Hydrodynamics  >  > > _______________________________________________ > Numpydiscussion mailing list > Numpydiscussion@... > https://lists.sourceforge.net/lists/listinfo/numpydiscussion > 
From: Chris Barker <chrishbarker@ho...>  20010917 23:40:48

Mike Romberg wrote: > > I am attempting to create 2D arrays which are offset copies of a > given starting array. For example if I have a 2D array like this: > have any ideas? This is not quite as clean as i would like, but this will work: >>> a = array([[1, 2, 3], ... [4, 5, 6], ... [7, 8, 9]]) >>> m,n = a.shape >>> b[:m1,:n1] = a[1:,1:] >>> b array([[5, 6, 0], [8, 9, 0], [0, 0, 0]]) >>> if b does not have to be the same shape as a, then it is really easy: >>> b = a[1:,1:] Chris  Christopher Barker, Ph.D. ChrisHBarker@...    http://members.home.net/barkerlohmann @@ @@ @@ @@@ @@@ @@@ Oil Spill Modeling  @  @  @ Water Resources Engineering    Coastal and Fluvial Hydrodynamics   
From: Eric Nodwell <nodwell@ph...>  20010917 23:39:22

For "refine indexing and slicing" read "redefine indexing and slicing". Oops :) 
From: Eric Nodwell <nodwell@ph...>  20010917 23:34:45

Mike, As was pointed out to me when I had a similar query, one way to do this is to define a class which inherits UserArray and refine indexing and slicing. I actually shifted by an offset of one in the opposite direction to what you seem to require. I had intended to generalize to arbitrary offsets, but haven't had the time yet. Anyway, you're welcome to grab my code at http://www.physics.ubc.ca/~mbelab/python/arrayone as a starting point for your class. There are still some issues and quirkiness with the code, but they're documented along with workarounds, and suggestions for fixes have been made on this mailing list. Again, it's a matter of time... regards, Eric On Mon, Sep 17, 2001 at 05:20:06PM 0600, Mike Romberg wrote: > > I am attempting to create 2D arrays which are offset copies of a > given starting array. For example if I have a 2D array like this: > > array([[1, 2, 3], > [4, 5, 6], > [7, 8, 9]]) > > I would like to offset it by some amount in either or both the x and > y dimension. Lets say that both the x and y offset would be 1. Then > I would like to have an array like this: > > > > array([[5, 6, 0], > [8, 9, 0], > [0, 0, 0]]) > > Here I don't really care about the values which are now zero. The > main point is that now I can compare the data values at any given > (x,y) point with the values at the adjacent point (over one on each > axis). This would be useful for the kinds of calculations we need to > do. I just can't come up with a numeric way to do this. Does anyone > have any ideas? > > Thanks alot, > > Mike Romberg (romberg@...) > > _______________________________________________ > Numpydiscussion mailing list > Numpydiscussion@... > https://lists.sourceforge.net/lists/listinfo/numpydiscussion  ******************************** Eric Nodwell Ph.D. candidate Department of Physics University of British Columbia tel: 6048225425 fax: 6048225324 nodwell@... 
From: Chris Barker <chrishbarker@ho...>  20010917 23:22:27

OOPS! I replied to an arbitray message to get the address,and I forgot to change the subject, so here is the same message I just posted, but with an appropriate subject. Hi all, The MATLAB Digest just put out a little article about array indexing in MATLAB. I thought some of yo might find it interesting, and it might give some ideas for NumPy2. Most of what MATLAB has, NumPy has an equivalent, but I would love to see what matlab calls vector indexing, and a more natural way to do masks. I know vector indexing would be a pretty tricky thing to have work, at least with slices being references and all, but it would be a very nice thing!! Perhaps some brilliant person can figure out an elegant and efficient way to do it. Here is where you will find the article: http://www.mathworks.com/company/digest/sept01/matrix.shtml Chris  Christopher Barker, Ph.D. ChrisHBarker@...    http://members.home.net/barkerlohmann @@ @@ @@ @@@ @@@ @@@ Oil Spill Modeling  @  @  @ Water Resources Engineering    Coastal and Fluvial Hydrodynamics   
From: Mike Romberg <romberg@fs...>  20010917 23:20:09

I am attempting to create 2D arrays which are offset copies of a given starting array. For example if I have a 2D array like this: array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) I would like to offset it by some amount in either or both the x and y dimension. Lets say that both the x and y offset would be 1. Then I would like to have an array like this: array([[5, 6, 0], [8, 9, 0], [0, 0, 0]]) Here I don't really care about the values which are now zero. The main point is that now I can compare the data values at any given (x,y) point with the values at the adjacent point (over one on each axis). This would be useful for the kinds of calculations we need to do. I just can't come up with a numeric way to do this. Does anyone have any ideas? Thanks alot, Mike Romberg (romberg@...) 