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

20010612: image remapping



>From: Christian Page <address@hidden>
>Organization: Universite du Quebec a Montreal
>Keywords: 200106070835.f578Zop28356 McIDAS ADDE IMGCOPY IMGREMAP

Christian,

re: resampling images to 8-bit
>Ok. So, could you give me an example of this?
>I want to resample them to 8-bit (oversampled),

The command to look at here is IMGCOPY.  The conversion from 2-byte to 1-byte
data is controlled by the STYpe= keyword:

HELP IMGCOPY
IMGCOPY -- Copies image data from a server
   IMGCOPY sdataset ddataset <keywords>
Parameters:
   sdataset | source ADDE dataset name and position; specify as
              alias.position or group/descriptor.position; to use default
              position, either enter "0" or omit .position portion
              (no def for alias or group/descriptor, def=0 for position)
   ddataset | destination ADDE dataset name and position; specify as
              alias.position or group/descriptor.position; only positive
              integers (absolute positions) or the default are valid for
              the position number; to use the default position, omit the
              .position portion (no def for alias or group/descriptor, for
              position def=the position following the most recent image)
Keywords:
*********************  Image Positioning Keywords  ***********************

 ...

   STYpe=VISR | reduces 2-byte data to 1-byte brightness data; not valid
                with BAND=ALL or SIZE=ALL

 ...

So, let's assume you FTP the 2-byte data to your machine and then create
an ADDE dataset to hold it.  For sake of argument, let's call this first
dataset GE-2B, and it has three descriptors:

GE-2B/VIS
GE-2B/IR
GE-2B/WV

Now, you have already setup another dataset called MYDATA (previous email)
in which there is a descriptor IMAGES.  This group/descriptor set was
defined to include all possible images in AREA file format that are named
using AREA file naming conventions.  This dataset will automatically have
the AREA files in the Unidata McIDAS-X distribution in them.  For instance,
listing the information for images 9000 - 9020 should result in a list
that looks like (the listing migh have more):

IMGLIST MYDATA/IMAGES.ALL
Image file directory listing for:MYDATA/IMAGES
 Pos Satellite/         Date       Time      Center   Band(s)
     sensor                                 Lat  Lon
 --- -------------  ------------  --------  ---- ---- ------------
9010  TOPOGRAPHY     1 JAN 96001  00:00:00    40  105 1
9011  TOPOGRAPHY     1 JAN 96001  00:00:00    45  105 1
9012  TOPOGRAPHY     1 JAN 96001  00:00:00     0  100 1
9013  TOPOGRAPHY     1 JAN 96001  00:00:00   -90  105 1
9014  TOPOGRAPHY     1 JAN 96001  00:00:00    90  105 1
9015  TOPOGRAPHY     1 JAN 96001  00:00:00     0    0 1
9016  TOPOGRAPHY     1 JAN 96001  00:00:00    23   71 1
9017  TOPOGRAPHY     1 JAN 96001  00:00:00    25  138 1
9018  TOPOGRAPHY     1 JAN 96001  00:00:00    40   98 1
9019  TOPOGRAPHY     1 JAN 96001  00:00:00    26  100 1
9982  METEOSAT5     19 JAN 96019  16:00:00    26  100 8
9983  METEOSAT5     19 JAN 96019  16:00:00    27   70 8
9995  G-9 IMG       25 JAN 96025  19:00:00    25  138 4
IMGLIST: done

The point of this diversion is that you do not want to use these dataset
position numbers when running IMGCOPY.

Let's assume that you want to copy the latest image in the GE-2B/IR set
to MYDATA/IMAGES.2000 while reducing the data to 8-bit but keeping the
oversampling:

IMGLIST GE-2B/IR FORM=EXP         <- to get # LINes and ELEments in image
IMGCOPY GE-2B/IR MYDATA/IMAGES.2000 STYPE=VISR SIZE=nlin nele

where:

nlin - number of lines in GE-2B/IR dataset element
nele - number of elements in GE-2B/IR dataset element

You can not use SIZE=ALL with STYPE=VISR, this is why you have to
interrogate the source image to find out how many lines and elements
the source image has and use those numbers to specify the output image
"shape".

You would repeat this step for each image you want to convert to 1-byte.

>then I want to remap them to 2 projections:

Remapping is accomplished using the IMGREMAP command.  For this, choose
a different range in positions numbers in the MYDATA/IMAGES dataset.
For sake of argument, let's choose 3000:

>North Polar Stereographic projection
>#CLAT;CLON;DLAT;DLON
>#45.30;-73.35;1.5;4  (CYUL)

You will have to play with this to get the RES correct, but the following
is the gist:

IMGREMAP MYDATA/IMAGES.2000 MYDATA/IMAGES.3000 PRO=PS 45.30 73.35 RES=4 SIZE=ALL

>#45.30;-73.35;5;7    (NE US)

I'll let you play with the IMGREMAP invocations for this one.

>Also, for METEOSAT imagery, I want to remap them to these projections:
>
>North Polar Stereographic projection
>#CLAT;CLON;DLAT;DLON
>#46.25;1.50;11.5;16  (France)
>#45;14;13;23         (Europe)

I'll let you play with the IMGREMAP invocations for these.

>Thanks a lot again for the great support...!

You are welcome.

Tom