From bryan.cole at teraview.co.uk Mon Feb 3 05:40:26 2003 From: bryan.cole at teraview.co.uk (bryan cole) Date: 03 Feb 2003 10:40:26 +0000 Subject: [SciPy-user] shell for scipy In-Reply-To: <000001c2c97f$64546fc0$8901a8c0@ERICDESKTOP> References: <000001c2c97f$64546fc0$8901a8c0@ERICDESKTOP> Message-ID: <1044268826.3540.29.camel@bryan.teraviewhq.local> On Fri, 2003-01-31 at 23:20, eric jones wrote: > > The problem is at re-running the > > python-process each time to test things out is slow because Scipy > takes > > so long to load each time (OK I'm impatient). > > Agreed. It would be cool if there was some way of doing on-demand > loading of the sub-modules without explicitly requiring people to import > them. I guess this would have to be a python level feature instead of > doing it in scipy. If this were possible, it would ameliorate the > problem markedly. The effort involved (or even if it is possible -- > should be) is not clear to me. I have found that ipython (www-hep.colorado.edu/~fperez/ipython/) goes along way to provide this functionality. With the ipython @edit & @run commands you can edit/run blocks of code. Since the python interpreter remains running between executions, slow module imports only occur once. This works great for SciPy; you can do multiple edits and re-executions of code real fast. Plotting with plt.plot also works this way, provided you use Gui_Thread. I ran into problems trying to call plt.plot from the main thread (with my own wxApp() object and a few extra GUI items); once you destroy the main plot-window, you can only re-create it in a new process (forcing you to kill ipython and start over ... lucky for the ipython logging facility...) All ipython lacks is a pretty user-interface (yes, a worksheet would be nice) with syntax-highlighting. This is important for Windows users who don't commonly have a decent terminal/command-line (installing cygwin is too much hassle for most windows-users). Somehow integrating ipython and pycrust would be my ideal.... Bryan > > eric > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user -- Bryan Cole Teraview Ltd., 302-304 Cambridge Science Park, Milton Road, Cambridge CB4 0WG, United Kingdom. tel: +44 (1223) 435380 / 435386 (direct-dial) fax: +44 (1223) 435382 From alobo at ija.csic.es Mon Feb 3 07:02:14 2003 From: alobo at ija.csic.es (Agustin Lobo) Date: Mon, 3 Feb 2003 13:02:14 +0100 (MET) Subject: [SciPy-user] step in arrays Message-ID: Hi! I would need a little help on this: I want to read a set of images (raw bin data, unsigned int*8) and display them using xply.imagesc just to mae sure there have been no errors at downloding them. For each file, I'm doing the following: f =open("NDVI_GIMMS_8KM.8107","r") a=f.read() b = array(a,typecode=UnsignedInt8) b.shape = (2168,5004) xplt.imagesc(b) The problem is that, as the array "b" is very large, the display takes too long. Therefore, I'm trying to subsample b. I've tried with take(), but no luck. The question is, how could I select every i.e. 10th row and col from matrix b? Also, any other comment on improving what I want to do is welcome! (perhaps I can subsample at reading). Thanks Agus Dr. Agustin Lobo Instituto de Ciencias de la Tierra (CSIC) Lluis Sole Sabaris s/n 08028 Barcelona SPAIN tel 34 93409 5410 fax 34 93411 0012 alobo at ija.csic.es From bryan.cole at teraview.co.uk Mon Feb 3 07:07:43 2003 From: bryan.cole at teraview.co.uk (bryan cole) Date: 03 Feb 2003 12:07:43 +0000 Subject: [SciPy-user] step in arrays In-Reply-To: References: Message-ID: <1044274063.3547.43.camel@bryan.teraviewhq.local> how about: ... b.shape=(2168,5004) c = b[0:2168:8,0:5004:8] #this should subsample b every 8th point xplt.imagesc(c) ... Bryan On Mon, 2003-02-03 at 12:02, Agustin Lobo wrote: > Hi! > I would need a little help on this: > > I want to read a set of images > (raw bin data, unsigned int*8) and > display them using xply.imagesc just > to mae sure there have been no errors at downloding > them. > > For each file, I'm doing the following: > > f =open("NDVI_GIMMS_8KM.8107","r") > a=f.read() > b = array(a,typecode=UnsignedInt8) > b.shape = (2168,5004) > xplt.imagesc(b) > > The problem is that, as the array "b" is very large, > the display takes too long. Therefore, I'm trying > to subsample b. I've tried with take(), but no luck. > The question is, how could I select every i.e. 10th row > and col from matrix b? > > Also, any other comment on improving what I want to do > is welcome! (perhaps I can subsample at reading). > > Thanks > > Agus > > > Dr. Agustin Lobo > Instituto de Ciencias de la Tierra (CSIC) > Lluis Sole Sabaris s/n > 08028 Barcelona SPAIN > tel 34 93409 5410 > fax 34 93411 0012 > alobo at ija.csic.es > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user -- Bryan Cole Teraview Ltd., 302-304 Cambridge Science Park, Milton Road, Cambridge CB4 0WG, United Kingdom. tel: +44 (1223) 435380 / 435386 (direct-dial) fax: +44 (1223) 435382 From alobo at ija.csic.es Mon Feb 3 10:02:56 2003 From: alobo at ija.csic.es (Agustin Lobo) Date: Mon, 3 Feb 2003 16:02:56 +0100 (MET) Subject: [SciPy-user] step in arrays In-Reply-To: <1044274063.3547.43.camel@bryan.teraviewhq.local> Message-ID: Thanks, why is it that, while xplt.imagesc(b[0:2168:8,0:5004:8]) and xplt.imagesc(b[0:2168:8,5004:0:-8]) display the image with a black background xplt.imagesc(b[2168:0:-8,0:5004:8]) displays it with a green background? (the background in the image has value 128, so it seems that somehow I change the lut). Agus Dr. Agustin Lobo Instituto de Ciencias de la Tierra (CSIC) Lluis Sole Sabaris s/n 08028 Barcelona SPAIN tel 34 93409 5410 fax 34 93411 0012 alobo at ija.csic.es On 3 Feb 2003, bryan cole wrote: > how about: > > ... > b.shape=(2168,5004) > c = b[0:2168:8,0:5004:8] #this should subsample b every 8th point > xplt.imagesc(c) > ... > > Bryan > > On Mon, 2003-02-03 at 12:02, Agustin Lobo wrote: > > Hi! > > I would need a little help on this: > > > > I want to read a set of images > > (raw bin data, unsigned int*8) and > > display them using xply.imagesc just > > to mae sure there have been no errors at downloding > > them. > > > > For each file, I'm doing the following: > > > > f =open("NDVI_GIMMS_8KM.8107","r") > > a=f.read() > > b = array(a,typecode=UnsignedInt8) > > b.shape = (2168,5004) > > xplt.imagesc(b) > > > > The problem is that, as the array "b" is very large, > > the display takes too long. Therefore, I'm trying > > to subsample b. I've tried with take(), but no luck. > > The question is, how could I select every i.e. 10th row > > and col from matrix b? > > > > Also, any other comment on improving what I want to do > > is welcome! (perhaps I can subsample at reading). > > > > Thanks > > > > Agus > > > > > > Dr. Agustin Lobo > > Instituto de Ciencias de la Tierra (CSIC) > > Lluis Sole Sabaris s/n > > 08028 Barcelona SPAIN > > tel 34 93409 5410 > > fax 34 93411 0012 > > alobo at ija.csic.es > > > > > > _______________________________________________ > > SciPy-user mailing list > > SciPy-user at scipy.net > > http://www.scipy.net/mailman/listinfo/scipy-user > -- > Bryan Cole > Teraview Ltd., 302-304 Cambridge Science Park, Milton Road, Cambridge CB4 0WG, United Kingdom. > tel: +44 (1223) 435380 / 435386 (direct-dial) fax: +44 (1223) 435382 > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From oliphant at ee.byu.edu Mon Feb 3 11:10:10 2003 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Mon, 3 Feb 2003 09:10:10 -0700 (MST) Subject: [SciPy-user] step in arrays In-Reply-To: Message-ID: > Thanks, > > why is it that, while > > xplt.imagesc(b[0:2168:8,0:5004:8]) > and > xplt.imagesc(b[0:2168:8,5004:0:-8]) > > display the image with a black background > > xplt.imagesc(b[2168:0:-8,0:5004:8]) > > displays it with a green background? > The image is always a byte array and what is plotted is a colormap of 240-255 different colors. Your image values are transformed into that range. If you would like a fixed range, then use cmax= and cmin= as keywords to the imagesc plot. But, in your case, the data should be exactly the same (it's just given in a different order), so I'm not sure what is wrong. You can do source(xplt.imagesc) to see what is happening under the covers Also, xplt.ghelp('pli') can give you the Gist documentation on the underlying commands. This does seem like strange behavior. -Travis From alobo at ija.csic.es Mon Feb 3 11:27:13 2003 From: alobo at ija.csic.es (Agustin Lobo) Date: Mon, 3 Feb 2003 17:27:13 +0100 (MET) Subject: [SciPy-user] execute program from withn python Message-ID: Is there any way to run a program from within python? I would like to run gunzip (and other programs) and then read in the result. This is done within a loop, and beacuse of reasons of disk space, it is not convenient for me in theis case to run the program first for all files and then start python. Thanks Agus Dr. Agustin Lobo Instituto de Ciencias de la Tierra (CSIC) Lluis Sole Sabaris s/n 08028 Barcelona SPAIN tel 34 93409 5410 fax 34 93411 0012 alobo at ija.csic.es From bryan.cole at teraview.co.uk Mon Feb 3 11:42:20 2003 From: bryan.cole at teraview.co.uk (bryan cole) Date: 03 Feb 2003 16:42:20 +0000 Subject: [SciPy-user] execute program from withn python In-Reply-To: References: Message-ID: <1044290540.3547.139.camel@bryan.teraviewhq.local> Try "os.spawnl()" or one of it's relatives (there are eight different variations ... see the Python reference docs). Alternatively, you could use "os.popen()" (4 versions!) to run gunzip on a file and read the result directly into python via a pipe (no need to write an intermediate file). Bryan On Mon, 2003-02-03 at 16:27, Agustin Lobo wrote: > Is there any way to run a program > from within python? > > I would like to run gunzip > (and other programs) and > then read in the result. > This is done within a loop, > and beacuse of reasons > of disk space, it is not convenient > for me in theis case to run the program first for > all files and then start python. > > Thanks > > Agus > > Dr. Agustin Lobo > Instituto de Ciencias de la Tierra (CSIC) > Lluis Sole Sabaris s/n > 08028 Barcelona SPAIN > tel 34 93409 5410 > fax 34 93411 0012 > alobo at ija.csic.es > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user -- Bryan Cole Teraview Ltd., 302-304 Cambridge Science Park, Milton Road, Cambridge CB4 0WG, United Kingdom. tel: +44 (1223) 435380 / 435386 (direct-dial) fax: +44 (1223) 435382 From fperez at pizero.colorado.edu Tue Feb 4 13:18:00 2003 From: fperez at pizero.colorado.edu (Fernando Perez) Date: Tue, 4 Feb 2003 11:18:00 -0700 (MST) Subject: [SciPy-user] ipython => TeXmacs! In-Reply-To: <3E39FFD7.5040108@ActiveState.com> Message-ID: On Thu, 30 Jan 2003, David Ascher wrote: > Fernando Perez wrote: > > >However, as I said before, I don't intend to embark on a gui project myself. > >For my needs, ipython + xemacs is basically perfect. However, if there is > >enough interest in a gui scientific pyhton shell, I'd be glad to help along > >with the internal redesign and I can probably write the 'plumbing' necessary > >for ipython to plug into another external system. But gui programming just > >doesn't interest me very much, sorry. > > > > > I'm interested, not so much in the scipy-ipython integration (although > that would be neat), but in finding a way of using ipython in Komodo, > when we get to do our interactive shells. I'm not going to have time to > work on that for a while, but I'd love to learn more about ipython and > its architecture -- specifically what API you'd like to see between the > GUI handling part and the "model" of the shell. Well, give IPython a try one day and see if it seems to fit your needs. As far as architecture goes, let's say there isn't much of one (to be very kind to me :). IPython is quite robust and useful, but internally a mess. And that's precisely why I'm interested in hearing about possible development along with a good gui: so that I can drive a major internal cleanup with an eye out for gui integration. Honestly, I think that for a text-only shell it's "good enough" and probably the effort of cleaning it up internally isn't really justified. But if there's interest in using it as the core for a good gui, I could definitely reorganize it and actually come up with a good API. The pieces are in my head and I know what needs to be done. Here's how I see it being done: I could reorganize its internals by coordinating with gui folks so that the current ipython (text-mode) becomes one 'view' of the internal engine. That would be the simplest view, as a text client running in a terminal. The gui writers could then call the same engine from inside a graphical window for added functionality. I would help with the internal rewrite and could maintain the text interface, but I won't go into the gui stuff. Sorry but I'm just not very interested in that and don't have the time for it. Ideally it could be done so that PyCrust, Idle or Komodo could all (with suitable, hopefully minor adapations) call ipython for their shell services. If this is done right, it could eventually become part of the standard library and we could have a really solid underpinning for all the python shells. This would bring the added benefit of more developers fixing bugs/adding features to a core which all shells (graphical or not) could benefit from. Best, Fernando. From fperez at pizero.colorado.edu Tue Feb 4 13:31:03 2003 From: fperez at pizero.colorado.edu (Fernando Perez) Date: Tue, 4 Feb 2003 11:31:03 -0700 (MST) Subject: [SciPy-user] shell for scipy In-Reply-To: <87lm12xo3y.fsf@jeeves.blindglobe.net> Message-ID: On Thu, 30 Jan 2003, A.J. Rossini wrote: > >>>>> "FP" == Fernando Perez writes: > > FP> That's exactly what I'd like to have for python: ipython as the command-line > FP> shell, and a gui which uses ipython as its interaction engine, but which can > FP> also save the whole session, edit across lines, embed graphics and change > FP> fonts, etc. > > FP> Such a project is fairly ambitious, but I'd like to pitch it here to see if > FP> there is community response. Mathematica, maple, matlab & IDL all have > FP> graphical desktops and for scipy to dethrone the last two of them, it will > FP> probably need one too (I say the last two because I don't see scipy as > FP> competing with Mathematica, but definitely as a better environment than matlab > FP> or IDL). > > You might look at the Sweave tools in R, combined with ESS (Emacs > Speaks Statistics) for interactive construction and evaluation. It > isn't interactive in the Mathematica sense, but it is the next best > thing -- construction of documents using Noweb/literate programming > techniques, and evaluation of "chunks" interactively, or via a "report > generation" mechanism. sounds very interesting, thanks for the info. If there is enough interest in this to move forward in the direction of a gui, we'll definitely take a look. Cheers, f From fperez at pizero.colorado.edu Tue Feb 4 13:33:20 2003 From: fperez at pizero.colorado.edu (Fernando Perez) Date: Tue, 4 Feb 2003 11:33:20 -0700 (MST) Subject: [SciPy-user] shell for scipy In-Reply-To: <1044012112.21780.37.camel@bryan.teraviewhq.local> Message-ID: On 31 Jan 2003, bryan cole wrote: > OK, I've taken a closer look at ipython and I see I can acheive 'code > block' editing using the @edit magic function. Looks like I'm now an > ipython convert :) Also look at @macro and @save, which allow you to respectively re-execute and save chunks of code you've typed interactively. You can select non-contiguous sets of lines in your input history to assemble on the fly code snippets for quick re-execution. I use @macro a lot when doing interactive work to make single letter aliases for chunks of code I need to rerun many times. Cheers, f. From fperez at pizero.colorado.edu Tue Feb 4 13:37:23 2003 From: fperez at pizero.colorado.edu (Fernando Perez) Date: Tue, 4 Feb 2003 11:37:23 -0700 (MST) Subject: [SciPy-user] shell for scipy In-Reply-To: <15930.33024.963771.82916@monster.linux.in> Message-ID: On Fri, 31 Jan 2003, Prabhu Ramachandran wrote: > >>>>> "FP" == Fernando Perez writes: > > FP> I think IPython is indeed quite nice, and in combination with > > IPython is really nice and a must use for any serious Pythoner. :) > > [snip] > > > FP> I would therefore like to hear from the scipy users/developers > FP> about interest on this topic. I honestly think that ipython > FP> provides some of the most solid low-level interface of all the > FP> current python shells, but it's text only. I definitely can't > FP> do the work of writing a large graphical layer above it, but > FP> I'd be more than happy to coordinate witha larger team for the > FP> necessary rewrites. > > Well, you know my state of affairs well enough to know that I cant > volunteer time but I think the idea of a redesign is good and worth it > in the long run. If there is serious interest the rewrite/redesign > will only make it easier for those who wish to see a graphical > frontend. Besides, if its easy enough perhaps the existing GUI shells > can all incorporate the IPython "engine". However, I have no idea if > that would be possible at all. > > In any case I think it would be really nice if IPython could be > embedded in any GUI shell. That would really make for an extremely > powerful pycrust or pyshell. Ah. Apologies to Prabhu, the mail I just sent a moment ago is basically a copy of his suggestion. I wasn't trying to 'steal' it, it's just that I've been super-swamped with urgent work this week and had fallen behind in my email. I'm trying to catch up and hadn't re-read Prabhu's message when I replied. Just to add something following Prabhu's comments, maybe it will be worth cleaning up ipython's internals regardless. I guess if it's clean inside, the activation barrier for anyone starting a gui project on top of it is that much lower. But I'm really busy, and I'm not sure I'll want to commit the time for that 'just in case'. As I said, for a text-only client I can work with the current code quite well, messy as it is (and it's fairly bug-free as far as I can tell). Cheers, f From prabhu at aero.iitm.ernet.in Tue Feb 4 13:51:20 2003 From: prabhu at aero.iitm.ernet.in (Prabhu Ramachandran) Date: Wed, 5 Feb 2003 00:21:20 +0530 Subject: [SciPy-user] shell for scipy In-Reply-To: References: <15930.33024.963771.82916@monster.linux.in> Message-ID: <15936.2984.824801.308391@monster.linux.in> >>>>> "FP" == Fernando Perez writes: FP> Ah. Apologies to Prabhu, the mail I just sent a moment ago is FP> basically a copy of his suggestion. I wasn't trying to FP> 'steal' it, it's just that I've been super-swamped with urgent Well, I did not even think that you'd do (or intend to do) something like that and did not see your post that way. So, please, no need to apologize. :) [snip] FP> But I'm really busy, and I'm not sure I'll want to commit the FP> time for that 'just in case'. As I said, for a text-only FP> client I can work with the current code quite well, messy as FP> it is (and it's fairly bug-free as far as I can tell). I can sympathize with all of those reasons. :) cheers, prabhu From alobo at ija.csic.es Thu Feb 6 11:01:08 2003 From: alobo at ija.csic.es (Agustin Lobo) Date: Thu, 6 Feb 2003 17:01:08 +0100 (MET) Subject: [SciPy-user] error execption Message-ID: Hi! I have a loop within which, sometimes, there is an error because a given file that is suppossed to be read is not present. In this case python issues an error message and stops. Is there any way I could get the error message but get the process continue with the next element in the list? Thanks Agus Dr. Agustin Lobo Instituto de Ciencias de la Tierra (CSIC) Lluis Sole Sabaris s/n 08028 Barcelona SPAIN tel 34 93409 5410 fax 34 93411 0012 alobo at ija.csic.es From fperez at pizero.colorado.edu Thu Feb 6 10:54:12 2003 From: fperez at pizero.colorado.edu (Fernando Perez) Date: Thu, 6 Feb 2003 08:54:12 -0700 (MST) Subject: [SciPy-user] error execption In-Reply-To: Message-ID: On Thu, 6 Feb 2003, Agustin Lobo wrote: > > Hi! > > I have a loop within which, > sometimes, there is an error because a given > file that is suppossed to be read is not present. > In this case python issues an error message > and stops. Is there any way I could > get the error message but > get the process continue with the next > element in the list? You need to learn how to handle exceptions, which are described here: http://www.python.org/doc/current/tut/node10.html and here: http://www.python.org/doc/current/ref/try.html You'll find a raft of tutorials at: http://www.python.org/doc/Newbies.html Cheers, f. From nwagner at mecha.uni-stuttgart.de Fri Feb 7 03:26:47 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 07 Feb 2003 09:26:47 +0100 Subject: [SciPy-user] Installation problems using latest cvs Message-ID: <3E436DC7.DC55FD71@mecha.uni-stuttgart.de> Hi all, I have updated my cvs installation of scipy. /usr/local/bin/python setup.py build /usr/local/bin/python setup.py install works well. However importing scipy fails with the following output Python 2.1.2 (#1, Feb 25 2002, 18:04:21) [GCC 2.95.3 20010315 (SuSE)] on linux2 Type "copyright", "credits" or "license" for more information. >>> import scipy Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.1/site-packages/scipy/__init__.py", line 64, in ? import optimize, integrate, signal, special, interpolate, cow, \ File "/usr/local/lib/python2.1/site-packages/scipy/signal/__init__.py", line 70, in ? from signaltools import * File "/usr/local/lib/python2.1/site-packages/scipy/signal/signaltools.py", line 190 order = numels//2 ^ SyntaxError: invalid syntax >>> Any suggestion ? Nils From yankdomas at netscape.net Fri Feb 7 11:14:40 2003 From: yankdomas at netscape.net (YANK DOMAS) Date: Fri, 07 Feb 2003 11:14:40 Subject: [SciPy-user] RESPOND URGENTLY Message-ID: <20030207104010.AEDED3EB0A@www.scipy.com> SOLICIT1NG FOR ASISTANCE AND BUSINESS PARTNERSHIP INVESTMENT OF US$12.5 MILLION FROM: YANK DOMAS TEL: +31 641-895-182 Sir, I am Yank Domas .The son of former minister of finance (Domas Makabo) of the Republic of Sierra-Leone West Africa, based on the information I gathered from your chamber of commerce and industry on your credibility, I decide to contact for the assistance. Regarding my zeal toward foreign investment and security for my life and possession, I therefore write to you a break down of this proposal. My father died when a group of rebel soldier led by Sir Foday Sankoh overthrown Government of sierra-Leone forcing the president out of power and killing many members of the cabinet and ministerincuding my own father. When it become apparently obvious that the country no longer safe for the citizens due to the political war and massive killing and destruction of properties, I decided to move to Holland with a treasure containing the sum of US$12.500.000.00(twelve million five hundred thousand united state dollars) through a diplomatic means, this fund is the last tangible money my father left behind before his death. The said amount is presently in Holland (The Netherlands) where I am currently seeking political asylum. While the consignment containing the fund is in the custody of the diplomatic courier company they are not aware of the content as it was deposited as personal effect and artifact. I am seeking for partner who will serve as a the guardian of this fund with whom I could plan the best way to move this money out of Holland for investment which is my main purpose of contacting you. Thus I decided to offer you 20% of the total money for assisting me to actualize this project while 10% of the money has been set aside to offset any incidental expenses that might incurred during the course of this funds and the balance 70%shall be for me and my family which shall be invested in your country. So if you are willing to assist me contact me on the number above. And are will visit you country soonest in order to inquire areas of possible business investment. I shall be sincerely glad if my request is rendered. Thank you God bless you YANK DOMAS From yankdomas at netscape.net Fri Feb 7 14:32:14 2003 From: yankdomas at netscape.net (YANK DOMAS) Date: Fri, 07 Feb 2003 14:32:14 Subject: [SciPy-user] RESPOND URGENTLY Message-ID: <20030207135747.38A0E3EB0A@www.scipy.com> SOLICIT1NG FOR ASISTANCE AND BUSINESS PARTNERSHIP INVESTMENT OF US$12.5 MILLION FROM: YANK DOMAS TEL: +31 641-895-182 Sir, I am Yank Domas .The son of former minister of finance (Domas Makabo) of the Republic of Sierra-Leone West Africa, based on the information I gathered from your chamber of commerce and industry on your credibility, I decide to contact for the assistance. Regarding my zeal toward foreign investment and security for my life and possession, I therefore write to you a break down of this proposal. My father died when a group of rebel soldier led by Sir Foday Sankoh overthrown Government of sierra-Leone forcing the president out of power and killing many members of the cabinet and ministerincuding my own father. When it become apparently obvious that the country no longer safe for the citizens due to the political war and massive killing and destruction of properties, I decided to move to Holland with a treasure containing the sum of US$12.500.000.00(twelve million five hundred thousand united state dollars) through a diplomatic means, this fund is the last tangible money my father left behind before his death. The said amount is presently in Holland (The Netherlands) where I am currently seeking political asylum. While the consignment containing the fund is in the custody of the diplomatic courier company they are not aware of the content as it was deposited as personal effect and artifact. I am seeking for partner who will serve as a the guardian of this fund with whom I could plan the best way to move this money out of Holland for investment which is my main purpose of contacting you. Thus I decided to offer you 20% of the total money for assisting me to actualize this project while 10% of the money has been set aside to offset any incidental expenses that might incurred during the course of this funds and the balance 70%shall be for me and my family which shall be invested in your country. So if you are willing to assist me contact me on the number above. And are will visit you country soonest in order to inquire areas of possible business investment. I shall be sincerely glad if my request is rendered. Thank you God bless you YANK DOMAS From e.hartley at lancaster.ac.uk Mon Feb 10 10:31:08 2003 From: e.hartley at lancaster.ac.uk (Hartley, Ed) Date: Mon, 10 Feb 2003 15:31:08 -0000 Subject: [SciPy-user] import scipy seg faults Message-ID: <7F332A8009EE5D4CB62C87717A3498A124B3A6@exchange-be1.lancs.ac.uk> Hi the problems I'm having are: built CVS scipy against Numeric 20.2.0 and got Numeric cannot import rank error message imported Numeric then scipy imported OK ran the scipy.test() Ok So figured that the version of Numeric I was working with put MA etc in site-packages not site-packages/Numeric so got CVS version of Numeric placed in Numerical underneath scipy tree rebuilt Numeric rebuilt scipy ran python imported scipy and got a segmentation fault. I have since repeated install of both Numeric and SciPy with the install --force option with the same result. and repeated above with non CVS versions of Numeric. So which versions of Numeric are known to work with the current CVS of SciPy and what is needed to get a clean build of SciPy Regards Ed Hartley From travis at enthought.com Mon Feb 10 10:44:27 2003 From: travis at enthought.com (Travis N. Vaught) Date: Mon, 10 Feb 2003 09:44:27 -0600 Subject: [SciPy-user] import scipy seg faults In-Reply-To: <7F332A8009EE5D4CB62C87717A3498A124B3A6@exchange-be1.lancs.ac.uk> Message-ID: <002401c2d11b$4e247710$0300a8c0@tvlaptop> I'm not sure what might be happening, but the nightly build process (which is currently 'nightly' only for win32) tests many configurations--you can see the configurations and drill down to the results here: http://www.scipy.org/site_content/scoreboard An example of a build header is: Python Version: 2.2.1 Numeric Version: cvs F2py Version: cvs Build Start: Mon Feb 10 05:34:10 2003 Test Level: 10 Results: Ran 753 tests in 451.850 seconds with no failures and 1 error ...to provide more diagnostic info, you might try importing each sub-package individually and see which seg faults. Travis > -----Original Message----- > From: scipy-user-admin at scipy.net [mailto:scipy-user-admin at scipy.net] On > Behalf Of Hartley, Ed > Sent: Monday, February 10, 2003 9:31 AM > To: 'scipy-user at scipy.net' > Subject: [SciPy-user] import scipy seg faults > > Hi > the problems I'm having are: > built CVS scipy against Numeric 20.2.0 and got > Numeric cannot import rank > error message > imported Numeric then scipy imported OK ran the scipy.test() Ok > > So figured that the version of Numeric I was working with put MA etc in > site-packages not site-packages/Numeric > so got CVS version of Numeric placed in Numerical underneath scipy tree > rebuilt Numeric > rebuilt scipy > ran python imported scipy and got a segmentation fault. > > I have since repeated install of both Numeric and SciPy with the install > --force option > with the same result. and repeated above with non CVS versions of > Numeric. > > So which versions of Numeric are known to work with the current CVS of > SciPy > and > what is needed to get a clean build of SciPy > Regards > Ed Hartley > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From e.hartley at lancaster.ac.uk Mon Feb 10 12:03:08 2003 From: e.hartley at lancaster.ac.uk (Hartley, Ed) Date: Mon, 10 Feb 2003 17:03:08 -0000 Subject: [SciPy-user] import scipy seg faults fixed Message-ID: <7F332A8009EE5D4CB62C87717A3498A124B3A7@exchange-be1.lancs.ac.uk> Hi some further information I'm now able to import scipy again without a seg fault using Numeric-21.0 and it passes 739 tests in 12.897 secs of scipy.test() Im using running redhat Linux normally gcc 2.96 but followed instruction on Atlas Site to build atlas with gcc2.95 Independently built Atlas lapack and an optimised blas Ed From pearu at cens.ioc.ee Mon Feb 10 15:25:54 2003 From: pearu at cens.ioc.ee (Pearu Peterson) Date: Mon, 10 Feb 2003 22:25:54 +0200 (EET) Subject: [SciPy-user] import scipy seg faults In-Reply-To: <7F332A8009EE5D4CB62C87717A3498A124B3A6@exchange-be1.lancs.ac.uk> Message-ID: On Mon, 10 Feb 2003, Hartley, Ed wrote: > the problems I'm having are: > built CVS scipy against Numeric 20.2.0 and got > Numeric cannot import rank > error message > imported Numeric then scipy imported OK ran the scipy.test() Ok > > So figured that the version of Numeric I was working with put MA etc in > site-packages not site-packages/Numeric > so got CVS version of Numeric placed in Numerical underneath scipy tree > rebuilt Numeric > rebuilt scipy > ran python imported scipy and got a segmentation fault. > > I have since repeated install of both Numeric and SciPy with the > install --force option with the same result. and repeated above with > non CVS versions of Numeric. > > So which versions of Numeric are known to work with the current CVS of > SciPy and what is needed to get a clean build of SciPy Numeric 20.3 or newer. Many people have experienced segmentation faults when they have switched/updated Numeric version. The reason seems to be that when installing Numeric, its header files are not updated (due to distutils, I guess), and since the header files are not binary compatible between major versions, curious segmentation faults will occur. A throughout clean up and rebuilding all Numeric related extension modules from scratch often fixes such segmentation faults. If it doesn't, then either the clean up wasn't complete enough or there are other causes for these segmentation faults. In either case, to localize the source of the problem, one should try to import scipy extension modules separately. Also, make sure that newly installed Numeric and its packages are working properly. Pearu From sesaymassaquoe at netscape.net Thu Feb 13 16:37:54 2003 From: sesaymassaquoe at netscape.net (SESAY MASSAQUOE) Date: Thu, 13, Feb 2003 21:37:54 -0000 Subject: [SciPy-user] A CRY FOR HELP Message-ID: <20030213220550.CC38A3EB09@www.scipy.com> DEAR FRIEND, THROUGH THE COURTESY OF BUSINESS OPPORTUNITY, I TAKE LIBERTY ANCHORED ON A STRONG DESIRE TO SOLICIT YOUR ASSISTANCE ON THIS MUTUALLY BENEFICIAL AND RISKFREE TRANSACTION WHICH I HOPE YOU WILL GIVE YOUR URGENT ATTENTION. I AM MR.SESAY MASSAQUOE I AM MOVED TO WRITE YOU THIS LETTER ,THIS WAS IN CONFIDENCE CONSIDERING OUR PRESENT CIRCUMSTANCE AND SITUATION. I ESCAPED WITH MY WIFE AND CHILDREN OUT OF SIERRA LEONE TO GHANA WHERE WE ARE PRESENTLY RESIDING ON TEMPORARY POLITICAL ASYLUM. HOWEVER DUE TO THIS SITUATION I DECIDED TO CHANGE MOST OF MY BILLIONS OF DOLLARS DEPOSITED IN SWISS BANK AND OTHER COUNTRIES INTO OTHER FORMS OF MONEY CODED FOR SAFE PURPOSE BECAUSE THE NEW HEAD OF STATES AHMED TIJJAN KABBA MADE ARRANGEMENTS WITH THE SWISS GOVERNMENT AND OTHER EUROPEAN COUNTRIES TO FREEZE ALL MY TREASURES DEPOSITED IN SOME EUROPEAN COUNTRIES,HENCE I AND MY WIFE ALONG WITH MY CHILDREN, DECIDED LAYING LOW IN AFRICA TO STUDY THE SITUATION TILL WHEN THINGS GETS BETTER,SINCE PRESIDENT TIJJAN KABBA TAKING OVER GOVERNMENT AGAIN IN SIERRA LEONE ONE OF MY CHATEAUX IN SOUTHERN FRANCE WAS CONFISCATED BY THE FRENCH GOVERNMENT,AND AS SUCH WE HAD TO CHANGE OUR IDENTITY SO THAT OUR INVESTMENT WILL NOT BE TRACED AND CONFISCATED. I HAVE DEPOSITED THE SUM OF THIRTY MILLION,FIVE HUNDRED THOUSAND UNITED STATES DOLLARS(US$30,500,000)WITH A SECURITY COMPANY FOR SAFEKEEPING. THE FUNDS ARE SECURITY CODED TO PREVENT THEM FROM KNOWING THE ACTUAL CONTENTS. WHAT I WANT YOU TO DO NOW IS TO INDICATE YOUR INTEREST THAT YOU WILL ASSIST ME AND MY IMMEDIATE FAMILY BY RECEIVING THE MONEY ON OUR BEHALF. THE ACCOUNT REQUIRED FOR THIS PROJECT CAN EITHER BE PERSONAL,COMPANY OR AN OFFSHORE ACCOUNT THAT YOU HAVE TOTAL CONTROL OVER,YOUR AREA OF SPECIALISATION WILL NOT BE A HINDERANCE TO THE SUCCESSFUL EXECUTION OF THIS TRANSACTION. ACKOWLEDGE THIS MESSAGE,SO THAT I CAN INTRODUCE YOU TO MY FAMILY AS OUR FOREIGN TRUSTED PARTNER WHO SHALL TAKE CHARGE OF OUR INVESTMENT ABROAD WHERE WE NOW PLAN TO SETTLE. I WANT YOU TO ASSIST US IN INVESTING THIS MONEY,BUT I WILL NOT WANT OUR IDENTITY REVEALED.I WILL ALSO WANT TO BUY PROPERTIES AND STOCKS IN MULTI-NATIONAL COMPANIES AND TO ENGAGE IN OTHER SAFE AND NON SPECULATIVE INVESTMENTS. WE HAVE BEEN THROUGH A LOT OF HEALTH AND SPIRITUAL TURMOIL,HENCE WILL NEED YOUR UNDERSTANDING AND ASSISTANCE. MAY I AT THIS POINT EMPHASIZE THE HIGH LEVEL OF CONFIDENTIALLITY WHICH THIS BUSINESS DEMANDS AND HOPE YOU WILL NOT BETRAY THE TRUST AND CONFIDENCE WHICH WE REPOSE IN YOU.I SHALL PUT YOU IN THE PICTURE OF THIS BUSINESS,I.E TELL YOU WHERE THE FUNDS ARE CURRENTLY BEING MAINTAINED AND ALSO DISCUSS OTHER MODALITIES INCLUDING REMUNERATION FOR YOUR SERVICES. I SHALL INFORM YOU WITH THE NEXT LINE OF ACTION AS SOON AS I RECEIVE YOUR POSITIVE RESPONSE. IS THIS PROPOSITION ATTAINABLE?IF IT IS,PLEASE KINDLY FURNISH ME IMMEDIATELY BY E-MAIL WITH YOUR DIRECT TELEPHONE AND FAX NUMBERS TO ENHANCE THE CONFIDENTIALLITY WHICH THIS BUSINESS DEMANDS. BEST REGARDS MR.SESAY MASSAQUOE. FOR FAMILY. private email to reply to : semassaq at rediffmail.com From fperez at pizero.colorado.edu Thu Feb 13 21:00:14 2003 From: fperez at pizero.colorado.edu (Fernando Perez) Date: Thu, 13 Feb 2003 19:00:14 -0700 (MST) Subject: [SciPy-user] Alternative to NumTut's view() function? Message-ID: Hi all, In the past I've used the view() function from NumTut (Numeric's tutorial package) to view 2-d arrays. But now something isn't working too well (and I've seen reports from others on the web about this). Basically, there seems to be a threading problem, and the simple act of importing view.py kicks cpu usage to 100% and makes any interactive work in the python interpreter impossible. I tested it both with ipython and a regular python shell. In the past I'd used it with (I think) RedHat 7.2, now I'm in RedHat 8.0, I don't know if that matters or not. At any rate, I wonder if as part of scipy there is anything with similar functionality. view() allows one to view 2-d arrays as images, in either grayscale or color. Since I don't have high hopes for anyone fixing view(), and I'm switching to scipy for all my work, I'd be happy to go with a scipy-based alternative if one exists. Thanks for any input. Regards, Fernando From DavidA at ActiveState.com Thu Feb 13 21:03:07 2003 From: DavidA at ActiveState.com (David Ascher) Date: Thu, 13 Feb 2003 18:03:07 -0800 Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: References: Message-ID: <3E4C4E5B.2080705@ActiveState.com> Fernando Perez wrote: > Hi all, > > In the past I've used the view() function from NumTut (Numeric's tutorial > package) to view 2-d arrays. But now something isn't working too well (and > I've seen reports from others on the web about this). Basically, there seems > to be a threading problem, and the simple act of importing view.py kicks cpu > usage to 100% and makes any interactive work in the python interpreter > impossible. I tested it both with ipython and a regular python shell. Funny. I wrote that function strictly to make it easy to write the numeric tutorial. Glad to know it's helpful. I'm not surprised to hear of threading problems with it, however. Have you looked into it? It shouldn't be impossible to figure out what's wrong with the code and fix it =). --david From DavidA at ActiveState.com Thu Feb 13 21:03:07 2003 From: DavidA at ActiveState.com (David Ascher) Date: Thu, 13 Feb 2003 18:03:07 -0800 Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: References: Message-ID: <3E4C4E5B.2080705@ActiveState.com> Fernando Perez wrote: > Hi all, > > In the past I've used the view() function from NumTut (Numeric's tutorial > package) to view 2-d arrays. But now something isn't working too well (and > I've seen reports from others on the web about this). Basically, there seems > to be a threading problem, and the simple act of importing view.py kicks cpu > usage to 100% and makes any interactive work in the python interpreter > impossible. I tested it both with ipython and a regular python shell. Funny. I wrote that function strictly to make it easy to write the numeric tutorial. Glad to know it's helpful. I'm not surprised to hear of threading problems with it, however. Have you looked into it? It shouldn't be impossible to figure out what's wrong with the code and fix it =). --david From fperez at pizero.colorado.edu Thu Feb 13 21:06:50 2003 From: fperez at pizero.colorado.edu (Fernando Perez) Date: Thu, 13 Feb 2003 19:06:50 -0700 (MST) Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: <3E4C4E5B.2080705@ActiveState.com> Message-ID: On Thu, 13 Feb 2003, David Ascher wrote: > > In the past I've used the view() function from NumTut (Numeric's tutorial > > package) to view 2-d arrays. But now something isn't working too well (and > > I've seen reports from others on the web about this). Basically, there seems > > to be a threading problem, and the simple act of importing view.py kicks cpu > > usage to 100% and makes any interactive work in the python interpreter > > impossible. I tested it both with ipython and a regular python shell. > > Funny. I wrote that function strictly to make it easy to write the numeric > tutorial. Glad to know it's helpful. > > I'm not surprised to hear of threading problems with it, however. > > Have you looked into it? It shouldn't be impossible to figure out what's > wrong with the code and fix it =). I've been poking at it for about 30 minutes, without much success. I know _strictly zero_ about both Tk programming and threaded programming. Great start :) I was looking at what the actual display code is and trying to rip out the bare guts I need to just show an image, even if it means creating/destroying a new Tk window each time. I'm sure I can pay that price far easier than the full lockup I get with the threads. Any suggestions? Cheers, f From prabhu at aero.iitm.ernet.in Thu Feb 13 21:32:08 2003 From: prabhu at aero.iitm.ernet.in (Prabhu Ramachandran) Date: Fri, 14 Feb 2003 08:02:08 +0530 Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: References: Message-ID: <15948.21800.641695.774686@monster.linux.in> Hi, >>>>> "FP" == Fernando Perez writes: [snip] FP> At any rate, I wonder if as part of scipy there is anything FP> with similar functionality. view() allows one to view 2-d FP> arrays as images, in either grayscale or color. Since I don't FP> have high hopes for anyone fixing view(), and I'm switching to FP> scipy for all my work, I'd be happy to go with a scipy-based FP> alternative if one exists. Well, you could do it with MayaVi. I have a mayamat module on my system that I use to sample functions of the form z = F(x,y) and plot them using MayaVi and pyVTK. It should be easy to view any 2d array using this. If folks are interested I'll put it up for download sometime this weekend. cheers, prabhu From DavidA at ActiveState.com Thu Feb 13 23:25:12 2003 From: DavidA at ActiveState.com (David Ascher) Date: Thu, 13 Feb 2003 20:25:12 -0800 Subject: [SciPy-user] Alternative to NumTut's view() function? References: Message-ID: <3E4C6FA8.4060307@ActiveState.com> Fernando Perez wrote: >I've been poking at it for about 30 minutes, without much success. I know >_strictly zero_ about both Tk programming and threaded programming. Great >start :) > >I was looking at what the actual display code is and trying to rip out the >bare guts I need to just show an image, even if it means creating/destroying a >new Tk window each time. I'm sure I can pay that price far easier than the >full lockup I get with the threads. > >Any suggestions? > > It's working ok for me on win2k. I'll try tomorrow on rh8 at work. In the meantime, try forcing _inidle to be true before view() is defined. See if that behavior works better for you. --david From jnazal at puc.cl Thu Feb 13 19:55:30 2003 From: jnazal at puc.cl (J.) Date: Fri, 14 Feb 2003 01:55:30 +0100 Subject: [SciPy-user] (no subject) Message-ID: <000801c2d3c3$fd85e810$9cce1bc8@qwwft> Hi, I'm a chilean, so please excuse my english. I have a problem to install Clapack in my PC. My compiler is "Microsoft Visual C++" and my operation system is Windows 2000. Another cuestion: I`m a student of structural engineering and I work with square and symetrical matrix, so...how I can to use sparse matrix with Clapack, and what function is the best??. Thank you. Jorge Nazal, Universidad Cat?lica de Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From alobo at ija.csic.es Fri Feb 14 04:08:45 2003 From: alobo at ija.csic.es (Agustin Lobo) Date: Fri, 14 Feb 2003 10:08:45 +0100 (MET) Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: Message-ID: Fernando, Perhaps you would be interested on openEV (http://openev.sourceforge.net/) a package (in development) for image visualization (in particular satellite image) with a python console. Agus Dr. Agustin Lobo Instituto de Ciencias de la Tierra (CSIC) Lluis Sole Sabaris s/n 08028 Barcelona SPAIN tel 34 93409 5410 fax 34 93411 0012 alobo at ija.csic.es On Thu, 13 Feb 2003, Fernando Perez wrote: > Hi all, > > In the past I've used the view() function from NumTut (Numeric's tutorial > package) to view 2-d arrays. But now something isn't working too well (and > I've seen reports from others on the web about this). Basically, there seems > to be a threading problem, and the simple act of importing view.py kicks cpu > usage to 100% and makes any interactive work in the python interpreter > impossible. I tested it both with ipython and a regular python shell. > > In the past I'd used it with (I think) RedHat 7.2, now I'm in RedHat 8.0, I > don't know if that matters or not. > > At any rate, I wonder if as part of scipy there is anything with similar > functionality. view() allows one to view 2-d arrays as images, in either > grayscale or color. Since I don't have high hopes for anyone fixing view(), > and I'm switching to scipy for all my work, I'd be happy to go with a > scipy-based alternative if one exists. > > Thanks for any input. > > Regards, > > Fernando > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From karthik at james.hut.fi Fri Feb 14 04:05:29 2003 From: karthik at james.hut.fi (Karthikesh Raju) Date: Fri, 14 Feb 2003 11:05:29 +0200 Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: Message-ID: Hi All, On Thu, 13 Feb 2003, Fernando Perez wrote: > Hi all, > > In the past I've used the view() function from NumTut (Numeric's tutorial > package) to view 2-d arrays. But now something isn't working too well (and > I've seen reports from others on the web about this). Basically, there seems > to be a threading problem, and the simple act of importing view.py kicks cpu > usage to 100% and makes any interactive work in the python interpreter > impossible. I tested it both with ipython and a regular python shell. > This is exactly what happens. i have tried it on RH7.1/8.0 Systems or Tru64Unix. The response is no better with Irix (6.5). i suspected that it was the threading problem as mentioned above. Was not very sure abt it, but cpu usage does kick to 100%. > In the past I'd used it with (I think) RedHat 7.2, now I'm in RedHat 8.0, oI > don't know if that matters or not. > > At any rate, I wonder if as part of scipy there is anything with similar > functionality. view() allows one to view 2-d arrays as images, in either > grayscale or color. Since I don't have high hopes for anyone fixing view(), > and I'm switching to scipy for all my work, I'd be happy to go with a > scipy-based alternative if one exists. > The alternatives would be could, but something as simple as view should be great. Something like 'imagesc' as in Matlab, view i think provides that, and was simple enough, but i guess now somehow it has some threading problem. Any alternatives, Best regards karthik > Thanks for any input. > > Regards, > > Fernando > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From yann.ledu at noos.fr Fri Feb 14 08:06:57 2003 From: yann.ledu at noos.fr (Yann Le Du) Date: Fri, 14 Feb 2003 14:06:57 +0100 (CET) Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: Message-ID: On Thu, 13 Feb 2003, Fernando Perez wrote: > In the past I've used the view() function from NumTut (Numeric's tutorial > package) to view 2-d arrays. But now something isn't working too well (and > I've seen reports from others on the web about this). Basically, there seems > to be a threading problem, and the simple act of importing view.py kicks cpu > usage to 100% and makes any interactive work in the python interpreter > impossible. I tested it both with ipython and a regular python shell. Yes, I can't use it either. > At any rate, I wonder if as part of scipy there is anything with similar > functionality. view() allows one to view 2-d arrays as images, in either > grayscale or color. Since I don't have high hopes for anyone fixing view(), > and I'm switching to scipy for all my work, I'd be happy to go with a > scipy-based alternative if one exists. Having discovered that view() didn't work, I looked at scipy's website, in the plotting tutorial, and found a solution using plt : plt.image(name_of_array) and plt.imagesc(name_of_array) For more details have a look at : http://www.scipy.org/site_content/tutorials/plot_tutorial and more particularly where they display an image of "Lena". I use these plt functions inside ipython (launched with "-p scipy"), and it works great. I hope this helps ! Yann From sugino at brandeis.edu Fri Feb 14 03:52:28 2003 From: sugino at brandeis.edu (Ken Sugino) Date: Fri, 14 Feb 2003 08:52:28 +0000 Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: References: Message-ID: <20030214085228.703683a8.sugino@brandeis.edu> > > The alternatives would be could, but something as simple as view should be > great. Something like 'imagesc' as in Matlab, view i think provides that, > and was simple enough, but i guess now somehow it has some threading > problem. > I use "scipy.plt.imagesc", works great except for large zooming which eats memory and sometimes kills machine. I have 'a' fix on this zooming problem if anybody is interested. Ken From karthik at james.hut.fi Fri Feb 14 09:13:45 2003 From: karthik at james.hut.fi (Karthikesh Raju) Date: Fri, 14 Feb 2003 16:13:45 +0200 Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: <20030214085228.703683a8.sugino@brandeis.edu> Message-ID: Hi All i somehow cant get to use the plt module in the scipy. This is because i could not get wxPython installed. i am down on diskspace too. View or something on that lines would be great. Best regards karthik ----------------------------------------------------------------------- Karthikesh Raju, email: karthik at james.hut.fi Researcher, http://www.cis.hut.fi/karthik Helsinki University of Technology, Tel: +358-9-451 5389 Laboratory of Comp. & Info. Sc., Fax: +358-9-451 3277 Department of Computer Sc., P.O Box 5400, FIN 02015 HUT, Espoo, FINLAND ----------------------------------------------------------------------- On Fri, 14 Feb 2003, Ken Sugino wrote: > > > > > The alternatives would be could, but something as simple as view should be > > great. Something like 'imagesc' as in Matlab, view i think provides that, > > and was simple enough, but i guess now somehow it has some threading > > problem. > > > > I use "scipy.plt.imagesc", works great except for large zooming which eats > memory and sometimes kills machine. I have 'a' fix on this zooming problem > if anybody is interested. > > Ken > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From Kasper.Souren at ircam.fr Fri Feb 14 09:40:47 2003 From: Kasper.Souren at ircam.fr (Kasper Souren) Date: Fri, 14 Feb 2003 15:40:47 +0100 Subject: [SciPy-user] convolve2d.. or Numeric to numarray conversion Message-ID: <200302141540.47395.Kasper.Souren@ircam.fr> Hi! I would like to do a 2D convolution. And as it seems there is a nice convolve2d in the Convolve package that comes with numarray, which doesn't seem available for Numeric or for SciPy. The conversion from Numeric arrays to numarray arrays works fine with 1D arrays (numarray.array(list(a))). But for 2D arrays it gives me: Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.2/site-packages/numarray/numarray.py", line 313, in array return fromlist(buffer, type, shape) File "/usr/local/lib/python2.2/site-packages/numarray/numarray.py", line 265, in fromlist arr.fromlist(seq) TypeError: NA_setFromPythonScalar: bad value type. Is there another easy way to convert Numeric arrays to numarray arrays? (And the reverse would also be handy to have, but that's for later.) Or is there another simple way to do a 2D convolution of Numeric arrays? And related to this problem: what are the plans regarding a possible move to using numarray instead of Numeric? btw, it's a pity the "find" function of scipy.org is not working properly. Even just a plain google search would be nicer... bye, Kasper From perry at stsci.edu Fri Feb 14 10:11:45 2003 From: perry at stsci.edu (Perry Greenfield) Date: Fri, 14 Feb 2003 10:11:45 -0500 Subject: [SciPy-user] convolve2d.. or Numeric to numarray conversion In-Reply-To: <200302141540.47395.Kasper.Souren@ircam.fr> Message-ID: > Hi! > > I would like to do a 2D convolution. And as it seems there is a nice > convolve2d in the Convolve package that comes with numarray, > which doesn't > seem available for Numeric or for SciPy. > > The conversion from Numeric arrays to numarray arrays works fine with 1D > arrays (numarray.array(list(a))). But for 2D arrays it gives me: > > Traceback (most recent call last): > File "", line 1, in ? > File > "/usr/local/lib/python2.2/site-packages/numarray/numarray.py", line > 313, in array > return fromlist(buffer, type, shape) > File > "/usr/local/lib/python2.2/site-packages/numarray/numarray.py", line > 265, in fromlist > arr.fromlist(seq) > TypeError: NA_setFromPythonScalar: bad value type. > > Is there another easy way to convert Numeric arrays to numarray > arrays? (And > the reverse would also be handy to have, but that's for later.) > Yes, but I don't think there is a current way for multidimensional arrays that doesn't require you to manually pass along shape information (though it would be trivial to write a function to do so. We've talked about making numarray and Numeric arrays being aware of each other, but haven't done anything yet about it. In any case, you can do what you did above after flattening the array (list only works on the first dimension, the reason it fails is that it returns a list of 1-d Numeric arrays) and then reshaping the resultant 1-d numarray array. Or you should be able to use tostring and fromstring as long as you provide the necessary type and shape information to fromstring. We will get around to making numarray more Numeric aware eventually (currently we are working on improving small array performance). Thanks, Perry Greenfield From jmiller at stsci.edu Fri Feb 14 10:35:23 2003 From: jmiller at stsci.edu (Todd Miller) Date: Fri, 14 Feb 2003 10:35:23 -0500 Subject: [SciPy-user] convolve2d.. or Numeric to numarray conversion References: <200302141540.47395.Kasper.Souren@ircam.fr> Message-ID: <3E4D0CBB.1060403@stsci.edu> Kasper Souren wrote: >Hi! > >the reverse would also be handy to have, but that's for later.) > >Or is there another simple way to do a 2D convolution of Numeric arrays? > > I just worked through some of this for one of our developers so numarray's Convolve.convolve2d now has an "fft" mode. The short answer is, use the convolution theorem and Numeric's FFT module: Fdata = FFT.real_fft2d(data) Fkernel = FFT.real_fft2d(kernel) multiply(Fdata, Fkernel, Fdata) convolved = inverse_real_fft2d( Fdata) The edges can be a little tricky, but other than that, it's mostly already implemented (in Numeric) in the form of 2d Fourier transforms. If the kernel you want to use is bigger than about 15x15, the FFT is also an increasingly faster way of convolving than the brute force approach in numarray-0.4. Todd From falted at openlc.org Fri Feb 14 11:19:02 2003 From: falted at openlc.org (Francesc Alted) Date: Fri, 14 Feb 2003 17:19:02 +0100 Subject: [SciPy-user] convolve2d.. or Numeric to numarray conversion In-Reply-To: <200302141540.47395.Kasper.Souren@ircam.fr> References: <200302141540.47395.Kasper.Souren@ircam.fr> Message-ID: <200302141719.02521.falted@openlc.org> A Divendres 14 Febrer 2003 15:40, Kasper Souren va escriure: > Is there another easy way to convert Numeric arrays to numarray arrays? > (And the reverse would also be handy to have, but that's for later.) I find this way specially fast as no actual data should be copied in the process: naarr = numarray.array(buffer(arr), type=arr.typecode(), shape=arr.shape) that works for any Numeric object (except for typecode 'c'). And for the reverse case, this should work just fine: arr=Numeric.array(naarr.tolist(), typecode=naarr.typecode()) although in this case, a data buffer copy is actually made. Hope that helps, -- Francesc Alted From Kasper.Souren at ircam.fr Fri Feb 14 11:48:25 2003 From: Kasper.Souren at ircam.fr (Kasper Souren) Date: Fri, 14 Feb 2003 17:48:25 +0100 Subject: [SciPy-user] convolve2d.. or Numeric to numarray conversion In-Reply-To: <3E4D0CBB.1060403@stsci.edu> References: <200302141540.47395.Kasper.Souren@ircam.fr> <3E4D0CBB.1060403@stsci.edu> Message-ID: <200302141748.25588.Kasper.Souren@ircam.fr> > I just worked through some of this for one of our developers so > numarray's Convolve.convolve2d now has an "fft" mode. The short answer > is, use the convolution theorem and Numeric's FFT module: > > Fdata = FFT.real_fft2d(data) > Fkernel = FFT.real_fft2d(kernel) > multiply(Fdata, Fkernel, Fdata) > convolved = inverse_real_fft2d( Fdata) > > The edges can be a little tricky, but other than that, it's mostly > already implemented (in Numeric) in the form of 2d Fourier transforms. > If the kernel you want to use is bigger than about 15x15, the FFT is > also an increasingly faster way of convolving than the brute force > approach in numarray-0.4. The multiply part gives me some troubles: ValueError: frames are not alligned. It seems to me that multiply(a, b) just means a * b. And thus a and b need to have the same dimensions. And I don't know how to deal with this problem. I guess filling up Fkernel with 0's doesn't make sense bye, Kasper From shurem at ccf.org Fri Feb 14 12:16:37 2003 From: shurem at ccf.org (Mark Shure) Date: Fri, 14 Feb 2003 12:16:37 -0500 Subject: [SciPy-user] Alternative to NumTut's view() function? Message-ID: Hi, I also found the NumTut view() function very useful but problematic. I now use "scipy.pilutil.imshow", which uses the PIL. There are other very useful image manipulation functions in the "scipy.pilutil" module which work on Numeric arrays. These were mentioned by Travis Oliphant on this mailing list back in December (a belated thanks, Travis!). Mark -------------------------------- Mark Shure Project Scientist The Cleveland Clinic Foundation Division of Ophthalmology, i32 9500 Euclid Avenue Cleveland OH 44195 email: shurem at NOSPAM.ccf.org phone: 216-444-7277 (ofc) 216-445-1531 (lab) fax: 216-445-8475 From jmiller at stsci.edu Fri Feb 14 12:27:10 2003 From: jmiller at stsci.edu (Todd Miller) Date: Fri, 14 Feb 2003 12:27:10 -0500 Subject: [SciPy-user] convolve2d.. or Numeric to numarray conversion References: <200302141540.47395.Kasper.Souren@ircam.fr> <3E4D0CBB.1060403@stsci.edu> <200302141748.25588.Kasper.Souren@ircam.fr> Message-ID: <3E4D26EE.7050805@stsci.edu> Kasper Souren wrote: >>I just worked through some of this for one of our developers so >>numarray's Convolve.convolve2d now has an "fft" mode. The short answer >>is, use the convolution theorem and Numeric's FFT module: >> >> Fdata = FFT.real_fft2d(data) >> Fkernel = FFT.real_fft2d(kernel) >> multiply(Fdata, Fkernel, Fdata) >> convolved = inverse_real_fft2d( Fdata) >> >>The edges can be a little tricky, but other than that, it's mostly >>already implemented (in Numeric) in the form of 2d Fourier transforms. >> If the kernel you want to use is bigger than about 15x15, the FFT is >>also an increasingly faster way of convolving than the brute force >>approach in numarray-0.4. >> >> > >The multiply part gives me some troubles: ValueError: frames are not alligned. > >It seems to me that multiply(a, b) just means a * b. And thus a and b need to >have the same dimensions. And I don't know how to deal with this problem. >I guess filling up Fkernel with 0's doesn't make sense > >bye, >Kasper > > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > > I forgot to mention: when doing FFT-based convolution, the kernel and data must be identically shaped. I do this by sticking the kernel into the center of a data-shaped array of zeros. Todd From karthik at james.hut.fi Fri Feb 14 13:26:37 2003 From: karthik at james.hut.fi (Karthikesh Raju) Date: Fri, 14 Feb 2003 20:26:37 +0200 Subject: [SciPy-user] Alternative to NumTut's view() function In-Reply-To: Message-ID: Hi All, On Fri, 14 Feb 2003, Mark Shure wrote: > Hi, > > I also found the NumTut view() function very useful but problematic. I now use "scipy.pilutil.imshow", which uses the PIL. > > There are other very useful image manipulation functions in the "scipy.pilutil" module which work on Numeric arrays. These were mentioned by Travis Oliphant on this mailing list back in December (a belated thanks, Travis!). i tried to use it. It says xv not found. How should set the default viewer, as i do have xview, just that it is called xview not xv. Searched the web, not with much success, is there some variable that can be set to the viewer of choice. Best regards karthik > > > Mark > > -------------------------------- > Mark Shure > Project Scientist > The Cleveland Clinic Foundation > Division of Ophthalmology, i32 > 9500 Euclid Avenue > Cleveland OH 44195 > > email: shurem at NOSPAM.ccf.org > phone: 216-444-7277 (ofc) > 216-445-1531 (lab) > fax: 216-445-8475 > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From oliphant.travis at ieee.org Fri Feb 14 14:51:18 2003 From: oliphant.travis at ieee.org (Travis Oliphant) Date: 14 Feb 2003 12:51:18 -0700 Subject: [SciPy-user] convolve2d.. or Numeric to numarray conversion In-Reply-To: <200302141540.47395.Kasper.Souren@ircam.fr> References: <200302141540.47395.Kasper.Souren@ircam.fr> Message-ID: <1045252278.16245.9.camel@travis.local.net> On Fri, 2003-02-14 at 07:40, Kasper Souren wrote: > Hi! > > I would like to do a 2D convolution. And as it seems there is a nice > convolve2d in the Convolve package that comes with numarray, which doesn't > seem available for Numeric or for SciPy. Look at the scipy.signal package info(scipy.signal.convolve) will do N-D convolution for you. -Travis O. From oliphant.travis at ieee.org Fri Feb 14 14:56:31 2003 From: oliphant.travis at ieee.org (Travis Oliphant) Date: 14 Feb 2003 12:56:31 -0700 Subject: [SciPy-user] Alternative to NumTut's view() function In-Reply-To: References: Message-ID: <1045252592.16244.11.camel@travis.local.net> > i tried to use it. It says xv not found. How should set the default > viewer, as i do have xview, just that it is called xview not xv. > > Searched the web, not with much success, is there some variable that can > be set to the viewer of choice. I just made a link from /usr/bin/xv to /usr/bin/ee on my system You could make a link from /usr/bin/xv to /usr/bin/xview -Travis O. From oliphant.travis at ieee.org Fri Feb 14 14:50:15 2003 From: oliphant.travis at ieee.org (Travis Oliphant) Date: 14 Feb 2003 12:50:15 -0700 Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: <20030214085228.703683a8.sugino@brandeis.edu> References: <20030214085228.703683a8.sugino@brandeis.edu> Message-ID: <1045252215.16245.7.camel@travis.local.net> On Fri, 2003-02-14 at 01:52, Ken Sugino wrote: > If you have the PIL installed and a recent version of scipy you can use imshow(array) which will convert the image to a PIL object and show it through the PIL external viewer. This works for both RGB and grayscale images. For grayscale images I personally use xplt.imagesc quite a bit but you have to have a Unix environment. -Travis O. From karthik at james.hut.fi Fri Feb 14 15:15:51 2003 From: karthik at james.hut.fi (Karthikesh Raju) Date: Fri, 14 Feb 2003 22:15:51 +0200 Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: <1045252215.16245.7.camel@travis.local.net> Message-ID: Thankx to all. scipy.pilutils.imagesc did the trick, with me having a symbolic link to xview. it worked atlast. Thankx again, will probably be around this group for more time to come... Best wishes karthik ----------------------------------------------------------------------- Karthikesh Raju, email: karthik at james.hut.fi Researcher, http://www.cis.hut.fi/karthik Helsinki University of Technology, Tel: +358-9-451 5389 Laboratory of Comp. & Info. Sc., Fax: +358-9-451 3277 Department of Computer Sc., P.O Box 5400, FIN 02015 HUT, Espoo, FINLAND ----------------------------------------------------------------------- On 14 Feb 2003, Travis Oliphant wrote: > On Fri, 2003-02-14 at 01:52, Ken Sugino wrote: > > > > If you have the PIL installed and a recent version of scipy you can use > > imshow(array) > > which will convert the image to a PIL object and show it through the PIL > external viewer. > > This works for both RGB and grayscale images. > > > For grayscale images I personally use > > xplt.imagesc > > quite a bit but you have to have a Unix environment. > > > -Travis O. > > > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From karthik at james.hut.fi Fri Feb 14 15:18:53 2003 From: karthik at james.hut.fi (Karthikesh Raju) Date: Fri, 14 Feb 2003 22:18:53 +0200 Subject: [SciPy-user] Object too deep for desired copy In-Reply-To: <1045252215.16245.7.camel@travis.local.net> Message-ID: Hi All, Well, what does the above message mean. Being a matlaby, used to move around arrays, cut them chop them, didnt care abt references etc, suddenly was hit by this - object too deep for desired copy. Can someone explain what this means and how to circumnavigate it. Best regards karthik ----------------------------------------------------------------------- Karthikesh Raju, email: karthik at james.hut.fi Researcher, http://www.cis.hut.fi/karthik Helsinki University of Technology, Tel: +358-9-451 5389 Laboratory of Comp. & Info. Sc., Fax: +358-9-451 3277 Department of Computer Sc., P.O Box 5400, FIN 02015 HUT, Espoo, FINLAND ----------------------------------------------------------------------- From oliphant.travis at ieee.org Fri Feb 14 18:02:26 2003 From: oliphant.travis at ieee.org (Travis Oliphant) Date: 14 Feb 2003 16:02:26 -0700 Subject: [SciPy-user] Object too deep for desired copy In-Reply-To: References: Message-ID: <1045263748.17398.6.camel@travis.local.net> On Fri, 2003-02-14 at 13:18, Karthikesh Raju wrote: > Hi All, > > Well, what does the above message mean. Being a matlaby, used to move > around arrays, cut them chop them, didnt care abt references etc, suddenly > was hit by this - object too deep for desired copy. Can someone explain > what this means and how to circumnavigate it. Didn't get the message. But, it sounds like an array with too many dimensions was trying to be copied into another array. For example, >> a = rand(50,50) >> a[:,10] = rand(25,50) Traceback (most recent call last): File "", line 1, in ? ValueError: Object too deep for desired array -Travis Oliphant From fperez at pizero.colorado.edu Fri Feb 14 21:32:59 2003 From: fperez at pizero.colorado.edu (Fernando Perez) Date: Fri, 14 Feb 2003 19:32:59 -0700 (MST) Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: <3E4C6FA8.4060307@ActiveState.com> Message-ID: On Thu, 13 Feb 2003, David Ascher wrote: > >Any suggestions? > > > > > It's working ok for me on win2k. I'll try tomorrow on rh8 at work. > > In the meantime, try forcing _inidle to be true before view() is > defined. See if that behavior works better for you. Well, that does help quite a bit. However, the keyboard response is still a bit sluggish, which I honestly can't stand. I type reasonably fast and I can't stand a delay in typing at a console (it is however far better than before, and perhaps quite usable for most). However, I've modified view.py and now have a reasonably functional version. I'm attaching it to this message for the benefit of others, since it seems that this problem is reasonably common. I also modified view() to accept a single scaling factor besides the tuple of (scalex,scaley). This allows zooming in both directions with a single number, a common operation. Thanks a lot for all the suggestions, I did look at the tutorial and various other options. I did go ahead, against my better judgement, and installed wxpython. I say this because in the past, getting wxpython to work has been a frustrating experience every single time. No change :) I tried reproducing the instructions from teh tutorial mentioned in another reply, and I got only a dead window labelled 'Figure 0'. The window showed no contents and none of its control widgets worked (including 'close'). I could only kill it by exiting the python shell. Here's my text output: [libfmwt]> python Python 2.2.1 (#1, Aug 30 2002, 12:15:30) [GCC 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import gui_thread >>> from scipy import plt >>> from scipy import * >>> img = plt.lena() >>> plt.image(img) ['__copy__', '__deepcopy__', 'astype', 'byteswapped', 'copy', 'iscontiguous', 'itemsize', 'resize', 'savespace', 'spacesaver', 'tolist', 'toscalar', 'tostring', 'typecode'] >>> Note that after the gui_thread statement, I did NOT see printed as the tutorial says should occur. This was done with a cvs copy of scipy from today which passed all tests with scipy.test(level=10), on a RedHat 8.0 machine. I'm sure that eventually it will be very nice to use all the nice scipy-provided plotting functionality. But until that day arrives, the simple-minded view.py I attach here may be of use to some. Thanks again to all those who replied in various forms (in case I don't reply to you directly, I did read all the responses). Best regards, Fernando. -------------- next part -------------- """ Displaying image files in a separate thread on Tk+thread, w/ xv in forked & execv'ed processes otherwise. view(array): will spawn a displaying program for arrays which are either NxM or NxMx3. does the 'min/max' and conversion to char. array2ppm(array): given an NxM or NxMx3 array, returns a ppm string which is a valid thing to put in a PPM file. (or PGM file if NxM file). TODO: - automatic scaling for small images - accept rank-1 arrays NOTE: This is a modified version which removes all threading and PIL support. It should work on any system with Tkinter alone. """ DEFAULT_HEIGHT = 255 MINSIZE = 150 import os import Tkinter from Numeric import * import tempfile, time def save_ppm(ppm, fname=None): if fname == None: fname = tempfile.mktemp('.ppm') f = open(fname, 'wb') f.write(ppm) f.close() return fname def array2ppm(image): # scaling if len(image.shape) == 2: # B&W: image = transpose(image) return "P5\n#PPM version of array\n%d %d\n255\n%s" % \ (image.shape[1], image.shape[0], ravel(image).tostring()) else: # color image = transpose(image, (1, 0, 2)) return "P6\n%d %d\n255\n%s" % \ (image.shape[1], image.shape[0], ravel(image).tostring()) def preprocess(image, (scalex,scaley)): assert len(image.shape) in (1, 2) or \ len(image.shape) == 3 and image.shape[2] == 3, \ "image not correct format" themin = float(minimum.reduce(ravel(image))) themax = float(maximum.reduce(ravel(image))) if len(image.shape) == 1: len_x = image.shape[0] ys = ((image - themin)/(themax-themin)*(DEFAULT_HEIGHT-1)).astype('b') image = (zeros((DEFAULT_HEIGHT, len_x))+255).astype('b') for x in range(len_x): image[DEFAULT_HEIGHT-1-ys[x],len_x-x-1] = 0 image = transpose(image) elif image.typecode() != 'b': image = (image - themin) / (themax-themin) * 255 image = image.astype('b') len_x, len_y = image.shape[:2] if scalex is None: if len_x < MINSIZE: scalex = int(float(MINSIZE) / len_x) + 1 else: scalex = 1 if scaley is None: if len_y < MINSIZE: scaley = int(float(MINSIZE) / len_y) + 1 else: scaley = 1 return image, (scalex, scaley) class PPMImage(Tkinter.Label): def __init__(self, master, ppm, (scalex, scaley)): self.image = Tkinter.PhotoImage(file=save_ppm(ppm)) w, h = self.image.width(), self.image.height() self.image = self.image.zoom(scalex, scaley) self.image.configure(width=w*scalex, height=h*scaley) Tkinter.Label.__init__(self, master, image=self.image, bg="black", bd=0) self.pack() # Start the Tk process from which all subsequent windows will be opened. def tk_root(): if Tkinter._default_root is None: root = Tkinter.Tk() Tkinter._default_root.withdraw() else: root = Tkinter._default_root return root _root = tk_root() def view(image, scale=None): """Display an image, optionally rescaling it. scale can be either an integer or a tuple of 2 integers (for separate x/y rescaling. """ if scale is None: scale=(None,None) else: try: len(scale) except TypeError: scale = (scale,scale) image, scales = preprocess(image, scale) tl = Tkinter.Toplevel() u = PPMImage(tl, array2ppm(image), scales) u.pack(fill='both', expand=1) u.tkraise() From fperez at pizero.colorado.edu Fri Feb 14 21:36:34 2003 From: fperez at pizero.colorado.edu (Fernando Perez) Date: Fri, 14 Feb 2003 19:36:34 -0700 (MST) Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: <15948.21800.641695.774686@monster.linux.in> Message-ID: On Fri, 14 Feb 2003, Prabhu Ramachandran wrote: > Hi, > > >>>>> "FP" == Fernando Perez writes: > > [snip] > > FP> At any rate, I wonder if as part of scipy there is anything > FP> with similar functionality. view() allows one to view 2-d > FP> arrays as images, in either grayscale or color. Since I don't > FP> have high hopes for anyone fixing view(), and I'm switching to > FP> scipy for all my work, I'd be happy to go with a scipy-based > FP> alternative if one exists. > > Well, you could do it with MayaVi. I have a mayamat module on my > system that I use to sample functions of the form z = F(x,y) and plot > them using MayaVi and pyVTK. It should be easy to view any 2d array > using this. > > If folks are interested I'll put it up for download sometime this > weekend. That would actually be great, esp. considering that I know how reliable and flexible Mayavi has been in the past. Best, f From fperez at pizero.colorado.edu Fri Feb 14 21:40:15 2003 From: fperez at pizero.colorado.edu (Fernando Perez) Date: Fri, 14 Feb 2003 19:40:15 -0700 (MST) Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: Message-ID: On Fri, 14 Feb 2003, Agustin Lobo wrote: > Fernando, > > Perhaps you would be interested on > openEV (http://openev.sourceforge.net/) > a package (in development) for image visualization > (in particular satellite image) with a > python console. It looks quite interesting, thanks for the link. I'll keep an eye on it to see how it develops, but I'm a bit worried to see that their activity level seems a bit low (from looking at the SF stats). But we'll see... cheers, f From fperez at pizero.colorado.edu Fri Feb 14 21:44:04 2003 From: fperez at pizero.colorado.edu (Fernando Perez) Date: Fri, 14 Feb 2003 19:44:04 -0700 (MST) Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: Message-ID: On Fri, 14 Feb 2003, Mark Shure wrote: > Hi, > > I also found the NumTut view() function very useful but problematic. I now > use "scipy.pilutil.imshow", which uses the PIL. > Well, thanks for the tip, but for me this does exactly nothing. No output, no error message, nothing: >>> import gui_thread >>> import scipy >>> from NumTut import greece,greeceBW,sgreece >>> scipy.pilutil.imshow (greece) # Nothing happens here at all >>> So maybe it's something the scipy team will get a chance to work on (these symptoms are from today's cvs code on a system with RH8.0 and the PIL 1.1.4a2). Regards, f. From fperez at pizero.colorado.edu Fri Feb 14 21:51:46 2003 From: fperez at pizero.colorado.edu (Fernando Perez) Date: Fri, 14 Feb 2003 19:51:46 -0700 (MST) Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: <1045252215.16245.7.camel@travis.local.net> Message-ID: Hi Travis, > If you have the PIL installed and a recent version of scipy you can use > > imshow(array) > > which will convert the image to a PIL object and show it through the PIL > external viewer. thanks for the suggestion, but with today's PIL and cvs scipy, this does exactly nothing on my system. > > This works for both RGB and grayscale images. > > > For grayscale images I personally use > > xplt.imagesc > > quite a bit but you have to have a Unix environment. Thanks! That does work quite well for plain numerical arrays, which is what I need most. It doesn't seem to be the tool for images such as NumTut's 'greece', this gives a pygist window which is empty, and the following traceback: In [6]: scipy.xplt.imagesc(greece) --------------------------------------------------------------------------- MemoryError Traceback (most recent call last) ? /usr/lib/python2.2/site-packages/scipy/xplt/Mplot.py in imagesc(z, cmin, cmax, xryr, _style, palette, color) 694 byteimage = gist.bytscl(z,cmin=cmin,cmax=cmax) 695 change_palette(palette) --> 696 gist.pli(byteimage,xryr[0],xryr[1],xryr[2],xryr[3]) 697 return 698 But that's ok, I can always use the modified 'view' I posted for images, which I need rarely. For numerical 2d arrays your solution seems great. I can't wait for the whole Chaco framework to stabilize so that scipy can grow an integrated, single data plotting system. That will be really great. Thanks again for all the help, F. From DavidA at ActiveState.com Fri Feb 14 23:47:41 2003 From: DavidA at ActiveState.com (David Ascher) Date: Fri, 14 Feb 2003 20:47:41 -0800 Subject: [SciPy-user] Alternative to NumTut's view() function? References: Message-ID: <3E4DC66D.1050802@ActiveState.com> Fernando Perez wrote: >Thanks! That does work quite well for plain numerical arrays, which is what I >need most. > >It doesn't seem to be the tool for images such as NumTut's 'greece', this >gives a pygist window which is empty, and the following traceback: > NumTut's greece (a souvenir from my high-school trip to greece =) was a fairly unusual format -- it's a pickled Numeric array. I didn't want the tutorial to have to rely on any particular image library being installed. Fernando -- could you submit view.py as a patch on the numeric project? It should be considered as a replacement for the existing view.py. --david From elizabethmoore at phantomemail.com Sat Feb 15 07:08:21 2003 From: elizabethmoore at phantomemail.com (elizabeth moore) Date: Sat, 15 Feb 2003 13:08:21 +0100 Subject: [SciPy-user] KINDLY GET BACK TO ME PLEASE Message-ID: <20030215123643.0D4FD3EB09@www.scipy.com> 0031-612702802 Dear Friend, You may be surprised to receive this letter from me, since you do not know me personally. I am Elizabeth Moore, the son of JAMES Moore, the most popular black farmer in Zimbabwe. He was recently murdered in the land dispute in my country. I got your contact through network online hence decided to write you. Before the death of my father, he had taken me to Johannesburg to deposit the sum of US8.5 million (Eight million, Five Hundred United States dollars), in one of the security company, as he foresaw the looming danger in Zimbabwe. This fund was deposited in a box as gemstones for concealment and to avoid much demurrage from the Security Company. This land problem came when Zimbabwean President, Mr. Robert Mugabe introduced a new land Act Reform wholly affecting the rich white farmers and some few rich black farmers who are opposed to him and this resulted to the killing and mob action by Zimbabwean war veterans and some lunatics in the society. In fact, a lot of people were killed because of this Land reform Act for which my father was one of the victims. The problem is yet unresolved as some white farmers who could not quit are being arrested by the government. It is against this background that my family and I fled Zimbabwe for fear of our lives of which i am currently staying in the Netherlands seeking political asylum. Moreover, I have decided to transfer my father's money to a more reliable foreign account WHERE IT WILL BE SAFE AND SECURE AND NOT TRACED BY THE GOVERNMENT OF ZIMBABWE. Since the law of Netherlands prohibits a refugee (asylum seeker) to have such amount of money in any bank account or to be involved in any financial transaction of such magnitude throughout the territorial zone of Netherlands, I am seeking a partner, who I have to entrust my future and that of my family in his hands.I must let you know that this transaction is risk free, if you accept to assist me. All I want you to do for me is to make an arrangement with the security company to clear the consignment (funds) from their affiliate office here in the Netherlands. I have already given directives for the consignment to be brought from South Africa to The Netherlands. All modalities will have to be put in place like change of ownership of the consignment in your name as the empowered sole beneficiary so that you can be contacted by the security company and clear the consignment on my behalf. I have two reward options for you. Firstly, I can give you a certain percentage preferably 20 (percent)of the funds for your role in clearing the consignment and ensuring that the fund is transferred into an account which you have control over. Secondly,you can go into partnership with me for the proper profitable investment of the funds in your country. Whichever option you want, feel free to notify me. I have also mapped out 5( five percent) of this money for all kinds of expenses incurred by you to defray them at the successful completion of this transaction. You may reply me by giving me your telephone and fax numbers so that I will send to you all the necessary documents once you have decided and willing to help while maintaining the absolute secrecy required in this transaction. Thank You. Yours sincerely, Elizabeth Moore --------------------------------------------------------- Demo Version Sent. ---------------------------------------------------------- From elizabethmoore at phantomemail.com Sat Feb 15 08:18:02 2003 From: elizabethmoore at phantomemail.com (elizabeth moore) Date: Sat, 15 Feb 2003 14:18:02 +0100 Subject: [SciPy-user] KINDLY GET BACK TO ME PLEASE Message-ID: <20030215134623.102EA3EB09@www.scipy.com> 0031-612702802 Dear Friend, You may be surprised to receive this letter from me, since you do not know me personally. I am Elizabeth Moore, the son of JAMES Moore, the most popular black farmer in Zimbabwe. He was recently murdered in the land dispute in my country. I got your contact through network online hence decided to write you. Before the death of my father, he had taken me to Johannesburg to deposit the sum of US8.5 million (Eight million, Five Hundred United States dollars), in one of the security company, as he foresaw the looming danger in Zimbabwe. This fund was deposited in a box as gemstones for concealment and to avoid much demurrage from the Security Company. This land problem came when Zimbabwean President, Mr. Robert Mugabe introduced a new land Act Reform wholly affecting the rich white farmers and some few rich black farmers who are opposed to him and this resulted to the killing and mob action by Zimbabwean war veterans and some lunatics in the society. In fact, a lot of people were killed because of this Land reform Act for which my father was one of the victims. The problem is yet unresolved as some white farmers who could not quit are being arrested by the government. It is against this background that my family and I fled Zimbabwe for fear of our lives of which i am currently staying in the Netherlands seeking political asylum. Moreover, I have decided to transfer my father's money to a more reliable foreign account WHERE IT WILL BE SAFE AND SECURE AND NOT TRACED BY THE GOVERNMENT OF ZIMBABWE. Since the law of Netherlands prohibits a refugee (asylum seeker) to have such amount of money in any bank account or to be involved in any financial transaction of such magnitude throughout the territorial zone of Netherlands, I am seeking a partner, who I have to entrust my future and that of my family in his hands.I must let you know that this transaction is risk free, if you accept to assist me. All I want you to do for me is to make an arrangement with the security company to clear the consignment (funds) from their affiliate office here in the Netherlands. I have already given directives for the consignment to be brought from South Africa to The Netherlands. All modalities will have to be put in place like change of ownership of the consignment in your name as the empowered sole beneficiary so that you can be contacted by the security company and clear the consignment on my behalf. I have two reward options for you. Firstly, I can give you a certain percentage preferably 20 (percent)of the funds for your role in clearing the consignment and ensuring that the fund is transferred into an account which you have control over. Secondly,you can go into partnership with me for the proper profitable investment of the funds in your country. Whichever option you want, feel free to notify me. I have also mapped out 5( five percent) of this money for all kinds of expenses incurred by you to defray them at the successful completion of this transaction. You may reply me by giving me your telephone and fax numbers so that I will send to you all the necessary documents once you have decided and willing to help while maintaining the absolute secrecy required in this transaction. Thank You. Yours sincerely, Elizabeth Moore --------------------------------------------------------- Demo Version Sent. ---------------------------------------------------------- From Kasper.Souren at ircam.fr Sun Feb 16 20:20:28 2003 From: Kasper.Souren at ircam.fr (Kasper Souren) Date: Mon, 17 Feb 2003 02:20:28 +0100 Subject: [SciPy-user] convolve2d.. or Numeric to numarray conversion In-Reply-To: <1045252278.16245.9.camel@travis.local.net> References: <200302141540.47395.Kasper.Souren@ircam.fr> <1045252278.16245.9.camel@travis.local.net> Message-ID: <200302170220.28451.Kasper.Souren@ircam.fr> > Look at the scipy.signal package > > info(scipy.signal.convolve) > > will do N-D convolution for you. That's what I had found before. But I didn't mention in the list; in fact I forgot about it. It works fine, but only for N = 1... >>> signal.convolve(zeros((5,5)), zeros((5,5))) Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.2/site-packages/Numeric/Numeric.py", line 205, in convolve return cross_correlate(a,asarray(v)[::-1],mode) ValueError: Object too deep for desired array And the zen of this message is yet too deep for me to comprehend. Maybe my earthly desires are still too grand to commence on this journey ;) bye, Kasper From fperez at pizero.colorado.edu Mon Feb 17 13:10:13 2003 From: fperez at pizero.colorado.edu (Fernando Perez) Date: Mon, 17 Feb 2003 11:10:13 -0700 (MST) Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: <3E4DC66D.1050802@ActiveState.com> Message-ID: On Fri, 14 Feb 2003, David Ascher wrote: > Fernando -- could you submit view.py as a patch on the numeric project? > It should be considered as a replacement for the existing view.py. Well, keep in mind that I stripped _all_ the things I didn't understand from that code (PIL, threading, Windows support, etc). So it may be that now it only works on _my_ computer. It was as simple-minded a job as I could possibly do to make it work. So I'm a bit hesitant. But if at least you or someone else can confirm that it works for them (someone with Windows would be great to hear from), then sure, I can send it in to the Numpy folks. Worst that can happen is that they say no :) Cheers, f. From karthik at james.hut.fi Mon Feb 17 13:22:39 2003 From: karthik at james.hut.fi (Karthikesh Raju) Date: Mon, 17 Feb 2003 20:22:39 +0200 Subject: [SciPy-user] Alternative to NumTut's view() function? In-Reply-To: Message-ID: Hi On Mon, 17 Feb 2003, Fernando Perez wrote: > On Fri, 14 Feb 2003, David Ascher wrote: > > > Fernando -- could you submit view.py as a patch on the numeric project? > > It should be considered as a replacement for the existing view.py. > > Well, keep in mind that I stripped _all_ the things I didn't understand from > that code (PIL, threading, Windows support, etc). So it may be that now it > only works on _my_ computer. It was as simple-minded a job as I could > possibly do to make it work. So I'm a bit hesitant. But if at least you or > someone else can confirm that it works for them (someone with Windows would be > great to hear from), then sure, I can send it in to the Numpy folks. Worst > that can happen is that they say no :) > It did work. i tried it on my linux and sgi machines at work. i havent tried it on my home computer though. The slowing down was not present, looks like it does work. Best regards karthik > Cheers, > > f. > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From oliphant.travis at ieee.org Tue Feb 18 00:25:23 2003 From: oliphant.travis at ieee.org (Travis Oliphant) Date: 17 Feb 2003 22:25:23 -0700 Subject: [SciPy-user] convolve2d.. or Numeric to numarray conversion In-Reply-To: <200302170220.28451.Kasper.Souren@ircam.fr> References: <200302141540.47395.Kasper.Souren@ircam.fr> <1045252278.16245.9.camel@travis.local.net> <200302170220.28451.Kasper.Souren@ircam.fr> Message-ID: <1045545924.10017.10.camel@travis.local.net> On Sun, 2003-02-16 at 18:20, Kasper Souren wrote: > > Look at the scipy.signal package > > > > info(scipy.signal.convolve) > > > > will do N-D convolution for you. > > That's what I had found before. But I didn't mention in the list; in fact I > forgot about it. > It works fine, but only for N = 1... > > >>> signal.convolve(zeros((5,5)), zeros((5,5))) > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/local/lib/python2.2/site-packages/Numeric/Numeric.py", line 205, > in convolve > return cross_correlate(a,asarray(v)[::-1],mode) > ValueError: Object too deep for desired array > > And the zen of this message is yet too deep for me to comprehend. Maybe my > earthly desires are still too grand to commence on this journey ;) > I'm sorry you are running into trouble. The problem is that your version of SciPy has a bug which overwrites the correct convolve function (that handles N-d) with the one in Numeric which only handles 1-d. The current version (in CVS) works correctly. Or you can fix it with a simple line change in scipy/signal/__init__.py -Travis O. From Kasper.Souren at ircam.fr Tue Feb 18 15:51:20 2003 From: Kasper.Souren at ircam.fr (Kasper Souren) Date: Tue, 18 Feb 2003 21:51:20 +0100 Subject: [SciPy-user] convolve2d.. or Numeric to numarray conversion In-Reply-To: <1045545924.10017.10.camel@travis.local.net> References: <200302141540.47395.Kasper.Souren@ircam.fr> <200302170220.28451.Kasper.Souren@ircam.fr> <1045545924.10017.10.camel@travis.local.net> Message-ID: <200302182151.20901.Kasper.Souren@ircam.fr> > I'm sorry you are running into trouble. Well, I chose to use cvs stuff myself, so you don't have to be sorry :) > The problem is that your version of SciPy has a bug which overwrites the > correct convolve function (that handles N-d) with the one in Numeric > which only handles 1-d. > The current version (in CVS) works correctly. Or you can fix it with a > simple line change in scipy/signal/__init__.py I did a "cvs update" and reinstalled the stuff. The signal.convolve2d works fine now, but the signal.convolve still gives me troubles: File "test.py", line 26, in convtest convolved = norm(abs(signal.convolve(data, kernel))) File "/usr/lib/python2.2/site-packages/Numeric/Numeric.py", line 205, in convolve return cross_correlate(a,asarray(v)[::-1],mode) data and kernel are both 2 dimensional. I'm happy with the signal.convolve2d function working correctly now, but maybe the signal.convolve still needs some fixing. bye, Kasper From w.f.alexander at ieee.org Thu Feb 20 01:07:09 2003 From: w.f.alexander at ieee.org (Bill Alexander) Date: 19 Feb 2003 22:07:09 -0800 Subject: [SciPy-user] Namespace Questions Message-ID: <1045721230.3709.268.camel@turtle> Chalk these up to the "I want it like Matlab" category... My apologies for the length. What I'd like to do is invoke scripting commands from an interactive python session from the global namespace. In Matlab, all m-file scripts are members of and operate within the invoking namespace, whereas functions create a private interior namespace for operation. I want to be able to mimic the no-namespace-change scripts of Matlab from within the Python interactive shell. The only thing I can figure to do is to use import. However, this creates a namespace for operation, and seems to restrict access to objects not a direct member of that namespace. I've looked for some kind of namespace override command (sort of like a "chdir" or debugger "up" and "down" for namespaces), but don't see anything applicable. Here's a concrete example - if I can get this to work, I can get scripting to do what I want. First, from the command line to ensure it should work: >>> from scipy import * >>> x = randn(5) >>> cos(x) [ 0.82844182 0.70265662 0.55083457 0.58898356 0.9564757 ] OK - works great. Now, let's pretend that this was something more significant, and that I'd like to invoke it as a script from within the python shell. Edit a file foo.py: ###### # foo.py x = randn(5) print cos(x) ####### Now, restart the python interpreter and try this: >>> from scipy import * >>> from foo import * Traceback (most recent call last): File "", line 1, in ? File "foo.py", line 1, in ? x = randn(5) NameError: name 'randn' is not defined You can test variations of this with varying degrees of success. Let me discuss one solution that won't work: importing the required modules at the top of this module. That is, to fix the above problem, I could of course just issue a "from scipy import *" directive at the top of the file. I don't want this for two reasons: one, I will be manually setting up the global namespace with desired features, including functional and data objects, which I need to be imported into the script (these scripts are going to be complicated and VERY quickly coded - I don't have time for a detailed class design until I know what I'm doing, which I won't know until I experiment with some data and ideas, and so on...); and two, if I do make this a module with it's own namespace, I don't want that namespace cluttered with the entire scipy set (I find this to be very frustrating when dealing with the existing code modules - the namespaces are overlapped and cluttered and it's hard to see what is actually unique to the separate modules). It doesn't make sense to me that modules which descend from the global namespace don't automatically have access to objects in the global space. I understand about needing to specify write permission to global objects with the global directive, but what about read-only invocation of functional or class objects? Anyone got an idea or suggestion? I have a feeling I just don't understand Python's model yet. Thanks in advance! - Bill Alexander From DavidA at ActiveState.com Thu Feb 20 01:18:39 2003 From: DavidA at ActiveState.com (David Ascher) Date: Wed, 19 Feb 2003 22:18:39 -0800 Subject: [SciPy-user] Namespace Questions References: <1045721230.3709.268.camel@turtle> Message-ID: <3E54733F.4040907@ActiveState.com> Bill Alexander wrote: >Chalk these up to the "I want it like Matlab" category... My apologies >for the length. > >What I'd like to do is invoke scripting commands from an interactive >python session from the global namespace. In Matlab, all m-file scripts >are members of and operate within the invoking namespace, whereas >functions create a private interior namespace for operation. I want to >be able to mimic the no-namespace-change scripts of Matlab from within >the Python interactive shell. > Look at execfile() --da From w.f.alexander at ieee.org Thu Feb 20 01:27:45 2003 From: w.f.alexander at ieee.org (Bill Alexander) Date: 19 Feb 2003 22:27:45 -0800 Subject: [SciPy-user] Namespace Questions In-Reply-To: <3E54733F.4040907@ActiveState.com> References: <1045721230.3709.268.camel@turtle> <3E54733F.4040907@ActiveState.com> Message-ID: <1045722465.1116.272.camel@turtle> Straight from Page 2 of the _Python_Essential_Reference_, among other places. Sometimes secrets hide in the open. I am quite embarrassed. Many thanks. - Bill On Wed, 2003-02-19 at 22:18, David Ascher wrote: > Bill Alexander wrote: > > >Chalk these up to the "I want it like Matlab" category... My apologies > >for the length. > > > >What I'd like to do is invoke scripting commands from an interactive > >python session from the global namespace. In Matlab, all m-file scripts > >are members of and operate within the invoking namespace, whereas > >functions create a private interior namespace for operation. I want to > >be able to mimic the no-namespace-change scripts of Matlab from within > >the Python interactive shell. > > > > Look at execfile() > > --da > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From nwagner at mecha.uni-stuttgart.de Thu Feb 20 08:52:43 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Thu, 20 Feb 2003 14:52:43 +0100 Subject: [SciPy-user] ValueError: I/O operation on closed file Message-ID: <3E54DDAB.6004EB95@mecha.uni-stuttgart.de> Hi all, I guess there is a bug in io.write_array. When I try to write an array to a file several times I get the following message Traceback (most recent call last): File "iotest.py", line 6, in ? io.write_array(file,A,separator=' ',linesep='\n', precision=5,suppress_small=1) File "/usr/local/lib/python2.1/site-packages/scipy/io/array_import.py", line 428, in write_array file.write(astr) ValueError: I/O operation on closed file from scipy import io from scipy import * file = open("test.dat",'w') A = array(([1.0,0.0],[0.0,1.0])) io.write_array(file,A,separator=' ',linesep='\n', precision=5,suppress_small=1) io.write_array(file,A,separator=' ',linesep='\n', precision=5,suppress_small=1) Any idea ? Nils From fperez at pizero.colorado.edu Thu Feb 20 12:31:26 2003 From: fperez at pizero.colorado.edu (Fernando Perez) Date: Thu, 20 Feb 2003 10:31:26 -0700 (MST) Subject: [SciPy-user] Namespace Questions In-Reply-To: <1045721230.3709.268.camel@turtle> Message-ID: On 19 Feb 2003, Bill Alexander wrote: > Chalk these up to the "I want it like Matlab" category... My apologies > for the length. > > What I'd like to do is invoke scripting commands from an interactive > python session from the global namespace. In Matlab, all m-file scripts > are members of and operate within the invoking namespace, whereas > functions create a private interior namespace for operation. I want to > be able to mimic the no-namespace-change scripts of Matlab from within > the Python interactive shell. You may also want to look at ipython (http://www-hep.colorado.edu/~fperez/ipython/). Its @run command is essentially a fancy wrapper around execfile(), with all sorts of options to control namespaces, access to the debugger and the profiler, etc. It was designed specifically with interactive scientific computing in mind, so you may find it useful. Cheers, f From Neuropsynut at aol.com Sun Feb 23 00:53:26 2003 From: Neuropsynut at aol.com (Neuropsynut at aol.com) Date: Sun, 23 Feb 2003 00:53:26 EST Subject: [SciPy-user] hello Message-ID: <2f.354f386e.2b89bbd6@aol.com> noticed the question around last October 11, concerning random numbers that are complex. I did research about 40 years ago on complex numbers that wererandom and also the reverse (inverse? very little on it in literature. any ideas? see Mandelbrot? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbakker at engr.uga.edu Thu Feb 27 10:39:23 2003 From: mbakker at engr.uga.edu (Mark Bakker) Date: Thu, 27 Feb 2003 10:39:23 -0500 Subject: [SciPy-user] using scipy.plt Message-ID: <3E5E312B.4060904@engr.uga.edu> Hello - I am using scipy.plt from within PyShell and have 2 questions: Why doesn't it work in IDLE? After I close a window, I don't seem to be able to plot anything anymore. Here is my error message when I try. Any thoughts? from scipy import plt plt.plot([1,2,3,4],[4,3,5,2]) plt.close() plt.plot([1,2,3,4],[4,3,5,2]) Traceback (most recent call last): File "", line 1, in ? File "C:\PROGRA~1\PYTHON22\Lib\site-packages\scipy\plt\interface.py", line 459, in plot if not _active.hold in ['on','yes']: File "C:\Program Files\Python22\lib\site-packages\wxPython\wx.py", line 1677, in __getattr__ raise wxPyDeadObjectError( self.attrStr % self._name ) wxPyDeadObjectError: The C++ part of the plot_frame object has been deleted, attribute access no longer allowed. Thanks, Mark From stephen.walton at csun.edu Thu Feb 27 20:11:45 2003 From: stephen.walton at csun.edu (Stephen Walton) Date: 27 Feb 2003 17:11:45 -0800 Subject: [SciPy-user] Latest CVS seems to break Absoft 4.6 Message-ID: <1046394707.28169.69.camel@hector.sfo.csun.edu> Hi, I have previously built SciPy on both RedHat 7.3 and RedHat 8.0 systems, most recently in about mid January. I use Absoft 4.6, old I know but it works very well. The command I use is of course "python setup.py build build_flib --fcompiler=Absoft install". At some point between then and now, the SciPy build broke with this setup. Specifically, the f77 compiles now use the -N15 switch to the f77 command. This switch is not documented in my copy of Absoft, but tests indicate that it results in a double underscore being appended to all external names. When I try to start scipy after a new build, it complains it cannot find cdftnc_ (one underscore). "nm cdftnc.o" shows the name in that file to be cdftnc__ (two underscores). The contents of __cvs_version.py for my working build are (1,154,1542,4500). For the nonworking build it is (1,156,1544,4568). The breakage seems to be independent of the version of f2py, as it happens on systems with either version 2.23.190 or 2.32.225 installed. My not-so-educated guess is that the new switch was an effort to make Absoft more compatible with g77. g77 appends a double underscore only to names with embedded underscores, a single underscore otherwise. (Why?) Absoft tech support confirmed that version 4.6 cannot emulate this, though version 6.0 has a '-g77' switch which mangles external names in the same way g77 does. These problems are why I had to build fftw from source, btw. -- Stephen Walton, Professor, Dept. of Physics & Astronomy, Cal State Northridge stephen.walton at csun.edu From mmckerns at its.caltech.edu Thu Feb 27 20:51:07 2003 From: mmckerns at its.caltech.edu (Michael McKerns) Date: Thu, 27 Feb 2003 17:51:07 -0800 (PST) Subject: [SciPy-user] fftpack link problems Message-ID: sorry to be a bother, but I'm having trouble with the new version of SciPy (0.2.0_alpha_156.4568). I had the ...144.4350 installed previously, but now after update I get errors upon "import scipy" This seems to stem from fftpack now not being able to find librfftw.so.2 I'm on RH8.0 & am using most recent F2PY & not using ATLAS. I think that it should be a matter of just linking the libraries, yes? Can you explain really slow for my little brain? I had some trouble trying to figure out the new build/install procedure for scipy... --- Mike McKerns mmckerns at caltech.edu From prabhu at aero.iitm.ernet.in Fri Feb 28 03:02:48 2003 From: prabhu at aero.iitm.ernet.in (Prabhu Ramachandran) Date: Fri, 28 Feb 2003 13:32:48 +0530 Subject: [SciPy-user] [ANN] imv.py: interactive 3D plots with MayaVi. Message-ID: <15967.6056.108550.473693@monster.linux.in> hi, imv.py is a module that lets you sample surfaces and arrays from the Python interpreter via convenient one line functions. It requires MayaVi (version 1.2) to be installed and running as a Python module i.e. the binary installs will not be able to use this. imv provides three useful functions: surf -- Creates a surface given regularly spaced values of x, y and the corresponding z as arrays. Also works if z is a function. view -- Allows one to view a 2D Numeric array. Note that the view will be set to the way we normally think of matrices with with 0, 0 at the top left of the screen. Works best for smaller arrays (size < 512x512). viewi -- Allows one to view a 2D Numeric array as an image. This works best for very large arrays (like 1024x1024 or larger arrays). The code is well documented and has an illustrative example in the function 'main' at the end of the file. To see the example simply run imv.py. The module is available here: http://www.ae.iitm.ac.in/~prabhu/software/mayavi.html or http://www.aero.iitm.ernet.in/~prabhu/software/mayavi.html Additionally, the module has some code that lets you easily convert Numeric Arrays into vtkDataArrays. So if you are interested in doing that you might want to take a look at the code. Have fun! prabhu p.s. Sorry about the cross-posting. From pearu at cens.ioc.ee Fri Feb 28 03:22:31 2003 From: pearu at cens.ioc.ee (Pearu Peterson) Date: Fri, 28 Feb 2003 10:22:31 +0200 (EET) Subject: [SciPy-user] fftpack link problems In-Reply-To: Message-ID: On Thu, 27 Feb 2003, Michael McKerns wrote: > sorry to be a bother, but I'm having trouble with the > new version of SciPy (0.2.0_alpha_156.4568). I had the > ...144.4350 installed previously, but now after update > I get errors upon "import scipy" Please include error messages to bug reports. They could be relevant for resolving problems quickly. > This seems to stem from fftpack now not being able to find > librfftw.so.2 > > I'm on RH8.0 & am using most recent F2PY & not using ATLAS. > > I think that it should be a matter of just linking the libraries, > yes? Can you explain really slow for my little brain? I had > some trouble trying to figure out the new build/install procedure > for scipy... The only relevant difference between these SciPy versions seem to be that the order of fftw, rfftw libraries was changed to rfftw, fftw (which should be the correct order). What `python scipy_distutils/system_info.py` says about finding FFTW in your case? Do you have librfftw.so properly installed in your system? May be you need to add the directory path of librfftw.so to LD_LIBRARIES_PATH variable (or to /etc/ld.so.conf). See also scipy/fftpack/NOTES.txt when you are building FFTW by yourself. Pearu From pearu at cens.ioc.ee Fri Feb 28 04:33:55 2003 From: pearu at cens.ioc.ee (Pearu Peterson) Date: Fri, 28 Feb 2003 11:33:55 +0200 (EET) Subject: [SciPy-user] Latest CVS seems to break Absoft 4.6 In-Reply-To: <1046394707.28169.69.camel@hector.sfo.csun.edu> Message-ID: On 27 Feb 2003, Stephen Walton wrote: > I have previously built SciPy on both RedHat 7.3 and RedHat 8.0 systems, > most recently in about mid January. I use Absoft 4.6, old I know but it > works very well. The command I use is of course "python setup.py build > build_flib --fcompiler=Absoft install". > > At some point between then and now, the SciPy build broke with this > setup. Specifically, the f77 compiles now use the -N15 switch to the > f77 command. This switch is not documented in my copy of Absoft, but > tests indicate that it results in a double underscore being appended to > all external names. When I try to start scipy after a new build, it > complains it cannot find cdftnc_ (one underscore). "nm cdftnc.o" shows > the name in that file to be cdftnc__ (two underscores). The two underscores are surprising. I recently tested scipy_distutils/f2py with Absoft 8.0 compiler and the -N15 switch approach worked properly. Update scipy_distutils and try again. See absoft_fortran_compiler class in scipy_distutils/command/build_flib.py for fine tuning Absoft compiler options if necessary. > My not-so-educated guess is that the new switch was an effort to make > Absoft more compatible with g77. g77 appends a double underscore only > to names with embedded underscores, a single underscore otherwise. > (Why?) Absoft tech support confirmed that version 4.6 cannot emulate > this, though version 6.0 has a '-g77' switch which mangles external > names in the same way g77 does. Actually, scipy_distutils and f2py aim not to be compatible with g77 in this case. Instead, the target is to be compatible with an "average" compiler in the sense that f2py generated C codes that call Fortran remain the same and the differences between C-to-Fortran symbol mapping among different compilers are resolved in the level of Fortran compiler options. Yhe average Fortran compiler is expected to map any Fortran subroutine name * to lower case * and with ending *single* underscore as they appear in object files. So far I have found that most Fortran compilers have switches to support such a rule but not always the g77 mapping rule. > These problems are why I had to build fftw from source, btw. Hmm, scipy does not use fftw Fortran interface, so the problems must be due to something else. See scipy/fftpack/NOTES.txt about scipy expectations on fftw library. Pearu From groma at nucleus.szbk.u-szeged.hu Fri Feb 28 06:53:46 2003 From: groma at nucleus.szbk.u-szeged.hu (=?iso-8859-1?Q?G=E9za_Groma?=) Date: Fri, 28 Feb 2003 12:53:46 +0100 Subject: [SciPy-user] problem in converting scipy to exe Message-ID: <008d01c2df39$8d8aa9c0$a13f72a0@szbk.uszeged.hu> I tried to convert a program using scipy into an exe file on Windows NT using both Gordon's Installer and py2exe. The problem is that weave is hardcoded to be imported by scipy.__init__. Weave tries to open swigptr.c using and absolute path. If the exe file built is exetuted on an other computer it will not find it. Py2exe even gives an error message during building the exe file. To cure the problem I simply commented out importing weave in scipy.__init__ as well as its name anddescription in _pkgs and _pkg_doc. For the current case it eliminated the problem since I did not need weave. Any permanent solution? Can not be weave absolutely independent of scipy? Regards, G?za Groma Institute of Biophysics Biological Research Center of Hungarian Academy of Sciences 6701 Szeged, Hungary -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmckerns at its.caltech.edu Fri Feb 28 20:06:25 2003 From: mmckerns at its.caltech.edu (Michael McKerns) Date: Fri, 28 Feb 2003 17:06:25 -0800 (PST) Subject: [SciPy-user] gui_thread problem Message-ID: Thanks the librfftw.so was an oversight on my part, I just forgot to link the library. SciPy is almost back to the normal working state it was for me previously. One slight difference is that things aren't importing correctly with gui_thread. I noticed that the last line of __init__.py is "main.start()" for the built version, however in __init__.py in site-packages/gui_thread version the last line is "from main import register, start, startup". Could this be causing the following behavior upon exit? Python 2.2.2 (#1, Jan 7 2003, 15:12:31) [GCC 3.2 20020903 (Red Hat Linux 8.0 3.2-7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import gui_thread >>> gui_thread.main.start() >>> >>> 04:41:09 PM: Debug: C++ assertion "wxThread::IsMain()" failed in /usr/src/redhat/BUILD/wxPythonSrc-2.4.0.2/src/unix/threadpsx.cpp(1618): only main thread can be here Exception wxPython.wxc.wxPyAssertionError: 'C++ assertion "wxThread::IsMain()" failed in /usr/src/redhat/BUILD/wxPythonSrc-2.4.0.2/src/unix/threadpsx.cpp(1618): only main thread can be here' in > ignored --- Mike McKerns mmckerns at caltech.edu