Source: src/idl_cvs/quickdespike.pro
src/idl_cvs/quickdespike.pro
NAME: quickdespike PURPOSE: Quick way (execution-wise) to remove single-element spikes. CATEGORY: Smoothing CALLING SEQUENCE: IDL> smoothedData = despike( data ) INPUTS: input = 1-D or 2-D data array. KEYWORDS spike - value that is considered a spike (or higher) DEFAULT= 3 times the difference between the average and the minimum. downward - if = 0, will not check for downward spikes lowest - for downward pointing spikes, fraction of points to check for ones "percent" below this value (DEFAULT=0.333) percent - (see above) DEFAULT = 1% replacement - value to replace spikes with EXAMPLE: IDL> mdsopen, 'usxr', 130000 IDL> y=mdsvalue('\USXR_HUP_00:RAW') IDL> d=quickdespike( y, spike=20 ) IDL> plot,y IDL> oplot,d,color=mk_color('red') To test: IDL> s = quickdespike( /plot ) To test not needing despiking: IDL> d = replicate(20,100)+randomu(seed,100)*5 IDL> s= quickdespike( d, /plot ) NOTE: if keyword "spike" not present, will use a value 3 times as large as the difference between the average and the minimum. Since this is not so good if there are no spikes, the maximum of the data set must be 4 times this, otherwise, just use 0.9*2^16. spikes way below the average will just be flipped around before removing ones above. The identification of ones below are not as good. Test your data !!! MODIFICATION HISTORY: 27-Oct-2010 added REPLACEMENT keyword 15-Mar-2010 cleaned up 30-Sep-2009 Written by Bill Davis, PPPL
Source: src/idl_cvs/readcol.pro
src/idl_cvs/readcol.pro
NAME: READCOL PURPOSE: Read a free-format ASCII data file with columns of data into IDL variables. Lines of data not meeting the specified format (e.g. comments) are ignored. Columns may be separated by commas or spaces. Use READFMT to read a fixed-format ASCII file. Use RDFLOAT for much faster I/O (but less flexibility). CATEGORY: Files CALLING SEQUENCE: READCOL, name, v1 [, v2, v3, v4, v5, ... v25 , status=status, $ FORMAT = , /DEBUG , /SILENT , nSkip = , NUMLINE =, comment= ] INPUTS: NAME - Name of ASCII data file, scalar string. In VMS, an extension of .DAT is assumed, if not supplied. OPTIONAL INPUT KEYWORDS: FORMAT - scalar string containing a letter specifying an IDL type for each column of data to be read. Allowed letters are A - string data, B - byte, D - double precision, F- floating point, I - integer, L - longword, and X - skip a column. (G & E equate to F) Columns without a specified format are assumed to be floating point. Examples of valid values of FMT are 'A,B,I' ;First column to read as 6 character string, then 1 column of byte data, 1 column integer data. 'V' for LONG64 'L,L,L,L' ;Four columns will be read as longword arrays. ' ' ;All columns are floating point If a FORMAT keyword string is not supplied, then all columns are assumed to be floating point. SILENT - Normally, READCOL will display each line that it skips over. If SILENT is set and non-zero then these messages will be suppressed. DEBUG - If this keyword is non-zero, then additional information is printed as READCOL attempts to read and interpret the file. nSkip - Scalar specifying number of lines to skip at the top of file before reading. Default is to start at the first line. COMMENT - skip if a line begins with this NUMLINE - Scalar specifying number of lines in the file to read. Default is to read the entire file LINESSKIPPED - Ascii array of lines skipped TABDELIM - If set, then assume columns are delimitted by tabs OUTPUTS: V1,V2,V3,...V15 - IDL vectors to contain columns of data. Up to 25 columns may be read. The type of the output vectors are as specified by FORMAT. EXAMPLES: Each row in a file POSITION.DAT contains a star name and 6 columns of data giving an RA and Dec in sexigesimal format. Read into IDL variables. (NOTE: The star names must not contain internal spaces.) IDL> FMT = 'A,I,I,F,I,I,F' IDL> READCOL,'POSITION',F=FMT,name,hr,min,sec,deg,dmin,dsec The HR,MIN,DEG, and DMIN variables will be integer vectors. Alternatively, all except the first column could be specified as floating point. IDL> READCOL,'POSITION',F='A',name,hr,min,sec,deg,dmin,dsec To read just the variables HR,MIN,SEC IDL> READCOL,'POSITION',F='X,I,I,F',HR,MIN,SEC RESTRICTIONS: This procedure is designed for generality and not for speed. If a large ASCII file is to be read repeatedly, it may be worth writing a specialized reader. Columns to be read as strings must not contain spaces or commas, since these are interpreted as column delimiters. (UNLESS /TABDELIM is used). Use READFMT to read such files. Numeric values are converted to specified format. For example, the value 0.13 read with an 'I' format will be converted to 0. PROCEDURES CALLED GETTOK(), NUMLINES(), REPCHR(), STRNUMBER(), ZPARCHECK REVISION HISTORY: 14-Apr-2010 added datatype 'V' for LONG64 16-Oct-2008 added status keyword 24-Aug-99 Added LINESSKIPPED keyword 10/99 Added TABDELIM keyword [Bill Davis] Written W. Landsman November, 1988 Modified J. Bloch June, 1991 (Fixed problem with over allocation of logical units.) Added nSkip and NUMLINE keywords W. Landsman March 92 Read a maximum of 25 cols. Joan Isensee, Hughes STX Corp., 15-SEP-93. Call NUMLINES() function W. Lansdman Feb. 1996
Source: src/idl_cvs/read_array.pro
src/idl_cvs/read_array.pro
NAME: read_array PURPOSE: Read a numeric array (1-D) from a text file CATEGORY: Files CALLING SEQUENCE: IDL> num_array = read_array(filename) INPUTS: filename = name of file containing lines of ascii data. KEYWORD PARAMETERS: nskip - number of lines to skip before reading status - odd, if OK OUTPUTS: num_array = returned array of floating point values COMMON BLOCKS: NONE EXAMPLE: IDL> num_array = read_array( filename ) NOTES:; MODIFICATION HISTORY: 01-Aug-2008 Written by Bill Davis, PPPL
Source: src/idl_cvs/read_floats.pro
src/idl_cvs/read_floats.pro
NAME: read_floats PURPOSE: Read a list from a text file and return a floating-point array CATEGORY: Files CALLING SEQUENCE: IDL> floats = read_floats(filename) INPUTS: filename = name of file containing lines of ascii data. KEYWORD PARAMETERS: HLP - When set, help information is printed. nskip - lines to skip status - if even, then read was successful OUTPUTS: floats = returned array of floats - 1 per line out COMMON BLOCKS: NONE EXAMPLE: IDL> floats = read_floats( 'hans.txt', maxlines=500000 ) NOTES: MODIFICATION HISTORY: 26-Sep-2008 Written by Bill Davis, PPPL
Source: src/idl_cvs/read_generic.pro
src/idl_cvs/read_generic.pro
NAME: read_generic PURPOSE: read an image from a variety of types of files CATEGORY: Files, Graphics CALLING SEQUENCE: IDL> data2D = read_generic( filename ) INPUTS: filename - file name to read in can be type 'jpg','tif','tif','bmp','jpeg,'png', 'ppm', 'pgm', or 'gif' KEYWORD PARAMETERS: Optional output: extension - the file extension, eg., 'jpg' inDim - for .raww files, specify x & y dimensions (Default to [256,128]) nBytesPer- for .raww files, specify number of bytes per data point (Default=2) center - if set, will only return center columns (1/2 of data) OUTPUTS: 2-D data array from file out COMMON BLOCKS: NONE MODIFICATION HISTORY: 17-Jul-2013 return bad status if fails in read_image 15-Apr-2009 added support for .raww type (from Photron cameras) 30-Sep-2008 added channel keyword 25-Apr-2007 added colortable keyword 21-Feb-2007 added ppm file type 19-Apr-2006 replaced keywords with args R,G,B 15-Oct-2004 Written by Bill Davis, PPPL
Source: src/idl_cvs/read_list.pro
src/idl_cvs/read_list.pro
NAME: READ_LIST PURPOSE: Read a list from a text file and return a string array. Will ignore lines beginning with a semicolon, but will will return blank lines. CATEGORY: Files CALLING SEQUENCE: IDL> str_array = READ_LIST(filename) INPUTS: filename = name of file containing lines of ascii data. KEYWORD PARAMETERS: HLP - When set, help information is printed. nskip - lines to skip status - if even, then read was successful OUTPUTS: str_array = returned array of strings - 1 per line out COMMON BLOCKS: NONE EXAMPLE: IDL> str_array = READ_LIST( filename ) NOTES: MODIFICATION HISTORY: 16-Aug-2008 added skipChar keyword 01-Aug-2008 added nskip keyword 13-Apr-2007 added status keyword 11-Apr-06 added maxlines keyword [BD] 1-Apr-99 Written by Bill Davis, PPPL
Source: src/idl_cvs/read_numbers.pro
src/idl_cvs/read_numbers.pro
NAME: read_numbers PURPOSE: Read a numeric array (1-D) from a text file CATEGORY: Files CALLING SEQUENCE: IDL> num_array = read_numbers(filename) INPUTS: filename = name of file containing lines of ascii data. KEYWORD PARAMETERS: nskip - number of lines to skip before reading status - odd, if OK OUTPUTS: num_array = returned array of floating point values COMMON BLOCKS: NONE EXAMPLE: IDL> num_array = read_numbers( filename ) NOTES:; MODIFICATION HISTORY: 28-Feb-2002 Written by Bill Davis, PPPL
Source: src/idl_cvs/read_quoted.pro
src/idl_cvs/read_quoted.pro
NAME: READ_QUOTED PURPOSE: Reads a file and returns anything between first two quotes. CATEGORY: Files CALLING SEQUENCE: IDL> comments = READ_QUOTED(filename) INPUT: filename - e.g., "waveform.DAT" RETURNED: comments - string array with dimension = # of lines read (& not skipped) KEYWORDS delim - quote character, defaults to " nskip - number of lines to skip before reading RETURNED: strings - string array MODIFICATION HISTORY: 16-Aug-2008 added skipChar & status keywords 26-Aug-00 WMD Written
Source: src/idl_cvs/read_table.pro
src/idl_cvs/read_table.pro
NAME: read_table PURPOSE: Reads a table file, like from a spreadsheet. CATEGORY: files CALLING SEQUENCE: IDL> data2d = read_table( filename, nskip=nskip, header=header ) INPUT: filename - e.g., "AMP.DAT" OPTIONAL INPUT: nskip - number of lines to skip before reading (will be returned in header) nCols - # of data values per line maxLines - default=1,000,000 delim - if not tab-delimited, set this to ' ' OPTIONAL OUTPUT: strings - if set, returns a string array, rather than floats RETURNED: Data_2D - nCols x N array EXAMPLE: IDL> data2d=read_table('/u/bdavis/StrachanDB/HiRadEnergyBal.txt', nskip=1, $ header=header, /strings ) LIMITATIONS: Can't handle blanks in fields WRITTEN 25-Feb-2011 by Bill Davis for Jim Strachan
Source: src/idl_cvs/remchar.pro
src/idl_cvs/remchar.pro
NAME: REMCHAR PURPOSE: Remove all appearances of character (char) from string (st) CATEGORY: Strings CALLING SEQUENCE: REMCHAR, ST, CHAR INPUTS: ST - String from which character will be removed. CHAR- Character to be removed from string. EXAMPLE: If a = 'a,b,c,d,e,f,g' then IDL> remchar,a, ',' will give a = 'abcdefg' REVISIONS HISTORY Written D. Lindler October 1986 Test if empty string needs to be returned W. Landsman Feb 1991
Source: src/idl_cvs/remove.pro
src/idl_cvs/remove.pro
NAME: REMOVE PURPOSE: Contract a vector or up to 7 vectors by removing specified elements CATEGORY: Arrays CALLING SEQUENCE: REMOVE, index, v1,[ v2, v3, v4, v5, v6, v7] INPUTS: INDEX - scalar or vector giving the index number of elements to be removed from vectors. Duplicate entries in index are ignored. An error will occur if one attempts to remove all the elements of a vector. INPUT-OUTPUT: v1 - Vector or array. Elements specifed by INDEX will be removed from v1. Upon return v1 will contain N fewer elements, where N is the number of values in INDEX. OPTIONAL INPUT-OUTPUTS: v2,v3,...v7 - additional vectors containing the same number of elements as v1. These will be contracted in the same manner as v1. EXAMPLES: (1) If INDEX = [2,4,6,4] and V = [1,3,4,3,2,5,7,3] then after the call IDL> remove,index,v V will contain the values [1,3,3,5,3] (2) Suppose one has a wavelength vector W, and three associated flux vectors F1, F2, and F3. Remove all points where a quality vector, EPS is negative IDL> bad = where( EPS LT 0, Nbad) IDL> if Nbad GT 0 then remove, bad, w, f1, f2, f3 METHOD: If more than one element is to be removed, then HISTOGRAM is used to generate a 'keep' subscripting vector. To minimize the length of the subscripting vector, it is only computed between the minimum and maximum values of the index. Therefore, the slowest case of REMOVE is when both the first and last element are removed. REVISION HISTORY: Written W. Landsman ST Systems Co. April 28, 1988 Cleaned up code W. Landsman September, 1992 Converted to IDL V5.0 W. Landsman September 1997 Major rewrite for improved speed W. Landsman April 2000
Source: src/idl_cvs/rem_elem.pro
src/idl_cvs/rem_elem.pro
NAME: rem_elem PURPOSE: return subscripts of input array remaining after elements in a second array are removed CATEGORY: Programming INPUT PARAMETERS: inarray - array to search/remove from remarray - array of elements to search/remove from inarray OUTPUT PARAMETERS: count - number of elements (subscripts) returned CALLING SEQUENCE: ss = rem_elem(inarray,remarray) ; subscripts remaining or -1 HISTORY: slf, 20-jan-1993 slf, 7-feb-1993 - documentation carification and variable name change
Source: src/idl_cvs/repchr.pro
src/idl_cvs/repchr.pro
NAME: REPCHR PURPOSE: Replace all occurrences of one character with another in a text string. CATEGORY: Strings CALLING SEQUENCE: new = repchr(old, c1, [c2]) INPUTS: old = original text string. in c1 = character to replace. in c2 = character to replace it with. in default is space. KEYWORD PARAMETERS: OUTPUTS: new = edited string. out COMMON BLOCKS: NOTES: MODIFICATION HISTORY: R. Sterner. 28 Oct, 1986. Johns Hopkins Applied Physics Lab. RES 1 Sep, 1989 --- converted to SUN. R. Sterner, 27 Jan, 1993 --- dropped reference to array. Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory This software may be used, copied, or redistributed as long as it is not sold and this copyright notice is reproduced on each copy made. This routine is provided as is without any express or implied warranties whatsoever. Other limitations apply as described in the file disclaimer.txt.
Source: src/idl_cvs/repstr.pro
src/idl_cvs/repstr.pro
NAME: REPSTR PURPOSE: Replace all occurences of one substring by another. CATEGORY: Strings EXPLANATION: Meant to emulate the string substitution capabilities of text editors CALLING SEQUENCE: result = repstr( obj, in, out ) INPUT PARAMETERS: obj = object string for editing, scalar or array in = substring of 'obj' to be replaced, scalar OPTIONAL INPUT PARMETER: out = what 'in' is replaced with, scalar. If not supplied then out = '', i.e. 'in' is not replaced by anything. KEYWORDS: INSENSITIVE - if set, then replace string regardless of case ("in" will go in without any case changes) OUTPUT PARAMETERS: Result returned as function value. Input object string not changed unless assignment done in calling program. PROCEDURE: Searches for 'in', splits 'obj' into 3 pieces, reassembles with 'out' in place of 'in'. Repeats until all cases done. EXAMPLE: If a = 'I am what I am' then print,repstr(a,'am','was') will give 'I was what I was'. MODIFICATION HISTORY: 18-Nov-2008 added keyword INSENSITIVE 14-Sep-04 made to work! Bill Davis Converted to IDL V5.0 W. Landsman September 1997 Accept vector object strings, W. Landsman HSTX, April, 1996 Written by Robert S. Hill, ST Systems Corp., 12 April 1989.
Source: src/idl_cvs/resample.pro
src/idl_cvs/resample.pro
NAME: resample PURPOSE: Resample a vector with triangular smoothing. CATEGORY: Smoothing CALLING SEQUENCE: smallerVector = resample( VECTOR, nth ) INPUTS: VECTOR = The vector to be smoothed nth = The full width of the window over which the median is determined for each point (if even, use window+1). OUTPUT: Function returns every nth point of the smoothed input vector KEYWORDS: Indices - Optionally returned. Indices of resulting vector Guass - if set, will do psuedo-gaussian weighting, rather than triagular SUBROUTINES CALLED: PROCEDURE: Each point is replaced by triangular weighting of the nearest WINDOW of points. The width of the window shrinks towards the ends of the vector. LIMITATION: This type of looping is inherently slow in IDL. Should make a FORTRAN routine based on BDAVIS$:[IDL.MDS.FOR]BCSMOOTH.FOR or interpwf.for & use a CALL_EXTERNAL REVISION HISTORY: Written, Bill Davis. 23-Mar-00
Source: src/idl_cvs/resetplt.pro
src/idl_cvs/resetplt.pro
NAME: RESETPLT PURPOSE: This procedure will reset all or a selection of the system plot variables to their initial values CATEGORY: Plotting CALLING SEQUENCE: resetplt,/all ;clear the !p, !x, !y, !z resetplt,/x,/z ;clear the !x and !z variables resetplt,/x ;only clear the !x variable resetplt,/x,/invert ;clear all except the !x INPUTS: KEYWORDS: x,y,z,p = clear the appropriate variable all = clear all, this is equivalent to /x,/y,/z,/p invert = invert the logic. Clear all unselected variables. Therefore "clearplt,/all,/invert" does nothing. OUTPUTS: none COMMON BLOCKS: none. SIDE EFFECTS: The sytem plot variables are changed. MODIFICATION HISTORY: Written by: Trevor Harris, Physics Dept., University of Adelaide, July, 1990.
Source: src/idl_cvs/rightyaxislimits.pro
src/idl_cvs/rightyaxislimits.pro
NAME: rightYaxisLimits PURPOSE: Widget to set some Y Axis values for the right-hand axis in mdsw CATEGORY: Graphics, Widgets CALLING SEQUENCE: IDL> rightYaxisLimits INPUTS: none required KEYWORD PARAMETERS: Inputs (Optional): nPlots - # of plots to allow for (def=8) GROUP_LEADER - This widget is destroyed if it's GL is destroyed OUTPUTS: COMMON BLOCKS: rightAxis EXAMPLE: IDL> rightYaxisLimits NOTES: Upgrade could use a user-defined system variable rather than common MODIFICATION HISTORY: 13-Feb-01 Added multiple axes settings 07-Feb-01 Written by Bill Davis, PPPL
Source: src/idl_cvs/right_aspect.pro
src/idl_cvs/right_aspect.pro
NAME: Right_Aspect PURPOSE: Allow contour (or x-y) plots to have the aspect ratio of the data CATEGORY: Graphics USE: IDL> RIGHT_ASPECT, xarray, yarray, IN_POSITION=in_position, $ MARGIN=margin, POSITION=position KEYWORD PARAMETERS: MARGIN: (INPUT) The margin around the edges of the plot. The value must be a floating point value between 0.0 and 0.5. It is expressed in normalized coordinate units. The default margin is 0.15. If margin is a 2-element array, the first value is the left and bottom margin, and the second is the right and top margin. Otherwise, the right and top margin is set to 1/2 the value of margin. IN_POSITION: (INPUT) A 4-element floating array of normalized coordinates. The order of the elements is [x0, y0, x1, y1], similar to the !P.POSITION system variable or the POSITION keyword on any IDL graphic command. Fit resulting contour plot within these limits. POSITION: (OUTPUT) A 4-element floating array of normalized coordinates. The order of the elements is [x0, y0, x1, y1], similar to the !P.POSITION system variable or the POSITION keyword on any IDL graphic command. If not present, will set system variable !p.position. XRANGE_IN & YRANGE_IN: (INPUTS) - hese override ranges in data GetWithZ - if set, plots to Z buffer, and reads back X & Y ticks to determine plot range. EXAMPLE: IDL> xarray=FINDGEN(41) & yarray=FINDGEN(21) IDL> z = DIST(41,21) IDL> in_pos = [.1,.4,.9,.9] ; draw in top part of screen IDL> Right_Aspect, xarray, yarray, IN_POS=in_pos, POSITION=out_pos IDL> CONTOUR, z, xarray, yarray, XSTYLE=1,YSTYLE=1, $ XMARGIN=[0,0], YMARGIN=[0,0], POSITION=out_pos LIMITATIONS: if the POSITION keyword is not used, then the !P.POSITION variable will be set after calling this routine. So, after plotting, do this: IDL> !P.POSITION = [0,0,0,0] MODIFICATIONS: 03-Feb-2010 added GetWithZ keyword. 07-Dec-2006 Added xrange_in & yrange_in keywords. These override ranges in data 28-May-03 Added keyword In_Position. Should now work when partial screen specified. 04-Apr-01 Do like David Fanning routine, ASPECT, so will work with A4 paper 14-Mar-01 Take into account !p.multi settings when computing !p.position Also remove adjustment for x & y pixel number differences. Add POSITION keyword (not fully tested)
Source: src/idl_cvs/rmfilesbydate.pro
src/idl_cvs/rmfilesbydate.pro
NAME: rmfilesbydate PURPOSE: Remove files not modified since a certain date CATEGORY: Files, Dates CALLING SEQUENCE: IDL> rmfilesbydate, path=path, prefix=prefix, ext=ext, date=date INPUTS: none KEYWORD PARAMETERS: path - directory prefix - file prefix for deletion ext - file extension for deletion; file search will be path+prefix+'*.'+ext date - date for search, of form yyyymmdd, e.g., 20050617 (default=TODAY) daysbefore - optional additional number of days before date verbose - if set, will print informational output justprint - if set, will not remove files OUTPUTS: none COMMON BLOCKS: NONE EXAMPLE: IDL> NOTES: for safety, on Unix, you may wish to create a ~/Trash directory and alias rm to /bin/mv !* ~/Trash LIMITATIONS MODIFICATION HISTORY: 22-Aug-2005 Written by Bill Davis, PPPL
Source: src/idl_cvs/roundedaxislimits.pro
src/idl_cvs/roundedaxislimits.pro
NAME: roundedAxisLimits PURPOSE: Find "nice" axis values, like IDL plot routine does. CATEGORY: Plotting CALLING SEQUENCE: v = roundedAxisLimits(x1,x2) INPUTS: x1 = Range minimum. in x2 = Range maximum. in KEYWORD PARAMETERS: OUTPUTS: v = 2-element array of "nice" axis limits. out COMMON BLOCKS: LIMITATION: IDL> print,roundedaxislimits(0.0,.11) 0.00000 0.120000 OK, but IDL> print,roundedaxislimits(0.0,.12) 0.00000 0.125000 why not 0.12? NOTES: includes routines copyrighted by Johns Hopkins University (see below) MODIFICATION HISTORY: 26-Jul-04 Written by Bill Davis
Source: src/idl_cvs/runtot.pro
src/idl_cvs/runtot.pro
NAME: runTot PURPOSE: compute a running total of an array by calling an external routine (this is inefficient in normal IDL) CATEGORY: Math CALLING SEQUENCE: IDL> outarray = runTot(inarray) INPUTS: inarray = a numeric array. KEYWORD PARAMETERS: Keywords: HLP - When set, help information is printed. OUTPUTS: outarray = returned array of running total out COMMON BLOCKS: NONE EXAMPLE: IDL> print, runtot(findgen(10)) IDL> MDSOPEN, 'operations', 100601 IDL> ip = MDSVALUE( '\operations::ip_ipf1b_1' ) IDL> V = runTot( ip ) NOTES: When the routine is called with no parameters, or with the keyword hlp set, help information is printed. MODIFICATION HISTORY: 04-Oct-99 Written by Bill Davis, PPPL
Source: src/idl_cvs/sametype.pro
src/idl_cvs/sametype.pro
NAME: sameType PURPOSE: make two variables the same numerical type CATEGORY: Programming CALLING SEQUENCE: IDL> sametype, x, y INPUTS: inputs - numerical scalars or arrays (not for structures or strings) OUTPUTS: inputs are re-typed, as needed MODIFICATION HISTORY: 30-Jan-2007 Written by Bill Davis, PPPL
Source: src/idl_cvs/saveblobs.pro
src/idl_cvs/saveblobs.pro
NAME: saveblobs PURPOSE: Save blob tracks, just like FCplayer, but easier and faster. Usually called from LoadBlobs.pro. CATEGORY: blobs CALLING SEQUENCE: IDL> saveblobs, filename INPUTS: filename - a .cin or .hdf file containing plasma images KEYWORD PARAMETERS: filename - cine file to analyze outfilename - output of text with blob info (default formed from inputs) t1 & t2 - time range to load (in sec) aveT1 - start for averaging frame (DEF=t1) (in sec) aveT2 - ending time for averaging frame (DEF=t2) horiz - if=0, do not flip frames horizontally RotCCW - if set, will rotate frame Counter-clockwise (after horizontal flip) default for NSTX, but not for CMOD BlobCriteria - structure for blob criteria, like min normalized height, etc. nSmooth - amount to smooth image before looking for blobs GaussSmooth - if set, will do "gaussian" smoothing (sort of a double smooth) instead of boxcar smoothing FrameOffset - if set, subtract this (like a baseline) from all pixels FrameAveMin - if set, make close-to-zero pixels this number, so when dividing into data, as in normalizing, result is near zero AveFrameSmooth - smoothing for the averaged frame(s) FrameAveDeltaMS - make frames used for normalizing an average of this many millisec EXAMPLES: saveblobs, T1=0, T2=20, /verb, $ '/p/gpi/szweben/Phantom_Data/2009_Phantom_data/1091216/shot_1091216030.cin' '/p/gpi/szweben/Phantom_Data/2010_data/1100120/shot_1100120025.cin' saveblobs, T1=90, T2=92, /verb, $ '/p/gpi/szweben/Phantom_Data/2009_Phantom_data/1110114/1110114026.cin' saveblos, '/u/bdavis/Blobs/solt_012_3.5b.hdf', shot=99901203, norm=0 MODIFICATION HISTORY: 12-Nov-2012 added FrameAveDeltaMS keyword and feature to have an average for a particular frame just be over this # of milliseconds.q 17-May-2012 several updates to receive parameters to output to file 01-Mar-2012 decided not to smooth average frame WRITTEN 09-Feb-2012 by Bill Davis, PPPL, for Stewart Zweben
Source: src/idl_cvs/screendump.pro
src/idl_cvs/screendump.pro
NAME: screendump PURPOSE: Postscript file from an IDL window, whether 8- or 24-bit graphics CATEGORY: Printing, 24-bit graphics CALLING SEQUENCE: IDL> screendump, filename, Encapsulated=encapsulated INPUTS: filename (or will be prompted) KEYWORD PARAMETERS: Keywords: Encapsulated - if set, will get encapsulated postscript Right_Aspect - if set, will maintain aspect ration of window OUTPUTS: just the output file MODIFICATION HISTORY: 09-May-02 Added bits_per_pixel=8 when not true color [BD] still not working in 24-bit color (???) 27-Jun-02 Added Right_Aspect keyword [BD] 07-Mar-02 Added landscape determination [BD] ?? Written by David Fanning, www.dfanning.com.
Source: src/idl_cvs/screen_title.pro
src/idl_cvs/screen_title.pro
NAME: screen_title PURPOSE: write a plot title with shot date and time and NSTX label CATEGORY: Plotting CALLING SEQUENCE: IDL> screen_title, mytitle, ishot INPUTS: mytitle = whatever you want as the main plot title. ishot = shot number. KEYWORD PARAMETERS: Keywords: noShot - if set, do not plot shot number noTime - if set, do not plot time charsize - character size logo - if = 0 will not put logo on plot nstx - if - 0 will not put =NSTX= logo on plot, vs. just NSTX ALIGNMENT - alignment of title. Default to 0.5 (centered) HLP - When set, help information is printed. OUTPUTS: none COMMON BLOCKS: NONE EXAMPLE: IDL> !Y.OMARGIN=[0,1] IDL> plot,indgen(100) IDL> screen_title, 'This is my title', 100523 NOTES: You'll probably want a little more room at the top of your plots, e.g. IDL> !Y.OMARGIN=[0,1] MODIFICATION HISTORY: 13-Aug-2009 fixed logic for mptscam.pro 17-Sep-2008 added logo and alignment keywords 30-Jun-2008 added charsize and NSTX keywords 21-Sep-00 Written by Bill Davis, PPPL
Source: src/idl_cvs/sdev.pro
src/idl_cvs/sdev.pro
NAME: SDEV PURPOSE: Returns standard deviation of an array. CATEGORY: Math CALLING SEQUENCE: s = sdev(a) INPUTS: a = input array. in KEYWORD PARAMETERS: OUTPUTS: s = standard deviation of a. out COMMON BLOCKS: NOTES: MODIFICATION HISTORY: 01-Aug-00 Commented-out checks for a major speed up. [BD] Written by K. Kostoff, 1/16/85 Johns Hopkins University Applied Physics Laboratory. Modified by B. Gotwols, R. Sterner --- 1 Oct, 1986. Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory This software may be used, copied, or redistributed as long as it is not sold and this copyright notice is reproduced on each copy made. This routine is provided as is without any express or implied warranties whatsoever. Other limitations apply as described in the file disclaimer.txt.
Source: src/idl_cvs/searchmdsnodes.pro
src/idl_cvs/searchmdsnodes.pro
NAME: SearchMDSNodes PURPOSE: Search MDSplus nodes for string contents CATEGORY: MDSplus, Searching CALLING SEQUENCE: IDL> paths= SearchMDSNodes( str[, sensitivity, text=text][,path=path]) INPUTS: str - string to search on sensitivity - (Optional) if ='Sensitive', then make search case sensitive KEYWORD PARAMETERS: Input (Optional): JustText - if set, just look for Text nodes (no effect if /TAGS set) nonNodeStr - exclude nodes in returned array if this string found in name tags - if set, just look for nodes with tags sizesearch - when searching text, length of string to check (def=1024) whatToSearch - = 'NAMES', 'TEXT', or 'TDI' treeName - MDSplus tree. Default='NSTX' shot - MDSplus shot to search. Default=-1 (the model tree). server - MDSplus server. Default is the default NSTX data server. Returned (Optional): text (contains the full text found), path(returns the full path to the text) isSignal - logical array where 1s indicate corresponding node is a signal status - status from mdsvalue call OUTPUTS: result - status of function: 0 = success, -1 = failed to find COMMON BLOCKS: none EXAMPLE: IDL> paths=SearchMDSNodes('xray', text=text ) NOTES: tree must already be open before SearchMDSNodes can be called if no records are found in current tree returns -1 else returns 0 MODIFICATION HISTORY: 06-May-2010 added max2search keyword 20-Apr-2010 added keyword isSignal 11-Nov-05 Added tree keyword 01-Dec-00 Added capability for wildcards in search string 10-Nov-00 Added sensitivity [BD] 7-Feb-00 Written by Dana Mastrovito, PPPL
Source: src/idl_cvs/searchtextnodes.pro
src/idl_cvs/searchtextnodes.pro
NAME: SearchTextNodes PURPOSE: Search MDS Plus Trees for Textual Data CATEGORY: MDSplus, Searching CALLING SEQUENCE: IDL> result= SearchTextNodes( keyword[, sensitivity, text=text][,path=path]) INPUTS: keyword - string to search on sensitivity - (Optional) if ='Sensitive', then make search case sensitive KEYWORD PARAMETERS: text (contains the full text found), path(returns the full path to the text) OUTPUTS: result - status of function: 0 = success, -1 = failed to find COMMON BLOCKS: none EXAMPLE: IDL> result=SearchTextNodes('xray', text=text,path=path) NOTES: tree must already be open before tsearch can be called if no records are found in current tree returns -1 else returns 0 MODIFICATION HISTORY: 01-Dec-00 Added capability for wildcards in search string 10-Nov-00 Added sensitivity [BD] 7-Feb-00 Written by Dana Mastrovito, PPPL
Source: src/idl_cvs/select_font.pro
src/idl_cvs/select_font.pro
NAME: SELECT_FONT Purpose: Select a Unix hardware font for IDL graphics. Category: Utility, Fonts Usage: SELECT_FONT Input: None required. Optional Keywords: /HELVETICA Select a Helvetica font (default) /TIMES Select a Times font /PALATINO Select a Palatino font /COURIER Select a Courier font /BOLD Select a bold font (default is no bold) /ITALIC Select and italic font (default is no italics) SIZE If set to a named variable, sets the font size (default=12) NAME If set to a named variable, returns the font name selected Revised: 17-OCT-1997 Liam Gumley, CIMSS/SSEC Created Notes: (1) This procedure currently only works on Unix IDL platforms. (2) The NAME value returned by SELECT_FONT can be used to set the default widget font by the command Example: !P.MULTI=[0,1,2,0,0] PLOT,INDGEN(10) SELECT_FONT,/BOLD PLOT,INDGEN(10) NOTE: this version is only for Unix at the moment
Source: src/idl_cvs/sepvstime.pro
src/idl_cvs/sepvstime.pro
NAME: sepvstime PURPOSE: Get the separtrix (last closed flux surface) R & Z values vs. time. from EFIT or LRDfit for a particular NSTX or CMOD shot. Can also return R & Z of limiter interior. CATEGORY: EFIT, NSTX CALLING SEQUENCE: IDL> sepvstime, shot, trange=trange, Redge=Redge, Zedge=Zedge INPUTS: shot - shot number for MDSplus call KEYWORD PARAMETERS: Optional Inputs: tRange - range of times desired (defaults to all available) fit - fit desired. Default is "best fit" outer - if set will just return edge values > median value (default) inner - if set will just return edge values <= median value verbose - if set, will print many informational messages debug - if set, debug output will be printed Returned: RedgeVsTime - r values of separatrix (edge) points ZedgeVsTime - z values of separatrix points used_fit - the fit used tFit - times of the fit nPerTime - # of good values in corresponding time element of arrays EXAMPLE: to get get R & Z data: IDL> sepvstime, 138847, RedgeVsTime=R, ZedgeVsTime=Z MODIFICATION HISTORY: WRITTEN 05-Jun-2013 by Bill Davis for Stewart Zweben
Source: src/idl_cvs/setmdsshotevent.pro
src/idl_cvs/setmdsshotevent.pro
NAME: setmdsshotevent PURPOSE: set an MDS event with shot number associated with the event CATEGORY: MDSplus, Events CALLING SEQUENCE: IDL> setmdsshotevent, eventName [, shot_num] INPUTS: eventName - string of MDS event name, e.g., 'NE_DENSITY_CALC' shot_num - NSTX shot number (OPTIONAL -- will default to current shot) KEYWORD PARAMETERS: Optional: VERBOSE - If set, print debugging information NOCONNECT - if set, will not try to connect to an MDSplus server SERVER - if not set, will connect to default server in OpenMDSshot STATUS = return status, low bit set = success OUTPUTS: none -- just sets the event COMMON BLOCKS: NONE EXAMPLE: NOTES: Works from Unix or VMS MODIFICATION HISTORY: 17-Dec-2008 don't try to fill valBlk if shot_num not a number [bd] 11-Nov-2008 Default to no mdsconnect [BD] 02-Nov-2008 Added status keword. 11-Feb-04 use SETEVENT in MDSVALUE on Unix. Add connect option on unix. 20-Dec-99 Written [bd]
Source: src/idl_cvs/setpmulti.pro
src/idl_cvs/setpmulti.pro
NAME: setpmulti PURPOSE: partition the screen into different graphs if 7 or less plot boxes, then 1 column of plots if more than 7 plot boxes, then 2 columns of plots CATEGORY: Graphics, Color Specification. CALLING SEQUENCE: setpmulti, nboxes setpmulti, nboxes, /SameXTitles setpmulti, nboxes, /SameXTitles, /sameXlabels, /SamePTitles INPUTS: nboxes: number of plot boxes per page KEYWORD PARAMETERS: CharSize : Value desired for !P.CHARSIZE, else guesses SameXTitles: If set and non-zero, just place xtitle at bottom (This reserves less vertical space between plots) SamePTitles: If set and non-zero, just place title at top (This reserves less vertical space between plots) SameXlabels: If set and non-zero, just label x-axis at bottom (This reserves less vertical space between plots) NRows : Maximum number of rows (default is 7) COMMON BLOCKS: SetPMulti_Local SIDE EFFECTS: Leaves !P.MULTI set unless you call UnSetPMulti. Changes character sizes, etc. MODIFICATION HISTORY: 01-May-01 fix for # of rows and columns 24-Jan-01 Don't force !x.margin[1] to 3. Only reduce this for multi- columns if !x.margin[1] = 3. 11-Jan-01 Undid setting of !y.ticks, because can't force axis then 21-Nov-00 Fine tuned !y.multi values; if no columns, make x.margin[1]=3 18-Sep-00 Corrected SamePtitle keyword use 24-Jun-99 changed charsize when more than one plot (to 1.4 if rows or cols > 2) 03-Jun-99 added CHARSIZE keyword [BD] Jan-99 - Written by Bill Davis
Source: src/idl_cvs/setup_ps.pro
src/idl_cvs/setup_ps.pro
NAME: setup_ps PURPOSE: open postscript file and set system variables for postscript device CATEGORY: Printing CALLING SEQUENCE: SETUP_PS, name, PRINTER=printer INPUTS: (Optional) name - name of file (defaults to IDL) (if no extention, will add .ps) KEYWORD PARAMETERS: Optional Inputs: PRINTER - printer to send file to (else will be default printer) NOTE: if PRINTER begins with postscript', file will not be sent to a printer PORTRAIT - If set, print is in portrait mode FONT - font for printing, e.g., TIMES, HELVETICA, AVANTGARDE, BKMAN, BOLD, PALATINO, ZAPFCHANCERY, NARROW (Default is Times) COLOR - if set, postscript will be in color AspectRatio - if set, Ascpect ratio of image is maintained CharMagnification - magnify !p.charsize (or, if !p.charsize=0, use as charsize) xsize - size in inches (defaults to page size -1.5) ysize - size in inches (defaults to page size -1.5) tt_font bold OUTPUTS: none CALLING EXAMPLE: printer = 'picasso color printer' ; or printer = 'postscript color ' ; or printer = 'b143 Laserwriter in B143' ; or printer = 'default printer' ; setup_ps,'myplot', PRINTER=printer plot,indgen(11) ; any number of plot commands unsetup_ps ; send to printer and back to X RELATED ROUTINES: unsetup_ps SIDE EFFECTS: System variables are changed until unsetup_ps is called. NOTE: If you haven't already, you may wish to plot on a white background, e.g., IDL> !p.background=MK_COLOR('white') IDL> !p.color=MK_COLOR('black') MODICATION HISTORY: 30-Oct-2009 default to COLOR if postscript output 07-May-08 fixed when /ASPECTRATIO made plot bigger than one dimension 19-Apr-04 Added Filename keyword 03-Aug-01 Append .ps to output filename if not specified 04-Apr-01 make max paper width 8.25 to account for A4 paper size. make margins 3/4" (rather than 1") 21-May-99 Added Font keyword (default changed to Times) [BD] 1-Apr-99 Added Portrait Keyword [BD] 12-Feb-99 Write file in the login area. Don't send to D4D area. [BD] Printer can have "color" after the name (following a space) 27-Jan-99 BD - change y.margin settings 10/15/97 BD - Removed bold fonts and set to landscape mode 10/13/97 TBT - Added phaser5 6/11/97 TBT - took out printer from discolor and added as a keyword 5/22/97 TBT - added phaser4 & phaser4_trans & hpdj2 5/21/97 TBT - added include discolor to get printer passed in. 5/21/97 Ted Terpstra - Put in color printer check & added phaser2 and phaser3 to the list. 5-16-95 K. Greene -- When setting up output file name, check operating system. VMS cannot use Unix format.
Source: src/idl_cvs/setup_tek.pro
src/idl_cvs/setup_tek.pro
NAME: setup_tek PURPOSE: Set system variables for tektronix device. Use to direct plots to the Tek window in Versaterm, or to XTC. CATEGORY: Graphics, Cross-platform plotting CALLING SEQUENCE: setup_tek INPUTS: KEYWORD PARAMETERS: Optional Inputs: CharMagnification - magnify !p.charsize (or, if !p.charsize=0, use as charsize) OUTPUTS: none CALLING EXAMPLE: setup_tek plot,indgen(11) ; any number of plot commands unsetup_tek ; send to printer and back to X setup_tek, /xtc ; use Tektronix simulator on X plot,indgen(11) ; any number of plot commands unsetup_tek ; send to printer and back to X RELATED ROUTINES: unsetup_tek LIMITATIONS: Y-axis ticklabels may overlay the axis. If so, you may use: IDL> plot, x, y, YTICKFORMAT='betterticklabels', ... SIDE EFFECTS: System variables are changed until unsetup_tek is called. NOTE: see http://w3.pppl.gov/~pshare/help/xtc.htm MODICATION HISTORY: 12-Sep-2008 change "/bin/ps -auxw" to "/bin/ps auxw" 28-Jun-2006 allow for different complier loading in .cshrc 13-Feb-2006 add XTC calls 26-Oct-2000 Written by Bill Davis
Source: src/idl_cvs/setup_xpc.pro
src/idl_cvs/setup_xpc.pro
NAME: setup_xpc PURPOSE: Use to direct postscript plots to the X-windows Plot Controller (XPC). CATEGORY: Graphics, Postscript CALLING SEQUENCE: setup_xpc INPUTS: KEYWORD PARAMETERS (all optional): SETUP_PS Keywords: PORTRAIT - If set, print is in portrait mode FONT - font for printing, e.g., TIMES, HELVETICA, AVANTGARDE, BKMAN, BOLD, PALATINO, ZAPFCHANCERY, NARROW (Default is Times) AspectRatio - if set, Ascpect ratio of image is maintained CharMagnification - magnify !p.charsize (or, if !p.charsize=0, use as charsize) xsize ysize XPC keywords: scratchDir - defaults to /loca/$USER/tmpdir (or value of $TMPDIR) programs running on different computers will have differnt areas. This must be the same used by the plotting-control software, setup_xpc.pro. NODELETE - if set, files in sractchDir (from previous invocation) are not deleted when application is started. TITLE: A scalar string to be used for the window title. NFILES - # of files to show at one time in window (def=10) filter - search filter for plots to show in window (def=XPC_*.ps) psPlotFile - file with plotting application keeps plotting (def=scratchDir+'/GV2plot.ps') psApp - file plotting application (def="gv") appSwitch - switch for file plotting application (def="--watch") updateTime - time in seconds between checks to see if list needs refreshed (def=0.5) ext - file extensions to look for (def='ps') OUTPUTS: establishes XPC window CALLING EXAMPLE: setup_xpc ; xpc and gv windows should appear PLOT, indgen(11) ; any number of plot commands XYOUT, .2, .3, 'This is a Label' unsetup_xpc ; close ps file PROCEDURE: (see xpc.pro) RELATED ROUTINES: xpc unsetup_xpc LIMITATIONS: Y-axis ticklabels may overlay the axis. If so, you may use: IDL> plot, x, y, YTICKFORMAT='betterticklabels', ... This system assumes that /local disks are unique to each system. SIDE EFFECTS: Post script files (default of 10) are written to ~/XPC_scratch NOTE: This, in conjunction with unsetup_xpc, is supposed to be a replacement for XTC. see http://w3.pppl.gov/~pshare/help/xtc.htm MODICATION HISTORY: 09-Jul-2011 don't use /local, so can be used from different computers 18-Nov-2009 Written by Bill Davis
Source: src/idl_cvs/shade_surfrange.pro
src/idl_cvs/shade_surfrange.pro
NAME: shade_surfrange PURPOSE: make SHADE_SURF plots with x & y ranges (correctly) CATEGORY: 2-D Plotting CALLING SEQUENCE: shade_surfrange, f, x, y, XRANGE=xrange, YRANGE=yrange, _EXTRA =_extra INPUTS: f, x & y are just as for surf in KEYWORD PARAMETERS Input: XRANGE - array containing min x & max x YRANGE - array containing min y & max y ZRANGE - array containing min y & max y _EXTRA - standard idl EXTRA keyworrd OUTPUTS: none EXAMPLE: x=findgen(100) y=x f=DIST(100) _EXTRA = { title: 'My Title', $ ; pass any extra SHADE_SURF keywords here xtitle: 'seconds', $ ax : 40 } shade_surfrange, f, x, y, xrange=[20,40], yrange=[50,70], _EXTRA =_EXTRA COMMON BLOCKS: NOTES: If your are using color tables with reserved colors at the the top, e.g., if you use mk_color, you should first call: IDL> dum=mk_color(n_nonfixed=ncolors) IDL> set_shading, values=[0,ncolors-1] skirt doesn't seem to work MODIFICATION HISTORY: 09-Jul-02 Handle when yrange or xrange reversed (i.e., first > last) 17-Aug-01 Handle correctly when !z.range set 17-Oct-00 Written by Bill Davis
Source: src/idl_cvs/shockvstime.pro
src/idl_cvs/shockvstime.pro
NAME: shockvstime PURPOSE: Stack plots of a line from the center of .cin file image at various times See http://nstx.pppl.gov/nstx/Software/Help/shockwaves.html for sample images. After plotting, ou will be prompted for times for which calculate the speed of the leading edge of the shockwave. CATEGORY: Image Processing, CINE files. CALLING SEQUENCE: IDL> shockvstime, filename INPUTS: filename - a .cin file KEYWORD PARAMETERS: INPUTS: filename - .cin filename title - will default to 'Shock Wave at various times' times - times entered in msec (are seconds in file) jline - vertical index in image to use for line plot. Defaults to 25 addIn - vertical space between plots inc - increment between files to plot (defaults to 1, which plots all) gradient - if set, uses a gradient color palette flatFrac - see leadingedge.pro deltaPercent - see leadingedge.pro edge - if set, draw symbol at leading edge of shockwave (defined by point of increase after a long flat portion. cmPerPixel - centimeters per pixel (Default=0.2423) debug - if set, will stop RETURNED: allData - returns all the data within the time specified OUTPUTS: none. EXAMPLE: To get a postscript file: IDL> setup_ps, filename='shockvstime.ps', /color IDL> shockvstime IDL> unsetup_ps surftime=findgen(145)/145*(0.00119100-0.000773)*1000 +1.191 surfx =findgen(128) surf = interpPeak(allData) for j=1,2 do surf = interpPeak(surf) save,surfx,surfTime,surf, file='Surf_50ma.sav' shockvstime, /edge, inc=3 MODIFICATION HISTORY: 18-Jun-2009 Written by Bill Davis, PPPL, for Lane Roquemore
Source: src/idl_cvs/shotattime.pro
src/idl_cvs/shotattime.pro
NAME: shotAtTime PURPOSE: find the NSTX shot number closest to a certain time CATEGORY: Dates, MDSplus CALLING SEQUENCE: IDL> shot = MDSshotDate( date, time ) INPUTS: date - e.g. '2009/2/10' or '15-Oct-2010' time - e.g., '12:13' OUTPUT: shot - NSTX shot number, probably 6 digits NOTES: Looks up shot range for the year and then does a binary search to find the nearest shot number to the input time. EXAMPLE: IDL> date='2009/2/10' & time='12:13' IDL> print, shotattime( date, time ) 131441 31-May-2011 WRITTEN by Bill Davis, PPPL, for Doug Darrow
Source: src/idl_cvs/shotduration.pro
src/idl_cvs/shotduration.pro
NAME: ShotDuration PURPOSE: Return the Shot Duration in seconds CATEGORY: MDSplus CALLING SEQUENCE: IDL> seconds = ShotDuration(ishot, IpNeeded=IpNeeded, IpSignal=IpSignal, $ RoundUp=RoundUp) INPUTS: ishot - shot number. If not supplied, will use current shot KEYWORD PARAMETERS: Keywords: IpNeeded - plamsa current in kiloAmps to be considered real (default=50) IpSignal - mdsplus signal to use to determine plasma current default = \wf::ip NOTE if signal is not in kiloAmps, divide or multiply by correct factor InSignal - input Ip signal, so doesn't have to be read maxValue - returns max plasma current in KA. nSmooth - the amount to smooth Ip signal before checking the value Default = 11 points. RoundUp - if set, add 0.1 seconds and round up to nearest 0.1 seconds quiet - if not set, quiet realquiet - if set, no "MDSOPEN success" message Verbose - if set, print debugging information Server - MDS server (default is for NSTX) HLP - When set, help information is printed. OUTPUTS: seconds out COMMON BLOCKS: NONE EXAMPLE: IDL> opt = ShotDuration( IpNeeded=5, IpSignal='\engineering::ip2' ) to load a scalar with the shot duration time, IDL> for i=shot1,shot2 do d=ShotDuration( i, outSig='\nstx::shotduration' ) NOTES: MODIFICATION HISTORY: 07-Oct-2009 fixed bug recently introduced when reading default signal. 05-Mar-2008 Allow Ip to be passed in 18-Feb-2008 Account for WF tree, but no \IP 06-Feb-2008 replaced openMDSshot with mdsopen [BD] 25-Apr-2006 added MaxValue (for Ip) keyword 29-Aug-2005 nSmooth keyword added 28-Jul-2004 added realquiet keyword 08-Apr-2004 Written by Bill Davis, PPPL
Source: src/idl_cvs/shotsoffiles.pro
src/idl_cvs/shotsoffiles.pro
>> TIMES RETURNED FROM FILE_INFO AREN'T CORRECT!!!!!!!! NAME: shotsOfFiles PURPOSE: Return MDSplus shots (based on creation time) of files CATEGORY: dates, MDSplus CALLING SEQUENCE: IDL> shots = shotsOfFiles( rundate ) INPUTS: files - array of files, or scalar string which may contain wild cards KEYWORD PARAMETERS: dates - dates (LONG) of files in YYYYMMDD (e.g., 20061231) times - time of day of file, e.g., 23:59:59 seconds - seconds since midnight of time of file creation delta_seconds - time of shot minus time of file creation outfiles - files corresponding to shots out (useful when wild cards used) beforeSeconds - seconds before shot to count as that shot (Default=60) verbose - if set, will print informational output OUTPUTS: shots - array of shot numbers associated with files EXAMPLE: IDL> shots=shotsOfFiles( '*.dat',dates=dates,times=times,out=outfiles ) IDL> d=read_cih(filename, shot=120337, filedate=filedate2,filetime=filetime2) IDL> print,shotsoffiles( filename) NOTES: On Windows, in IDL v. 6.2 and before, when running during Daylight Savings time, for files created before DST, use keyword addSeconds=-3600 MODIFICATION HISTORY: 31-Mar-2006 Written by Bill Davis, PPPL
Source: src/idl_cvs/show3m.pro
src/idl_cvs/show3m.pro
NAME: SHOW3m PURPOSE: Show a 2D array three ways in a display that combines SURFACE, CONTOUR, and an image (color/gray scale pixels). CATEGORY: 2-D Plotting, Graphics, Image Processing. CALLING SEQUENCE: SHOW3m, Image [, INTERP = Interp, SSCALE = Sscale] INPUTS: Image: The 2-dimensional array to display. OPTIONAL INPUTS: X = a vector containing the X values of each column of Image. If omitted, columns have X values 0, 1, ..., Ncolumns-1. Y = a vector containing the Y values of each row of Image. If omitted, columns have Y values 0, 1, ..., Nrows-1. KEYWORD PARAMETERS: INTERP: Set this keyword to use bilinear interpolation on the pixel display. This technique is slightly slower, but for small images, it makes a better display. SSCALE: Reduction scale for surface. The default is 1. If this keyword is set to a value other than 1, the array size is reduced by this factor for the surface display. That is, the number of points used to draw the wire-mesh surface is reduced. If the array dimensions are not an integral multiple of SSCALE, the image is reduced to the next smaller multiple. E_CONTOUR: a structure containing additional keyword parameters that are passed to the CONTOUR procedure. See the example below. E_SURFACE: a structure containing additional keyword parameters that are passed to the SURFACE procedure. See the example below. TITLE: Top plot title XTITLE: x-axis title YTITLE: y-axis title FLOOR: if = 0, will not show color contours on floor CHARTHICK; character thickness on color bar DRAWLINES: draw lines to indicate a region of interest DRAWBOX : draw box around region of interest BOXYMID: y-mid point of box, an line location (default=0.1) BOXXMID: x-mid point of box, an line location (default=1) BOXWIDTH: width of box (default=0.1) BAR: if = 0, will not draw color bar C_COLOR: colors for contours OUTPUTS: No explicit outputs. EXAMPLE: IDL> gp, '/u/bdavis/MarthRedi/kineticballooning.txt' SIDE EFFECTS: A new plot is generated. RESTRICTIONS: The display gets too "busy" when displaying larger (say 50 by 50), images, especially if they are noisy. It can be helpful to use the SSCALE keyword or the SMOOTH and/or REBIN functions to smooth the surface plot. You might want to modify the calls to CONTOUR and SURFACE slightly to customize the display to your tastes, i.e., with different colors, skirts, linestyles, contour levels, etc. PROCEDURE: First, do a SURFACE with no data to establish the 3D to 2D scaling. Then convert the coordinates of the corner pixels of the array to 2D. Use POLYWARP to get the warping polynomial to warp the 2D image into the area underneath the SURFACE plot. Output the image, output the surface (with data) and then output the contour plot at the top (z=1). EXAMPLES: A = BESELJ(SHIFT(DIST(30,20), 15, 10)/2.,0) ;Array for example SHOW3, A ;Show it with default display. SHOW3, A, SQRT(FINDGEN(30)) ;Make X axis proportional to sqrt SHOW3, A, E_CONTOUR={C_CHARSIZE:2, DONW:1} ;Label CONTOUR lines with double size characters, and include downhill tick marks. SHOW3, A, E_SURFACE={SKIRT:-1, ZRANGE:[-2,2]} ;Draw a surface with a skirt and scale Z axis from -2 to 2. MODIFICATION HISTORY: DMS. Jan, 1988. Added fudges for PostScript, April, 1988. Fixed bug where contour plot was occasionally clipped. Dec, 1990. Added optional axis variables, and _EXTRA keywords for CONTOUR, and SURFACE. Jan, 1996. DD. Added code to ignore !ORDER for the TV of the image. Mar 1997. SJL Fixed bug from scaling with polywarp. July, 1998. DD. Add better support for TrueColor devices. Honor !P.BACKGROUND (rather than assuming black or white background). Sept, 2000. Feb/2005 hacked by Bill Davis for Martha Redi: better scaling of bottom image. Added lines and a square to indicate region. When bottom values are zero, make white (transparent). Add color bar.
Source: src/idl_cvs/showbits.pro
src/idl_cvs/showbits.pro
NAME: showbits PURPOSE: Given a byte or integer, return a vector of 8 or 16 values which are the binary representation of the value. CATEGORY: Bits, Hardware USAGE: bitarr = SHOWBITS( invalue, /print ) INPUT: invalue - The byte or integer value to check OUTPUT: bitarr - The 8-element array with values set if the bit is set KEYWORDS: (Optional) NtoShow - # of bits to show HISTORY: 29-Oct-99 Converted to Function by Bill Davis, ntoshow added Written 1988 by M.Morrison 13-Nov-92 (MDM) - Modified to allow integer*2 values and to allow an array of values. 7-Apr-94 (MDM) - Allow integer*4 values 15-Aug-94 (MDM) - Corrected error from 7-Apr-94 mod which did not allow an array of inputs LIMITATIONS: Only works for non-negative, fixed-point numbers
Source: src/idl_cvs/sign.pro
src/idl_cvs/sign.pro
NAME: SIGN VERSION: 3.0 PURPOSE: Gives the sign of X, i.e. 1 for positive, -1 for negative, 0 for 0. CATEGORY: Math CALLING SEQUENCE: Result = SIGN(X) INPUTS: X Numerical, otherwise arbitrary. OPTIONAL INPUT PARAMETERS: None. KEYWORD PARAMETERS: None. OUTPUTS: Returns the value of SIGN(X), see above, as an long integer. OPTIONAL OUTPUT PARAMETERS: None. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: For complex X the result is SIGN(REAL(X)), the imaginary part is ignored PROCEDURE: Straightforward. Using CAST from MIDL. MODIFICATION HISTORY: Created 15-JUL-1991 by Mati Meron. Modified 25-DEC-1991 by Mati Meron. Modified 5-DEC-1993 by Mati Meron. Output type changed to LONG.
Source: src/idl_cvs/simp.pro
src/idl_cvs/simp.pro
NAME: SIMP PURPOSE: Does Simpson numerical integration on an array of y values. CATEGORY: CALLING SEQUENCE: i = simp(y, h) INPUTS: y = array of y values of function. in h = separation between evenly spaced x values. in KEYWORD PARAMETERS: OUTPUTS: i = value of integral. out COMMON BLOCKS: NOTES: MODIFICATION HISTORY: R. Sterner, 19 Dec, 1984. Johns Hopkins University Applied Physics Laboratory. Copyright (C) 1984, Johns Hopkins University/Applied Physics Laboratory This software may be used, copied, or redistributed as long as it is not sold and this copyright notice is reproduced on each copy made. This routine is provided as is without any express or implied warranties whatsoever. Other limitations apply as described in the file disclaimer.txt.
Source: src/idl_cvs/size_struct.pro
src/idl_cvs/size_struct.pro
NAME: SIZE_STRUCT PURPOSE: Obtain the size in bytes of an IDL structure definition. CATEGORY: Programming CALLING SEQUENCE: bytes = size_struct( structure ) examples: print, size_struct( "fdq_sdf" ) INPUTS: structure = a structure variable or a string giving the structure name as known by IDL (help,/struct,variable). /PRINT = to print all sub structure sizes. inputs/outputs used recursively: struct = the structure VARIABLE currently analyzed. Max_Field_Size = size of the largest field found in structure. RESULT: Function returns the total size in bytes of a structure element. EXPLANATION: For most applications this function is superceded by use of the /LENGTH keyword to the intrinsic N_TAGS function introduced in IDL V2.3.0 PROCEDURE: Strategy is to call size_struct recursively if structure contains sub-structures. Otherwise just add up the field sizes. MODIFICATION HISTORY: written 1990 Frank Varosi STX @ NASA/GSFC (using align_struct). Converted to IDL V5.0 W. Landsman September 1997
Source: src/idl_cvs/smooth2.pro
src/idl_cvs/smooth2.pro
NAME: SMOOTH2 PURPOSE: Do multiple smoothing. Gives near Gaussian smoothing. CATEGORY: Smoothing CALLING SEQUENCE: b = smooth2(a, w) INPUTS: a = array to smooth (1,2, or 3-d). in w = smoothing window size. in KEYWORD PARAMETERS: EDGE_TRUNCATE - as in SMOOTH OUTPUTS: b = smoothed array. out COMMON BLOCKS: NOTES: MODIFICATION HISTORY: R. Sterner. 8 Jan, 1987. Johns Hopkins University Applied Physics Laboratory. RES 14 Jan, 1987 --- made both 2-d and 1-d. RES 30 Aug, 1989 --- converted to SUN. R. Sterner, 1994 Feb 22 --- cleaned up some. 25-Apr-00 Added EDGE_TRUNCATE keyword. [BD] 06-Jul-2009 for RGB images, smooth component separately [BD] limit smoothing width to dimension of data Copyright (C) 1987, Johns Hopkins University/Applied Physics Laboratory This software may be used, copied, or redistributed as long as it is not sold and this copyright notice is reproduced on each copy made. This routine is provided as is without any express or implied warranties whatsoever. Other limitations apply as described in the file disclaimer.txt.
Source: src/idl_cvs/smoothedge.pro
src/idl_cvs/smoothedge.pro
NAME: smoothedge PURPOSE: smooth a 2-D array using /edge_truncate, but then smooth the remaining rows and columns within width/2 of the edge even more. CATEGORY: Smoothing CALLING SEQUENCE: IDL> smarray = smoothedge( array, nsmooth ) INPUTS: array - a 2-D array. (If 2-D array, will just call smooth) KEYWORD PARAMETERS: Inputs: any keywords will be passed directly to IDL smooth routine nsmooth - a number passed to smooth routine OUTPUTS: smarray - smoothed array EXAMPLE: array = dist(100,100)+randomu(seed,100,100)*20 !p.multi=[0,2,0] thcont, array thcont, smoothedge(array, 11) NOTES: MODIFICATION HISTORY: 28-Aug-2012 smooth corners, as well 04-May-2009 WRITTEN by Bill Davis, PPPL
Source: src/idl_cvs/smoothtruecolor.pro
src/idl_cvs/smoothtruecolor.pro
NAME: smoothtruecolor PURPOSE: smooth a true color array 1 component at a time. CATEGORY: Smoothing CALLING SEQUENCE: IDL> smarray = smoothTrueColor( array, nsmooth ) INPUTS: array - a 3xNXxNY array. (If 2-D array, will just call smooth) nsmooth - a number passed to smooth routine KEYWORD PARAMETERS: Inputs: any keywords will be passed directly to IDL smooth routine OUTPUTS: smarray - smoothed array EXAMPLE: array = dist(100,100)+randomu(seed,100,100)*20 array = [[array], [array], [array]] array = reform( array, 3, 100, 100 ) !p.multi=[0, 2,0] thcont, array thcont, smoothtruecolor(array, 11) NOTES: MODIFICATION HISTORY: 09-Nov-2011 Written by Bill Davis, PPPL
Source: src/idl_cvs/spawnprint.pro
src/idl_cvs/spawnprint.pro
NAME: spawnprint PURPOSE: Spawn command on VMS or Unix to print a Postscript file CATEGORY: Printing CALLING SEQUENCE: IDL> spawnprint, filename, printer=printer INPUTS: filename (or will be prompted) KEYWORD PARAMETERS: Keywords: printer - else will go to the default printer NOTE: if PRINTER begins with postscript', file will not be sent to a printer OUTPUTS: none MODIFICATION HISTORY: 07-Mar-02 Written by Bill Davis
Source: src/idl_cvs/spec_dir.pro
src/idl_cvs/spec_dir.pro
NAME: SPEC_DIR PURPOSE: Provide a complete file specification by appending a default disk or directory if necessary. CATEGORY: Files, OS Specific, Strings CALLING SEQUENCE: File_spec = SPEC_DIR( filename, [ extension ] ) INPUT: filename - character string giving partial specification of a file name. Examples for different operating systems include the following: VMS: '$1$DUA5:TEST.DAT','[.SUB]TEST' Unix: pro/test.dat, $IDL_HOME/test MacOS: ':Programs:test' Windows: '\pro\test.dat','d:\pro\test' OPTIONAL INPUT: exten - string giving a default file name extension to be used if filename does not contain one. Do not include the period. OUTPUT: File_spec - Complete file specification using default disk or directory when necessary. EXAMPLE: IDL> a = spec_dir('test','dat') is equivalent to the commands IDL> cd, current=cdir IDL> a = cdir + delim + 'test.dat' where delim is the OS-dependent separator METHOD: SPEC_DIR() decomposes the file name using FDECOMP, and appends the default directory (obtained from the CD command) if necessary. Under VMS, SPEC_DIR() will also try to translate disk and directory logical names. SPEC_DIR() does not check whether the constructed file name actually exists. PROCEDURES CALLED: FDECOMP, OS_FAMILY() REVISION HISTORY: Written W. Landsman STX July, 1987 Added Unix compatibility, W. Landsman, STX August 1991 Added Windows and Macintosh compatibility W. Landsman September 1995
Source: src/idl_cvs/sqlfixspecialchars.pro
src/idl_cvs/sqlfixspecialchars.pro
NAME: sqlfixspecialchars PURPOSE: Encapsulate special characters so they can work in SQL text insertions The special characters are '%', '^', '$', '*', '@', '#', '(', '!', ')', '?' CATEGORY: Strings CALLING SEQUENCE: new = sqlfixspecialchars(old) INPUTS: old = original text string. in c2 = character to replace it with. in default is space. KEYWORD PARAMETERS: replace - if set, replace any special characters with an underscore OUTPUTS: new = edited string. out EXAMPLE: IDL> in_string = 'high $ jog $ !' IDL> print,fixspecialchars(in_string) high '$$' jog '$$' '!!' COMMON BLOCKS: NOTES: uses repstr.pro MODIFICATION HISTORY: 06-Mar-2007 written by Bill Davis
Source: src/idl_cvs/stackplot.pro
src/idl_cvs/stackplot.pro
NAME: stackplot PURPOSE: An example of X-window widgets for plotting some GA data CATEGORY: Plotting, Example, Widgets, GA CALLING SEQUENCE: stackplot USE: If you have a file named mdsplussig.txt in the directory from which you are running IDL, signal names in the file will be plotted when you click on "My Signals." The names should be one per row. MAJOR FUNCTIONS and PROCEDURES: PLOT: X-Y plotting. SMOOTH: Smooths data and overplots. MODIFICATION HISTORY: Written by: WMD, PPPL, March, 1997 based on RSI's Forecast example 26-Jan-99 Modified for using MDS at PPPL by Bill Davis 21-Oct-97 WMD Simplified for IDL class example at GA 15-Apr-97 WMD Changed for remote plotting test
Source: src/idl_cvs/strarraysame.pro
src/idl_cvs/strarraysame.pro
NAME: StrArraySame PURPOSE: Returns TRUE if two strings, or string arrays, are identical, else FALSE CATEGORY: Strings CALLING SEQUENCE: Result = StrArraySame( STRING1, STRING1 ) INPUTS: STRING1 & STRING1 Character strings. KEYWORD PARAMETERS: IGNORECASE - if set then ignore case in comparison OUTPUTS: Returns 1 if the words in two strings, or string arrays are identical, else 0. e.g. 'ece1 ece2' is considered equal to ['ece1','ece2'] OPTIONAL OUTPUT PARAMETERS: None. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. MODIFICATION HISTORY: Created 19-Sep-97 by Bill Davis
Source: src/idl_cvs/strconcat.pro
src/idl_cvs/strconcat.pro
NAME: strconcat PURPOSE: Concatenate a string array into single string, or a matrix of strings into a string array. CATEGORY: Strings CALLING: string = strconcat( string_array ) INPUTS: string_array = array of strings or numbers, if numbers they will be converted to strings before concatenating. KEYWORD PARAMETERS: Optional: delim - string to insert between parts of array (default to null) OUTPUT: Function returns a single string. HISTORY: 16-Nov-2004 add delim keyword Written: Frank Varosi NASA/GSFC 1994.
Source: src/idl_cvs/strep.pro
src/idl_cvs/strep.pro
NAME: STREP PURPOSE: Edit a string by position. Precede, Follow, Replace, Delete. CATEGORY: Strings CALLING SEQUENCE: newstring = strep(string,cmd,p,ss,[iflg]) INPUTS: string = string to edit. in cmd = edit command: in 'P' = precede position p with substring ss. 'F' = follow position p with substring ss. 'R' = replace text starting at position p with text from substring ss. 'D' = delete N characters starting at position p. The calling sequence for this command is slightly different: IFLG = STREP(string,'D',p,n,[iflg]) Where n = number of characters to delete. p = character position to use. in 0 = first char. Any number larger than the string length = last char. ss = substring to use. For 'D' command in n is used instead of ss. KEYWORD PARAMETERS: OUTPUTS: iflg = 0 for a successful edit, out iflg = -1 for an error and no change to string. newstring = edited string. out COMMON BLOCKS: NOTES: MODIFICATION HISTORY: Written by R. Sterner, 27 Dec, 1984. Converted to SUN 13 Aug, 1989 --- R. Sterner. Johns Hopkins University Applied Physics Laboratory. Copyright (C) 1984, Johns Hopkins University/Applied Physics Laboratory This software may be used, copied, or redistributed as long as it is not sold and this copyright notice is reproduced on each copy made. This routine is provided as is without any express or implied warranties whatsoever. Other limitations apply as described in the file disclaimer.txt.
Source: src/idl_cvs/stress.pro
src/idl_cvs/stress.pro
NAME: STRESS PURPOSE: String edit by sub-string. Precede, Follow, Delete, Replace. CATEGORY: CALLING SEQUENCE: new = stress(old,cmd,n,oldss,newss,ned) INPUTS: old = string to edit. in cmd = edit command: in 'P' = precede. 'F' = follow. 'D' = delete. 'R' = replace. n = occurrence number to process (0 = all). in oldss = reference substring. in oldss may have any of the following forms: 1. s a single substring. 2. s... start at substring s, end at end of string. 3. ...e from start of string to substring e. 4. s...e from subs s to subs e. 5. ... entire string. newss = substring to add. Not needed for 'D' in KEYWORD PARAMETERS: OUTPUTS: ned = number of occurrences actually changed. out new = resulting string after editing. out COMMON BLOCKS: NOTES: Notes: oldss and newss may be arrays. MODIFICATION HISTORY: Written by R. Sterner, 6 Jan, 1985. Johns Hopkins University Applied Physics Laboratory. RES --- 23 May, 1988 fixed a bug in SSTYP = 2. Converted to SUN 13 Aug, 1989 --- R. Sterner. (FOR loop change). --- 8 Dec, 1992 added recursion so that OLDSS and NEWSS may be arrays T.J.Harris, University of Adelaide. Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory This software may be used, copied, or redistributed as long as it is not sold and this copyright notice is reproduced on each copy made. This routine is provided as is without any express or implied warranties whatsoever. Other limitations apply as described in the file disclaimer.txt.
Source: src/idl_cvs/stretchsteps.pro
src/idl_cvs/stretchsteps.pro
NAME: stretchsteps PURPOSE: stretch parts of the color tables into steps. CATEGORY: Colors, Image processing CALLING SEQUENCE: stretchsteps, Low, High, steps=n [, /CHOP] INPUTS: Low: The lowest pixel value to use. If this parameter is omitted, 0 is assumed. Appropriate values range from 0 to the number of available colors-1. High: The highest pixel value to use. If this parameter is omitted, the number of colors-1 is assumed. Appropriate values range from 0 to the number of available colors-1. OPTIONAL INPUTS: Gamma: Gamma correction factor. If this value is omitted, 1.0 is assumed. Gamma correction works by raising the color indices to the Gamma power, assuming they are scaled into the range 0 to 1. steps: number of steps/colors of the resulting color table (default=16) KEYWORD PARAMETERS: CHOP: If this keyword is set, color values above the upper threshold are set to color index 0. Normally, values above the upper threshold are set to the maximum color index. OUTPUTS: No explicit outputs. COMMON BLOCKS: COLORS: The common block that contains R, G, and B color tables loaded by LOADCT, HSV, HLS and others. SIDE EFFECTS: Image display color tables are loaded. RESTRICTIONS: Common block COLORS must be loaded before calling stretchsteps. PROCEDURE: New R, G, and B vectors are created by linearly interpolating the vectors in the common block from Low to High. Vectors in the common block are not changed. If NO parameters are supplied, the original color tables are restored. EXAMPLE: Load the STD GAMMA-II color table by entering: LOADCT, 5 Create and display and image by entering: TVSCL, DIST(300) Now adjust the color table with stretchsteps. Make the entire color table fit in the range 0 to 70 by entering: stretchsteps, 0, 70 Notice that pixel values above 70 are now colored white. Restore the original color table by entering: stretchsteps MODIFICATION HISTORY: 26-May-2006 Fixed green & blue switch & get color table rather than relying on common block [BD] 18-Dec-2002 Modified RSI STRETCH.PRO [BD] DMS, RSI, Dec, 1983. DMS, April, 1987. Changed common. DMS, October, 1987. For unix. DMS, RSI, Nov., 1990. Added GAMMA parameter.
Source: src/idl_cvs/strmatch.pro
src/idl_cvs/strmatch.pro
NAME: strmatch PURPOSE: check for string match to a wild card specification CATEGORY: Strings USAGE: result=strmatch(str,spec) INPUT: str string spec wild card specification OUTPUT: 1 if STR matches SPEC 0 if STR does not match SPEC LIMITATIONS: Currently the only wild card character is asterisk, "*" which matches 1 or more arbitrary characters. EXAMPLE: print,strmatch('string','st*ng') ; => 1 print,strmatch('string','*st*ng') ; => 0 print,strmatch('string','*t*ng') ; => 1 print,strmatch('string','st*ng*') ; => 0 print,strmatch('string','st*n*') ; => 1 AUTHOR: Paul Ricchiazzi jan94 Institute for Computational Earth System Science University of California, Santa Barbara
Source: src/idl_cvs/strnumber.pro
src/idl_cvs/strnumber.pro
NAME: STRNUMBER PURPOSE: Function to determine if a string is a valid numeric value. CATEGORY: Strings CALLING SEQUENCE: result = strnumber(st,val) INPUTS: st - string OUTPUTS: 1 is returned as the function value if the string st has a valid numeric value, otherwise, 0 is returned. OPTIONAL OUTPUT: val - (optional) value of the string. real*8 WARNING: Note that (as of Version 2.0.10) a blank string (e.g. " ") is not a valid numeric value, although an empty string ("") is. HISTORY: version 1 By D. Lindler Aug. 1987
Source: src/idl_cvs/strparse.pro
src/idl_cvs/strparse.pro
NAME: STRPARSE VERSION: 3.0 PURPOSE: Parses the string LINE using the characters in DELIM as delimiters. Puts individual pieces into consecutive locations in LIST. CATEGORY: Strings CALLING SEQUENCE: Result = STRPARSE( LINE, DELIM [, LIST]) INPUTS: LINE Character string. DELIM Character string. Each Character of DELIM is used as a delimiter. OPTIONAL INPUT PARAMETERS: None. KEYWORD PARAMETERS: None. OUTPUTS: Returns the number of pieces found minus one i.e. the index of the last element of LIST if LIST is provided. If LINE is a null string or not a string, the function returns -1l. OPTIONAL OUTPUT PARAMETERS: LIST Character array. If name is provided, the pieces of LINE resulting from the parsing process are returned in consecutive locations in LIST. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: Straightforward. Using the function TYPE from MIDL. MODIFICATION HISTORY: Created 15-JUL-1991 by Mati Meron.
Source: src/idl_cvs/strucedit.pro
src/idl_cvs/strucedit.pro
NAME: strucedit PURPOSE: Widget to edit a structure of scalars from an IDL save file. The names of the input fields are the names of the structure elements. CATEGORY: Widgets, structures CALLING SEQUENCE: IDL> strucedit INPUTS: input = whatever. KEYWORD PARAMETERS: Optional Keywords: inStrc - IDL structure of variables to edit labels - labels for input fields. If not specifie, name of variable will be used. savefile - name of IDL save file with initial structure not used if inStrc input specified, if neither user will be prompted for a file name. title - title of widget GROUP_LEADER - This widget is destroyed if it's GL is destroyed OUTPUTS: a new IDL save file is created LIMITATIONS: Will only work on a structure containing scalars. Does not ask any "are you sure" type of questions. COMMON BLOCKS: NONE EXAMPLE: IDL> strucedit, savefile='/u/bdavis/SpecFit/modespecstrc.sav' or IDL> strucedit, instrc={a:0, b:1.0, c:'label name'}, $ labels=['Value of A', 'Value of B'] NOTES: MODIFICATION HISTORY: 29-Apr-2005 Written by Bill Davis, PPPL
Source: src/idl_cvs/strwhere.pro
src/idl_cvs/strwhere.pro
NAME: strwhere PURPOSE: a "where" operator for strings matching a set of string wild cards CATEGORY: Strings, Searching USAGE: result = strwhere( starr, wildcard ) result = strwhere( starr, wildcard, nfound ) INPUT: starr an array of strings wildcard wild card specifier composed of regular and special characters. The special characters are asterisk '*' and vertical bar '|'. The asterisk matches any number of characters the vertical bar indicates an "or" operation between different wild card specifications. KEYWORD INPUT: orchar character used to indicate "or" wildcard operation. (default = '|') notequal - if set, return indices where values are NOTEQUAL ignoreCase - if set, will ignore case OUTPUT: result an index array such that starr(result) = those elements of STARR that match the wild card specification in WILDCARD EXAMPLE: f=findfile(/home/paul/arm/arese/bsrn/sgpbsrnC1.a1.*.cdf) clrdays='*1018*|*1022*|*1030*' print,f(strwhere(f,clrdays)) AUTHOR: Paul Ricchiazzi 14 Jan 97 Institute for Computational Earth System Science University of California, Santa Barbara paul@icess.ucsb.edu REVISIONS: 20-Dec-04 added notEqual and ignoreCase keywords 22-Apr-03 if no matches, see if need to strip quotes from wildcard 03-Jan-03 Replace sep_str with breakstring [Bill Davis] 21-Jan-00 Make work for no matches. Add nfound. [Bill Davis]
Source: src/idl_cvs/surfrange.pro
src/idl_cvs/surfrange.pro
NAME: surfrange PURPOSE: make SURF plots with x & y ranges (correctly) CATEGORY: 2-D Plotting CALLING SEQUENCE: surfrange, f, x, y, XRANGE=xrange, YRANGE=yrange, _EXTRA =_extra INPUTS: f, x & y are just as for surf in KEYWORD PARAMETERS Input: XRANGE - array containing min x & max x YRANGE - array containing min y & max y ZRANGE - array containing min y & max y _EXTRA - standard idl EXTRA keyworrd OUTPUTS: none EXAMPLE: x=findgen(100) y=x f=DIST(100) _EXTRA = { title: 'My Title', $ ; pass any extra SURF keywords here xtitle: 'seconds', $ ax : 40 } surfrange, f, x, y, xrange=[20,40], yrange=[50,70], _EXTRA =_EXTRA COMMON BLOCKS: NOTES: logic is still not perfect. See, e.g., AUSER4:[BDAVIS.TEST.NDD]NDD3D.PRO for a working example of overlaying surface plot on a shaded surface plot with ranges set. MODIFICATION HISTORY: 09-Jul-02 Handle when yrange or xrange reversed (i.e., first > last) 17-Aug-01 Handle correctly when !z.range set 17-Oct-00 Written by Bill Davis
Source: src/idl_cvs/surf_contour.pro
src/idl_cvs/surf_contour.pro
NAME: SURF_CONTOUR PURPOSE: The purpose of this program is to demonstrate how to create a shaded surface and coutour plot in the same object graphics window. The contour plot should be able to be translated independently of the surface. AUTHOR: FANNING SOFTWARE CONSULTING David Fanning, Ph.D. 2642 Bradbury Court Fort Collins, CO 80521 USA Phone: 970-221-0438 E-mail: davidf@dfanning.com Coyote's Guide to IDL Programming: http://www.dfanning.com CATEGORY: Widgets, IDL 5 Object Graphics. CALLING SEQUENCE: SURF_CONTOUR, data, x, y REQUIRED INPUTS: None. Fake data will be used if no data is supplied in call. OPTIONAL INPUTS data: A 2D array of surface data. x: A vector of X data values. y: A vector of Y data values. OPTIONAL KEYWORD PARAMETERS: _EXTRA: This keyword collects otherwise undefined keywords that are passed to the surface initialization routine. GROUP_LEADER: The group leader for this program. When the group leader is destroyed, this program will be destroyed. XTITLE: A string used as the X title of the plot. YTITLE: A string used as the Y title of the plot. ZTITLE: A string used as the Z title of the plot. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. EXAMPLE: To use this program with your data, type: IDL> Surf_Contour, data MODIFICATION HISTORY: Written by David Fanning, 20 September 98.
Source: src/idl_cvs/syb_entry.pro
src/idl_cvs/syb_entry.pro
NAME: SYB_ENTRY PURPOSE : Display/modify/create entries in the NSTX logbook database. CATEGORY: Database CALLING SEQUENCE: IDL> SYB_ENTRY IDL> syb_entry, font=find_font(/courier,/bold, size=12) KEYWORD PARAMETERS: DEFAULT='save_file' to restore settings. FONT = a font FSIZE = font size (default=14) WARNING - if=0, will not display intial warning of "RUN_INFO has not been run today" INITAL_QUERY - the initial query of the database, e.g. 'rundate=20070523 and VOIDED IS NULL' defaults to current user, last day with entries, topic in ('PHYS OPS','SESSION LEADER')) and VOIDED IS NULL LIMITATIONS About - ENTRY_DISPLAY is a widget based IDL procedure for looking at entries in the LOGBOOK database. Its primary purpose is to display an up-to-date set of logbook entries during a run. The user specified the record selection criteria (Options->Display Options). Whenever a new logbook entry is made, the display is automatically updated to include the new record(s) if they meet the criteria (unless one is in a blocking entry widget). This tool allows the user to create new logbook entries. Chose 'Make Final Entry' from the Entry menu. In addition this tool can be used to void and edit existing logbook entries. Select part of an entry in main display, and then choose 'Edit Entry' or 'Void Entry' from the Entry menu. NOTE: you may only void or edit entries which you have entered into the database! Send email to dbadmin to have other entries changed. NOTES To get a white background on text, you need certain commands in a .Xresources file. You can have these loaded under the file menu in syb_entry. use add_topic_logbook.pro to add topics. to void a topic: IDL> cmd = "DELETE FROM topics WHERE topic='BOLOMETERS'" IDL> count = DSQL(cmd, stat=stat) MODIFICATION HISTORY: 02-Aug-2010 added timer to refresh every n seconds (DEFAULT=60) 04-Jun-2010 increased default max rows to 300 02-Apr-2010 added help on pattern matching syntax 12-Mar-2009 use common to pass display options, because structures within structures have bugs, and are too convoluted. [BD] 02-Oct-2008 only do an mdsconnect if mds_event_server not defined. 20-May-2008 fixed Make Entry Options. 12-May-2008 calling mdssetevent breaks the connection needed for the widget to recognize events, so now just spawn "setevent". Requires that environmental variable mds_event_target be set. (e.g. to birch.pppl.gov:8501) Tidied up several other issues like consistancy of "Auto Updates" checkbox. 27-Jul-2007 Added WARNING and INITIAL_QUERY keywords. Added UPDATE button to MAKE_ENTRY widget, so entries can be made in steps. Help added to CUSTOM QUERY window to aid searches. 02-May-2007 changed default printing to your default printer. Added debug printing 30-Apr-2007 fixed auto updates on Linux 09-Apr-2007 Get Current shot from MDSplus, rather getting the largest shot number from the database [BD] 05-Mar-2007 Allow text with special characters ('%', '^', '$', '*', '@', '#', '(', '!', ')', '?', ';') to go into the logbook. added some color buttons. [BD] 22-Jan-2007 Make sure connect to an event server (default to europa:8501). 18-Jul-2005 change !version.os to !version.os_family to pick up linux 05-Mar-2004 Upon startup update the screen with a query [BD] 02-Mar-2004 Font keyword added, and changed options to ascending order and auto scroll = off (Bill Davis) Josh Stillerman 9/20/96 initial version Lew Randerson 1999-11-04 Convert from ENTRY_DISPLAY to SYB_ENTRY by mimicking Stan Kaye's mods to create VMS SYB_ENTRY ... Convert entry_display to syb_entry (*** default file = $HOME/SybEntry.dat ***) (*** strayed from sk default file handling ***) ... Add GetCurrentDate Lew Randerson 1999-11-08 Change 'logbook' to 'nstxlogs' Lew Randerson 1999-11-16 Check for os when handling print options Lew Randerson 1999-11-17 Add event handling stuff Lew Randerson 2000-01-11 Fix typo in get_entry_text parameters Lew Randerson 2000-01-11 Put back 'RUN_INFO' check Lew Randerson 2000-01-11 Handle unix printing Check hand.key exists