[Previous]
[Next]
NAME:
MagnifyArray
PURPOSE:
Rebin an image to a integer multiple of its original size by
copying pixel values
CATEGORY:
Tricks
CALLING SEQUENCE:
result = MagnifyArray(array [, mag, /undo])
INPUTS:
array array[n,m]; type: any
any 2-dimensional array
OPTIONAL INPUT PARAMETERS:
mag scalar; type: integer; default: 2
magnification factor; must be an integer
/undo undoes a previous magnification operation (the magnification
factor must be the same to retrieve the original array)
OUTPUTS:
result array[n*magnification,m*magnification]
the resulting array enlarged by the magnification factor.
array element array[i,j] from the input image is replicated
in array elements
result[i*magnification..i*magnification+magnification-1,
j*magnification..j*magnification+magnification-1]
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, IsType, SuperArray
CALLED BY:
img_read, qImage_cw_Blowup, qImage_cw_BoxZoom, qImage_cw_Where, qView_Movie
qView_Save2File, qView_Wall, qvu_draw, smei_frm_flatfield, smei_frm_rebin
smei_setup_roi, smei_star_fit, smei_star_fitone, smei_star_lsqfit
RESTRICTIONS:
PROCEDURE:
Both IDL rebinning functions (REBIN and CONGRID) use interpolation
procedures, and hence in general will produce pixel values not present
in the original array.
MagnifyArray replicates pixel values in blocks of magnification
x magnification pixels.
MODIFICATION HISTORY:
FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
max_pos
PURPOSE:
Finds the position of maximum in a 2D array
CALLING SEQUENCE:
max = max_pos(f)
INPUTS:
f array
OUTPUTS:
max fltarr(2) 2D array containing the position of the maximum
max(0) = x-coordinate of maximum
max(1) = y-coordinate of maximum
(values based on array index)
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS
ArrayLocation
CALLS: ***
ArrayLocation
CALLED BY:
xyoff
PROCEDURE:
The indices of the element with the max. value are obtained from
a call to `max'.
If the element has a neighbour on either side (in horizontal or
vertical direction) the x and y positions of the maximum are refined
by fitting a quadratic polynomial through the maximum array element
and its two neighbours.
MODIFICATION HISTORY:
H. Cohl, 20 Nov, 1990 --- Initial implementation.
[Previous]
[Next]
NAME:
MercatorProj
PURPOSE:
Transforms latitude and longitude to X and Y coordinates in the
Mercator map projection.
CALLING SEQUENCE:
Pos = MercatorProj(Pos)
INPUTS:
Pos array[2,n]; type: float
n locations in the sky
Pos[0,n] longitudes
Pos[1,n] latitudes in [-90.,90.]
OPTIONAL INPUT PARAMETERS:
/degrees if set then all angles are in degrees (default: radians)
dabg array[3]; type: float: default: none
Euler angles for a rotation to be applied to
'Pos' prior to the Mercator projection.
(see FishEye)
zero_phase scalar; type: float; default: none
Additional offset applied to phase angle
(see FishEye)
OUTPUTS:
Pos array[2,n]; type: float
X,Y Cartesian coordinates (same structure as input array)
(in radians or degrees)
The longitude is scaled to [-180,+180].
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
AngleRange, EulerRotate, IsType, SyncDims
CALLED BY:
PlotEarthSkymap, PlotEloTimeMap, PlotPolarSkymap
PROCEDURE:
MODIFICATION HISTORY:
FEB-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
mk_flick
PURPOSE:
Make movie from group of image files
CATEGORY:
sat/idl/util
CALLING SEQUENCE:
PRO mk_flick, movie, filter, $
delay = delay , $
loop = loop , $
mpeg = mpeg , $
png = png , $
gif = gif , $
first = first , $
last = last , $
fps = fps , $
bits = bits , $
timestamp=timestamp , $
frames = frames , $
cleanup = cleanup , $
silent = silent , $
step = step
INPUTS:
movie scalar; type: string
name of movie file; if no directory is specified the
movie file is created in the current directory
filter scalar or array; type: string
a scalar identifying a group of image files. This
could be a directory (all files) or a filter containing
a wild card. An array should be a list of file names.
OPTIONAL INPUT PARAMETERS:
first=first scalar; type: integer
last =last scalar; type: integer
number of images used to make movies
use only first or last group of files (after sorting
file names) to make a movie
/png makes an mng movie (this is the default)
/mpeg makes an mpeg movie
/gif makes an animated gif movie using gifsicle
step=step scalar; type: integer
Use only one frame of every 'step' frames
Keywords for mng and gif movies (tested with convert and gifsicle):
delay=delay sets the delay between images in units of 0.01 seconds
/loop created an animation with an infinite loop
ffmpeg keywords:
fps=fps frames per second
bits=bits bits per second
OUTPUTS:
(creates movie file)
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
CheckDir, FILEPATH, FindAllSubDirs, GetFileSpec, InitVar, IsType, SetFileSpec, UNIQ
do_file, hide_env, qFramestamp, say
CALLED BY:
qView_Save2File, smei_star_fitone, vu_movie, vu_quick_movie
RESTRICTIONS:
Runs only on Linux so far.
PROCEDURE:
PNG animation (mng movie):
Uses 'convert'. This is part of ImageMagick, and is usually located
in /usr/X11R6/bin or /usr/bin. It is called with keywords -loop 0
(if /loop is set) and -delay <delay> (if delay=delay is specified).
GIF animation (gif movie):
Uses 'gifsicle'. It is called with keywords --loop (if /loop
is set) and --delay=<delay> (if delay=delay is specified).
MPG animation (mpeg movie)
Uses 'ffmpeg'. It is called with keywords fps and bits (if provided
as keywords).
The executable is located by spawning a 'which' command, i.e. the
movie maker program must be in the path.
MODIFICATION HISTORY:
APR-2001, Paul Hick (UCSD/CASS)
SEP-2001, Paul Hick (UCSD/CASS)
Merged Kevin's mk_mpeg with this procedure.
MAY-2003, Paul Hick (UCSD/CASS)
Added PNG animation. This is now the default.
OCT-2006, John Clover, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
MPEG support is now done with ffmpeg