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

20021101: setting DAY, TIME, BAND, etc in remapped image



>From: "Paul L. Sirvatka" <address@hidden>
>Organization: College of DuPage
>Keywords: 200210041733.g94HXZ106826 McIDAS NEXRCOMP BAR IMGREMAP IMGCHA

Hi Paul,

>I have just about got everything figure out now...
>
>I am still trying to make 1km satellite pix and radar composites have the
>same projection. I have been taking a copy of the 1km goes east and
>imgremapping the nexradcomp on top of that.

OK, sounds good.

>I get a good image, but the time code is not correct.

When you remap an image on top of an existing one, a number of
parameters from the base image are left intact.  In order to have
things like the time, day, sensor source, etc. match the image that is
being remapped, you need to run IMGCHA on the result.

Here are the things you can change with IMGCHA:

IMGCHA -- Changes an image directory
   IMGCHA dataset <keywords>
Parameters:
   dataset | ADDE dataset name and position; specify as alias.position or
             group/descriptor.position; only positive integers are valid
             for 'position'
Keywords:
  BANd=   | changes the image band number; the range is 1-64
      =NA | band sequence Not Available; reserved for GOES visible
            images prior to GOES-8
  CTYpe= | changes the calibration type
  DAY= | changes the Julian day (YYDDD) of the image
  ELE= | changes the beginning image element number
  ID= |  changes the NEXRAD station ID, e.g., MKX
  LINe= | changes the beginning image line number
  MEMo='text' | changes the text of the memo field; 32 characters max
  RES= line elem | changes the line and element resolution
  SS= | changes the sensor source number
  STYpe= | changes the source type
  TIMe= | changes the time (HH:MM:SS) of the image
  VALcode= | changes the validity code


>How do I keep the nexrad comp time on the destination image.

What you will need to do is an IMGLIST of the NEXRCOMP dataset so you
can get the date, time, etc. for the output image.  Store this output
in a file that you will then read in in your script.  Here is an
example:

IMGLIST NEXRCOMP/1KN0R-NAT DEV=FNN nexclist.out

The contents of nexclist.out will look like:

Image file directory listing for:NEXRCOMP/1KN0R-NAT
 Pos Satellite/         Date       Time      Center   Band(s)
     sensor                                 Lat  Lon
 --- -------------  ------------  --------  ---- ---- ------------
  32  RADAR          2 NOV 02306  14:52:00     TWX    27
IMGLIST: done

Your script then has to read this file and extract the information on
the 5th line.  This is exactly the sort of thing that is done in the
example McBASI scripts GEWCOMP.MCB and GEWCOMP1.MCB that are included
in the McIDAS distribution.  These are good scripts to use as a basis
for things that you may want to do.

A quickie McBASI example script that will read the output file I
specified above and run IMGCHA is:

REM First, get input ADDE dataset group/descriptor 
1   INPUT W$

REM Verify the input
    IF W$ = "" PRINT "You must specify an ADDE group/descriptor":STOP

REM Get a listing of the most recent element of the input dataset
20  KEYIN "IMGLIST ";W$;" DEV=FNN nexclist.out"

    OPEN "nexclist.out",10,80
    INPUT @10,A$:INPUT @10,A$
    IF MID$(A$,1,4) = EOF$ PRINT "IMGLIST did not return information":STOP
    INPUT @10,A$:INPUT @10,A$:INPUT @10,A$

REM Get the dataset position number
    P$=MID$(A$,1,4)
    L = 4
21  IF MID$(P$,1,1) <> " " GOTO 22
    P$ = MID$(P$,2,L)
    L = L - 1
    GOTO 21    
                        
22  D$=MID$(A$,28,5)
    T$=MID$(A$,35,8)    
    B$=MID$(A$,55,1)

REM Now, print out the relevant information gathered from the listing
30  PRINT "ADDE dataset:   ";W$
    PRINT "Image Position: ";P$
    PRINT "Image Date:     ";D$
    PRINT "Image Time:     ";T$
    PRINT "Image Band:     ";B$

REM Done
    STOP


Now, if the other part of your script is a McIDAS BATCH file, you would
modify this McBASI script to store the relevant input image values
into McIDAS strings so that you can use them in your BATCH file.
Here is one idea:

REM Now, save the relevant information int McIDAS strings
30  PTABLE W$,"NEXCNAME"
    PTABLE P$,"NEXCPOS"
    PTABLE D$,"NEXCDATE"
    PTABLE T$,"NEXCTIME"
    PTABLE B$,"NEXCBAND"

Now, back in your BATCH file, you can use these string values in your
IMGCHA invocation.  Here is one example:

IMGCHA MYDATA/IMAGES.1234 BAND=#NEXCBAND DAY=#NEXCDATE TIME=#NEXCTIME SS=7

Better yet, convert your BATCH file into a McBASI script so that you
can do everything in one step.  Again, GEWCOMP.MCB and GEWCOMP1.MCB
are good examples to base new work on.

Tom

>From address@hidden Sun Nov  3 23:06:38 2002
>Subject: Re: 20021101: setting DAY, TIME, BAND, etc in remapped image

OK...

I have got everything done in perl instead of McBasi. (I am taking a perl
class so I need the practice!)

Everything works great when I am McIDAS. But LDM is running things and
nothing works correctly. I have fixed things but it seems to be
in-elegant, calling a bunch of BATCH files with the mcidas kickoff
routine.

I know that the problem involves haveing the wrong environemtn variables
set. The kickoff sets them in a Bourne shell...is there a way to do it in
the perl script? Or maybe, the ldm can spawn a process that used mcidas
can run? I know this may rather arcane, but I have spent so much time
making sure things are good, I would just like to clean this up a bit so
there is one file doing all the work for me.

Paul

>From address@hidden Mon Nov  4 07:57:16 2002
>Subject: User permissions

Ah ha!

I figured it out this morning...

I just use the kickoff script but instead of running the batch.k command,
I use a perl script there. It seems to be working well.

That kickoff script *does* set the environment like I wanted...I just
needed a different command! Cool!

BTW You can see how our images look at

http://weather.cod.edu/paul/nexrad

and although we still have to set them up to run automatically, they will
have the same projection as the 1km satellite images at

http://weather.cod.edu/paul/satellite/new/


Thanks for your patience and your help!

Paul

******************************************************************************
* Paul L. Sirvatka          | Office: (630) 942-2118; Lab: (630) 942-2590    *
* Professor of Meteorology  | COD Weather Lab: (630) 858-0032                * 
* College of DuPage         | Address: 425 Fawell Blvd. Glen Ellyn, IL 60137 *  
******************************************************************************