external/CDAWlib/
cdaweb_skymap.pro
Routines
top source cdaweb_skymap
cdaweb_skymap, image, sc_pos=sc_pos, spin_axis=spin_axis, prime_meridian=prime_meridian, sun_pos=sun_pos, mag=mag, sphere=sphere, lonmin=lonmin, lonmax=lonmax, latmin=latmin, latmax=latmax, annotation=annotation, top_annotation=top_annotation, min=min, max=max, grid=grid, field=field, limb=limb, terminator=terminator, exobase=exobase, colorbar=colorbar, log=log, smooth=smooth, norotate=norotate, xmargin=xmargin, ymargin=ymargin, title=title, subtitle=subtitle, clip=clip, true=true, square=square, pathlogo=pathlogo, contour=contour, median=median, lee=lee, closeup=closeup, xcloseup=xcloseup, top=top, noerase=noerase, limit=limit, earth=earth, fullscreen=fullscreen, time=time, geogrid=geogrid, fill=fill, landcolor=landcolor, seacolor=seacolor, gei=gei, bartitle=bartitle, barlevels=barlevels, noimage=noimage, antiearthward=antiearthward, cbarposition=cbarposition, barcharsize=barcharsize, barformat=barformat, wim=wim, p0lat=p0lat, p0lon=p0lon, rot=rot, annosize=annosize, line_thick=line_thick, ps=ps, ctab=ctab, units=units, sun_spot=sun_spot, label_field_line=label_field_line, position=position, thumb=thumb
NAME: CDAWeb_Skymap PURPOSE: This Skymap code was given to us by the TWINS project in order to properly produce mapped image plots of their TWINS images. Modifications: TJK modified it slightly to allow a position to be defined, thus allowing it to be used from CDAWeb for making thumbnails and larger sized mapped images. I also changed the name of the routine from skymap to cdaweb_skymap, so there's no confusion between the two. CALLING SEQUENCE: (sample call from below, making large images) cdaweb_skymap, image, sc_pos = sc_posv_re_eci_dat[*,(frame-1)], $ spin_axis=spin_axis_eci_dat[*,(frame-1)], sun_pos=sun_posv_eci_dat[*,(frame-1)], $ prime_meridian=prime_meridian_eci_dat[*,(frame-1)], lonmin=-88, lonmax=268,latmin=4, $ latmax=88, colorbar=0, grid = 1, $ field=1, limb=1, sphere = 1, mag = mag, term=1, log=0, norotate=1, noerase=1,ctab=39, exobase=0 INPUTS: Required are: image, sc_pos, spin_axis, sun_pos, prime_meridian SEE DETAILS BELOW
NAME: CDAWEB_SKYMAP.PRO
PURPOSE:
Project a lat-lon matrix onto the sphere of the sky and draw the
earth with field lines.
CATEGORY:
CALLING SEQUENCE:
CDAWEB_SKYMAP, IMAGE
INPUTS: IMAGE[nlon,nlat] - An image with a column corresponding to
one latitude and row corresponding to longtitude of the map.
OPTIONAL INPUTS:
KEYWORD PARAMETERS:
SC_POS - A three element array of the S/C postition in some
geocentric coordinate system.
SPIN_AXIS - Spin axis direction of the satellite in the same
geocentric coordinate system.
PRIME_MERIDIAN - A 3 element vector that lies in the plane of the
sphere pole and the zero reference angle of the
sphere equator (the +x axis). This has nothing
to do with the prime meridian of the earth; it is
just the most convenient description.
SUN_POS - The unit vector to the sun in the same system
MAG - Magnetic dipole direction in the same geocentric system.
All vectors and positions must be expressed in the same geocentric
coordinate system.
SPHERE - Set 0 gives us the full sphere. Set to 1 gives us the
hemisphere lat and lon 0 deg in the center.
LATMIN, LATMAX, LONMIN, LONMAX - Same as keywords to MAP_IMAGE.PRO
ANNOTATION - An array of strings containing information such as time
and position, to be output together with the plot in
the assigned space.
MIN - The minimum number on the colorbar.
MAX - The max number of the color bar
GRID - If set turns on lat-lon grid in S/C coordinates with the
'north pole' of the grid (+90 deg) being the spinaxis, and
lon being the spin angle.
FIELD - Plots, dipole field lines L=4 and 8 for noon, dusk,
midnight, and dawn.
LIMB - If set plots the Earth's limb.
TERMINATOR - Turns on terminator line
EXOBASE - If set plots the exobase line (dashed) at 300 km altitude.
COLORBAR - If set plots a color bar.
LOG - Turns on logarithmic scaling.
SMOOTH - Applies a boxcar smoothing function to the mapped (output
of MAP_IMAGE) image. The purpose is to smooth the visible
image to aid the eye in interpreting the image as a 3D
structure and not make the eye unconciously map it to the
sphere. CAUTION!!: Localized features broadens. Care has to
be taken when interpreting.
NOROTATE - Turns off the fancy rotation that make some people
seasick. If set, spin axis (lat = +90 deg) always points
up (positive orbit normal down).
XMARGIN, YMARGIN - Used in MAP_SET (Margin between map and image border)
TITLE - Inserts title at top of SKYMAP Image
SUBTITLE - Inserts subtitle under title at top of SKYMAP Image
CLIP - All values GE than clip are set to 0.
TRUE - Use TRUE Color representation
SQUARE - Enable a square format window with minimum space for
annotation. Default is landscape. The effect of this
keyword is essentially to put the colorbar in the right
place (vertically) and annotation under the map. XMARGIN
and YMARGIN are used to set the position of the map.
PATHLOGO - The absolut path to a GIF file containing an optional
pathlogo to be placed. Does not work just yet. Seems that
calling TVIMAGE the first time makes the position keyword
not work.
CONTOUR -'contourimage' is the image that is smoothed and median filtered.
The CONTOUR procedure puts NLEVELS contours between min_value >
min(data) and max_value < max(data).
MEDIAN - Apply the MEDIAN filtering function with a
nearest-neighbor window. This is applied to the raw
pixelated image and not the mapped one. This can be used
together with the SMOOTH keyword but not the LEE
keyword. The purpose is to clean up statistical noise and
outliers. CAUTION!!: This function alters the appearance
of localized features such as the "low-altitude" ENA
emissions in the IMAGE/HENA data.
LEE - Apply the LEE filter to the raw image. This can be used
together with the SMOOTH keyword but not the MEDIAN
keyword. Should do a better job than MEDIAN but one needs to
tweak the N and SIG arguments to the LEEFILT.PRO
function. EXPERIMENTAL!
CLOSEUP - A shorcut of setting the LIMIT keyword to MAP_SET. This
gives you automatically 120 x 120 deg FOV. Equal to
setting LIMIT=[60,-60,-60,60]. Overrides SPHERE.
XCLOSEUP -A shorcut of setting the LIMIT keyword to MAP_SET. This
gives you automatically 120 x 120 deg FOV. Equal to
setting LIMIT= [45, -45, -45, 45]. Overrides SPHERE.
TOP - Same as for BYTSCL.PRO.
NOERASE - If set, skymap doesn't erase the previous plot.
LIMIT - LAT, LON (in degrees) [LATMIN, LONMIN, LATMAX, LONMAX]
EARTH - Adds the Earth with landcolor, seacolor, maps out continents
FULLSCREEN - Eliminates colorbar, annotation. Entire screen filled
by IMAGE
TIME - Stucture with Year, Doy, Hour, Min, Sec Used with keyword EARTH
GEOGRID - Used with keyword EARTH
FILL - Used with keyword EARTH
LANDCOLOR - Used with keyword EARTH, indicates color of continents
SEACOLOR - Used with keyword EARTH, indicates color of water
GEI - Indicates sc_pos (plus other vectors) is in GEI coordinates Used with keyword EARTH
BARTITLE - Annotation to appear on colorbar, typically Units
BARLEVELS - Number of divisions in the colorbar. (divisions + 1) annotations
NOIMAGE - Indicates that no image should be made
ANTIEARTHWARD - essentially sets
p0lon=180 instead of 0 deg.
CBARPOSITION - positions colorbar
BARCHARSIZE - The character size of the color bar annotations.
BARFORMAT - Format of the Numbers used in the colorbar labeling
WIM - Passes back the map_image(image) to the calling program
P0LAT - center of the plot being p0lat, p0lon in map coordinates
P0LON - center of the plot being p0lat, p0lon in map coordinates
ROT - If not set, then Rotate the map so that mag dipole axis always points
upwards. If set use rot value to rotate the map.
ANNOSIZE - Size of the text used in the annotation
LINE_THICK - Thickness of lines used in images
PS - Indicates whether we are making a postscript image or not
**Might go away
CTAB - Indicates which colortable is used to make the image
UNITS - **Will most likely be replaced by bartitle
SUN_SPOT - Adds the A, Dot annotation on the plots
LABEL_FIELD_LINE - Adds 0, 6, 12, 18 labels to the field lines
OUTPUTS:
The input image projected onto the sphere of the sky, using the
azimuthal projection with the 'north pole' of the sky sphere being
the spin axis. The coordinats of the map are the spin based
coordinates to represent what a spinning imager 'sees'.
OPTIONAL OUTPUTS:
COMMON BLOCKS:
None!
SIDE EFFECTS:
KNOWN PROBLEMS/BUGS: - Field-line plotting crashes at sc_pos_x=0???
RESTRICTIONS:
PROCEDURE:
Set up the map by, setting 0 deg lat and lon as the
subsatellite point of the skysphere, i.e. the center of
the plot. The rotation (ROT argument to MAP_SET) is set
such that MAG will always point upward on the plot
window. Points a bit to the side for some positions but
gives a continuous pointing position of the earth, so
that it will work if one wants to do a movie. REFLECT_MAP
is used to mirror turn the map since the map projections
in IDL are used to put data on the surface of a
sphere. We want to put data INSIDE a sphere.
Field lines are plotted for fixed L-shell and MLT range.
DEPENDENCIES (non-standard IDL routines):
FIELD_LINE.PRO - To plot field_lines.
EARTH_BOUNDARY.PRO - To plot Earth's limb.
TERMINATOR_LINE.PRO - To plot terminator line.
SPHERE_BASIS.PRO
DOT.PRO
SPHERE2SPHERE.PRO
SPHERE_TO_XYZ.PRO
XYZ_TO_SPHERE.PRO
REFLECT_MAP.PRO
XYTEXT.PRO
COLORBAR.PRO
EXAMPLE:
Following examples lets you view the earth as the
satellite passes it in a straight trajectory below the
southpole.
pro test
mag = [0, 0, 1]
sun_pos = [1, 0, 0]
spin_axis = [-1, 1, 0]
xs = transpose(interpol([6, -6], 50))
ys = xs
zs = transpose(replicate(-2, 50))
sc_pos = [[xs, ys, zs]]
for i = 0, 49 do begin
SKYMAP, dist(10), sc_pos = reform(sc_pos(*, i)), spin_axis = spin_axis, $
sun = sun_pos, sphere = 0, mag = mag
wait, .1
endfor
end
MODIFICATION HISTORY:
Jun 19 2007, Jillian Redfern, SWRI
- received new skymap.pro from Pontus Brandt
incorporating his changes into our version of skymap
Added in no_sun_spot, ps, line_thick, annosize, ctab keywords
Added additional comments to the top of the program
Mar 22, 2005. Michael Muller, SwRI
- Commented out overplot of gridlines.
Dec 06, 2004. Michael Muller, SwRI
- originally created/tested Nov 07, 2002.
- Added code to make map of pixels
so can get values at any x,y grid
point. Also, overlay/plot the grid.
Thu Mar 4 09:32:56 2004, Pontus Brandt
Parameters
- image
Keywords
- sc_pos
- spin_axis
- prime_meridian
- sun_pos
- mag
- sphere
- lonmin
- lonmax
- latmin
- latmax
- annotation
- top_annotation
- min
- max
- grid
- field
- limb
- terminator
- exobase
- colorbar
- log
- smooth
- norotate
- xmargin
- ymargin
- title
- subtitle
- clip
- true
- square
- pathlogo
- contour
- median
- lee
- closeup
- xcloseup
- top
- noerase
- limit
- earth
- fullscreen
- time
- geogrid
- fill
- landcolor
- seacolor
- gei
- bartitle
- barlevels
- noimage
- antiearthward
- cbarposition
- barcharsize
- barformat
- wim
- p0lat
- p0lon
- rot
- annosize
- line_thick
- ps
- ctab
- units
- sun_spot
- label_field_line
- position
- thumb
File attributes
Modification date: | Tue Oct 21 13:53:48 2014 |
Lines: | 463 |