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

[Support #FWQ-357482]: Re: conversion to image format



Megan,

I put together a completely standalone tarfile (attached to this message)
that should run without any upgrade of your previous versions.

First thing is to see if your Redhat can run the binary I built here under
fedora core 5.

Unpack the tarfile (it will create its own "ncsu" subdirectory where you unpack 
it.
In the directory are the nex2gini.tbl file that defines the mapping from
temperature to pixel value:
CTMPK     16    2 K,255,176,163,242;175,0,242.5,330         TICZ99 TMPK

The 2 part IR mapping is pixel values 255 -> 176 convert to 163K -> 242K,
                                      175 ->   0 convert to 242.5K -> 330K
These match the standard IR curve used for10.7 micron imagery in 
$GEMPAK/source/gemlib/im/imbtot.f
and GEMPAK/source/gemlib/im/imttob.f.

The CTMPK in this entry must match the name of your grid function! Band
used will be "16" which is used in the $GEMTBL/imgtyp.tbl entry I sent
you previously as 2**(band-1) (aka 2**15).

You will be able to run the program within the ncsu directory since all tables 
are searched
in the current working directory. Otherwise, the nex2gini.tbl would be found in 
$GEMTBL/unidata/nex2gini.tbl, the gd2img.pdf would be found in 
$GEMPDF/gd2img.pdf.

The program can be run as:
> gd2img
 GDATTIM   Grid date/time                    f024
 GDFILE    Grid file                         satir_f24.gem
 GLEVEL    level                             0
 GVCORD    Vertical coordinate               none
 GFUNC     Gridded parameter                 CTMPK
 SCALE     Output scaling                    0
 PROJ      Map projection/angles/margins|dr   
 GRDAREA   Area covered by grid               
 KXKY      Number of grid points in x;y       
 CPYFIL    Grid file whose navigation is to  satir_f24.gem
 SATFIL    output file name                  testimg.gini

Since your grid is a 4x4km LCC grid, I used that in cpyfil for
the output image projection. Otherwise, a GRDAREA, PROJ, and KXKY could
be specified but it has to be a lambert tangent cone with dx=dy, but
you probably don't want to have to figure that out unless you change the model 
resoltion!

The GFUNC name CTMPK must match the entry in nex2gini.tbl

Go ahead and give this a try. As I mentioned, its under development so it spits 
out some debug information
and the help file is basically non-existant, but improving 100% all the time ;-)

Let me know if you can get the program to run, and I'll keep working on 
cleaning up
the interface and input. Of course, you will eventually want to run a 
production version in an
up to date GEMPAK release in the future.

Steve Chiswell
Unidata User Support 




> Dr. Chiswell,
> We are running Red Hat Enterprise Linux, 4 or 5.  I am currently using
> gempak v5.6.  If that's too old, I think 5.8.3 is also compiled on the
> cluster I'm using, so I could use it instead.
> Thanks again for your help,
> Megan
> 
> >> Mr. Chiswell,
> >> I took a look at that test image you sent, and that's exactly what I
> >> wanted.
> >> I'd like to generate a lot more of these images from my model output.  I
> >> was wondering if you could send me the code you used.  Could I install
> >> gd2img by itself or would I need a whole new gempak version?
> >> Thanks,
> >> Megan
> >
> > Megan,
> >
> > I have the gd2img directory in the source distribution of 5.10.1, but
> > didn't
> > configure it to be built in the binary distributions since it is still
> > under development.
> > I have been testing it out to create topo images from dem data, but
> > created the
> > TMPK to pixel value entry in the table for your data. I will make it part
> > of the standard
> > build for 5.10.2; I just need to add some user friendliness to the
> > program.
> >
> > I can send you the program to run without upgrading your distribution if
> > you can tell me what OS etc you are running. Do you know what version of
> > GEMPAK you are
> > currently running?
> >
> > Dr. Steve Chiswell
> > NC State 87, 90, 94
> > Unidata User Support
> >
> >
> >
> >>
> >>
> >> > Megan,
> >> >
> >> > I created the attached GINI format satellite image from your data.
> >> > To display the image, you will need to add the following line to your
> >> > $GEMTBL/sat/imgtyp.tbl file (or imgtyp.tbl file in your working
> >> > directory):
> >> >
> >> > CTMPK                IR_TMPK       0    255     11  2**15      1
> >> > ir_upc3.tbl
> >> >
> >> > Note use only spaces in that file, not tabs.
> >> >
> >> > The conversion process is somewhat manual for this process since I
> >> have to
> >> > generate a
> >> > mapping of pixel values to gridded data values. This is something I
> >> need
> >> > to add for
> >> > users in a working program, but doing this with your data helps me get
> >> to
> >> > that
> >> > point - I did discuss this type of project with Gary Lackmann here
> >> last
> >> > summer,
> >> > so its a work in progress.
> >> >
> >> > I need to find out from you if this mapping of brightness temperature
> >> to
> >> > pixel
> >> > is what you are looking for (its the standard 2 part temperature curve
> >> > used for
> >> > IR satellites), and if not, I'll need to get this worked out to
> >> provide
> >> > you with the
> >> > program.
> >> >
> >> > I displayed this with your grid points and contours in gdplot2 and the
> >> > image lines up
> >> > with the points, so my first pass seems to be in the right direction.
> >> >
> >> > Let me know how this works for you.....
> >> >
> >> > Steve Chiswell
> >> > Unidata User Support
> >> >
> >> >
> >> >> Here's the grid navigation from gdinfo...
> >> >> GDFILE    Grid file                         satir_f24.gem
> >> >> LSTALL    Full list flag                    YES
> >> >> OUTPUT    Output device/filename            T
> >> >> GDATTIM   Grid date/time                    last
> >> >> GLEVEL    Grid level                        0
> >> >> GVCORD    Grid vertical coordinate          none
> >> >> GFUNC     Scalar grid                       CTMPK
> >> >> Parameters requested:
> >> GDFILE,LSTALL,OUTPUT,GDATTIM,GLEVEL,GVCORD,GFUNC.
> >> >> GEMPAK-GDINFO>r
> >> >>
> >> >> GRID FILE: satir_f24.gem
> >> >>
> >> >> GRID NAVIGATION:
> >> >> PROJECTION:          LCC
> >> >> ANGLES:                27.0   -85.3    27.0
> >> >> GRID SIZE:          159 159
> >> >> LL CORNER:              15.83    -82.64
> >> >> UR CORNER:              21.20    -76.45
> >> >>
> >> >> GRID ANALYSIS BLOCK:
> >> >> ANALYSIS TYPE:        BARNES
> >> >> DELTAN:               0.073
> >> >> DELTAX:           -9999.000
> >> >> DELTAY:           -9999.000
> >> >> GRID AREA:            15.00  -84.00   22.00  -75.00
> >> >> EXTEND AREA:          15.00  -84.00   23.00  -75.00
> >> >> DATA AREA:            15.00  -84.00   23.00  -75.00
> >> >>
> >> >> Also, the file (satir_f24.gem) is posted at..
> >> >> http://tempest.meas.ncsu.edu/megan
> >> >> if you'd like to have the actual file.
> >> >>
> >> >> Basically, I'm working on generating a model-simulated satellite IR
> >> >> product, kind of like model-simulated radar.  But I'd like to use the
> >> >> satellite color tables to make an observational comparison.  I'd
> >> >> eventually like to try and use the model-simulated IR on grids of
> >> >> different navigation, but I started out with this grid because it's
> >> 4-km
> >> >> grid spacing, similar to satellite resolution.
> >> >>
> >> >> Thanks for your help! If there's any other information you'd like,
> >> just
> >> >> let me know.
> >> >>
> >> >> Megan
> >> >>
> >> >>
> >> >> > Megan,
> >> >> > I have been working on a gd2img program in the source distribution
> >> >> which
> >> >> > can convert a grid to an image using a specified satellite id and
> >> >> > channel number with a projection remapped into one that the image
> >> >> format
> >> >> > can handle.
> >> >> >
> >> >> > Can you send me some information about what grid
> >> projection/navigation
> >> >> > you have so I can see if this will be sufficient for your
> >> application?
> >> >> > The GINI format is somewhat limited specifying a projection and
> >> pixel
> >> >> > shape, so might have to use an AREA format instead. Please send
> >> this
> >> >> to
> >> >> > address@hidden.
> >> >> >
> >> >> > Steve Chiswell
> >> >> > Unidata User Support
> >> >> >
> >> >> > On Fri, 2007-03-30 at 10:25 -0400, Megan Gentry wrote:
> >> >> >> I have a GEMPAK grid file that I'd like to convert to image format
> >> >> and
> >> >> >> view using the satellite IR color tables.  I was wondering what
> >> the
> >> >> best
> >> >> >> way is to convert a grid file to an image file that can be viewed
> >> >> using
> >> >> >> the IR color tables?
> >> >> >> Thanks,
> >> >> >> Megan
> >> >> >>
> >> >> >> ----------------------------------------------------
> >> >> >> Megan S. Gentry
> >> >> >> Graduate Research Assistant, Forecasting Lab
> >> >> >> Department of Marine, Earth and Atmospheric Sciences
> >> >> >> North Carolina State University
> >> >> >>
> >> >> >> ===============================================================================
> >> >> >> To unsubscribe gembud, visit:
> >> >> >> http://www.unidata.ucar.edu/mailing-list-delete-form.html
> >> >> >> ===============================================================================
> >> >> > --
> >> >> > Steve Chiswell <address@hidden>
> >> >> > Unidata
> >> >> >
> >> >>
> >> >>
> >> >> ----------------------------------------------------
> >> >> Megan S. Gentry
> >> >> Graduate Research Assistant, Forecasting Lab
> >> >> Department of Marine, Earth and Atmospheric Sciences
> >> >> North Carolina State University
> >> >>
> >> >>
> >> >
> >> >
> >> > Ticket Details
> >> > ===================
> >> > Ticket ID: FWQ-357482
> >> > Department: Support
> >> > Priority: Normal
> >> > Status: Closed
> >>
> >>
> >> ----------------------------------------------------
> >> Megan S. Gentry
> >> Graduate Research Assistant, Forecasting Lab
> >> Department of Marine, Earth and Atmospheric Sciences
> >> North Carolina State University
> >>
> >>
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: FWQ-357482
> > Department: Support GEMPAK
> > Priority: Normal
> > Status: Closed
> >
> >
> 
> 
> ----------------------------------------------------
> Megan S. Gentry
> Graduate Research Assistant, Forecasting Lab
> Department of Marine, Earth and Atmospheric Sciences
> North Carolina State University
> 
> 


Ticket Details
===================
Ticket ID: FWQ-357482
Department: Support GEMPAK
Priority: Normal
Status: Closed

Attachment: ncsu.tar.gz
Description: application/gzip