NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: pgmtonc.tar.Z

An easy way to do this is to convert the PGM to GeoTIFF using the
"gdal_translate" tool that is part of FWTOOLS:

http://fwtools.maptools.org/

gdal_translate  -a_srs EPSG:4326 -a_ullr -180 -35 180 35
SeaWiFS_median_depth.35N.35S.180W.180E.pgm  SeaWiFS_geotiff.tif

This took about 5 seconds on my intel pc.

Then you can visualize it (instantly) using the OpenEV viewer that
comes with FWTOOLS, or visualize it in IDV (I think, since IDV handles
GeoTIFF)

-Rich

On 9/6/06, Don Murray <dmurray@xxxxxxxxxxxxxxxx> wrote:
Hi Valentijn-

Valentijn Venus wrote:

> i'm looking for a utility developed by Unidata in the days of Ynot:
> pgmtonc
>
> This utility takes an image in the Portable Gray Map intermediate
> format and writes it to a netCDF file. I would like to convert a
> shallow waterdepth product from SeaWIFS into a netCDF file to be able
> to display and use it in the IDV.
>
> coral reefs shallow waterdepths from SeaWIFS:
> ftp://ocdist5.sci.gsfc.nasa.gov/pub/seawifs_bathymetry/README
>
> pgmtonc: see
> http://www.unidata.ucar.edu/newsletter/1993spr/93sprel.html#article6
>
> quote:
>
> Pbmplus utilities you can get them via anonymous ftp from
> ftp.unidata.ucar.edu in the file pub/pbmplus.tar.Z. This compressed
> tar file contains all of the Pbmplus utilities, including pgmtonc.
> Or, you can FTP it from the contrib directory in the Ynot
> distribution account (this will only work if you are a licensed Ynot
> user). The file name is pgmtonc.tar.Z. To build the Pbmplus
> utilities, you will need the various Pbmplus libraries included in
> the tar file, as well as the netCDF library.

Even if you had this file, you'd still need to add in navigation
information since that is not in the file.

> Unfortunately, it's no longer on the server. Any ideas/other
> solutions?

You could take the PPM version and convert it to a GIF and
then read it into the IDV and use the Navigated Image formula.
However, if I uncompress the PPM file, it's 756 Mb.  I used
ppmtogif to create a GIF which was 103 Mb (36000x7000 pixels).
You could subsample the navigated image with the following
Jython:

def skip(image, skip):
   from ucar.unidata.data.grid import GridUtil
   return GridUtil.subset(image, int(skip))

and have your formula be:

skip(image, numpts[isuser=true])

which would prompt you for the number of points.  I used 100
and displayed it with a Color Shaded Plan view which produced
a blocky image.

By comparison, on my Windows system, it took the Windows Fax
and Picture viewer about 10 minutes to generate the preview of
the full image.

Don
*************************************************************
Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************





--
Dr. Richard P. Signell   (508) 457-2229
USGS, 384 Woods Hole Rd.
Woods Hole, MA 02543-1598



  • 2006 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the idvusers archives: