Alexis -

Plotting libraries in PDL are not centrally coordinated so PDL's support
for various plotting libraries is wholly dependent upon someone taking it
up as a personal project.

Integrating NCL into PDL (or Perl more generally) could take a handful of
different routes depending on your inclination and familiarity with Perl
and NCL. The simplest route is to provide a Perl class that provides the
same abstractions as NCL, and then produces output by generating an NCL
script and executing it. A second route would be to open a pipe to an NCL
shell<http://www.ncl.ucar.edu/Document/Manuals/Getting_Started/introduction.shtml>and
then provide Perl functions that talk to the NCL process through the
pipe. This is how PDL::Graphics::Gnuplot works, and I'm sure Craig could
give you some pointers about that sort of thing. A more difficult but more
sophisticated route would be to write Perl bindings for the
HLU<http://www.ncl.ucar.edu/Document/HLUs/index.shtml>(i.e. the C
interface). That last route requires familiarity with NCL's C
bindings, and experience writing Perl XS modules, which is far from
trivial. Being a Perl noob, I do not recommend that route. But if you some
day decide to go that route, consider starting off with Inline::C.

If you think it would be nice to have, start off with a simple Perl script
that opens a pipe to the ncl interpreter, something like this:

--------%<--------
use strict;
use warnings;

open my $ncl_pipe, '|-', 'ncl';

# Make ncl say something:
print $ncl "print('Hello from NCL!')\n"
-------->%--------

Hope that gets you started!
David


On Thu, Nov 21, 2013 at 8:04 AM, Alexis Praga <[email protected]>wrote:

> Hi,
>
> Will support for NCL be added into PDL in a near future ?
> For those who don't know it, it's a proprietary plotting language designed
> by NCAR ( http://www.ncl.ucar.edu/ ).
>
> I don't know how hard it would be to integrate it, but I guesse I could
> look into it (perl noob here).
>
> --
> Alexis Praga
> GPG key : 66F9 4BD4 70EC E5D5 2AA4  9097 0673 7CE2 4671 306F
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>



-- 
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to