[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 950603: Perl interface to netcdf?



>Organization: Texas A&M University at Tallahassee
>Keywords: 199506031813.AA05607

Hi James,

> According to the draft concering release 2.4 I notice:
> 
>  Add a perl interface, to make netCDF I/O usable from perl scripts. 
>  This will be a separate small package, rather than part of the 2.4 
>  release. (Done) 
> 
> Since this is done, has it been released? This would surely make some
> of my scripts a tad more efficient, and opens vast possibilities for
> use with WWW pages.

We've released a beta test to a few users who had expressed an interest in a
netCDF perl interface.  The test is going pretty well, and the package will
be ready for general release soon.  If you want a copy of the beta test,
I've appended a copy of the email that Steve Emmerson has sent out about
that, providing directions for getting the beta test release.  Note that
there will probably be some name changes before the general release, so
don't write anything that depends too heavily on the current names.

--Russ

______________________________________________________________________________

Russ Rew                                           UCAR Unidata Program
address@hidden                              http://www.unidata.ucar.edu


Full-Name: Steve Emmerson
To: Phil Austin <address@hidden>, address@hidden (Jon Meek),
        address@hidden (Bjorn Erlingsson),
        "Pete Phillips" <address@hidden>
Subject: perl5 netCDF interface 
Date: Mon, 15 May 95 16:47:25 -0600
From: Steve Emmerson <address@hidden>
X-Mts: smtp

Hi,

If you're interested, we've just released a beta-version of a perl
extension for netCDF.  It's called netCDFPerl and is available for
anonymous FTP at the following location:

    Host:      ftp.unidata.ucar.edu
    Directory: pub/netcdf-perl/
    File:      netcdf-perl-0.0.tar.Z

The README file gives instructions on how to incorporate it into your
perl 5 utility (warning: can be painful!).  Also, there's a netCDFPerl(1)
manual page that gets installed in the same location as the perl5 manual
pages.

Naturally, I'd like to hear about any problems you encounter.

To facilitate feedback and discussion, I've created a mailing-list
specific to netCDFPerl.  You can subscribe to it by sending a message
whose body consists solely of the following

    subscribe netcdf-perl [your-email-address]

to

    address@hidden

After that, you can post articles to

    address@hidden

and we'll all see them.

Please keep this beta-release somewhat under your hat until I have
enough confidence to issue a general release.  Feel free, however, to
tell other "friendly" users who might be interested.

Regards,
Steve Emmerson   <address@hidden>

----------------------------------------------------------------------------
To: address@hidden
Subject: Re: netCDF perl module
Date: Tue, 30 May 1995 15:55:32 +0100
From: Tim Bunce <address@hidden>
Sender: address@hidden
Organisation: Paul Ingram Group, Software Systems, +44 483 424424


> From: Steve Emmerson <address@hidden>
> 
> Tim,
> 
> >Date: Mon, 22 May 1995 23:17:48 +0100 
> >From: Tim Bunce <address@hidden>
> >To: address@hidden
> >Subject: Re: netCDF perl module 
> 
> In the above message you wrote:
> 
> > > From: Steve Emmerson <address@hidden>
> > > 
> > > I've written a perl 5 module to interface to our netCDF package, which
> > > is an API for access to scientific databases.  The module is in beta test.
> > > 
> > Thanks for the update.
> > 
> > Would you consider capitalising the first letter of the name?
> > Having it lowercase goes against Perl5 conventions.
> 
> I actually thought about this.  The problem is that the word `netCDF'
> is rather well known with just that capitalization.  You can see this
> for yourself via the URL
> 
>     http://www.unidata.ucar.edu/packages/netcdf/index.html
> 
> Thus, the tradeoff is between confusing perl(1) users or netCDF users.
> I've chosen to be kind to netCDF users because they'll be the ones
> writing the perl(1) scripts.  I'm willing to be convinced otherwise,
> however, and have CC'd this message to the beta-testers.
> 
> One possibility would be to use `NC' as in
> 
>     NC::ncvarput($ncid, $varid, \@start, \@rcount, \@values);
> 
> even though two characters is somewhat cryptic.  If I changed the
> name that much, however, I would probably go all the way and drop the
> redundant `nc' from all the function names:
> 
>     NC::varput($ncid, $varid, \@start, \@rcount, \@values);
> 
> Beta-testers, what do you think?
> 

Any conclusion to this?

Would perl users really be confused by NetCDF ?

> Regards,
> Steve Emmerson
> 
Tim.
----------------------------------------------------------------------------
Full-Name: Steve Emmerson
To: Tim Bunce <address@hidden>
Subject: Re: netCDF perl module 
Date: Tue, 23 May 95 09:28:36 -0600
From: Steve Emmerson <address@hidden>
X-Mts: smtp

Tim,

>Date: Mon, 22 May 1995 23:17:48 +0100 
>From: Tim Bunce <address@hidden>
>To: address@hidden
>Subject: Re: netCDF perl module 

In the above message you wrote:

> > From: Steve Emmerson <address@hidden>
> > 
> > I've written a perl 5 module to interface to our netCDF package, which
> > is an API for access to scientific databases.  The module is in beta test.
> > 
> Thanks for the update.
> 
> Would you consider capitalising the first letter of the name?
> Having it lowercase goes against Perl5 conventions.

I actually thought about this.  The problem is that the word `netCDF'
is rather well known with just that capitalization.  You can see this
for yourself via the URL

    http://www.unidata.ucar.edu/packages/netcdf/index.html

Thus, the tradeoff is between confusing perl(1) users or netCDF users.
I've chosen to be kind to netCDF users because they'll be the ones
writing the perl(1) scripts.  I'm willing to be convinced otherwise,
however, and have CC'd this message to the beta-testers.

One possibility would be to use `NC' as in

    NC::ncvarput($ncid, $varid, \@start, \@rcount, \@values);

even though two characters is somewhat cryptic.  If I changed the
name that much, however, I would probably go all the way and drop the
redundant `nc' from all the function names:

    NC::varput($ncid, $varid, \@start, \@rcount, \@values);

Beta-testers, what do you think?

> Also, is netCDF Unidata specific?

No.  The netCDF API has been implemented by the NCSA (the entity that
brought you mosaic(1)) on top of one of their own file formats.
However, I'd venture to say that most netCDF users use the
implementation supplied by the Unidata Program Center.

You can uncover more information on the netCDF package than you probably
want via the above URL.

Regards,
Steve Emmerson
----------------------------------------------------------------------------
Full-Name: Steve Emmerson
To: address@hidden
Subject: netCDFPerl 0.1 released
Date: Tue, 23 May 95 10:17:13 -0600
From: Steve Emmerson <address@hidden>
X-Mts: smtp

Hi,

I've ported the netCDFPerl installation procedures to perl 5.001 and
released the new version as netCDFPerl 0.1.  There's no functional
difference between it and the previous release, so if you've already
installed netCDFPerl 0.0, then I wouldn't bother installing 0.1.

What do you think about the naming conventions?

--Steve
----------------------------------------------------------------------------
Date: Tue, 30 May 95 23:01:14 EDT
From: address@hidden (Jon Meek)
To: address@hidden, address@hidden
Subject: Re: netCDF perl module

I also agree with the ordering of "netCDF case versions that Steve
posted. So, NetCDF would not be too bad from either a netCDF or Perl
standpoint.

If name changes are being considered, I suggest that nc is redundant
with netCDF. Eliminating "nc" would (slightly) shorten the names, and
it would be easier to see what function is being called at a glance:

netCDF::ncvarget(

netCDF::varget( easier to read since the eye (mine anyway) is drawn to the "::"

Steve's NC::varget idea would be better, but maybe too cryptic as he suggested.

I did a fair amount of programming with the package over the weekend
and it is great. I replaced a slightly buggy netCDF plotting program in
C with solid Perl in about 30 minutes. I hate to think about how many
hours I spent working on that C code a couple of years ago.

Two possible problems that I have seen are:

- I can't seem to get Global Attribute names beyond the first one
defined in a file.

- I ran into a bit of trouble with NULL terminated strings. Maybe the
NULLs should be removed before passing strings to Perl. I don't think
that NULLs are useful on string in Perl, but I might be wrong.

Jon

Jon Meek
American Cyanamid Company
PO Box 400 / Clarksville Road
Princeton, NJ 08543-0400

Voice: 609-799-0400 x2504  Home: 609-895-1810

address@hidden
----------------------------------------------------------------------------
Full-Name: Steve Emmerson
To: address@hidden (Jon Meek)
Subject: Re: netCDF perl module 
Date: Wed, 31 May 95 08:39:34 -0600
From: Steve Emmerson <address@hidden>
X-Mts: smtp

Jon,

>Date: Tue, 30 May 95 23:01:14 EDT 
>From: address@hidden (Jon Meek)
>To: address@hidden
>Subject: Re: netCDF perl module 

In the above message you wrote:

> If name changes are being considered, I suggest that nc is redundant
> with netCDF. Eliminating "nc" would (slightly) shorten the names, and
> it would be easier to see what function is being called at a glance:

If the consensus is to change the name, then it's better to change both
the module name and the function names at the same time.  Please folks,
voice your opinion.

> I did a fair amount of programming with the package over the weekend
> and it is great. I replaced a slightly buggy netCDF plotting program in
> C with solid Perl in about 30 minutes. I hate to think about how many
> hours I spent working on that C code a couple of years ago.

The complete netCDF operator package could be implemented this way.

> Two possible problems that I have seen are:
> 
> - I can't seem to get Global Attribute names beyond the first one
> defined in a file.

Can you send me a trivial test script showing the problem?
 
> - I ran into a bit of trouble with NULL terminated strings. Maybe the
> NULLs should be removed before passing strings to Perl. I don't think
> that NULLs are useful on string in Perl, but I might be wrong.

Strings are, indeed, a problem.  Perl treats them as scalar values but
the netCDF package treats them as byte vectors.  Right now, arguments
that refer to strings must be arrays rather than scalar values.  I'm
thinking about adding code to netCDFPerl that will notice when a string
argument is used and handle such cases specially.

--------
Steve Emmerson   <address@hidden>
----------------------------------------------------------------------------