Re: [Matplotlib-users] ploting matrix data

2009-04-09 Thread Matthias Michler
Hi Bala,

I added a small example showing up your matrix in order to have a running 
example, where you can specify your needs. 

In the program contourf  could be replaced by contour or imshow - see help / 
docu / examples on the web 
The colormap can be specified with the kwarg "cmap" : e.g. pyplot.cm.gray.

regards Matthias

On Wednesday 08 April 2009 14:08:13 Bala subramanian wrote:
> Friends,
>
> I have a pairwise comparison of 50 data points. The comparison is based on
> the mean square deviation between the points. I want to plot this data by
> specifying different colors for diffrent ranges of mean square deviation.
> Any suggestion would be of much help to me. I have attached the data file
> with the mail.
>
> Thanks,
> Bala




show_matrix.py
Description: application/python
--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib._path failed on windows build for Python 2.6

2009-04-09 Thread Lorenzo Di Gregorio
On Thu, Apr 9, 2009 at 7:06 AM, Andrew Straw  wrote:

> Lorenzo Di Gregorio wrote:
> > Hello,
> >
> > I've tried to build matplotlib 0.98.5.2 for Python 2.6 under Windows
> > (Win2k) using MinGW and win32_static.  After a few fixes, the
> > compilation and install appear to be ok, but I've got stuck at
> > importing matplotlib._path (see transcript below).
> > Any suggestions on what is going wrong and how to fix it?
> >
> >   File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 5,
> > in 
> >
> > from transforms import Bbox, IdentityTransform, TransformedBbox,
> > Transformed
> > Path
> >   File "C:\Python26\lib\site-packages\matplotlib\transforms.py", line
> > 34, in  > dule>
> > from matplotlib._path import affine_transform
> > ImportError: DLL load failed: Die angegebene Prozedur wurde nicht
> > gefunden.
> >
> Did _path.cpp get compiled to a .pyd OK? (Do you have
> C:\PYTHON26\Lib\site-packages\matplotlib\_path.pyd installed? -- I guess
> that's where it would be... Not running Python on Windows, though, I
> could be off a bit.)


Yes, that's compiled and installed at the location you mentioned.
In fact I have no idea what is wrong with that.
How does a .pyd reference a DLL and what is it supposed to load?


> And, as a hint to anyone else attempting to debug this: the above
> traceback means "The given procedure was not found". (And Lorenzo Di
> Gregorio doesn't sound like a very German name to me, so why your
> computer is speaking German I don't know... :)


Right, I don't know either why I haven't switched it already ;-) But
mitigating circumstances for lazyness are that German is my second language,
my wife is German, I live and work in Germany etc.

I do find something nice about running Python 2.6 under Win2k, though...
>

... under Linux it was too easy ;-P (my company runs Win2k!)
--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Changing axis units, with imshow()

2009-04-09 Thread Ciarán Mooney
Hi,

I am trying to plot an image with matplotlib and change the default axis units.

Using the cookbook recipe (import image with PIL, and use imshow() ).
I am able to get matplotlib to display the image, but the axis are
just the x and y pixel numbers.

I'd like to convert them to something else. Ie

y_value = ypixel * (131/1608)
x_value = xpixel * (5/60)

I am really struggling here and have been at it since yesterday. There
must be a simple way of doing this that is evading me.

Thanks,

Ciarán

--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ploting matrix data

2009-04-09 Thread Matthias Michler
Hi Bala,

you may want to have a look at the gallery including many example pictures on
http://matplotlib.sourceforge.net/gallery.html
especially the follwing two examples might be of interest for you
http://matplotlib.sourceforge.net/examples/pylab_examples/contourf_demo.html
http://matplotlib.sourceforge.net/examples/api/colorbar_only.html

I used these two to set up the attached example, which is very close to what 
you want.

Question for developers: Could it be useful to add two kwargs 'over_color' 
and 'under_color' to contourf in order to allow specification of a 
ListedColormap by kwarg 'colors' and these two colors?

best regards 
Matthias

 
On Thursday 09 April 2009 10:34:27 Bala subramanian wrote:
> Dear Matthias,
>
> Thanks a ton. This is a great help for me. Is there any way to specify a
> color range. By default it has produced different colors at the interval of
> 0.3, i need bit higher range like < 1 , 1 to 1.5, 1.5-2.0, 2-2.5, > 2.5.
> Also i need to set this range dynamically. Kindly write me how i can do
> this.
>
> Thanks in advance,
> Bala
>
> On Thu, Apr 9, 2009 at 9:08 AM, Matthias Michler 
wrote:
> > Hi Bala,
> >
> > I added a small example showing up your matrix in order to have a running
> > example, where you can specify your needs.
> >
> > In the program contourf  could be replaced by contour or imshow - see
> > help /
> > docu / examples on the web
> > The colormap can be specified with the kwarg "cmap" : e.g.
> > pyplot.cm.gray.
> >
> > regards Matthias
> >
> > On Wednesday 08 April 2009 14:08:13 Bala subramanian wrote:
> > > Friends,
> > >
> > > I have a pairwise comparison of 50 data points. The comparison is based
> >
> > on
> >
> > > the mean square deviation between the points. I want to plot this data
> > > by specifying different colors for diffrent ranges of mean square
> > > deviation. Any suggestion would be of much help to me. I have attached
> > > the data file with the mail.
> > >
> > > Thanks,
> > > Bala
> >
> > -
> >- This SF.net email is sponsored by:
> > High Quality Requirements in a Collaborative Environment.
> > Download a free trial of Rational Requirements Composer Now!
> > http://p.sf.net/sfu/www-ibm-com
> > ___
> > Matplotlib-users mailing list
> > Matplotlib-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users




contourf_with_extended_colorbar.py
Description: application/python
--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Computer specs for fast matplotlib and basemap processing

2009-04-09 Thread Jose Gómez-Dans
On Wednesday 08 April 2009 21:57:21 antonv wrote:
> The biggest bottleneck is happening because I'm unpacking grib files to csv
> files using Degrib in command line. That operation is usually around half
> an hour using no more than 50% of the processor but it maxes out the memory
> usage and it definitely is hard drive intensive as it ends up writing over
> 4 GB of data. I have noticed also that on a lower spec AMD desktop this
> runs faster than on my P4 Intel Laptop, my guess being that the laptop hdd

I do the same sort of processing, and use GDAL to read the GRIB (I think 
grib2, whatever ECMWF provides) files directly into numpy arrays. It's as 
easy as 

from osgeo import gdal
g = gdal.Open("my_grib_file.grib")
data = g.GetRasterBand( my_band ).ReadAsArray()
pylab.imshow 
blah blah blah

It doesn't take long at all, unless your files are huge and are stored over a 
slow and busy network. But then, there's little you can do about that!

J

-- 
RSU ■ Dept. of Geography ■ University College ■ Gower St, London WC1E 6BT UK
EMM ■ Dept. of Geography ■ King's College ■  Strand, London WC2R 2LS UK

--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Coordinates of contour lines

2009-04-09 Thread Ewald Zietsman
Hi All,

I need to use the coordinates of a contour line for further calculations. Is
there a simple way to get the x,y coordinates from a contour object or
otherwise?

i.e. I have (x,y,z) coordinates and have created a contour map from these. I
need the (x,y) coordinates of the contour line with value z0.

Cheers

Ewald
--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Changing axis units, with imshow()

2009-04-09 Thread Andrew Straw
Ciarán Mooney wrote:
> Hi,
>
> I am trying to plot an image with matplotlib and change the default axis 
> units.
>
> Using the cookbook recipe (import image with PIL, and use imshow() ).
> I am able to get matplotlib to display the image, but the axis are
> just the x and y pixel numbers.
>
> I'd like to convert them to something else. Ie
>
> y_value = ypixel * (131/1608)
> x_value = xpixel * (5/60)
>
> I am really struggling here and have been at it since yesterday. There
> must be a simple way of doing this that is evading me.
>   
You want the "extent" keyword argument. E.g. pylab.imshow( pixels,
extent=(0,131,0,5) ) if pixels has dimensions 1608 wide and 60 high to
match your above attempt.

--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] preventing scaling view after updating plot

2009-04-09 Thread Ryan May
On Thu, Apr 9, 2009 at 1:04 AM, C M  wrote:

> >
> > I tried this, and it did stop autoscaling--but I do want y autoscaling.
> > What I want is y autoscaling but not y autoscaling (just setting xlims).
> > I tried adding either of these lines right before or right after when I
> plotted
> > the highlighted point:
>
> Just to be clearer:  What I want is the plot to stay precisely the same
> when I add the highlighted point.  But now I have either of two undesired
> alternatives:
>
> 1) I do add_subplot(111,autoscale_on=False) when I create the
> subplot and none of my plots have the y scaled (but I want them scaled).
>
> 2) I do add_subplot(111) and when I add a highlighted datapoint it
> autoscales my plot (but I don't want that).
>

If you upgrade to SVN head, it supports what you want.  You can use:

add_subplot(111, autoscalex_on=False)

I don't think this particular feature has made it into a release yet.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Computer specs for fast matplotlib and basemap processing

2009-04-09 Thread Christopher Barker
Eric Firing wrote:
>> The biggest bottleneck is happening because I'm unpacking grib files to csv
>> files using Degrib in command line. That operation is usually around half an

disk speed -- you might want to try SATA RAID 0 (striping) -- I"d get a 
good hardware vendor's advise in maximizing your disk IO.

You can also multi-task that process easily, but if you're disk-bound, 
that won't help anyway.

> Instead of going to csv files--which are *very* inefficient to write, 
> store, and then read in again--why not convert directly to netcdf,

Or HDF, via PyTables. Or even direct binary numpy arrays, with either 
fromfile / to file, or, more robustly, with numpy.save and numpy.load.

> direct numpy-enabled access to the grib files might be 
> even better, eliminating the translation phase entirely.  Have you 
> looked into http://www.pyngl.ucar.edu/Nio.shtml?

Also, I think GDAL support GRIB, and can directly give you numpy arrays.

>> I have noticed also that on a lower spec AMD desktop this runs
>> faster than on my P4 Intel Laptop, my guess being that the laptop hdd is
>> 5400 rpm and the desktop is 7200 rpm.


yup, those laptop hard drives are SLOW -- you culd look into a Solic 
State drive, if you have some money to spend.

>> Next step is to take all those csv files and make images from them. For this
>> one I haven't dug too deep to see what is happening but it seems to be the
>> other way, using the cpu a lot more while keeping the memory usage high too.

mulit-cores aren't going to help here, unless yuo run a few separate 
processes -- also, how much memory? All 64 bits will buy you is more 
memory, which you may or may not need.

Also, as for Windows 64 bits -- is numpy supported there yet? I'd make 
sure, there are issues, as there is no MingGW for 64 bit Windows.

antonv wrote:
> I know that using the csv files is very slow but I have no knowledge of
> working with the netcdf format and I was in a bit of a rush when I wrote
> this. I will take a look again at it. How would you translate a grib in
> netcdf?

See if degrib supports any binary formats (I now, I'm form NOAA, I 
should know...). Otherewise yuo could use the hGDAL command-line tools 
to translate into something else binary that may be easier to deal with. 
Though it looks like Jeff may have solved this problem for you (One 
NOAA, Jeff!)

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib._path failed on windows build for Python 2.6

2009-04-09 Thread Michael Droettboom
Can you send us the output of this Python session to help us debug?  I'm 
curious what symbols *are* in there.

 >>> import matplotlib._path
 >>> dir(matplotlib._path)
['__doc__', '__file__', '__name__', 'affine_transform', 
'clip_path_to_rect', 'convert_path_to_polygons', 
'count_bboxes_overlapping_bbox', 'get_path_collection_extents', 
'get_path_extents', 'path_in_path', 'path_intersects_path', 
'point_in_path', 'point_in_path_collection', 'point_on_path', 
'update_path_extents']
 >>>

Cheers,
Mike

Lorenzo Di Gregorio wrote:
> On Thu, Apr 9, 2009 at 7:06 AM, Andrew Straw  > wrote:
>
> Lorenzo Di Gregorio wrote:
> > Hello,
> >
> > I've tried to build matplotlib 0.98.5.2 for Python 2.6 under Windows
> > (Win2k) using MinGW and win32_static.  After a few fixes, the
> > compilation and install appear to be ok, but I've got stuck at
> > importing matplotlib._path (see transcript below).
> > Any suggestions on what is going wrong and how to fix it?
> >
> >   File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 5,
> > in 
> >
> > from transforms import Bbox, IdentityTransform, TransformedBbox,
> > Transformed
> > Path
> >   File "C:\Python26\lib\site-packages\matplotlib\transforms.py",
> line
> > 34, in  > dule>
> > from matplotlib._path import affine_transform
> > ImportError: DLL load failed: Die angegebene Prozedur wurde nicht
> > gefunden.
> >
> Did _path.cpp get compiled to a .pyd OK? (Do you have
> C:\PYTHON26\Lib\site-packages\matplotlib\_path.pyd installed? -- I
> guess
> that's where it would be... Not running Python on Windows, though, I
> could be off a bit.)
>
>
> Yes, that's compiled and installed at the location you mentioned.
> In fact I have no idea what is wrong with that.
> How does a .pyd reference a DLL and what is it supposed to load?
>  
>
> And, as a hint to anyone else attempting to debug this: the above
> traceback means "The given procedure was not found". (And Lorenzo Di
> Gregorio doesn't sound like a very German name to me, so why your
> computer is speaking German I don't know... :)
>
>
> Right, I don't know either why I haven't switched it already ;-) But 
> mitigating circumstances for lazyness are that German is my second 
> language, my wife is German, I live and work in Germany etc.
>
> I do find something nice about running Python 2.6 under Win2k,
> though...
>
>
> ... under Linux it was too easy ;-P (my company runs Win2k!)
> 
>
> --
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> 
>
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] preventing scaling view after updating plot

2009-04-09 Thread C M
On Thu, Apr 9, 2009 at 9:25 AM, Ryan May  wrote:
> On Thu, Apr 9, 2009 at 1:04 AM, C M  wrote:
>>
>> >
>> > I tried this, and it did stop autoscaling--but I do want y autoscaling.
>> > What I want is y autoscaling but not y autoscaling (just setting xlims).
>> > I tried adding either of these lines right before or right after when I
>> > plotted
>> > the highlighted point:
>>
>> Just to be clearer:  What I want is the plot to stay precisely the same
>> when I add the highlighted point.  But now I have either of two undesired
>> alternatives:
>>
>> 1) I do add_subplot(111,autoscale_on=False) when I create the
>> subplot and none of my plots have the y scaled (but I want them scaled).
>>
>> 2) I do add_subplot(111) and when I add a highlighted datapoint it
>> autoscales my plot (but I don't want that).
>
> If you upgrade to SVN head, it supports what you want.  You can use:
>
> add_subplot(111, autoscalex_on=False)
>
> I don't think this particular feature has made it into a release yet.
>
> Ryan
> --
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma

Wow, thanks Ryan.  This is the beauty of an email list.  I'll try to
get it from SVN or back-burner this issue until the next release.

Che

--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib._path failed on windows build for Python 2.6

2009-04-09 Thread Lorenzo Di Gregorio
Well, that's exactly the problem: I just can't load some DLLs!

>>> import matplotlib._path

Traceback (most recent call last):
  File "", line 1, in 
import matplotlib._path
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.
>>> import matplotlib._delaunay
>>> import matplotlib._image

Traceback (most recent call last):
  File "", line 1, in 
import matplotlib._image
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.
I have run python -vv, it tries also ..._path but does not load it, so I
think it might be a linking problem.
I've noticed that _delaunay.cpp has a "PyMODINIT_FUNC init_delaunay(void)"
while _path.cpp has just a "void init_path(void)".

Best Regards,
Lorenzo

On 4/9/09, Michael Droettboom  wrote:
>
> Can you send us the output of this Python session to help us debug?  I'm
> curious what symbols *are* in there.
>
> >>> import matplotlib._path
> >>> dir(matplotlib._path)
> ['__doc__', '__file__', '__name__', 'affine_transform',
> 'clip_path_to_rect', 'convert_path_to_polygons',
> 'count_bboxes_overlapping_bbox', 'get_path_collection_extents',
> 'get_path_extents', 'path_in_path', 'path_intersects_path', 'point_in_path',
> 'point_in_path_collection', 'point_on_path', 'update_path_extents']
> >>>
>
> Cheers,
> Mike
>
> Lorenzo Di Gregorio wrote:
>
>> On Thu, Apr 9, 2009 at 7:06 AM, Andrew Straw > straw...@astraw.com>> wrote:
>>
>>Lorenzo Di Gregorio wrote:
>>> Hello,
>>>
>>> I've tried to build matplotlib 0.98.5.2 for Python 2.6 under Windows
>>> (Win2k) using MinGW and win32_static.  After a few fixes, the
>>> compilation and install appear to be ok, but I've got stuck at
>>> importing matplotlib._path (see transcript below).
>>> Any suggestions on what is going wrong and how to fix it?
>>>
>>>   File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 5,
>>> in 
>>>
>>> from transforms import Bbox, IdentityTransform, TransformedBbox,
>>> Transformed
>>> Path
>>>   File "C:\Python26\lib\site-packages\matplotlib\transforms.py",
>>line
>>> 34, in >> dule>
>>> from matplotlib._path import affine_transform
>>> ImportError: DLL load failed: Die angegebene Prozedur wurde nicht
>>> gefunden.
>>>
>>Did _path.cpp get compiled to a .pyd OK? (Do you have
>>C:\PYTHON26\Lib\site-packages\matplotlib\_path.pyd installed? -- I
>>guess
>>that's where it would be... Not running Python on Windows, though, I
>>could be off a bit.)
>>
>>
>> Yes, that's compiled and installed at the location you mentioned.
>> In fact I have no idea what is wrong with that.
>> How does a .pyd reference a DLL and what is it supposed to load?
>>
>>And, as a hint to anyone else attempting to debug this: the above
>>traceback means "The given procedure was not found". (And Lorenzo Di
>>Gregorio doesn't sound like a very German name to me, so why your
>>computer is speaking German I don't know... :)
>>
>>
>> Right, I don't know either why I haven't switched it already ;-) But
>> mitigating circumstances for lazyness are that German is my second language,
>> my wife is German, I live and work in Germany etc.
>>
>>I do find something nice about running Python 2.6 under Win2k,
>>though...
>>
>>
>> ... under Linux it was too easy ;-P (my company runs Win2k!)
>> 
>>
>>
>> --
>> This SF.net email is sponsored by:
>> High Quality Requirements in a Collaborative Environment.
>> Download a free trial of Rational Requirements Composer Now!
>> http://p.sf.net/sfu/www-ibm-com
>> 
>>
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Computer specs for fast matplotlib and basemap processing

2009-04-09 Thread Anton Vasilescu

Thanks a lot Chris for the detailed answer. I had the same doubts about 64bits 
and multiple cores. I just found out about Gdal and yes, Jeff's grib tools seem 
to be exactly what I needed.

I'll stay with a fast dual core and 32 bit os and I'll get a 1 rpm hdd. 
That should be more than enough especially that this machine will not do 
anything else but processing this.   

Sent from my iPhone

On Apr 9, 2009, at 10:12 AM, Christopher Barker  wrote:

Eric Firing wrote:
The biggest bottleneck is happening because I'm unpacking grib files to csv
files using Degrib in command line. That operation is usually around half an

disk speed -- you might want to try SATA RAID 0 (striping) -- I"d get a 
good hardware vendor's advise in maximizing your disk IO.

You can also multi-task that process easily, but if you're disk-bound, 
that won't help anyway.

Instead of going to csv files--which are *very* inefficient to write, 
store, and then read in again--why not convert directly to netcdf,

Or HDF, via PyTables. Or even direct binary numpy arrays, with either 
fromfile / to file, or, more robustly, with numpy.save and numpy.load.

direct numpy-enabled access to the grib files might be 
even better, eliminating the translation phase entirely.  Have you 
looked into http://www.pyngl.ucar.edu/Nio.shtml?

Also, I think GDAL support GRIB, and can directly give you numpy arrays.

I have noticed also that on a lower spec AMD desktop this runs
faster than on my P4 Intel Laptop, my guess being that the laptop hdd is
5400 rpm and the desktop is 7200 rpm.


yup, those laptop hard drives are SLOW -- you culd look into a Solic 
State drive, if you have some money to spend.

Next step is to take all those csv files and make images from them. For this
one I haven't dug too deep to see what is happening but it seems to be the
other way, using the cpu a lot more while keeping the memory usage high too.

mulit-cores aren't going to help here, unless yuo run a few separate 
processes -- also, how much memory? All 64 bits will buy you is more 
memory, which you may or may not need.

Also, as for Windows 64 bits -- is numpy supported there yet? I'd make 
sure, there are issues, as there is no MingGW for 64 bit Windows.

antonv wrote:
I know that using the csv files is very slow but I have no knowledge of
working with the netcdf format and I was in a bit of a rush when I wrote
this. I will take a look again at it. How would you translate a grib in
netcdf?

See if degrib supports any binary formats (I now, I'm form NOAA, I 
should know...). Otherewise yuo could use the hGDAL command-line tools 
to translate into something else binary that may be easier to deal with. 
Though it looks like Jeff may have solved this problem for you (One 
NOAA, Jeff!)

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users



  

--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Limiting scalex/scaley to specific elements.

2009-04-09 Thread Michael McNeil Forbes
Is there a standard way to associate scalex/scaley information with  
individual plot elements?

I would like to do the following:

x = linspace(-1,1,100)
y = sin(x)
plot(x,y)
plot(x,10*y,scaley=False)
plot(x,2*y)

and have it be equivalent to plotting instead in the order

plot(x,y)
plot(x,2*y)
plot(x,10*y,scaley=False)

i.e., the (x, 10*y) data does not affect the auto-scaling whereas the  
other two collections do.

The problem is that scaley seems to just change the autoscaling for  
the single plot command, but it does not remove the line from the  
autoscaling for future plotting.

Is there any easy work around?  (I know I could probably somehow  
accumulate all my results, and then finally sort them, plotting the  
non-scaled data last, but this seems very kludgy).

Thanks,
Michael.

--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users