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

19990316: dattim question



Robert,

the "last" or "first" keywords mean the last or first time
in the file. If you want to use specific times, then you can
use dattim = 0000;1200. Or, if you wanted to ensure that a file
didn't have odd time soundings, you could store the data in
hourly files rather than daily files (YYMMDDHH_upa.gem).
When last says there are soundings at 15Z or 18Z then there is at 
least one sounding reporting for that time. For example
today, there are about 8 15Z soundings (including AMA) and
at 18Z so far, 43295 has a sounding.

I can see what you want to accomplish is to have the script 
use the latest 0Z or 12Z time in the file (that of course
still won't guarantee that a specific station exists yet).

I created a short program in ~gbuddy/nawips-5.4/contrib/sntime.tar.Z
This program will list out the available times in an upper air file
using the filename on the command line input such as:

% sntime $UPA/990316_upa.gem
990316/0000     
990316/0300     
990316/0600     
990316/0900     
990316/1200     
990316/1500     
990316/1800

In you cgi script, you can use this program to quickly determine the
lastest 0Z or 12Z time in the file such as:
#!/bin/csh -f

set SNFILE=`ls $UPA/*_upa.gem | tail -1`

set TIMES=`sntime $SNFILE | sort -r`

foreach TIME ($TIMES)
   set HOUR=`echo $TIME | cut -f2 -d/`
   if(($HOUR == "0000")||($HOUR == "1200")) then
      echo $TIME
      exit
   endif
end


Running this script gives me:
% lasttime.csh
990316/1200

To build the sntime program, download and unpack in a directory.
Make sure you have sourced Gemenviron. type:
make
make install
make clean

If you need a binary, let me know.
Hopes this helps you out.

Steve Chiswell
Unidata User Support


>From: Robert Mullenax <address@hidden>
>Organization: National Scientific Balloon Facility
>Keywords: 199903161526.IAA09234

>I am still trying to make some CGI scripts work properly.
>Is there a way to tell snmap to use only 12Z or 00Z data.
>Using last as dattim produces the undesirable 15Z, 18Z
>etc times for which of course there is usually no data.
>I could figure out a Unix way of doing it, but I thought I
>would see if there is a GEMPAK way of doing it.
>
>
>
>Thanks,
>Robert Mullenax
>
>From address@hidden  Tue Mar 16 09:06:33 1999
>Received: from wxmcidas.nsbf.nasa.gov (wxmcidas.nsbf.nasa.gov [192.149.107.53]
> )
>       by unidata.ucar.edu (8.8.8/8.8.8) with ESMTP id JAA12188
>       for <address@hidden>; Tue, 16 Mar 1999 09:06:32 -0700 (MST)
>Organization: .
>Keywords: 199903161606.JAA12188
>Received: from wxmcidas.nsbf.nasa.gov by wxmcidas.nsbf.nasa.gov (8.9.1b+Sun/SM
> I-SVR4)
>       id QAA02030; Tue, 16 Mar 1999 16:06:30 GMT
>Message-Id: <address@hidden>
>Date: Tue, 16 Mar 1999 16:06:30 +0000 (GMT)
>From: weather <address@hidden>
>Reply-To: weather <address@hidden>
>Subject: dattim
>To: address@hidden
>MIME-Version: 1.0
>Content-Type: TEXT/plain; charset=us-ascii
>Content-MD5: O9z0/9l259T3ujZudJu+PQ==
>X-Mailer: dtmail 1.3.0 CDE Version 1.3 SunOS 5.7 i86pc i386 
>
>I don't know if you got the other message as the main mailserver
>is down.  I was wanting to know if there is a way to tell GEMPAK
>using SNMAP to only use 12Z or 00Z data.  I am writing scripts and
>the last input for dattim gives you 15Z or 18Z, etc for which there
>is no data.
>
>Thanks
>Robert Mullenax
>