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

Home » Public Forums » archive » Re: MAP_SET, /SATELLITE
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: MAP_SET, /SATELLITE [message #2032] Tue, 03 May 1994 06:17
grunes is currently offline  grunes
Messages: 68
Registered: September 1993
Member
In article <Cp7K7x.11E3@yuma.ACNS.ColoState.EDU>
dean@phobos.cira.colostate.edu writes:
> I have been getting GMS satellite data from over the internet. I already
> have a FORTRAN program that navigates the images pretty well. However,
> when I use IDL's MAP_SET for /SATELLITE, the IDL map doesn't line up. I
> looks OK near the subsatellite point, but the farther you get away, the
> the worst the navigation becomes.
...
> We would like to do the following in IDL:
>
> TV, b
> plot,/satellite,/continent..
>
> Use the IDL cursor lat,lon conversions to navigate through the image.

I really can't help you with map_set, as I also noticed that the positions
at which it draws map features appear to be incorrect.

But, I can supply you with a much simplified routine which can draw maps
using a simple cartesian projection, simply by reading the map files.
You can perhaps adapt it to your use:

---------------------------------CUT HERE-------------------------------

;----------------------------------------------------------- -----------------
; Routine to Draw a map.
;----------------------------------------------------------- -----------------
pro draw_map,latmin,latmax,lonmin,lonmax,title

;Draw a map. It will then be possible to
; plot over the map using
; PLOTS,LON,LAT,NOCLIP=0
; (LON and LAT are arrays in degrees).

;latmin,latmax=minimum,maximum latitude (>0=north)
;lonmin,lonmax=minimum,maximum longitude (>0=east)
;title=plot title

;By Mitchell Grunes.
;Simplified from userlib procedure map_set.pro,
; because I could not figure out a way to get
; map_set.pro to give a simple rectangular
; projection, and because it seemed to be drawing
; things in the wrong places.

latmin2=latmin
latmax2=latmax
lonmin2=lonmin
lonmax2=lonmax
aspect=8.3125/6.125/cos((latmin+latmax)/2.*!pi/180) ;Adjust so that
;latitude and
;longitude scales
;will be same at
;center.
if (lonmax-lonmin) lt (latmax-latmin)*(aspect*.98) then begin
d=(latmax-latmin)*aspect-(lonmax-lonmin)
lonmin2=lonmin2-d/2
lonmax2=lonmax2+d/2
endif else if (latmax-latmin) lt (lonmax-lonmin)/(aspect*.98) then begin
d=(lonmax-lonmin)/aspect-(latmax-latmin)
latmin2=latmin2-d/2
latmax2=latmax2+d/2
endif
xticks=fix(lonmax2-lonmin2)
yticks=fix(latmax2-latmin2)
if xticks lt 3 or xticks gt 15 or lonmin2 ne fix(lonmin2) $
or lonmax2 ne fix(lonmax2) then xticks=0
if yticks lt 3 or yticks gt 15 or latmin2 ne fix(latmin2) $
or latmax2 ne fix(latmax2) then yticks=0
plot,[lonmin2,lonmin2,lonmax2,lonmax2,lonmin2], $
[latmin2,latmax2,latmax2,latmin2,latmin2],xstyle=1,ystyle=1, title=title, $
ticklen=1,xticks=xticks,yticks=yticks
close,1
openr,1,FILEPATH('supmap.dat',subdir = "maps"),/xdr,/stream
fbyte = [ 0, 71612L, 165096L]
nsegs = [ 283, 325, 594 ]
ij=2 ;0=course resolution map,1=U.S. only,2=All
point_lun, 1, fbyte(ij)
for i=1,nsegs(ij) do begin
npts = 0L
maxlat=0. & minlat=0. & maxlon=0. & minlon=0.
readu,1,npts,maxlat,minlat,maxlon,minlon
npts = npts / 2 ;# of points
xy = fltarr(2,npts)
readu,1,xy
if (maxlat lt latmin2) or (minlat gt latmax2) then goto,skipit
if (maxlon lt lonmin2) or (minlon gt lonmax2) then BEGIN
if (lonmax2 gt 180 and maxlon + 360 ge lonmin2) then goto,goon
if ( lonmin2 lt -180 and minlon -360 le lonmax2) then goto,goon
goto, skipit
endif
goon:
lat = xy(0,*) & lon = xy(1,*)
plots, lon,lat,NOCLIP=0,color = 2
empty
skipit:
endfor
end


------------------------------CUT HERE-------------------------------

Now the problem of aligning image and graphics on the same screen
is much more dificult (and it is much different in postscript than
on the screen, as there are major bugs in the IDL and PV-Wave
postscript drivers). I won't try to explain that, but will leave it
to someone else!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: MAP_SET, /SATELLITE
Next Topic: Re: Moving and resizing windows in IDL

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

Current Time: Wed Oct 08 13:31:16 PDT 2025

Total time taken to generate the page: 0.00435 seconds