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
|
From: Rob <eu...@ho...> - 2001-09-29 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, user-friendly python interface to the > Grace plotting package. > > __________________________________________________________________ > > * WHAT IS IT? > > gracePlot.py is a high-level interface to the Grace plotting package available > at: http://plasma-gate.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 user-friendly, pythonic interactive command-line > interface. > > * WHAT FEATURES DOES IT OFFER? > > Since this package is in the early stages of development it does not yet > provide high-level command-line 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 (Linux-Mandrake 8.0 2.96-0.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 x-axis > >>> 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 x-axis > > 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 > -- > > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion -- The Numeric Python EM Project www.members.home.net/europax |
From: Nathaniel G. <n8...@ca...> - 2001-09-28 23:40:46
|
__________________________________________________________________ Announcing: gracePlot.py v0.5 An interactive, user-friendly python interface to the Grace plotting package. __________________________________________________________________ * WHAT IS IT? gracePlot.py is a high-level interface to the Grace plotting package available at: http://plasma-gate.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 user-friendly, pythonic interactive command-line interface. * WHAT FEATURES DOES IT OFFER? Since this package is in the early stages of development it does not yet provide high-level command-line 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 (Linux-Mandrake 8.0 2.96-0.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 x-axis >>> 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 x-axis 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 <eu...@ho...> - 2001-09-28 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 > 5D-Data. I have a module which can write vis5d-files directly from > numpy-data. 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 > > > > www.members.home.net/europax > > > > _______________________________________________ > > Numpy-discussion mailing list > > Num...@li... > > https://lists.sourceforge.net/lists/listinfo/numpy-discussion -- The Numeric Python EM Project www.members.home.net/europax |
From: Rob <eu...@ho...> - 2001-09-28 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 www.members.home.net/europax |
From: Rob <eu...@ho...> - 2001-09-28 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 > > www.members.home.net/europax > > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion -- The Numeric Python EM Project www.members.home.net/europax |
From: Rob <eu...@ho...> - 2001-09-28 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 www.members.home.net/europax |
From: John J. L. <jj...@po...> - 2001-09-26 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 K. <ke...@ca...> - 2001-09-26 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 ke...@ca... "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter |
From: Chris B. <chr...@ho...> - 2001-09-26 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. Chr...@ho... --- --- --- http://members.home.net/barkerlohmann ---@@ -----@@ -----@@ ------@@@ ------@@@ ------@@@ Oil Spill Modeling ------ @ ------ @ ------ @ Water Resources Engineering ------- --------- -------- Coastal and Fluvial Hydrodynamics -------------------------------------- ------------------------------------------------------------------------ |
From: Chris B. <chr...@ho...> - 2001-09-26 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. Chr...@ho... --- --- --- http://members.home.net/barkerlohmann ---@@ -----@@ -----@@ ------@@@ ------@@@ ------@@@ Oil Spill Modeling ------ @ ------ @ ------ @ Water Resources Engineering ------- --------- -------- Coastal and Fluvial Hydrodynamics -------------------------------------- ------------------------------------------------------------------------ |
From: Gerard V. <gve...@la...> - 2001-09-26 12:17:46
|
Announcing PyQwt-0.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 PyQwt-0.29.91: 1. compatible with PyQt-2.5/sip-2.5 and PyQt-2.4/sip-2.4. 2. compatible with NumPy-20.2.0, and lower. 3. *.exe installer for Windows (requires Qt-2.3.0-NC). 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 H. <ha...@xm...> - 2001-09-25 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 <eu...@ho...> - 2001-09-21 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 www.members.home.net/europax |
From: Mike R. <ro...@fs...> - 2001-09-19 18:49:48
|
>>>>> " " == Herbert L Roitblat <roi...@ha...> writes: > Konrad's solution is MUCH more elegant. > Message ----- From: "Konrad Hinsen" <hi...@cn...> [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 (ro...@fs...) |
From: Herbert L. R. <roi...@ha...> - 2001-09-19 17:13:16
|
Konrad's solution is MUCH more elegant. HLR ----- Original Message ----- From: "Konrad Hinsen" <hi...@cn...> To: <roi...@ha...> Cc: <chr...@ho...>; <ro...@fs...>; <num...@li...> Sent: Tuesday, September 18, 2001 10:05 PM Subject: Re: [Numpy-discussion] 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 | E-Mail: hi...@cn... > Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 > Rue Charles Sadron | Fax: +33-2.38.63.15.17 > 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ > France | Nederlands/Francais > -------------------------------------------------------------------------- ----- > |
From: Konrad H. <hi...@cn...> - 2001-09-19 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 | E-Mail: hi...@cn... Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais ------------------------------------------------------------------------------- |
From: Herbert L. R. <roi...@ha...> - 2001-09-18 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" <chr...@ho...> To: "Mike Romberg" <ro...@fs...> Cc: <num...@li...> Sent: Monday, September 17, 2001 2:03 PM Subject: Re: [Numpy-discussion] 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[:m-1,:n-1] = 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. > Chr...@ho... --- --- --- > http://members.home.net/barkerlohmann ---@@ -----@@ -----@@ > ------@@@ ------@@@ ------@@@ > Oil Spill Modeling ------ @ ------ @ ------ @ > Water Resources Engineering ------- --------- -------- > Coastal and Fluvial Hydrodynamics -------------------------------------- > ------------------------------------------------------------------------ > > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > |
From: Chris B. <chr...@ho...> - 2001-09-17 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[:m-1,:n-1] = 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. Chr...@ho... --- --- --- http://members.home.net/barkerlohmann ---@@ -----@@ -----@@ ------@@@ ------@@@ ------@@@ Oil Spill Modeling ------ @ ------ @ ------ @ Water Resources Engineering ------- --------- -------- Coastal and Fluvial Hydrodynamics -------------------------------------- ------------------------------------------------------------------------ |
From: Eric N. <no...@ph...> - 2001-09-17 23:39:22
|
For "refine indexing and slicing" read "re-define indexing and slicing". Oops :) |
From: Eric N. <no...@ph...> - 2001-09-17 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 work-arounds, 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 (ro...@fs...) > > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion -- ******************************** Eric Nodwell Ph.D. candidate Department of Physics University of British Columbia tel: 604-822-5425 fax: 604-822-5324 no...@ph... |
From: Chris B. <chr...@ho...> - 2001-09-17 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. Chr...@ho... --- --- --- http://members.home.net/barkerlohmann ---@@ -----@@ -----@@ ------@@@ ------@@@ ------@@@ Oil Spill Modeling ------ @ ------ @ ------ @ Water Resources Engineering ------- --------- -------- Coastal and Fluvial Hydrodynamics -------------------------------------- ------------------------------------------------------------------------ |
From: Mike R. <ro...@fs...> - 2001-09-17 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 (ro...@fs...) |
From: Chris B. <chr...@ho...> - 2001-09-17 23:14:34
|
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 eill find the article: http://www.mathworks.com/company/digest/sept01/matrix.shtml -Chris -- Christopher Barker, Ph.D. Chr...@ho... --- --- --- http://members.home.net/barkerlohmann ---@@ -----@@ -----@@ ------@@@ ------@@@ ------@@@ Oil Spill Modeling ------ @ ------ @ ------ @ Water Resources Engineering ------- --------- -------- Coastal and Fluvial Hydrodynamics -------------------------------------- ------------------------------------------------------------------------ |
From: Paul F. D. <pa...@pf...> - 2001-09-17 21:31:08
|
A. Mirone rode to the rescue and the fix is available as Numeric-20.2.1.tar.gz or in CVS. -----Original Message----- From: Travis Oliphant [mailto:oli...@ie...] Sent: Saturday, September 15, 2001 6:58 PM To: Paul F. Dubois Subject: Segfault with latest lapack_litemodule using complex matrices. Hi Paul, With the latest changes to the lapack_lite module, I now get segfaults when I'm trying to load call LinearAlgebra.eigenvectors using a complex-valued matrix. Could you check this on your system? Thanks, -Travis |
From: Rob <eu...@ho...> - 2001-09-16 17:32:42
|
Peter Soendergaard wrote: > > Hello, > > I just browsed over the archives for Numpy-discussion and saw this, and > decided to sign up. > > I work on the ATLAS-project http://math-atlas.sourceforge.net/ and we have > had similar problems with gcc3.0 Gcc 3.0 has a completely new backend > which produces much slower floating point code on i386 machines. It is > most visible on the Athlon, but it also also shows on on P4 and PIII > machines. We havn't yet figured out if there are some optimizations that > can make this go away, but if you need performance stick with the old 2.95 > release for now. > > By the way, if you would like to use Atlas in NumPy (I don't know if you > do it already) I might be of some help. There is c-interfaces to the BLAS > bundled with ATLAS, supporting both row-major and column-major storage. > > Cheers, > > Peter. > > FROM: Rob > DATE: 09/04/2001 18:02:05 > SUBJECT: [Numpy-discussion] Python and Numpy compiled on Athlon > optimized gcc3.01 > > Just for kicks last night I installed gcc3.01 which claims to have Athlon > optimization, ie. -march=athlon. I recompiled Python and Numpy, and then > ran a big simulation. The new compiler ran 200 seconds slower than the > old gcc2.95 with plain -march=pentium. I need to go to the gcc website > and see just what optimization they are claiming. Maybe I should have > also used -02. Rob. > > -- > The Numeric Python EM Project > > http://www.members.home.net/europax > > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion Hi Peter, great to know that I'm not alone. Maybe I can build an EM simulator using all integer math :). I think I mentioned this on the list before, but Win2k on my laptop (1Ghz) runs Numpy and Python faster than my 1.2Ghz Athlon DDR machine using FreeBSD :( Also, for reference, I have a 3DNow optimized MP3encoding program Gogo that encodes mp3's 10x faster on the athlon than Lame does on my FreeBSD system on the laptop. Go figure! -- The Numeric Python EM Project www.members.home.net/europax |