From: E. <ke...@ni...> - 2007-02-20 15:19:58
|
Dear list'ers I'm struggling with a surface shade plot and can't figure out what I'm doing wrong. I can't find any info other than the plplot homepage examples regarding PerlDL, and all I get by following those examples are just black surfaces... Anyway, here's my problem (and it should be simple to solve, argh!!!): I've got three different arrays, $lon, $lat and $value. $value[0] corresponds to $lon[0] and $lat[0] and so on. $value takes values from 0.0 to about 20.0. The lon/lat grid resolution is 2.5 X 2.5 deg and may take any geographical value (-180 to180 and -90 to 90) I'd like to make a surface shade plot (blue -> green -> red) showing red for the highest values. Sorry to bother you with such basic questions... Cheers, Ked |
From: Alan W. I. <ir...@be...> - 2007-02-20 18:52:01
|
On 2007-02-20 16:19+0100 K=E5re Edvardsen wrote: > Dear list'ers > > I'm struggling with a surface shade plot and can't figure out what I'm > doing wrong. I can't find any info other than the plplot homepage > examples regarding PerlDL, and all I get by following those examples are > just black surfaces... I just checked, and the standard pdl examples work for me on Debian stable (except I cannot do the map example since plmap is not implemented for that old version of pdl). Thus, I suspect there is something wrong/inconsistent with the version of PLplot that is linked to your version of pdl. To be sure you are using a modern good version of PLplot with the PDL available on your platform, here is what I would like you to do (which follows what I did for the above test). (1) Build PLplot from the current CVS version (which is quite stable). Follow the directions at http://www.miscdebris.net/plplot_wiki/ except that you should use the -DENABLE_pdl=3DON -DBUILD_TEST=3DON options for cmake. (The first allows pdl and the second allows ctest). You can stop after the make command (i.e., at this point you don't have to do the make install command). It is a good idea to save all output from the cmake and make commands in case there is any trouble with the ctest step below. (2) After executing the "make" command run ctest --verbose --tests-regex perl >& ctest.out (drop the --tests-regex perl option if you want to test everything). You should see postscript files that have been generated in the build tree test subdirectory as a result of that ctest command. Use a postscript viewer to look at them, (e.g., "gv test/x16pdl.ps"). Hopefully you will ge= t good-looking results that verify that all is well with PDL and the CVS version of PLplot on your platform, and we can take it from there to get equivalent good-looking results for your own pdl examples. If you notice cmake, make, or ctest errors or get no pdl results, then plea= se post to the list with the complete output from cmake, make, and ctest (i.e.= , cmake.out, make.out, and ctest.out) attached. Those files are usually neede= d to help us figure out what the problem is on any particular platform. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |
From: Alan W. I. <ir...@be...> - 2007-02-21 17:18:24
|
Hi K=E5re: I am going to answer you on list since others may be interested as well in my response. On 2007-02-21 09:08+0100 K=E5re Edvardsen wrote: > Hi Alan, > > Thanx for helping me out! I got all PerlDL examples work perfectly! It > was of cource me messing up the color maps, but everthing's ok now. > > >> >> You should see postscript files that have been generated in the build tr= ee >> test subdirectory as a result of that ctest command. Use a postscript >> viewer to look at them, (e.g., "gv test/x16pdl.ps"). Hopefully you will= get >> good-looking results that verify that all is well with PDL and the CVS >> version of PLplot on your platform, and we can take it from there to get >> equivalent good-looking results for your own pdl examples. > > > So then back to my own pdl problem. I just have to admit I can't figure > out how plshades work based on the examples (and the plplot ref-man is > not consistent with PDL, I guess...) > Anyway, as I wrote earlier I have three different arrays, $lon, $lat and > $value (or one three-column pdl) where I like to shade on basis of > $value. I spent some time last night figuring out how plshades work, but > still no success... Are you able to help me out on this one? Sure, but let's take some additional steps first which should make it easie= r for you to transform one of the PDL examples into what you want. (1) From your build tree (where you executed the make command and ctest command) try "make install >& make_install.out" which should install everything you need in a coherent way at the install prefix you specified t= o the cmake command. Look over make_install.out to make sure there are no errors, and everything is installed where you expect from the prefix that you specified. (2) Run the PDL examples in the install tree. cd $prefix/share/plplot5.7.2/examples/ =2E/plplot-test.sh --front-end=3Dperl The resulting output on my system is the following: Testing front-end perl PLplot library version: 5.7.2 perl: relocation error: /usr/lib/perl5/auto/PDL/Graphics/PLplot/PLplot.so: undefined symbol: plmap That last error is because my version of pdl does not have a wrapper implemented for plmap so the resulting x19pdl.ps is zero length, but all other postscript results are fine on my system including the plshades o= nes in x16pdl.ps. If you get results similar to above (especially the library version) and x16pdl.ps looks good, then the next step is to modify perl/x16.pl in that install tree to define the arrays plotted in the way that you like. Once that proof-of-concept is working, then you should figure out exactly what plplot-test.sh and test_perl.sh scripts do (e.g., to set LD_LIBRARY_PATH) t= o set up the PDL examples so that you can set up your own PDL example so that it works properly with the modern version of PLplot. BTW, I have little experience with Perl or PDL, but the syntax in x16.pl looks entirely straightforward. For example, your $lon, $lat, and $value arrays are the equivalent of $x, $y, and $z. By comparing every PLplot command in x16.pl with its C documentation (e.g., http://plplot.sourceforge.net/docbook-manual/plplot-html-5.7.2/plshades.htm= l) you should quickly be able to infer what the form of every PDL equivalent PLplot command should be. Note, PDL uses the "redacted" form of API (being documented as we speak) where all redundant dimensional information is dropped from commands. (Redundant, because the PDL arrays carry dimension information along with them, and the PDL interface to PLplot figures that out and sets up the C call appropriately.) Let us know how it goes. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |
From: Alan W. I. <ir...@be...> - 2007-02-22 19:36:43
|
Hi K=E5re: Glad the basic build-tree test (ctest) and the basic install-tree test are working for you. Note the library version shown by the latter should be 5.7.2 (corresponding to the CVS version of PLplot) rather than 5.6.1 as implied by what you said. I believe it is only the CVS version of PLplot that configures the test_perl.sh file properly (via LD_LIBRARY_PATH) so tha= t you always get the PLplot library version that you just built and installed as opposed to some system version. On 2007-02-22 10:19+0100 K=E5re Edvardsen wrote: > > Syntax seem almost straight forward, but the it seems like the function > call paramaters does not come in same order for c and perl > > C: plshades(z, nx, ny, NULL, -1., 1., -1., 1., ...and so on > > perl: plshades (z, -1., 1., -1., 1., ...and so on, > > and I've got some difficulties recognizing them, but I will look into it > now. Yes, that NULL C argument above stands for zdefined which is moved to a different place in the PDL argument for probably historical reasons. Note, the C API for both plshade (example 15) and plshades (example 16) is quite tricky and hard to emulate in other languages so your best choice for these two functions is to consult the implementation of the PDL interface to PLplot. That project has been implemented independently of PLplot and is separately maintained by Doug Hunt. (Doug, if you are lurking on this list please speak up.) Anyhow, K=E5re, you picked one of the most difficult case= s to deal with (plshades), and other PDL calls to PLplot functions usually follow the general rules (dropped redundant dimension arguments as in nx an= d ny above) much better with no argument list rearranging. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |