Re: pblplus and Solaris 2.3

NOTE: The difax mailing list is no longer active. The list archives are made available for historical reasons.

just a note concerning the discussion below:

g3topbm is not doing the truncation, the problem lies with alden and has since 
the onset of the DIFAX idd era. I too tried to get the problem resolved with 
alden and met with the same success as the gentleman below. I've found that 
just the very edges of the DIFAX surface maps are truncated (alden problem) and 
have been using the pbm utilities with great success for the last two years. 
You must understand that DIFAX is a very low priority with Alden, so don't 
expect too much from them. good luck.

                                        -andrew devanas
                                        associate in meteorology
                                        florida state university





Last spring I tried to use netpbm utilities to convert the DIFAX maps that we 
receive via IDD in g3 (FAX) format to postscript, with unsatisfactory results. 
Many of the images were chopped off, and most were too small. I experimented 
with all of the command-line options described in the netpbm man pages, to 
little effect. At that time, Mark Franklin of Alden was also on the trail of a 
satisfactory method to do the conversion, but he doesn't seem to have succeeded 
either, in spite of his vow to get to the bottom of the problem--I haven't 
heard from him since.

There may be a relatively simple technical fix to the netpbm program "g3otpbm" 
that would solve the problem, but I don't speak C and I don't know enough about g3 format 
to attempt to modify the g3topbm code.

I last looked at the mail archives on this subject at Unidata last spring, but 
didn't find anything of help. Has there been additional mail since then on this 
issue?

Below I've included a script that contains most of my various attempts to get 
the netpbm routines to decode DIFAX products satisfactorily, in case you find 
if of any value. I haven't looked at in in a while so I don't know exactly in 
what state I left it.

If you find a satisfactory conversion procedure, please share it!

-- Dave

#! /bin/sh
#
# This script prints a specified DIFAX map at a specified hour (default
# is the latest hour).
#
cd /d1/difax
hr=`ls -dt * | head -1`
plttime=""
mapnum=""
while [ -n "$1" ]; do case $1 in -cu)
         case $2 in
            "" | -*)
               shift
             ;;
            *)
               plttime="$1 $2"
               shift; shift
             ;;
         esac
      ;;
-hr)
         hr=$2
         shift; shift
      ;;
-map)
        mapnum=$2
        shift; shift
      ;;
2[0-9][0-9][0-9])
        mapnum=$1
        shift
      ;;
esac done if [ -n "${plttime}" ]; then
  if [ "${plttime}" != "la" ]; then
     hr=`wxpfile ${plttime} -in_file bogus -output seq | cut -c 9-10`
  fi
fi
cd ${hr} if [ -z "${mapnum}" ]; then
   echo " "
   echo "Must specify a map number on the command line as follows: "
   echo "Must specify a map number on the command line as follows: "
   echo " "
   echo "      difax.tst -map mapnum [-cu hoursback  or  -hr hour]"
   echo " "
   echo "Choices for hour ${hr}Z are: "
ls *.g3 | awk -F. '{print$1}'
   exit
fi
echo "Decoding file ${hr}/${mapnum}.g3"
#
# Decode the g3-format file into a postscript file.
#
#pnmprms="-height 8.3 -width 11.0 -scale 0.5"
#pnmprms="-height 8.5 -width 11.0 -scale 0.25"
pnmprms=""
g3prms="-kludge -reversebits"
g3prms=""
#
# The method below chops the edges off the map and prints a small
#   version surrounded on two sides by white space, which it seems to
#   consider part of the map.
#
#echo "Decode ${mapnum}.g3 directoy to postscript, using pnmtops."
#echo "g3 decoding params are: ${g3prms}."
#echo "ps decoding params are: ${pnmprms}."
#g3topbm ${g3prms} ${mapnum}.g3 | pnmtops ${pnmprms} > /tmp/${mapnum}.ps
#
pbmprms=""
echo "Decode ${mapnum}.g3 directoy to postscript, using pbm2ps."
echo "g3 decoding params are: ${g3prms}."
echo "ps decoding params are: ${pbmprms}."
g3topbm ${g3prms} ${mapnum}.g3 | pbm2ps ${pbmprms} > /tmp/${mapnum}.ps
#
# The method below also chops the edges off the map but prints the
#   chopped map on the full 8.5x11" page.
#
#echo "Decode ${mapnum}.g3 to GIF, then to postscript."
#echo "g3 decoding params are: ${g3prms}."
#echo "ps decoding params are: ${pnmprms}."
#g3topbm ${mapnum}.g3 | ppmtogif | giftopnm | pnmtops ${pnmprms} >
/tmp/${mapnum
}.ps
#
# Print the postscript file.
#
echo "Printing difax chart ${hr}/${mapnum}."
lpr -Psp -h /tmp/${mapnum}.ps
#
# Wait for print queue to clear, to avoid sending too many large jobs
#   to the printer.
#
#test=bogus
#while [ -n "${test}" ]; do
#   sleep 5
#   test=`lpstat -o | awk '{print$1}'`
#done
#
# Remove the postscript file.
#
\rm -f /tmp/${mapnum}.ps
#
# The method below also creates a GIF image rotated 90 degrees and
#   also significantly chopped around the edges, to the same degree as
#   those above. Seems like g3topbm must be doing the chopping. No
#   obvious command-line parameters that might fix it.
#
#echo "Decode ${mapnum}.g3 to GIF."
g3prms="-kludge -stretch -reversebits"
g3prms=""
#echo "g3 decoding params are: ${g3prms}."
#g3topbm ${g3prms} ${mapnum}.g3 | ppmtogif > /tmp/${mapnum}.gif
#\rm -f /tmp/${mapnum}.gif





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