comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: ms2gt .gpd and .mpp file creation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: ms2gt .gpd and .mpp file creation [message #71170] Mon, 07 June 2010 19:41 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
katb writes:

> Thanks for your input David - I will try your suggestion, I know you
> are quite knowledgeable in this area so just quickly do you have any
> suggestions for determining the number of rows and number of columns
> required for the resulting grid? I have been following ms2gt tutorials
> and I find 'gtest' confusing.

The number of rows and columns you need depends entirely on
what you want the resolution of your grid to be. If you have
25km data, there is no sense making the resolution of your
grid 500 meters. You could make it 10 or 20 km. Then it is
just a question of how much ground you want to cover.

Suppose you had a grid of 20 km and you wanted to see an
area of 5000 km by 4000 km. Then your grid would be 250 by 200.

I typically locate the center of my grid (as in the GPD
file I suggested previously), then just decide how much
of the world I want to see in my grid at what resolution.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: ms2gt .gpd and .mpp file creation [message #71176 is a reply to message #71170] Mon, 07 June 2010 18:03 Go to previous messageGo to next message
katb is currently offline  katb
Messages: 4
Registered: June 2010
Junior Member
On Jun 7, 10:50 pm, David Fanning <n...@dfanning.com> wrote:
> katb writes:
>> I am hoping someone can help shed some light on this problem.  I am
>> trying to reproject MODIS MOD02HKM 500m hdf data to Lambert Conic
>> Conformal Ellipsoid projection at 500m resolution using ms2gt.  The
>> tutorials execute fine so my software configuration (links to IDL) are
>> ok.  I am having difficulties preparing .gpd and .mpp files for
>> Australia as most of the examples are for Greenland or for another
>> projection.  I also believe the errors are related to the number of
>> columns and rows I have entered for the .gpd files.  I have tried
>> downloading David Fanning's gpd_viewer however it does not support the
>> projection I require.
>
>> My gpd file is as follows:
>
>> test.mpp        map projection parameters
>> Map Projection: Lambert Conic Conformal Ellipsoid
>> Map Reference Latitude:        -35.0
>> Map Second Reference Latitude: -40.0
>> Map Reference Longitude:     140.0
>> Map Scale: 1
>> Map Equatorial Radius: 6378.137
>> Map Eccentricity:      0.081819190843
>> Grid Map Units per Cell: 0.50
>> Grid Width: 2200
>> Grid Height: 1700
>> Grid Map Origin Column: 1099.5
>> Grid Map Origin Row: 849.5
>
>> My .mpp file is as follows:
>> Lambert Conic Conformal Ellipsoid
>> -36.5   147.0   lat0 lon0
>> 0.0             rotation
>> 0.50            scale (km/pixel)
>> -36.5   147.0   center lat lon
>> -35.0   144.0   lat min max
>> -38.0   150.0   lon min max
>> 1753 760        grid
>> 0.00    00.00   label lat lon
>> 1 0 0           cil bdy riv
>
>> The error I recieve when I execute ms2gt for two adjacent hdf files in
>> the listfile.txt is as follows:
>
>> fornav: ReadImage: error reading tester_cols_02708_00406_00000_20.img
>
> Sigh... These GPD files always confuse me. I think there are
> only two or three people in the world who understand them.
> Fortunately, they work with me, so I can check later.
>
> But that said, I would make a couple of changes here. You
> don't need an mpp file here, so you can eliminate that
> complication. And I would express your distances in meters
> (this may be a personal preference). But I would try a GPD
> file like this:
>
> Map Projection: Lambert Conic Conformal Ellipsoid
> Map Reference Latitude:        -35.0
> Map Second Reference Latitude: -40.0
> Map Reference Longitude:     140.0
> Map Equatorial Radius: 6378137.0
> Map Eccentricity:      0.081819190843
> Map Origin Latitude:     -27.0
> Map Origin Longitude:    140.0
> Map Origin X: -550000
> Map Origin Y: 425000
> Grid Map Units per Cell: 500
> Grid Width: 2200
> Grid Height: 1700
> Grid Map Origin Column: -0.5
> Grid Map Origin Row: -0.5
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Thanks Klemen - I thought ms2gt would be easier as i haven't had a
great deal of idl experience! If I can't get this going soon I will
probably resort to idl directly.

Thanks for your input David - I will try your suggestion, I know you
are quite knowledgeable in this area so just quickly do you have any
suggestions for determining the number of rows and number of columns
required for the resulting grid? I have been following ms2gt tutorials
and I find 'gtest' confusing.

Thanks again.
Kat
Re: ms2gt .gpd and .mpp file creation [message #71199 is a reply to message #71176] Mon, 07 June 2010 05:50 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
katb writes:

> I am hoping someone can help shed some light on this problem. I am
> trying to reproject MODIS MOD02HKM 500m hdf data to Lambert Conic
> Conformal Ellipsoid projection at 500m resolution using ms2gt. The
> tutorials execute fine so my software configuration (links to IDL) are
> ok. I am having difficulties preparing .gpd and .mpp files for
> Australia as most of the examples are for Greenland or for another
> projection. I also believe the errors are related to the number of
> columns and rows I have entered for the .gpd files. I have tried
> downloading David Fanning's gpd_viewer however it does not support the
> projection I require.
>
> My gpd file is as follows:
>
> test.mpp map projection parameters
> Map Projection: Lambert Conic Conformal Ellipsoid
> Map Reference Latitude: -35.0
> Map Second Reference Latitude: -40.0
> Map Reference Longitude: 140.0
> Map Scale: 1
> Map Equatorial Radius: 6378.137
> Map Eccentricity: 0.081819190843
> Grid Map Units per Cell: 0.50
> Grid Width: 2200
> Grid Height: 1700
> Grid Map Origin Column: 1099.5
> Grid Map Origin Row: 849.5
>
> My .mpp file is as follows:
> Lambert Conic Conformal Ellipsoid
> -36.5 147.0 lat0 lon0
> 0.0 rotation
> 0.50 scale (km/pixel)
> -36.5 147.0 center lat lon
> -35.0 144.0 lat min max
> -38.0 150.0 lon min max
> 1753 760 grid
> 0.00 00.00 label lat lon
> 1 0 0 cil bdy riv
>
> The error I recieve when I execute ms2gt for two adjacent hdf files in
> the listfile.txt is as follows:
>
> fornav: ReadImage: error reading tester_cols_02708_00406_00000_20.img

Sigh... These GPD files always confuse me. I think there are
only two or three people in the world who understand them.
Fortunately, they work with me, so I can check later.

But that said, I would make a couple of changes here. You
don't need an mpp file here, so you can eliminate that
complication. And I would express your distances in meters
(this may be a personal preference). But I would try a GPD
file like this:

Map Projection: Lambert Conic Conformal Ellipsoid
Map Reference Latitude: -35.0
Map Second Reference Latitude: -40.0
Map Reference Longitude: 140.0
Map Equatorial Radius: 6378137.0
Map Eccentricity: 0.081819190843
Map Origin Latitude: -27.0
Map Origin Longitude: 140.0
Map Origin X: -550000
Map Origin Y: 425000
Grid Map Units per Cell: 500
Grid Width: 2200
Grid Height: 1700
Grid Map Origin Column: -0.5
Grid Map Origin Row: -0.5


Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: ms2gt .gpd and .mpp file creation [message #71203 is a reply to message #71199] Mon, 07 June 2010 02:53 Go to previous messageGo to next message
Klemen is currently offline  Klemen
Messages: 80
Registered: July 2009
Member
Hi Kat, I have never used ms2gt, I use IDL to project the data. So
just a question - why don't you use IDL?

Otherwise, I would expect that ms2gt needs also some input about the
resolution. And I don't see such an input in your files.

Cheers, Klemen



On Jun 7, 7:20 am, katb <katborm...@gmail.com> wrote:
> Hi,
>
> I am hoping someone can help shed some light on this problem.  I am
> trying to reproject MODIS MOD02HKM 500m hdf data to Lambert Conic
> Conformal Ellipsoid projection at 500m resolution using ms2gt.  The
> tutorials execute fine so my software configuration (links to IDL) are
> ok.  I am having difficulties preparing .gpd and .mpp files for
> Australia as most of the examples are for Greenland or for another
> projection.  I also believe the errors are related to the number of
> columns and rows I have entered for the .gpd files.  I have tried
> downloading David Fanning's gpd_viewer however it does not support the
> projection I require.
>
> My gpd file is as follows:
>
> test.mpp        map projection parameters
> Map Projection: Lambert Conic Conformal Ellipsoid
> Map Reference Latitude:        -35.0
> Map Second Reference Latitude: -40.0
> Map Reference Longitude:     140.0
> Map Scale: 1
> Map Equatorial Radius: 6378.137
> Map Eccentricity:      0.081819190843
> Grid Map Units per Cell: 0.50
> Grid Width: 2200
> Grid Height: 1700
> Grid Map Origin Column: 1099.5
> Grid Map Origin Row: 849.5
>
> My .mpp file is as follows:
> Lambert Conic Conformal Ellipsoid
> -36.5   147.0   lat0 lon0
> 0.0             rotation
> 0.50            scale (km/pixel)
> -36.5   147.0   center lat lon
> -35.0   144.0   lat min max
> -38.0   150.0   lon min max
> 1753 760        grid
> 0.00    00.00   label lat lon
> 1 0 0           cil bdy riv
>
> The error I recieve when I execute ms2gt for two adjacent hdf files in
> the listfile.txt is as follows:
>


> fornav: ReadImage: error reading tester_cols_02708_00406_00000_20.img
> fornav: Success>>>Mon Jun  7 14:41:32 2010 MOD02: FATAL:
>
> [fornav 1 -v -t f4 -f 65535.0  -F 0 -d 1.2 2708 00406 20
> tester_cols_02708_00406_00000_20.img
> tester_rows_02708_00406_00000_20.img tester_ref_ch01_2708_08120.img
> 02030 01354 tester_refa_ch01_02030_01354.img]
> failed at /c/z3273429/bin/ms2gt/src/scripts/error_mail.pl line 116
>
> Does anyone have any suggestions on how I can develop .gdp and .mpp
> files suitable for Australia?
>
> Thanks in advance,
> Kat
Re: ms2gt .gpd and .mpp file creation [message #71301 is a reply to message #71170] Tue, 08 June 2010 16:51 Go to previous messageGo to next message
katb is currently offline  katb
Messages: 4
Registered: June 2010
Junior Member
On Jun 8, 12:41 pm, David Fanning <n...@dfanning.com> wrote:
> katb writes:
>> Thanks for your input David - I will try your suggestion, I know you
>> are quite knowledgeable in this area so just quickly do you have any
>> suggestions for determining the number of rows and number of columns
>> required for the resulting grid? I have been following ms2gt tutorials
>> and I find 'gtest' confusing.
>
> The number of rows and columns you need depends entirely on
> what you want the resolution of your grid to be. If you have
> 25km data, there is no sense making the resolution of your
> grid 500 meters. You could make it 10 or 20 km. Then it is
> just a question of how much ground you want to cover.
>
> Suppose you had a grid of 20 km and you wanted to see an
> area of 5000 km by 4000 km. Then your grid would be 250 by 200.
>
> I typically locate the center of my grid (as in the GPD
> file I suggested previously), then just decide how much
> of the world I want to see in my grid at what resolution.
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Thanks alot for your help David.
Unfortunately, I still can't get it to work, at least I know my .gpd
files are probably ok - I have contacted the NSIDC for help. I'll post
up if I have any success for others in the future.
Re: ms2gt .gpd and .mpp file creation [message #71739 is a reply to message #71301] Thu, 15 July 2010 22:46 Go to previous message
katb is currently offline  katb
Messages: 4
Registered: June 2010
Junior Member
OK so I finally have it all working now so here is a post for others
having similar issues with ms2gt reprojection tool for MODIS data!

There were two problems:
1) ms2gt likes to run in tcsh (i was using bash with a few work
arounds)

2) the gpd file needs to be fine tuned for your particular area

Map Origin X and Map Origin Y (top left corner of desired projected
grid space) is distance in metres from prescribed Map Origin Lat/Long
point (-32.7, 146.1) to the desired lat/long coordinates for the top-
left corner (in this case i wanted the top-left corner of my
reprojection area to be -34.23, 143.51) of the area you wish to
reproject data to. So for this case the top left corner of the
projected grid is to the west (negative X or left) and to the south
(negative Y or down).

for a reprojection grid bound by top-left lat/long of -34.23, 143.51
and bottom-right lat/long -43.89, 151.0 in Lambert Conformal Conic
reprojection space the gpd file ended up looking like this

Map Projection: Lambert Conic Conformal Ellipsoid
Map Reference Latitude: -27.5
Map Second Reference Latitude: -35.0
Map Reference Longitude: 146.1
Map Equatorial Radius: 6378137.0
Map Eccentricity: 0.081819190843
Map Origin Latitude: -32.7
Map Origin Longitude: 146.1
Map Origin X: -238500
Map Origin Y: -172500
Grid Map Units per Cell: 500
Grid Width: 1400
Grid Height: 2300
Grid Map Origin Column: -0.5
Grid Map Origin Row: -0.5

use crtest and xytest to test your .gpd file reprojection coordinates
and lat/longs prior to running ms2gt.

hope this is useful to someone, somewhere, sometime.

cheers
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Problem running an IDL VM application
Next Topic: Re: Problem running an IDL VM application

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:07:37 PDT 2025

Total time taken to generate the page: 0.00707 seconds