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

19990707: garp radar color bar



Brian,

You won't have to use the nids_link script since Tom now has an ADDE
server that will let McIDAS use the same directory structure that
Gempak expects.

Here is a pqact.conf entry to directly file the nids images:
#################### Nexrad Data ########################################
WSI   
^NEX/(.*)/(.*)/([1-2][0-9])([0-9][0-9])([0-1][0-9])([0-3][0-9])([0-2][0-9])([0-6][0-9])
        FILE    data/gempak/nexrad/NIDS/\1/\2/\2_\3\4\5\6_\7\8

The above FILE action will create any directories automatically with names like:
data/gempak/nexrad/NIDS/FTG/BREF1/BREF1_19990707_1515

Below is a script I use to scour the nids data from cron run every hour
with the crontab entry:
15 * * * * util/prune_nexrad.csh

The script will keep the last 60 (configure the KEEP variable) files
in each subdirectory as well as remove any files older than 1 day
which is useful if you have the floaters which change.

To use the script, save the script to the file "prune_nexrad.csh"
and place the script in your ~ldm/util directory. Make sure the
PATH definition in the script is the directory that the script is
located in. Also, define the "areadir" location to be the top
of your nids data tree (areadir is a historical name...we'll
assume that we are dealing with raw nids files now).

The script starts out be going to areadir, then recursively calls itself
for every subdirectory found underneath. If a directory has more
than $KEEP files in it, it prunes down to that number. If any files
are greater than 1 day (eg the -mtime number) old, they are removed,
and if a subdirectory is empty, it is removed. The purpose of removing
the old subdirectories is so that the menu buttons of garp/nsat which list
the possible stations to select won't get filled up with old floater
selections.

Steve Chiswell
Unidata User Support


#!/bin/csh -f
#
# Copyright (c)1993 UCAR/Unidata
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose without fee is hereby granted, provided
# that the above copyright notice appear in all copies, that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of UCAR/Unidata not be used in
# advertising or publicity pertaining to distribution of the software
# without specific, written prior permission.  UCAR makes no
# representations about the suitability of this software for any purpose.
# It is provided "as is" without express or implied warranty.  It is
# provided with no support and without obligation on the part of UCAR or
# Unidata, to assist in its use, correction, modification, or enhancement.
#
# Steve Chiswell        4/29/99
#
setenv PATH /usr/local/ldm/util:${PATH}
set KEEP=60
if($#argv == 0) then
   set areadir=/usr/local/ldm/data/gempak/nexrad
else
   set areadir=$1
endif

############################################################################## 

cd $areadir
@ NUMSUBS=0
#
set DIRS=`ls -d *`
foreach DIR ($DIRS)
   if(-d $DIR) then
      @ NUMSUBS = $NUMSUBS + 1
      prune_nexrad.csh $DIR
      if($status != 0) rmdir $DIR
   endif
end


@ IRET = 0
# scour down to $KEEP files in this leaf directory
if($NUMSUBS == 0) then
   set FILES=`find . -mtime +0 -print -exec rm -f {} \;`
   #if($#FILES > 0) echo removed old files $FILES
   set FILES=`ls -r`
   if ($#FILES > $KEEP) then
      @ COUNT = $KEEP + 1
      while($COUNT <= $#FILES)
         #echo SCOUR to $FILES[$COUNT]
         rm $FILES[$COUNT]
         @ COUNT = $COUNT + 1
      end
   endif
endif

set FILES=`ls`
if($#FILES == 0) @ IRET = 1


exit(${IRET})


---------------------------------------------------------------

>From: Brian Colle <address@hidden>
>Organization: .
>Keywords: 199907072306.RAA06779

>
>Chris,
>
>Perhaps I should be using the raw nids files rather than the 
>nids2area generated files. This might help my color bar problem since I
>noticed that the imgtyp.tbl is looking for NIDS product code. 
>
>Anyways, I want to use the raw data instead, but I need a better
>pqact than what I am using now. Currently, I am just using:
>WSI
>^NEX/(...)/(PRET)/..([0-9][0-9])([0-1][0-9])([0-3][0-9])([0-2][0-9])([0-6][0-9
> ])
>       PIPE    -close
>       nids2area -d data/mcidas 8013 \1 DIALPROD=RD \3%j \6\700 DEV=CCN
>
>which just dumps the raw file in the data/raw/wsi and then creates the 
>area file.
>
>I tried to point the data to a specific directory using :
>WSI
>^NEX/(...)/(VEL1)/..([0-9][0-9])([0-1][0-9])([0-3][0-9])([0-2][0-9])([0-6][0-9
> ])
>       FILE    /usr/local/ldm/data/gempak/images/radar/nids/OKX/VEL1\1/\2/\2_\
> 4\5\6_\7\8
>       PIPE    -close
>
>but it didn't work (I made sure the
>/usr/local/ldm/data/gempak/images/radar/nids/OKX/VEL1 directory exists).
>Basically, what I want to do here is use the nids_links script in cron to
>copy or link the raw nids data for Garp to use. Do you have a sample pqact
>WSI line that I can use which will copy the raw file to a premade
>directory (using the FILE command within pqact), so that the nids_script
>can work with it.
>
>Thanks,
>
>Brian
>
>PS: I just noticed while trying to debug pqact that my ldmd.log is not
>being generated when restarting the ldm. I tried touching the file
>beforehand, but nothing gets added to the file even though the ldm is
>running.
>
>On Wed, 7 Jul 1999, Unidata Support wrote:
>
>> 
>> Brian,
>> 
>> Garp and NSAT should have no trouble displaying the BREF1 images
>> from in the raw format. If you are having trouble displaying the
>> color bar, then possibly you haven't sourced the Gemenviron 
>> file so that the program can find the GEMTBL directory. The
>> enhancement tables and colors are defined in subdirectories
>> under GEMTBL.
>> 
>> In Garp, the color bar is toggled on/off in the sat/radar popup
>> menu, and the fade slider should adjust the color bar and image
>> colors at the same time. Nsat similarly will display the images.
>> NSAT allows browsing of user defined data directories for loading
>> the images from any directory. Both Garp and NSAT look for the $SAT
>> directory otherwise.
>> 
>> Any other information you can provide me regarding the color bar problem 
>> would be helpful, including determining is nsat shows the color bar,
>> and if a standard gempak program like gpmap can display the image.
>> Also, since ntl is running, if you can log any error messages
>> from garp such as not being able to find tables, it might help.
>> 
>> Steve Chiswell
>> Unidata User SUpport
>> 
>> 
>> 
>> >From: Brian Colle <address@hidden>
>> >Organization: .
>> >Keywords: 199907071740.LAA27765
>> 
>> >
>> >Tom,
>> >
>> >Thanks for your previous message. I can now view the images
>> >within Garp, but I can't seem to get the color label bar to have 
>> >colors and a scale (it is all black compared to the displayed data which 
>> >has all kinds of colors). I thought I might be out of colors for the bar,
>> >but I am allocating over 150 to radar using ntl. I am not sure how this
>> >label bar is generated (in terms of Garp_defaults, etc ...), so any
>> >suggestions you or others might have would be great.
>> >
>> >Thanks,
>> >
>> >Brian
>> >
>> >On Tue, 6 Jul 1999, Unidata Support wrote:
>> >
>> >> >From: Brian Colle <address@hidden>
>> >> >Organization: SUNYSB
>> >> >Keywords: 199907062012.OAA21001 ldm-mcidas nids2area GARP
>> >> 
>> >> Brian,
>> >> 
>> >> >I finally got the WSI nids datastream coming into our dept. I am decodin
> g
>> >> >the data using nids2area, which is creating AREA files. This is good, bu
> t
>> >> >I have been searching the help pages trying to see of an easy
>> >> >and automated way to link the AREA file to a file that Garp can 
>> >> >understand using times (ie., NIDS_BREF1_990706_1815). For sat. images
>> >> >I am using batch.k to move things for Garp to use. Right now I have all
>> >> >the WSI nids stuff (obtaining data and nids2area) within my pqact file, 
> so
>> >> >this is limiting my flexibility perhaps (at least with my knowledge of
>> >> >pqact).
>> >> >
>> >> >Any suggestions you might would be appreciated.
>> >> 
>> >> GEMPAK, GARP, and McIDAS can use the raw NIDS files as they come across t
> he
>> >> IDD.  It might be the best idea to NOT convert these files into McIDAS
>> >> AREAs.  Instead, simply file them in the directory structure that is
>> >> most useful by GARP (for information on that, I recommend that you look
>> >> through the GEMPAK web pages that we maintain).
>> >> 
>> >> If one of your objectives is to also be able to use McIDAS to look/analyz
> e
>> >> the images, then I can advise you (I am the McIDAS support person here at
>> >> Unidata) to look into the use of the Unidata NIDS ADDE servers.  The
>> >> good thing about ADDE is that conversion of the "raw" NIDS images to
>> >> AREA form is implicit.  For instance, if you define the ADDE dataset
>> >> NIDS/BREF1 to be the collection of "raw" NIDS images and MYDATA/IMAGES
>> >> to be a dataset composed of imagery in McIDAS AREA format, the conversion
>> >> is as simple as:
>> >> 
>> >> IMGCOPY NIDS/BREF1.1 MYDATA/IMAGES.300 SIZE=ALL
>> >> 
>> >> This converts the first member of the NIDS/BREF1 dataset into the 300th
>> >> member of the MYDATA/IMAGES dataset.  The conversion is identical to
>> >> running nids2area with appropriate output AREA range since the code that
>> >> does the conversion is the same in the ADDE server as in nids2area.
>> >> 
>> >> In order to give you a better idea of how you should proceed, it would be
>> >> most useful for you to give us an idea of the breadth of uses that you
>> >> want to put these images to.
>> >> 
>> >> >Thanks,
>> >> 
>> >> Please let me know the scope of your uses so that I will know if I
>> >> have missed the boat on your inquiry.
>> >> 
>> >> ____________________________________________________________
>> >> Dr. Brian Colle         INTERNET: address@hidden
>> >> (516)632-3174
>> >> Institute for Terrestrial and Planetary Atmospheres
>> >> Marine Sciences Research Center
>> >> State University of New York at Stony Brook
>> >> Stony Brook, NY 11794-5000
>> >> 
>> >> Tom Yoksas
>> >> *************************************************************************
> ***
>> >> Unidata User Support                                    UCAR Unidata Prog
> ram
>> >> (303)497-8644                                                  P.O. Box 3
> 000
>> >> address@hidden                                   Boulder, CO 80
> 307
>> >> -------------------------------------------------------------------------
> ---
>> >> Unidata WWW Service                        http://www.unidata.ucar.edu/  
>    
>> >> *************************************************************************
> ***
>> >> 
>> >
>> 
>> ****************************************************************************
>> Unidata User Support                                    UCAR Unidata Program
>> (303)497-8644                                                  P.O. Box 3000
>> address@hidden                                   Boulder, CO 80307
>> ----------------------------------------------------------------------------
>> Unidata WWW Service                        http://www.unidata.ucar.edu/     
>> ****************************************************************************
>> 
>