Re: Contour mapping of elevation points [message #83299] |
Mon, 25 February 2013 19:31 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
gpeterso@ucsc.edu writes:
> So I have successfully loaded the coyote library but when I try and run the program there is an error that says x,y, or Z dimensions are incompatible. i tried changing the code to
> lons=scale_vector(dindgen(s), 270, 360)
> lats=scale_vector(dindgen(s), 0, 90)
>
> to form two dimension arrays for longitude and latitude. When I ran it there was no system errors. However, the nothing really graphed.
Oh, duh! I had this:
> s = Size(array, /Dimensions)
> lats = Scale_Vector(Findgen(s[0]), 0, 90)
> lons = Scale_Vector(Findgen(s[1]), 270, 360)
> cgContour, array, lons, lats
And, of course, it should have been this:
s = Size(array, /Dimensions)
lons = Scale_Vector(Findgen(s[0]), 270, 360)
lats = Scale_Vector(Findgen(s[1]), 0, 90) - 90
cgContour, array, lons, lats
Really bad day today. It all started when I misspelled "aerosol" as
"areosol". But, it's a long story. :-(
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: Contour mapping of elevation points [message #83300 is a reply to message #83299] |
Mon, 25 February 2013 18:17  |
gpeterso
Messages: 22 Registered: February 2013
|
Junior Member |
|
|
On Monday, February 25, 2013 11:33:05 AM UTC-8, Coyote wrote:
> On Monday, February 25, 2013 11:29:40 AM UTC-7, gpet...@ucsc.edu wrote:
>
>
>
>> thanks so much! however when I try to run the program is says that scale_vector is undefined. I'm confused why it would do this for it is not a variable.
>
>
>
> Oh, sorry. Scale_Vector is a Coyote Library routine:
>
>
>
> http://www.idlcoyote.com/code_tips/installcoyote.php
>
>
>
> Cheers,
>
>
>
> David
So I have successfully loaded the coyote library but when I try and run the program there is an error that says x,y, or Z dimensions are incompatible. i tried changing the code to
lons=scale_vector(dindgen(s), 270, 360)
lats=scale_vector(dindgen(s), 0, 90)
to form two dimension arrays for longitude and latitude. When I ran it there was no system errors. However, the nothing really graphed.
|
|
|
|
Re: Contour mapping of elevation points [message #83302 is a reply to message #83301] |
Mon, 25 February 2013 10:36  |
gpeterso
Messages: 22 Registered: February 2013
|
Junior Member |
|
|
On Monday, February 25, 2013 9:28:56 AM UTC-8, gpet...@ucsc.edu wrote:
> I am trying to create a contour map of elevation points I have. the file is in .txt form and is an array 824 by 914. I know that each elevation point is equally spaced and the longitude starts at 270 and ends at 360 and the latitude starts at 0 and ends at 90S.
>
>
>
> I was able to configure a contour plot of that data, by simply reading in the two-dimensional elevation data and plotting. However, I am not sure if this is actually an accurate representation of the data. I've started to create a program that will assign the appropriate longitude and latitude but I am getting stuck.
>
>
>
> If anyone knows how to help me, that would be much appreciated! Thanks
This is my program so far.
openr, lun, 'arial.txt',/get_lun
data=dindgen(824,914)
readf, lun, data
close,lun
s=Size(data, /Dimensions)
lats=scale_vector(dindgen(s[0]), 0, 90)-90
lons=scale_vector(dindgen(s[1]), 270, 360)
cgContour, array, lons, lats
|
|
|
Re: Contour mapping of elevation points [message #83303 is a reply to message #83302] |
Mon, 25 February 2013 10:29  |
gpeterso
Messages: 22 Registered: February 2013
|
Junior Member |
|
|
On Monday, February 25, 2013 9:28:56 AM UTC-8, gpet...@ucsc.edu wrote:
> I am trying to create a contour map of elevation points I have. the file is in .txt form and is an array 824 by 914. I know that each elevation point is equally spaced and the longitude starts at 270 and ends at 360 and the latitude starts at 0 and ends at 90S.
>
>
>
> I was able to configure a contour plot of that data, by simply reading in the two-dimensional elevation data and plotting. However, I am not sure if this is actually an accurate representation of the data. I've started to create a program that will assign the appropriate longitude and latitude but I am getting stuck.
>
>
>
> If anyone knows how to help me, that would be much appreciated! Thanks
thanks so much! however when I try to run the program is says that scale_vector is undefined. I'm confused why it would do this for it is not a variable.
|
|
|
Re: Contour mapping of elevation points [message #83304 is a reply to message #83303] |
Mon, 25 February 2013 09:53  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> s = Size(array, /Dimensions)
> lats = Scale_Vector(Findgen(s[0]), 0, 90)
> lons = Scale_Vector(Findgen(s[1]), 270, 360)
> cgContour, array, lons, lats
Oh, 0 to 90S you said. Then,
lats = Scale_Vector(Findgen(s[0]), 0, 90) - 90
It is always hard to say if your array is upside down or not, but you
will have to check. IDL has a different notion of "orgin" on maps then
the rest of the world. Quite often you have to reverse the array to get
it oriented properly. If you do, then:
array = Reverse(array,2)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: Contour mapping of elevation points [message #83305 is a reply to message #83304] |
Mon, 25 February 2013 09:47  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
gpeterso@ucsc.edu writes:
> I am trying to create a contour map of elevation points I have. the file is in .txt form and is an array 824 by 914. I know that each elevation point is equally spaced and the longitude starts at 270 and ends at 360 and the latitude starts at 0 and ends at 90S.
>
> I was able to configure a contour plot of that data, by simply reading in the two-dimensional elevation data and plotting. However, I am not sure if this is actually an accurate representation of the data. I've started to create a program that will assign the appropriate longitude and latitude but I am getting stuck.
>
> If anyone knows how to help me, that would be much appreciated! Thanks
s = Size(array, /Dimensions)
lats = Scale_Vector(Findgen(s[0]), 0, 90)
lons = Scale_Vector(Findgen(s[1]), 270, 360)
cgContour, array, lons, lats
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|