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

20000404: McIDAS navigation for MERCator projection images



>From: Craig Motell <address@hidden>
>Organization: University of Hawaii
>Keywords: 200004040913.DAA22240 McIDAS-X AREA image MERCator navigation manual

Craig,

Are you no longer at the University of Hawaii?  I see your email address
is address@hidden.

>I have a program from Paul Jendrosky (spelling ? of NWS). Anyway, It
>probably came from you guys.

A quick look at the code you attached shows that it is not one of
our programs.

>The code converts AREA file image coordinates
>line and pixel to lat/lon.

OK.

>The code looks used the following include file: 
>
>$ more mercNav.h
>/*
>   Derived contents of the navigation for a Mercator Projection
>   MCIDAS area file
>*/
>struct mercNavAttr {
>  int    eqLine;
>  int    centralElem;
>  double refLat;
>  double centralLat;
>  double centralLon;
>  double topLat;
>  double botLat;
>  double leftLon;
>  double rightLon;
>  float  refRes;
>} ;
>
>
>This is include file is used by the program:
>
>[satellite@lxl2]$ more mercNav.c
>#include "mercNav.h"
>#include <math.h>
>double cnvt_ddmmss(int);
>struct mercNavAttr getMercArea( int elem0, int line0, int xdim,
>                        int ydim, int navblock[])
>{
>  struct mercNavAttr nav;
>  double rearth, blat, blon, rlat;
>  double radian = .01745329;
>
>  nav.eqLine = navblock[0];
>  nav.centralElem = navblock[1];
>  nav.refLat = cnvt_ddmmss(navblock[2]);
>  nav.centralLon = cnvt_ddmmss(navblock[4]);
>  nav.refRes = navblock[3]/1000.;
>  rearth = navblock[5]/1000.;
>  if (navblock[8] >= 0) nav.centralLon = -1. * nav.centralLon;
>
>  blat = rearth*cos(nav.refLat*radian)/nav.refRes;
>  blon = rearth*radian/nav.refRes;
>
>/* Compute longitude of left side */
>  nav.leftLon = (elem0 - nav.centralElem)/blon + nav.centralLon;
>  if ( nav.leftLon > 180.) {
>    nav.leftLon = nav.leftLon - 360. ;
>  }
>  if ( nav.leftLon <= -180.) {
>    nav.leftLon = nav.leftLon + 360. ;
>  }
>/* Compute longitude of right side */
>  nav.rightLon = (elem0 + xdim - 1 - nav.centralElem)/blon + nav.centralLon;
>  if ( nav.rightLon > 180.) {
>    nav.rightLon = nav.rightLon - 360. ;
>  }
>  if ( nav.rightLon <= -180.) {
>    nav.rightLon = nav.rightLon + 360. ;
>  }
>
>/* Compute latitude of top side */
>  rlat = atan( exp( (nav.eqLine - line0)/blat ) ) ;
>  nav.topLat = ((rlat/radian - 45.0)*2.0) + nav.refLat;
>
>/* Compute latitude of bottom side */
>  rlat = atan( exp( (nav.eqLine - (line0 + ydim - 1))/blat ) ) ;
>  nav.botLat = ((rlat/radian - 45.0)*2.0) + nav.refLat;
>
>/* Compute latitude of center */
>  rlat = atan( exp( (nav.eqLine - (line0 + (ydim -1)/2.0))/blat ) ) ;
>  nav.centralLat = ((rlat/radian - 45.0)*2.0) + nav.refLat;
>
>  return nav;
>}
>-------------------------------------------------

>Tom I have two questions:
>
>1) where is the navigation block, for a mercator projection, defined?

The unfortunate thing from my and other developer's point of view is
that the newer McIDAS Programmer's Reference Manual:

http://www.ssec.wisc.edu/mug/prog_man/prog_man.html

does not break out the specifics about the various types of navigation
supported in McIDAS.  I routinely go back to an old, hardcopy version
of the McIDAS Application Programming Manual to see exactly what the
words in the navigation block mean.  Here is the entry for MERCator
projection images:

MERC - Mercator

Word           Contents
--------------+----------------------------------------------------------
1              MERC
2              image line of the equator
3              image element of the equator
4              standard latitude [DDDMMSS]
5              spacing at standard latitude [m]
6              normal longitude, [DDDMMSS]
7              radius of the planet [m]
8              eccentricity of the planet, * 1000000
9              coordinate type, >= 0 planetodetic, < 0 planetocentric
10             longitude convention, >= 0 west positive, < 0 west negative
11-120         (reserved)
121-128        memo entry; up to 32 characters of comments

The code you sent along looks like it conforms to these definitions
EXCEPT that the code is ignoring the eccentricity of the planet.

The calculations being made using the McIDAS nav parameters looks like
are in preparation for use in some other system like GEMPAK where the
LAT,LON of the lower right left and upper right hand corners are
needed.

>In my documentation I have its very different

What does your documentation have?  Where did you get your documentation
(from us)?

For good measure, and to get this information into our inquiry tracking
system so that it will be readily available in the future, here are the
definition blocks for the LAMB (Lambert Conformal secant), PS (Polar
Stereographic), RADR (radar), RECT (rectilinear) projections, and TANC
(Lambert Conformal Tangent Cone).  All of this information came from
the old McIDAS Applications Programming Manual which was last updated
in November of 1993.

LAMB - Lambert Conformal

Word           Contents
--------------+----------------------------------------------------------
1              LAMB
2              image line of the North Pole
3              image element of the North Pole
4              standard latitude 1 [DDDMMSS]
5              standard latitude 2 [DDDMMSS]
6              spacing at standard latitude [m]
7              normal longitude, [DDDMMSS]
8              radius of the planet [m]
9              eccentricity of the planet, * 1000000
10             coordinate type, >= 0 planetodetic, < 0 planetocentric
11             longitude convention, >= 0 west positive, < 0 west negative
12-120         (reserved)
121-128        memo entry; up to 32 characters of comments


PS - Polar Stereographic

Word           Contents
--------------+----------------------------------------------------------
1              PS
2              image line of North Pole
3              image element of the North Pole
4              standard latitude [DDDMMSS]
5              spacing at standard latitude [m]
6              normal longitude, [DDDMMSS]
7              radius of the planet [m]
8              eccentricity of the planet, * 1000000
9              coordinate type, >= 0 planetodetic, < 0 planetocentric
10             longitude convention, >= 0 west positive, < 0 west negative
11-120         (reserved)
121-128        memo entry; up to 32 characters of comments


RADR - Radar

Word           Contents
--------------+----------------------------------------------------------
1              RADR
2              row (image coordinates) of the radar site
3              column (image coordinates) of the radar site
4              latitude of the radar site [DDDMMSS]
5              longitude of the radar site [DDDMMSS]
6              pixel resolution [m]
7              rotation of north from vertical, degrees * 1000
8              if present, same as 6 but only for longitude direction
9-120          (reserved)
121-128        memo entry; up to 32 characters of comments


RECT - Rectilinear

Word           Contents
--------------+----------------------------------------------------------
1              RECT
2              a particular image row number
3              latitude corresponding to 2, degrees * 10000
4              a particular image column number
5              longitude corresponding to 4, degrees * 10000
6              latitude degrees/image line, degrees * 10000
7              longitude degrees/image line, degrees * 10000
8              radius of the planet [m]
9              eccentricity of the planet, * 1000000
10             coordinate type, >= 0 planetodetic, < 0 planetocentric
11             longitude convention, >= 0 west positive, < 0 west negative
12-120         (reserved)
121-128        memo entry; up to 32 characters of comments


TANC - Lambert Conformal Tangent Cone

Word           Contents
--------------+----------------------------------------------------------
1              TANC
2              image line of pole, * 10000
3              image element of pole, *10000
4              km per pixel, * 10000
5              standard latitude, * 10000
6              standard longitude, * 10000
7-120          (reserved)
121-128        memo entry; up to 32 characters of comments


The earth is assumed to be spherical in the TANC nav module, and the
radius is set to be 6371.2 km.

The TANC navigation is the only one described with any detail in the
current McIDAS Programmer's Reference Manual. The only other place to
gleen this kind of information is the navigation modules themselves.
For reference, the source files for McIDAS navigation modules all begin
with 'nvx' and end with '.dlm' (e.g., nvxmerc.dlm, nvxps.dlm,
nvxrect.dlm, etc.).

>2) Do you know where this code is from?

No, sorry.  It looks pretty straightforward, however.

>Now, Paul will be back in a few days I may be able to 
>find this information from here.
>
>Thankyou,

You are welcome.

>From address@hidden  Tue Apr  4 14:28:31 2000
>Subject: Re: 20000404: McIDAS navigation for MERCator projection images

Dear Tom:

I am using yahoo email right now because I am
working at University of Hawaii as a consultant
now.

I quit so I can also work for another company
as a software consultant (writing VB <--> active
X <--> jet database software).

Its fun because I like science but I also wanted
to get paid more money--so now I have the semi-best
of both worlds.

I found out that yahoo email sucks, it truncated
part of your message but I got the pertinent
information.

Thankyou for all your help.
Sincerely,
Craig Motell