README = description of the Johns Hopkins Applied Physics Laboratory S1R group IDL library ftp site on fermi.jhuapl.edu The library called idlusr has been updated. Purpose of this ftp site ------------------------ This site contains the JHU/APL/S1R IDL library. Many of the routines are related to IDL programming support. It is not claimed that these routines are the ultimate in efficiency, they worked ok for their original purpose, and may be of general interest. Some routines have been updated to take advantage of new features in IDL. Other routines will be updated in the future. Brief description of the IDL library -------------------------------------- idlusr: routines thought to be of general interest. Categories: Text Files, Text strings, Date & time routines, Information, Plotting/Graphics, Imaging, Array processing, Math routines, Programming routine, Widget tools, Miscellanious. Related documentation --------------------- The JHU/APL/S1R IDL Web page is at URL http://fermi.jhuapl.edu/s1r/idl/idl.html It contains links to a number of IDL related web pages including a description of and tutorials for the JHU/APL/S1R IDL library. Accessing the ftp site ---------------------- Point your web browser to ftp://fermi.jhuapl.edu/pub/idl/ Files available in this ftp site -------------------------------- Last update: 2001 Feb 16 = date of last ftp site update (nothing in file). README = the file you are reading. cat.one = one line descriptions of the IDL routines by category. whats_new_*.txt = What's new since the last update. usr.tar.Z = the IDL library idlusr as a compressed tar file. usr_rn.txt.Z = the release notes for idlusr as a compress text file. routines is a directory with all the routines as *.pro files. I'll try to update this at reasonable intervals. Note: the release note file is also included in the library tar file. It is provided separately so you can check for bug fixes if you wish. After retrieving the files (unix instructions) *------------------------------------------------------------------* | If you are updating an existing copy of this library it is a | | good idea to keep a copy of the old library for awhile in case | | a modification causes a problem. | *------------------------------------------------------------------* The compressed files end in .Z and are uncompressed as follows: uncompress usr.tar.Z which gives usr.tar Tar files end in .tar and are untarred as follows: tar -xf xxx.tar which extracts whatever files were contained in the tar file. (make sure you uncompress compressed tar files first). Setting up the IDL libraries ---------------------------- Create a directory to hold the JHUAPL library. Place the library tar file in this directory and unpack as described above. To use just add the path to the library to your IDL path. Bug reports ----------- When you find a bug in these routines, first check the correct release_notes.txt file to see if it is a known bug. If it is a new bug send a bug report to Ray Sterner at ray.sterner@jhuapl.edu or phone: (443) 778-3032. Include the routine name, and what line(s) of the routine have problems, or describe the problem. There is no guarantee that the problem will be fixed, but as time permits an attempt will be made to fix bugs. Suggestions on improving the documentation files are welcome. If you find certain areas hard to understand let me know and I will try to clarify them. Positive comments on this library are also welcome and may be useful in justifying continuing support. Current status of ftp site files as of 2001 Feb 16 -------------------------------------------------- The ftp site currently contains the following files: ftp transfer Uncompressed File mode Size (approx) size ------ ----- ------------- ------------- README ascii 6.9 K bytes Not compressed Updated cat.one ascii 38 K bytes Not compressed Updated whats_new_*.txt ascii 14 K bytes Not compressed Updated usr.tar.Z binary 1.1 M bytes 3.2 M bytes Updated usr_rn.txt.Z binary 23 K bytes 51 K bytes Updated -------------------------------------------------------------- ***************************************************************************** IDL library routines classified by category Library name: IDLUSR Purpose: Generally useful routines. From: Johns Hopkins Applied Physics Laboratory Contact: sterner@tesla.jhuapl.edu Main categories --------------- Text Files Text strings Date and time routines Information Plotting/Graphics and annotation Imaging Array processing Math routines Programming routines Miscellanious ----------------------------------------------------------------------------- Text Files ========== add_margin:P Add space to left margin and top of a text file. drop_comments:F Drop comment and null lines from a text array. filebreak:P Breaks file name(s) into components. filename:F File names with system independent symbolic directories. findfile2:F Find files and sort them. findfile3:F Find files and sort them. getfile:F Read a text file into a string array. getfileln:F Get a line from a text file. graphfile:P List a file on the graphics device. helpfile:P Display a file of help text. nextitem:F Return next line from a file, ignore comments & null lines. putfile:P Write a text file from a string array. rdcol:F Read columns of numbers or times from a text file. rdfile:P Read lines from a text file. readtokey:P Read an open text file until a given key word is found. xtextfile:P Explore a text file of unkown format. xtextimg:P Create an image with text. Widget based. ----------------------------------------------------------------------------- Text strings ============ array_list:P List an array in a form useful to cut and paste. byt2strarr:P Unpack a string array from a byte array bytarr_get:P Extract a byte array from a byte buffer. bytarr_put:P Insert a byte array into a byte buffer. commalist:F Return a given array as a comma delimited text list. cposprint:P Print a string showing character positions. d2dms:F Function to convert from degrees to deg, min, sec. delchr:F Delete all occurrences of a character from a text string. detab:F Replace tab characters by spaces. dms2d:F Convert from Degrees, MInutes, and seconds to degrees. dms_form:F Convert degrees to a deg, min, sec vector font string. f2fi16:F Convert feet to feet, inches, and fractions to 1/16 inch. firstchar:F Position of first non-whitespace char in string. fndwrd:P Find number, locations, lengths of words in a text string. getstr:F Get delimited strings from a text string or array. getwrd:F Return the n'th word from a text string. isnumber:F Determine if a text string is a valid number. makelabels:F Make an array of tick mark labels. makes:F Make a string array of integers from lo to hi by step. more:P Display a text array using the MORE method. multicol:F Reformat a string array into multi-columns. namenum:P Break a name into a pattern and numbers in the name. numfrac:F Convert a number to a decimal string with n places. numname:F Generate names or text strings with embedded numbers. nwrds:F Return the number of words in the given text string. plural:F Plural function: returns 's' if arg > 1, else ''. repchr:F Replace all occurrences of one character with another in a text string. repword:F Replace a word in a text string. spc:F Return a string with the specified number of spaces (or other char). state_name:F Return name of state given 2 letter abbreviation. strarr2byt:P Pack a string array into a byte array strep:F Edit a string by position. Precede, Follow, Replace, Delete. stress:F String edit by sub-string. Precede, Follow, Delete, Replace. strlentab:F Gives length of a string with tab characters expanded. strsub:F Extract a substring by start and end positions. strtrm2:F Trim given character (and spaces) from ends of given string. text_block:P Print or return a block of inline text (lines starts with ;). txtgetkey:F Get a keyword value from a string array. unique:F Return the unique elements of an array. upcase1:F Capitalize first letter in string. wordarray:P Convert text string or string array to 1-d array of words. wordorder:F Re-arrange words in a text string. wordpos:F Gives word number in a reference string for a search word. xtxtin:P Widget based text input. ----------------------------------------------------------------------------- Date and time routines ====================== cyph:P Construct a cycle/phase array from time series data. date2doy:P Date to Day of Year conversion. date2dn:F Find day of year number from date. date2jd:F Convert a date string to Julian Day number. date2ymd:P Date text string to the numbers year, month, day. dt_tm_brk:P Break a date and time string into separate date and time. dt_tm_chk:F Check date & time string that both parts exist & are valid. dt_tm_dif:F Find time interval in seconds between two date/time strings. dt_tm_fromjs:F Convert "Julian Seconds" to a date/time string. dt_tm_full:F Add missing parts of date to get a full date/time string. dt_tm_inc:P Increment a date/time by a given number of seconds. dt_tm_mak:F Set up a time and date string from reference JD and offset. dt_tm_range:P Extract date/time range from string with two date/times. dt_tm_tojs:F Convert a date/time string to "Julian Seconds". gmt_offsec:F Return offset in seconds from local time to GMT (UT). jd2js:F Convert from Julian Day Number to Julian Seconds. jd2mdays:P Convert a range of Julian Days to month start and end JDs. jd2str:P Find year, month, day strings from Julian Day number. jd2ymd:P Find year, month, day from julian day number. jd2date:F Convert a Julian Day number to a date string. jdselect:F Select Julian Day array subset by month or weekday. js_incmonth:F Increment JS by one month. js2jd:F Convert from Julian Seconds to Julian Day Number. js2v:P Read a time (in "Julian seconds") vs value file. js2weekday:F Compute weekday given Julian Second. js2ymds:P Convert from "Julian Second" to year, month, day, second. jscheck:P Check accuracy of "Julian Seconds" over a given time span. jsplot:P Make a time series plot with time in Julian Seconds. lincal:P Plot a multimonth linear calendar on one page. lmst:F Give local mean sidereal time. monthdays:F Given a year and month returns number of days in that month. monthnames:F Returns a string array of month names. monthnum:F Return month number given name. nthweekday:F Julian Day of N'th weekday of month (like 2nd tues).' sechms:P Seconds after midnight to h, m, s, numbers and strings. secstr:F Convert a time string to seconds. select_intervals:F Select all intervals within a given range. sph_range_map:F Compute an array of ranges from a point on a sphere. strsec:F Convert seconds after midnight to a time string. sunclock:P Show world map with day, twilight, and night. time2jdoff:P Find Julian day and offset from seconds. JS, Timeaxis time_label:F Make a time label array timeaxis:P Plot a time axis. tnaxes:P Find nice time axis tics. weekday:F Compute weekday given year, month, day. xcyph:P Widget based cycle/phase images. xdate:P Widget based date selection tool. ydn2date:F Convert year and day of the year to a date string. ydn2md:P Convert from year and day number of year to month and day of month. ydns2js:F Convert year, day of the year, and seconds to Julian Seconds. ymd2date:F Convert from year, month, day numbers to date string. ymd2dn:F Convert from year, month, day to day number of year. ymd2jd:F From Year, Month, and Day compute Julian Day number. ymds2js:F Convert to year, month, day, second to "Julian Second". yy2yyyy:F Convert a 2 digit year to a 4 digit year. ----------------------------------------------------------------------------- Information =========== event_log:P Enter an event into the latest event log file. helpfile:P Display a file of help text. hexdump:P Display a file in hex. hlp:P Variant of HELP. Gives array min, max. posbox:P Test for a box drawn around the screen position, or plot one. wgs_84:F Return a structure with some WGS 84 Ellipsoid values. win_open:F Test if a given window is open. xbb:P Widget bill board utility for text display. xdatafile:P Explore a text file of unkown format. xhelp:P Widget to display given help text. ----------------------------------------------------------------------------- Plotting/Graphics ================== Interactive on screen --------------------- box_size:P Used by MOVBOX to change box size using the cursor. box1:P Single mouse button interactive box on image display. box2b:P Simple two mouse button interactive box on image display. boxarea:P Select an area with a box. cbar:P Make a color bar. chinit:P Initializes chart setup. Good for viewgraphs. color_wheel:P Pick a color using a color wheel. crossi:P Interactive cross-hair cursor on screen or plot. crossi2:P Interactive cross-hair cursor on screen or plot. drawpoly:P Draw a polygon using mouse. eqv:P Interactive equation viewer and curve fitter. eqv2:P Interactively plot a function on current plot. eqv3:P Execute IDL code using interactively varied parameters. hori:P Interactive horizontal line on screen or plot. imgline:P Interactive line on the screen. imgregion:F Interactively extract a selected image region. leg:P Make a plot legend. lini:P Interactive line. magcrs:P Show a magnified window around given point and wait for a cursor change. movbox:P Interactive box on image diaply. movcross:P Interactive cross-hair on a plot. normcrs:P Data cursor. Returns X and Y Normalized coordinate. paint:P Paint on an image. pan:P Pan around a screen image. Set pixels to a specified value. pickcolor:P Allow user to pick a color from current color table. pk:P Pick a set of points on a plot. pltcrv:P Edit curve points with mouse. Overlay spline. protractor:P Measure angles on the screen. regionsbar:P Plot a color bar for a regions type image. rev:P Reverse plot and background colors. show_box:P Used by MOVBOX to display current box size and position. slowplot:P Plot data slowly in fading colors. soplot:P Make a shaded over plot. splot:P Make a shaded plot. sprint:P Print text on screen, allows easy update. texti:P Interactive Text. thplot:P Plot a curve with varying thickness along it. tvbox:P Draw or erase a box on the image display. tvcirc:P Draw a circle on the display. tvrdbox:P Read part of screen image into a byte array. tvwrbox:P Display byte array on screen using box for position & size. vase:P Draw rotationally symetric shapes. veri:P Interactive vertical line on screen or plot. xcursor:P Cursor coordinate display in a pop-up widget window. xcurve:P Draw a curve in the display window. xline:P Interactive line on image display. xtextimg:P Create an image with text. Widget based. zpan:P Zoom and pan around an image using the mouse. Plotting and annotation ----------------------- align:P Vector text justification (positioning). arcs:P Plot specified arcs or circles on the current plot device. arrow2:P Draw arrows on screen. cgm:P Toggles graphics redirection to a *.cgm file on or off. draw:P Graphics draw from last point to given point. ellipse:P Plot specified ellipse on the current plot device. fill_cont:F Returns a byte array with filled contours. genarrow:P Generate an arrow polygon. genellipse:P Generate points on an ellipse. genshape:P Generate x,y coordinates to draw named shaped. graphfile:P List a file on the graphics device. hline:P Plot a horizontal line after erasing last plotted line. hor:P Plot a horizontal line on a graph at specified y value. jsplot:P Make a time series plot with time in Julian Seconds. lastplot:P Backup !p.multi to last plot position. linepts:P Gives pixel coordinates of points along a line segment. make_ruler:P Plot linear scales on the laser printer. make_scale:P Plot circular scales on the laser printer. move:P Graphics move to a point. movlabels:P Interactively position labels and list xyouts statement. movtxt:P Interactively position text and list xyouts statement. nextplot:P Update !p.multi to next plot position. nwin:P Convert from normalized window coordinates. parcurve:P Return a curve parallel to given curve. plotp:P Pencode plot routine. Allows disconnected lines. plotpos:F Compute plot position for a plot of specified shape. plotseq:P Plot a movielike sequence of graphs. point:P Plot a filled point at given position. points:F Convert from size in points to IDL charsize or pixels. posbox:P Test for a box drawn around the screen position, or plot one. radii:P Plot specified radii on the current plot device. raout:P Write text along an arc in data coordinates. rev:P Reverse plot and background colors. rtics:P Plot labeled or unlabeled tic marks around a circular arc. sph_demo:P Demonstrate some of the spherical plot (sph*) routines. sphgc:P Find intersections of two great circles on sphere. sphinit:P Initialize sphere drawing package. sphlat:P Draw parallels of latitude on a sphere. sphlng:P Draw meridians of longitude on a sphere. sphplot:P Plot a curve in spherical polar coordinates. sphrad:P Draw sphere radius. sph_range_map:F Compute an array of ranges from a point on a sphere. sphtext:P Write text on a sphere. splat:P Generate points on a splat curve. slowplot:P Plot data slowly in fading colors. stext_xyp:F Return stroke text plot arrays. sunclock:P Show world map with day, twilight, and night. textplot:P Plot text with 2-d alignment. Also return bounding box. textpos:P Find size and angle of text string given points at each end. thicken:P Thicken graphics in an existing image. Good for viewgraphs. ticklen:P Compute ticklength for specified size in pixels. timeaxis:P Plot a time axis. tvcrs2:P Like tvcr but allows data, device, & normal coordinates. vclip:P Clip a vector to a clipping window. vecfld:P Plot a 2-d vector field. ver:P Plot a vertical line on a graph at specified x value. vline:P Plot a vertical line after erasing last plotted line. xprint:P Print text on graphics device. After initializing use just like print. xtextimg:P Create an image with text. Widget based. xtics:P Draw labeled tics for an X type axis. xyoutb:P Bold text version of xyouts. zplot:P Plot symbols in various colors. Scaling/Windowing ----------------- axval:F Find nice axis values. cm2norm:P Convert from cm to normalized coordinates. exrange:F Return a range array with range expanded by given fraction. getwindow:P Get data window coordinates. getview:P Return current viewport. imgwindow:F Compute plot window needed to display given image. nwin:P Convert from normalized window coordinates. obj_draw:P Display graphical object in a resizable window. plotpos:F Compute plot position for a plot of specified shape. plotwin:P Gives plot window (area enclosed by axes) in pixels. pos_cm:F Convert keyword POSITION for PLOT from cm to norm. coords. set_isoxy:P Set data window with equal x & y scales. Covers at least given range set_window:P Set data window. subnormal:P Convert from subnormal coordinates to normalized coord. todev:P Convert from data or normalized to device coordinates. tvpos:P Gives screen position used by tv, tvscl. vclip:P Clip a vector to a clipping window. win_open:F Test if a given window is open. zwindow:P Z buffer window like normal x window. Hardcopy -------- cgm:P Toggles graphics redirection to a *.cgm file on or off. epsinit:P Redirect plots and images to Encapsulated Postscript File. epsterm:P Terminate Encapsulated Postscript plotting. latexoff:P Close the encapsulated Postscript file opened by LATEXON. latexon:P Generate encapsulated postscript file to include in LaTeX documents. prwindow:P Print current window or gif image on color printer. psinit:P Redirect plots and images to postscript printer. pspaper:P Plot a postscript layout sheet. Gives normalized coordinate system. psterm:P Terminate postscript plotting and send plots to printer. ----------------------------------------------------------------------------- Imaging ======= Image or 2-d array generation ----------------------------- makez:F Make simulated 2-d data. Useful for software development. phase:F Return an array filled in to indicate specified moon phase. radial_img:F Make an image array with a radial brightness distribution. Display and display related processing -------------------------------------- clr_scale:P Clear image scaling values embedded by put_scale. color_wheel:P Pick a color using a color wheel. colorize:P Colorize an image. colorwarn:P Warn if available IDL colors too few. dot:F Used by SUN_SHADE for dot prod. of surf. normal & sun vect. imgarray:P Create an array of small images given a list. imgneg:P Display negative of current image. imgopen:P Prepare a large image to be read. imgread:F Read part of a large image. imgscale:P Interactive image scaling. imgunder:P Display image in same area as last plot. izoom:P Zoom an image and display with labeled axes. izoom_sub:P Zoom part of an image that has scale embedded by put_scale. jpeg_mag:P Change size of a JPEG image. loglut:F Return a log lookup table useful for scaling images. map_put_scale:P Embed map coordinates info in image. map_set_scale:P Set map scaling from info embedded in a map image. obj_draw:P Display graphical object in a resizable window. pack:P Find best packing of images (rectangles) on a page. put_scale:P Embed in current image values needed to restore scaling. scale_rgb:P Interactively scale R,G,B image components. screengif:P Display a GIF image in a screen window. screenjpeg:P Display a jpeg image in a screen window. screentiff:P Display a tiff image in a screen window. set_scale:P Set scaling from currently displayed (or given) image. setwin:P Set which window should be currently active window. shade_img:P Shade a given image based on a shading array. shade_surf2:P Allow image overlay with surface shading. sun_shade:F Make a colored shaded relief view of a surface array. swdelete:P Delete a scrolling window. swindow:P Create a scrolling window. Works much like window. swlist:P Display info for all scrolling windows, set new active one. subimg:P From current image select and redisplay a subimage. topo:F Make a monochrome shaded relief view of a surface. tvrd2:F Version of tvrd that allows out of bounds. tvsharp:P Redisplay a sharpened version of the current screen image. vimgseq:P Display a sequence of byte images. vumov:P View a res file movie. win_open:F Test if a given window is open. xtextimg:P Create an image with text. Widget based. xview:P View and/or convert images (GIF, TIFF, ...). zwindow:P Z buffer window like normal x window. Processing not always related to immediate display -------------------------------------------------- binbound:F For binary image return array with boundary points set to 1. concoord:P Convert between two linear coordinate systems. ctrim:F Do a circular trim on an array. dist_scale:P Display a distance scale on an image. dist_scale2:P Display a distance scale on an image. ellfit:P Fit an ellipse to a 2-d probability distribution. gif2png:P GIF to PNG converter hist:F Compute histogram and corresponding x values. Allows weights. hist2d:F Compute a 2-d histogram for an array of points. ibilin:P Inverse bilinear interpolation. img_hsv:F Adjust Hue, Saturation, and Value for a 3-D image array. img_radial:F Radially distort a 2-D or 3-D image array. img_resize:F Resize a 2-D or 3-D image array. img_rotate:F Rotate an 2-D or 3-D image array. img_smooth:F Smnooth a 2-D or 3-D image array. img_stretch:F Stretch a 2-D or 3-D image array. imgfrm:P Puts a specified border around an image. imgmask:P Create a mask from an image. imgpolrec:F Map an angle/radius image to an X/Y image. imgrecpol:F Map an X/Y image to an angle/radius image. radon:F Compute the Radon Transform using the FFT method. size_img:P Return image size and true value. seedfill:P For an array fill a connected region bounded by given values. seedfillr:P For an array fill a connected region of constant pixel value. Color tables and color images ----------------------------- clt:P Load a color table. Menu selection. color_wheel:P Pick a color using a color wheel. color:P Set a color in the color table by specifying color name. colors8bit:P Show array of 256 colors in a window. color_quanj:F Combines Red, Green, Blue components into a color image. colorwarn:P Warn if available IDL colors too few. congrid8c:F Do 24 bit congrid interpolation on 8 bit color image. ctint:P Interpolate between two color table entries. ctool:P Modify a color table using widgets. gif2jpeg:P Convert a GIF image to a JPEG image. gifadd:P Add R,G,B color components for list of GIF images. gif2png:P GIF to PNG converter gifscreen:P Save current screen image and color table to a GIF file. imgneg:P Display negative of current image. imgsqz:P Squeeze number of image colors used for current image. jpeg2tiff8:P Convert a JPEG image to an 8 bit TIFF image. jpegscreen:P Save current screen image and color table to a JPEG file. loglut:F Return a log lookup table useful for scaling images. makevlt:P Generate and load a random color table (CT). pickcolor:P Allow user to pick a color from current color table. rgb:P Explore RGB color system. rotvlt:P Rotate current vlt or part of it. setcolor:P Set a single color table entry. shade_clt:P Sets up color table used for sun_shade shaded relief displays. tarclr:F Find closest match to target color in current color table. testcolor:P Display colors selected by number. tiff2jpeg:P Convert a TIFF image to a JPEG image. tiffscreen:P Save current screen image and color table to a TIFF file. topc:F Return top color number for current device. topcolors:P Reserve and define some colors at top of color table. xced1:P Simple widget to edit a single color table entry. xhsbc:P Adjust image hue, saturation, brightness, & contrast. Widget. xmerge:P Widget based routine to merge multiple color images in one. Hardcopy -------- imagesize:P Compute actual postscript image size given available space. pack:P Find best packing of images (rectangles) on a page. psimg:P Display an image on postscript printer. ----------------------------------------------------------------------------- Array processing ================ Curve and surface generation ---------------------------- apodize:F Weighting array for apodizing an image. Cosine taper. checker:P Return a checker board pattern array of 0 and 1. makei:F Make a long array with given start and end values and step size. makems:F Make array of values from start to end with a max step size. maken:F Make an array of N values, linear between two given limits. makenlog:F Make array of N values, logarithmic between two given limits. makenxy:P Make 2-d x and y coordinate arrays of specified dimensions. makex:F Make an array with specified start, end and step values. makexy:P Make 2-d X & Y coord. arrays, useful for functions of x,y. makey:F Make simulated data. Useful for software development. makez:F Make simulated 2-d data. Useful for software development. makev:F Make simulated 3-d data. Useful for software development. parcurve:P Return a curve parallel to given curve. 1-d only filters ---------------- cosfilt:F Cosine tapered weighting array to use for FFT filtering. costap:F Cosine taper weighting from 1 at center to 0 at ends. envelope:P Return the min/max envelope of a time series. fft_filter:F Do FFT filtering of time series data. filljumps:P Find indices needed to fill in value jumps in an array. fixang:F Fix angle discontinuety at 0-360. fixangh:F Fix angle wraparound using a hysteresis method. fixgaps:F Linearly interpolate across data gaps in an array. interp1:F Linear interpolation. interpx:F Interpolate data with possible gaps and missing (bad) values. interpx_demo:P Demonstrate the use of interpx. linfill:P Fill gaps in array data using linear interpolation. select_intervals:F Select all intervals within a given range. unique:F Return the unique elements of an array. 1-d or 2-d filters ------------------ kurf:F Computes kurtosis inside a moving window. skewf:F Computes skew inside a moving window. smooth2:F Do multiple smoothing. Gives near Gaussian smoothing. varf:F Computes variance inside a moving window. 2-d only filters ------------------ radon:F Compute the Radon Transform using the FFT method. Information ----------- best_fft:F Attempts to find size of fastest FFT from given choices. diskcenter:P Find center and radius of a disk in an image. explore:P Image stats in a 16 x 16 box movable with the mouse. extremes:F Find all the local extremes of a 1-d array. extremes_2d:F Find local extremes in a 2-d array. getgroup:F N'th group of identical elements from a given array.' getrun:F N'th run of consecutive integers from a given array.' inrange:P Find multiples of given step just inside given range. isarray:F Tests if the argument is an array. lastindex:P Returns last index for each dimension of the given array. locmax:P Find local maxima in an image. ngroups:F Gives # of groups of identical elements in given array. nruns:F Gives # of runs of consecutive integers in given array.' pmatch:P Find a given pattern in a 1-d array. runlength:F Give run lengths for array values. unique:F Return the unique elements of an array. Modification ------------ ave2d:F Average rows or columns of a 2-d array. blend:F Sets up weighting array for blending arrays together. congrid2:F Alternate (and limited) congrid using interpolate. embed:F Embed an array in a larger array. filljumps:P Find indices needed to fill in value jumps in an array. fixang:F Fix angle discontinuety at 0-360. fixgaps:F Linearly interpolate across data gaps in an array. imgpolrec:F Map an angle/radius image to an X/Y image. imgrecpol:F Map an X/Y image to an angle/radius image. interp2:F Interpolate a 2-d array to another size. interpx:F Interpolate data with possible gaps and missing (bad) values. interpx_demo:P Demonstrate the use of interpx. lgradient:F Create a floating array with a linear gradient. ls:F Scale image between percentiles 1 and 99 (or specified percentiles). one2two:P Convert from 1-d indices to 2-d indices. regions:F Using specified breakpoints map image values into 0,1,2,... scalearray:F Linearly scale array values to specified range. segment:F Set boundaries of constant value to 0. setminus:F Eliminate elements from a set that are also in another set. shiftf:F Shift an array by a fractional number of indices. stripshift:F Shift strips of an image in x or y. sum2d:F Sum rows or columns of a 2-d array. translate:P Translate an image to regisiter with a reference image. two2one:P Convert from 2-d indices to 1-d indices. ----------------------------------------------------------------------------- Math routines ============= scalar arg ---------- basecon:F Convert a number from one base to another. best_fft:F Attempts to find size of fastest FFT from given choices. ceil:F Return the ceiling of the argument. factor:P Find prime factors of a given number. floor:F Return the floor of the argument. getbits:F Pick out specified bits from a value. int_low:F Drop an integer data type to the lowest precision. nearest:F Return multiple of a given step nearest a target value. nicenumber:F Find a nice number close to the given number. num_dec:F Number of decimal places in given number. numfactors:F Gives the number of factors of a number. ph:F Return the phase of a complex number. pmod:F Find the positive modulo value of a number. putbits:F Insert specified bits in a target. round2:F Round that works for big double precision numbers. setminus:F Eliminate elements from a set that are also in another set. sign:F Return the mathematical sign of the argument. showbits:P Shows bits of an integer data type. zero_int:F Return a zero of the requested data type. Array arg --------- cspec:F Compute ensemble averaged frequency spectrum of complex data. cumulate:F Array with the cumulative sum of an array. Integrate. exdiff:F Return difference between array extremes. int_low:F Drop an integer data type to the lowest precision. intersect:F Return the elements common to two given arrays. kurt:F Returns the kurtosis of an array (4th moment/2nd moment^2). kurf: F Computes kurtosis inside a moving window. mean:F Returns the mean of an array. midv:F Return value midway between array extremes. numfrac:F Convert a number to a decimal string with n places. ph:F Return the phase of a complex number. pmod:F Find the positive modulo value of a number. round2:F Round that works for big double precision numbers. rspec:F Compute an ensemble averaged frequency spectrum of real data. scale_db:F Scale given data to db (meant for images). sdev:F Returns standard deviation of an array. simp:F Does Simpson numerical integration on an array of y values. skew:F Returns the skew of an array (3rd moment/2nd moment^3/2). skewf:F Computes skew inside a moving window. smooth2:F Do multiple smoothing. Gives near Gaussian smoothing. spl_angint:F Spline angular interpolation of a periodic function. symasym:P Resolve an array into symmetric & anti-symmetric components. variance:F Computes the variance of an array of numbers. varf:F Computes variance inside a moving window. xspec:F Compute an ensemble averaged cross spectrum of real data. zero_int:F Return a zero of the requested data type. Coordinate transformations/rotations/vector computations -------------------------------------------------------- earthrad:F Return earth radius in specified units. flat2sph:P Map a flat map onto a sphere. lint:P Find the intersection of two lines in the XY plane. ll2rb:P From latitude, longitude compute range, bearing. ph:F Return the phase of a complex number. plint:P Intersection point of a plane and a line. plane_int:P Compute the intersection line of two planes. polrec:P Convert 2-d polar coordinates to rectangular coordinates. polrec3d:P Convert vector(s) from spherical polar to rectangular form. rb2ll:P From range, bearing compute latitude, longitude . recpol:P Convert 2-d rectangular coordinates to polar coordinates. recpol3d:P Convert vector(s) from rectangular to spherical polar form. rot_3d:P Rotate 3-d coordinate system. rotate_xy:P Rotate a set of X,Y points about a given point. skewint:P Give the near-intersection point for two skew lines. sphic:P Compute intersection points of two circles on a unit sphere. unit:F Returns unit vector along given vector. wgs_84:F Return a structure with some WGS 84 Ellipsoid values. Fitting ------- ellfit:P Fit an ellipse to a 2-d probability distribution. eqv:P Interactive equation viewer and curve fitter. eqv2:P Interactively plot a function on current plot. fit:P Curve fit program. Polynomial, exponential, power law. fit12:P For internal use by FIT only. fit6:P For internal use by FIT only. gauss:F Return a fitted gaussian curve for a given histogram. gen_fit:F Fitted Y array for given X array from given fit parameters. poly_fit2:F Returns fitted Y values for each given X value. opfit1d:F Calculate orthonormal polynomial fit for 1-d data. opfit2d:F Calculate orthonormal polynomial fit for 2-d data. orthopoly:F Calculates a set of orthonormal polynomials. spl_angint:F Spline angular interpolation of a periodic function. Geometry -------- convexhull:P Return the convex hull of a polygon. ellfit:P Fit an ellipse to a 2-d probability distribution. polystat:P Compute polygon statistics (# vertices, area, perimeter). sphdist:F Angular distance between points on a sphere. vect_angle:F Angular distance between vectors. Numbers ------- factor:P Find prime factors of a given number. intersect:F Return the elements common to two given arrays. numfactors:F Gives the number of factors of a number. pmod:F Find the positive modulo value of a number. prime:F Return an array with the specified number of prime numbers. print_fact:P Print prime factors found by the factor routine. round2:F Round that works for big double precision numbers. Mandelbrot set -------------- mandelbrot:P Compute Mandelbrot images mcompute:P Compute mandelbrot set images. mzoom:P Compute new region needed to zoom a mandelbrot image. ----------------------------------------------------------------------------- Programming routine =================== Information ----------- array_list:P List an array in a form useful to cut and paste. check5:F Check if running IDL version 5 or greater. commalist:F Return a given array as a comma delimited text list. convert_ind:F Convert a text description of runs of indices to numbers. created:F Return file creation host, user, and time stamp or tag. data_block:P Read the block of data following data_block call. datatype:F Datatype of variable as a string (3 char or spelled out). endian:F Function indicating which endian the current machine uses. etc:F Return estimated time to completion in seconds. event_log:P Enter an event into the latest event log file. file_test:F Test if file readable &, optionally, has specified contents. get_count:F Get next count value, from 1 up. getenv2:F Version of getenv portable across operating systems. getsysnams:P Get a list from a file specified by an environmental var. grab_commands:P Grab command line recall commands and save in a text file. help_save2:P Look at files made by save2 and list what they contain. inbox:F Test if given point inside given box. isarray:F Tests if the argument is an array. lastindex:P Returns last index for each dimension of the given array. listruns:P Make a list of runs of consecutive integers. naxes:P Find nice axis tics. ngroups:F Gives # of groups of identical elements in given array. numpersec:F Given values increasing with time return rate per second. outbox:F Test if given point outside given box. path:P Examine and modify the IDL path. pcon:P IDL path control utility. May turn libraries on or off. scramble:F Scrambles an array or returns an array scrambled indices. showbits:P Shows bits of an integer data type. showpath:P Show the path of the calling routine. tag_test:F Test if given tag is in given structure. text_block:P Print or return a block of inline text (lines starts with ;). timer:P Measure elapsed time between calls. whoami:P Returns to the calling routine its directory and name. whocalledme:P Returns to calling routine its parent's directory and name. win_open:F Test if a given window is open. xautohelp:P Display auto help when mouse moves over a widget. xautohelp_example:P This routine shows how to use xautohelp. xmeter:P Display a 0 to 100% meter on a text screen. I/O and Memory -------------- bell:P Ring terminal bell. created:F Return file creation host, user, and time stamp or tag. crs_edit:P Edit a bitmap to use for a cursor image. dirmem:F Update a directory list for easy access. endian:F Function indicating which endian the current machine uses. enter:F Prompted entries allowing defaults. Help, IDL/DCL commands. filename:F File names with system independent symbolic directories. fslider_setrange:P Set new min/max for cw_fslider. getkey:F Return a keyboard key. Interpret escape sequences. hget:F Get a handle value. hset:P Set a handle value. more:P Display a text array using the MORE method. nextnum:F Return next number using the arrow keys. pckey:P Read PC keyboard. Interpret special keys. printat:P Print given items at specified screen column and line. resclose:P Close results file. rescom:P Display values from the results common and also file header. resget:P Get a variable from a results files. resopen:P Open a results file for reading or writing. resput:P Put values into a results file. restore2:P Retrieve from a file IDL variables saved by save2. save2:P Save IDL vars in a file. Allows them to be renamed during restore2. screen:P Print a terminal screen layout sheet on PS printer. swap:P Swap two values. text_block:P Print or return a block of inline text (lines starts with ;). tiffscreen:P Save current screen image and color table to a TIFF file. txtfile:P Enter a (new) file name. txtgetfile:P Select a file name. txtin:P txtmenu value entry. txtmenu_help:P Gives detailed help for the TXTMENU routine. txtmess:P Display a message on the screen and wait for any key. txtmeter:P Display a 0 to 100% meter on a text screen. txtpick:P Select file(s) from a screen menu displaying a file list. txtyesno:F Ask a yes/on question and read the answer. win_copy:P Copies graphics from a hidden window to the target window. win_redirect:P Redirects all graphics to a hidden window. wmenu2:F Like wmenu but allows non-mouse menus. Uses widgets if available. xbb:P Widget bill board utility for text display. xfiles:P Select files, individual or ranges. xgetfile:F Widget based file selection routine. xhotlist:P Widget based hotlist of items. xlist:F Pop-up list selection widget. xmess:P Display a message using a widget. xoption:F Widget option selection panel. xsubdir:P Widget based subdirectory selection tool. xyesno:F Widget Yes/No selection panel. Development tools ----------------- animals:F Return a string array of animals. makey:F Make simulated 1-d data. Useful for software development. makez:F Make simulated 2-d data. Useful for software development. makev:F Make simulated 3-d data. Useful for software development. ------------------------------------------------------------------------- Miscellanious ============= dayglobe:P Show the area of daylight/night on a globe. dt_tm_fromcr:F Convert from Carrington Rotation Number to Date/Time. dt_tm_tocr:F Convert from Date/Time to Carrington Rotation Number. exif_reader:P Read values from an Exif file (digital camera file). iglobe:P Plot a globe. pastel_sun_colors:P Load pastel sun color table precess:P Precess celestial coordinates to a new date. refract:F Correct true altitudes to refracted altitudes. sattrackaz:F Return the azimuth of a satellite track given inc and lat. state_name:F Return name of state given 2 letter abbreviation. sun:P Computes geocentric physical ephemeris of the sun. sun_colors:P Load sun color table sunaltazi:P Compute sun position from date/time and long/lat. sundisk:P Compute solar disk coordinates as seen from anywhere. sunjs:P Computes geocentric physical ephemeris of the sun. sun_zd:F Return solar zenith distances for given position. world_sunzd:F Compute Sun zenith distance for an array of world points. tetris:P Play tetris game. web_back:P Generate a random web background. webcaltab:P Generate HTML table code for a calendar. webshadow:P Add a shadow to a web page image. webtile:P Generate a Netscape web page background tile.