; PLOTORBS plots ICON orbits and COSMIC-2 sampling (one day) onto the GOLD field of regard
; Stan Solomon, 9/2016
; Added TIMED orbits, SCS, 1/2017

; Set up colors and grids:
color8wb
satlon=-47.5
satlat=0.
nlon=72
nlat=36
b=fltarr(nlon,nlat)
dlon=360./nlon
dlat=180./nlat
lonmin=-180.
lonmax= 180-dlon
latmin= -90+dlat
latmax=  90-dlat

; Draw GOLD field of regard:
window,0,xsize=1000,ysize=1000
map_set,0,satlon,satlat,/satellite,sat_p=[6.62,0,0],xmargin=[5,5],ymargin=[4,4],/noborder
map=map_patch(b,lat0=latmin,lat1=latmax,lon0=lonmin,lon1=lonmax,xsta=x0,ysta=y0,xsiz=xs,ysiz=ys)
tv,map,x0,y0,xsize=xs,ysize=ys
map_continents,thick=3,color=7
map_grid,latdel=15,londel=15,thick=2,color=7

; Plot COSMIC-2 orbits:
x=findgen(360)
xr=x*!pi/180.
ds=4.0/24.*360.*!pi/180.
dx=1.5/24.*360.*!pi/180.
for j=1,6 do begin
  for i=1,16 do begin
    y=sin(xr+ds*j+dx*i)*24.
    oplot,x,y,thick=2,color=2
  endfor
endfor

; Plot COSMIC-2 sampling:
close,1
openr,1,'cosmicsampling.dat'
c=fltarr(20,100000)
readf,1,c
close,1
clat=c[7,*]
clon=c[8,*]
circlesym,size=.8,/fill
oplot,clon[12:4088],clat[12:4088],psym=8,color=1    ; 1 day

; Plot ICON orbits:
x=findgen(360)
xr=x*!pi/180.
dx=1.5/24.*360.*!pi/180.
for i=1,16 do begin
  y=sin(xr+dx*i)*27.
  oplot,x,y,color=5,thick=2
endfor

; Plot TIMED orbits:
x=findgen(360)
xr=x*!pi/180.
dx=1.5/24.*360.*!pi/180.
for i=1,16 do begin
  y=sin(xr+dx*i)*74.
  oplot,x,y,color=3,thick=3
endfor

; Plot maximum latitudes of extent of ICON observations:
latcirc=fltarr(360)
latcirc[*]=42.
oplot,x,latcirc,line=5,color=4,thick=4
oplot,x,-latcirc,line=5,color=4,thick=4

; Plot locations of major ISR observatories:
;circlesym,thick=4,size=3
;oplot,[-66.75,-66.75],[18.34,18.34],psym=8,color=3
;oplot,[-76.87,-76.87],[-11.95,-11.95],psym=8,color=3
;oplot,[-71.49,-71.49],[42.62,42.62],psym=8,color=3
;oplot,[-50.95,-50.95],[66.99,66.99],psym=8,color=3

end