dpusersrc/0000755000175100003160000000000012745402552011076 5ustar ottirdpusersrc/.cproject0000644000175100003160000016114411001053557012706 0ustar ottir dpusersrc/.project0000644000175100003160000000461111001053557012536 0ustar ottir dpuser org.eclipse.cdt.managedbuilder.core.genmakebuilder clean,full,incremental, org.eclipse.cdt.make.core.fullBuildTarget all ?name? org.eclipse.cdt.make.core.enableAutoBuild false org.eclipse.cdt.make.core.buildLocation ${workspace_loc:/dpuser/dpuser} org.eclipse.cdt.make.core.enableFullBuild true org.eclipse.cdt.make.core.enableCleanBuild true org.eclipse.cdt.make.core.cleanBuildTarget clean org.eclipse.cdt.make.core.append_environment true org.eclipse.cdt.make.core.contents org.eclipse.cdt.make.core.activeConfigSettings org.eclipse.cdt.make.core.useDefaultBuildCmd false org.eclipse.cdt.make.core.buildArguments all_dp org.eclipse.cdt.make.core.buildCommand make org.eclipse.cdt.make.core.autoBuildTarget all org.eclipse.cdt.make.core.stopOnError true org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder org.eclipse.cdt.core.cnature org.eclipse.cdt.managedbuilder.core.ScannerConfigNature org.eclipse.cdt.core.ccnature org.eclipse.cdt.managedbuilder.core.managedBuildNature dpusersrc/bugs0000644000175100003160000000351112561134273011757 0ustar ottirbugs --------------------------------------------------- - rotation safety (values correct when rotated/flipped?) - cuts plot not rotation save - QFits2dFit: values are correct, just the resulting ellipse is missplaced - View3D has to be fixed... TotalView wrong - Wiregrid has to be fixed... TotalView wrong (moving white rectangle not working) - check ContourWidget as well - View 3D select continuum --> strange display... - Leonard: x-shooter-fits: - radial profile larger than image -> create spec --> crash (MacOSX) - rebin to 3x7 gives strange output - Stefan: ImageCreator bugs - crashes often when playing around with images, contrast etc - happens when moving images one to the other, enlarged and then changing the brightness (Helligkeitscuts) manually - changing Helligkeitscuts changes the zoom-level as well (happens as well when images are aligned 1:1) - Options->CubeDisplay-Dialog: doesn't apply cubeCenter-values etc... - MB: cubeCenter/lineWidth not homogen for homogenMBs (should be the same for all SBs) - TableView: 2 clicks needed to activate a row/column - GRAVITY - copy table to new buffer, select column -> CubeSpectrum completely gray! - do following: > read all > ext #1: select string-column > mouse move ext #2 > mouse move ext #1 (remembers step 1...) check for rotation-safety --------------------------------------------------- - ellipticalProfile marker - longslitProfile marker - radialProfile - Image Creator features --------------------------------------------------- - TableView: when col/row selected: think about setting this SB as locked (blue column, blue border...) - QMarkers: - add shift - allow to load mask larger/smaller than image - implement function writebintable - implement procedure setfitscolumnname - dpuser.y: implement buffer1[1]=[1,1]=1 buffer1 is a list, the [1] is a fits dpusersrc/check_env0000755000175100003160000000040012245612551012740 0ustar ottir#!/bin/bash echo "####################################" echo ">>> PATH <<<" echo $PATH echo ">>> QTDIR <<<" echo $QTDIR echo ">>> qmake <<<" which qmake echo ">>> moc <<<" which moc echo ">>> uic <<<" which uic echo "####################################" dpusersrc/dpuser/0000755000175100003160000000000012746112125012373 5ustar ottirdpusersrc/dpuser/doc/0000755000175100003160000000000012746112126013141 5ustar ottirdpusersrc/dpuser/doc/category.html0000644000175100003160000005160511023237413015645 0ustar ottir DPUSER - The Next Generation: Category index

Category index

The functions and procedures supplied by DPUSER can be sorted by the following categories:

Mathematical functions User interaction Environment settings Date and time
String manipulation File access Matrix creation FITS file handling
Data reduction      


Mathematical functions

Trigonometric functions

sin cos tan asin acos atan
sinh cosh tanh asinh acosh atanh
pi deg2rad rad2deg      

Statistical functions

total min max avg median  
      stddev meddev variance

Complex number arithmetics

DPUSER is able to handle complex numbers within most functions. Some functions are provided which only make sense when used with complex numbers. When used with real numbers, no error is generated, but a value of zero is returned.

complex polar conj      
abs arg imag real    

Matrix arithmetics

invert transpose        

Function fitting

polyfit polyfitxy polyfitxyerr interpol    
gaussfit gauss2dfit multigauss2dfit gauss2dsimplefit    
sersicfit sersic2dfit sersic2dsimplefit      

Other mathematical functions

float int round frac abs sign
exp ln log sqrt gammp ten
bessel erf random randomg poly cirrange


User interaction

free mem print printf read userDialog
exec run break sleep compile  


Environment settings

setenv getenv isvariable echo debug  


Date and time

jd jdfraction jdnumber now dayofweek calday
lmst          


String manipulation

char string stringarray lower upper replace
sprintf sort strlen nelements strpos right
strtrim simplifywhitespace strsplit      
import export        


File access

cd dir pwd fileexists filesize findfile
import export writebmp      


Matrix creation

Empty matrices

All these functions create empty matrices, i.e. all values are initialized with zero.

fits          
bytearray shortarray longarray floatarray doublearray complexarray

Matrix filter creation

gauss sersic2d circle ellipse delta rect
cosbell airy chinhat quickgauss    


FITS file handling

Reading and writing

readfits writefits header import export swapbytes

Information

naxis naxis1 naxis2 naxis3 nelements  
getfitskey setfitskey setwcs      

FITS cubes

cubeavg cubemaximum cubemedian cubeminimum cubemerge  


Data reduction

Image manipulation

boxcar cblank center clip collapse enlarge
flip magnify norm rebin resize rotate
setbitpix shift shrink smooth mosaic reform

Fourier transform

fft correl reass convolve    

Statistics, lists

xmax ymax maxima xcen ycen centroids
centroid fwhm markpos saomark limits  

Interaction with IRAF imtool

sao imexa saomarklabel saomarkpoint saoclear  
markpos saomark        

Analysis

find photometry transcoords transmatrix transform transpoly

Speckle

ssa ssaselect ssastat sssa    
swsa wsa wsastat      
dpixapply dpixcreate        

Deconvolution

lucy wien clean maxentropy psf  

Specialized 3D operations

This set of functions was copied from the 3D data reduction software (which uses Gipsy). They work only on original 3D (an imaging spectrograph build by MPE) data, which is of size 256x256, 256x600, or 16x16x600. These functions are extremely poorly documented within DPUSER. Use of those is depreciated.

3dcal 3dcubin 3dexpand 3dmegacal    
3dmerge 3dnorm 3dspec spec3d    
dpusersrc/dpuser/doc/examples.html0000644000175100003160000001320310735765731015660 0ustar ottir DPUSER - The Next Generation: Examples

Examples

In this section, a few examples how to use of DPUSER are given. This very often is the fastest way to learn how a software package works.

Printing the ASCII character set

Assign the ASCII character set to a string variable and print it out
ascii = ""                              // create empty string variable
for (i = 32; i <= 255; i++) ascii += char(i) // assign values
print ascii                             // display on screen

Getting information on files

Create a list of files and show their sizes
list = findfile("*.cpp")                // find all C++ files
size = longarray(nelements(list))       // create matrix for file sizes
for (i = 1; i <= nelements(list); i++ {
  size[i] = filesize(list[i])           // assign values and print out
  print "file " + list[i] + " has a size of " + size[i] / 1024 + " kB"
}

Reducing speckle data

This example shows how a standard speckle data reduction could look like.
dark = cubeavg('darkcube.fits')         // create dark frame
sky  = cubeavg('sky.fits')              // sky
dpl  = dpixcreate(sky, 5)               // dead pixel list
dpl[128,*] = 1                          // assume 128th row is dead
flat = dpixapply(sky - dark, dpl) // create flat field
flat = median(flat) / flat              // take inverse of flat field
lxp  = dpixapply(cubeavg('object.cube') - sky, dpl)
                                        // long exposure
'object.lxp' = lxp                      // write lxp to disk
x    = xmax(lxp)
y    = ymax(lxp)                        // find position of maximum
naxis1 = naxis1(lxp)
naxis2 = naxis2(lxp)                    // set up global variables
mask = circle(x, y, 20)                 // create mask for ssa
'object.ssa' = ssa('object.cube', x, y, sky, flat, dpl, mask)
                                        // do ssa and write to disk
x    = naxis1 / 2 + 1
y    = naxis2 / 2 + 1                   // center of the array
psf  = norm(center('object.ssa') * cosbell(x, y, 5, 20))
                                        // Point Spread Function
'object.wien' = wien('object.ssa', psf) // deconvolve
This standard reduction works fine if the object is dominated by one bright source. For faint sources or many objects of comparable brightness in the field of view, a more sophisticated reduction is necessary. See the help on ssa for more information. dpusersrc/dpuser/doc/fitsfiles.html0000644000175100003160000001126512733215062016023 0ustar ottir DPUSER - The Next Generation: Handling of FITS files

Handling of FITS files

FITS (Flexible Image Transport System) is commonly used in astronomy to store images. A very simple way to describe the format is that they contain an ASCII header describing the content of the file and the image itself in binary format. DPUSER is designed to efficiently handle this kind of files. The most common things you might want to do is reading images, writing images and editing the information in the header.
A set of functions has been optimised to deal with large files, which probably do not fit in the main memory of your computer.

Reading FITS files

DPUSER is able to read in FITS files, including FITS binary tables. The files may be compressed with gzip, uncompressing is done on the fly. The task of reading in a FITS file can be done in two ways:
  1. Use the function readfits
  2. Supply the filename in single quotes
  3. Use the function readfitsextension
  4. Use the function readfitsall
  5. Use the function readfitsbintable

Examples

Read in a complete FITS file into a variable named image:
    image = readfits("filename") or image = 'filename'
Read in the first image of a FITS cube:
    image = 'filename'[*,*,1]
Read in columns 100 to 200 and rows 50 to 150 of a FITS file:
    image = 'filename'[100:200, 50:150]

Writing FITS files

DPUSER is able to write simple FITS files, including FITS extensions, but it cannot (yet) write FITS tables. Writing, as reading FITS files can be accomplished using two methods:
  1. Use the procedure writefits
  2. Assign a matrix to a filename in single quotes
DPUSER creates a new file in either way. You cannot overwrite part of an existing file.

Examples

Write a 2-dimensional gaussian to a file named gauss.fits:
    writefits "gauss.fits", gauss(129,129,10)
which is equivalent to:
    'gauss.fits' = gauss(129,129,10)

Editing the FITS header

Once a FITS file is read into memory, where it is represented by a matrix, it is possible to edit and display the FITS header information with a set of FITS header editing functions. These are:
 
header Returns the FITS header as a string
getfitskey Returns the value of a FITS key
setfitskey Sets the value of a FITS key
setwcs Sets the world coordinate system in the FITS header
copyheader Copy a FITS header to a variable

Optimised routines

Some data analysis tasks require the handling of huge files. The following functions have been optimised to deal with large files. To take advantage of these capabilities, use filenames in single quotes and not the function readfits.
 
header Returns the FITS header as a string
cubeavg Does an average in the 3rd dimension
cubemedian Does a median in the 3rd dimension
ssa Simple Shift-and-Add
ssastat Simple Shift-and-Add statistics
sssa Simple Shift-and-Add using statistics
wsa Weighted Shift-and-Add
swsa Weighted Shift-and-Add using statistics
dpusersrc/dpuser/doc/functions.txt0000644000175100003160000032370512745376103015732 0ustar ottirsin Returns the trigonometric sine of its argument. The returned value will be real, complex, or a matrix, depending on the argument. By default, the argument is in radians. This can be changed by specifying the switch /deg. Syntax result = sin(angle [, /deg]) Arguments angle: a number (integer, real, complex) or a matrix, specifying the angle for which the sine is to be calculated. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. Switches /deg: The argument is in degrees Examples To find the sine of the angle 90 degrees, type: print sin(90, /deg) See also function_cos function_tan category_trigonometry cos Returns the trigonometric cosine of its argument. The returned value will be real, complex, or a matrix, depending on the argument. By default, the argument is in radians. This can be changed by specifying the switch /deg. Syntax result = cos(angle [, /deg]) Arguments angle: a number (integer, real, complex) or a matrix, specifying the angle for which the cosine is to be calculated. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. Switches /deg: The argument is in degrees Examples To find the cosine of the angle 90 degrees, type: print cos(90, /deg) See also function_sin function_tan category_trigonometry tan Returns the trigonometric tangent of its argument. The returned value will be real, complex, or a matrix, depending on the argument. By default, the argument is in radians. This can be changed by specifying the switch /deg. Syntax result = tan(angle [, /deg]) Arguments angle: a number (integer, real, complex) or a matrix, specifying the angle for which the tangent is to be calculated. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. Switches /deg: The argument is in degrees Examples To find the tangent of the angle 45 degrees, type: print tan(45, /deg) See also function_sin function_cos category_trigonometry sinh Returns the hyperbolic sine of its argument. The returned value will be real, complex, or a matrix, depending on the argument. By default, the argument is in radians. This can be changed by specifying the switch /deg. Syntax result = sinh(angle [, /deg]) Arguments angle: a number (integer, real, complex) or a matrix, specifying the angle for which the hyperbolic sine is to be calculated. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. Switches /deg: The argument is in degrees Examples To find the hyperbolic sine of the angle 90 degrees, type: print sinh(90, /deg) See also function_cosh function_tanh category_trigonometry cosh Returns the hyperbolic cosine of its argument. The returned value will be real, complex, or a matrix, depending on the argument. By default, the argument is in radians. This can be changed by specifying the switch /deg. Syntax result = cosh(angle [, /deg]) Arguments angle: a number (integer, real, complex) or a matrix, specifying the angle for which the hyperbolic cosine is to be calculated. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. Switches /deg: The argument is in degrees Examples To find the hyperbolic cosine of the angle 90 degrees, type: print cosh(90, /deg) See also function_sinh function_tanh category_trigonometry tanh Returns the hyperbolic tangent of its argument. The returned value will be real, complex, or a matrix, depending on the argument. By default, the argument is in radians. This can be changed by specifying the switch /deg. Syntax result = tanh(angle [, /deg]) Arguments angle:a number (integer, real, complex) or a matrix, specifying the angle for which the hyperbolic tangent is to be calculated. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. Switches /deg: The argument is in degrees Examples To find the hyperbolic tangent of the angle 45 degrees, type: print tanh(45, /deg) See also function_sinh function_cosh category_trigonometry asin Returns the arcus sine of its argument, which can be either real, complex or a matrix. The returned value's type is changed to complex if necessary (when the absolute value of the argument is greater than 1). By default, the returned value is in radians. This can be changed by specifying the switch /deg. Syntax result = asin(X [, /deg]) Arguments X: a number (integer, real, complex) or a matrix, specifying the sine of the angle to be returned. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. Switches /deg: The result will be in degrees Examples To find the angle (in degrees) whose sine is 0.5, type: print asin(0.5, /deg) See also function_acos function_atan category_trigonometry acos Returns the arcus cosine of its argument, which can be either real, complex or a matrix. The returned value's type is changed to complex if necessary (when the absolute value of the argument is greater than 1). By default, the returned value is in radians. This can be changed by specifying the switch /deg. Syntax result = acos(X [, /deg]) Arguments X: a number (integer, real, complex) or a matrix, specifying the cosine of the angle to be returned. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. Switches /deg: The result will be in degrees Examples To find the angle (in degrees) whose cosine is 0.5, type: print acos(0.5, /deg) See also function_asin function_atan category_trigonometry atan Returns the arcus tangent of its argument, which can be either real, complex or a matrix. The returned value has the same type as the argument. By default, the returned value is in radians. This can be changed by specifying the switch /deg. Syntax result = atan(X [, Y] [, /deg]) Arguments X: a number (integer, real, complex) or a matrix, specifying the tangent of the angle to be returned. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. Y: a real number. If given, returns atan(X / Y) for real numbers, quadrant correct. Switches /deg: The result will be in degrees Examples To find the angle (in degrees) whose tangent is 0.5, type: print atan(0.5, /deg) See also function_asin function_acos category_trigonometry asinh Returns the hyperbolic arcus sine of its argument, which can be either real, complex or a matrix. By default, the returned value is in radians. This can be changed by specifying the switch /deg. Syntax result = asinh(X [, /deg]) Arguments X: a number (integer, real, complex) or a matrix, specifying the hyperbolic sine of the angle to be returned. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. Switches /deg: The result will be in degrees Examples To find the angle (in degrees) whose hyperbolic sine is 0.5, type: print asinh(0.5, /deg) See also function_acosh function_atanh category_trigonometry acosh Returns the hyperbolic arcus cosine of its argument, which can be either real, complex or a matrix. By default, the returned value is in radians. This can be changed by specifying the switch /deg. Syntax result = acosh(X [, /deg]) Arguments X: a number (integer, real, complex) or a matrix, specifying the hyperbolic cosine of the angle to be returned. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. Switches /deg: The result will be in degrees Examples To find the angle (in degrees) whose hyperbolic cosine is 0.5, type: print acosh(0.5, /deg) See also function_asinh function_atanh category_trigonometry atanh Returns the hyperbolic arcus tangent of X, which can be either real, complex or a matrix. By default, the returned value is in radians. This can be changed by specifying the switch /deg. Syntax result = atanh(X [, /deg]) Arguments X: a number (integer, real, complex) or a matrix, specifying the hyperbolic tangent of the angle to be returned. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. Switches /deg: The result will be in degrees Examples To find the angle (in degrees) whose hyperbolic tangent is 0.5, type: print atanh(0.5, /deg) See also function_acosh function_asinh category_trigonometry exp Returns the exponential function of X. The returned value will be real, complex, or a matrix, depending on the argument. Syntax result = exp(X) Arguments X: a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. See also function_ln log Returns the logarithm of X. If no base is supplied, the logarithm to the base 10 is returned. Syntax result = log(X [, base]) Arguments X: The value whose logarithm is to be returned. This can be a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. base: If given, the logarithm of X to this base will be returned See also function_ln ln Returns the logarithm of X to the base e (the natural logarithm). Syntax result = ln(X) Arguments X: The value whose logarithm is to be returned. This can be a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. See also function_log sqrt Returns the square root of X. Syntax result = sqrt(X) Arguments X: The value whose square root is to be returned. This can be a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. erf Returns the error function of X. Syntax result = erf(X) Arguments X: A real number. bessel Returns the bessel function of X. Syntax result = bessel(X, kind, order) Arguments X: A real number. kind: An integer number (1 or 2), specifying the kind of the bessel function to be computed. order: An integer number >= 0, specifying the order of the bessel function to be computed. int Returns the integer part of X. Syntax result = int(X) Arguments X: a real number. Examples To print the integer part of the real number -6.7 which is -6, type: print int(-6.7) See also function_round round Returns X rounded to the nearest integer. Syntax result = round(X) Arguments X: a real number. See also function_int frac Returns the fractional part of X. Syntax result = frax(X) Arguments X: a real number. abs Returns the absolute value of X. Syntax result = abs(X) Arguments X: The value whose absolute value is to be returned. This can be a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. See also function_sign function_arg function_real function_imag sign Returns the sign of X. Syntax result = sign(X) Arguments X: a real number. See also function_abs rad2deg Returns X in radians converted to degrees. This is equivalent to X*180/pi. Syntax result = rad2deg(X) Arguments X: The value which is to be converted to degrees. This can be any number (integer, real, complex) or a matrix. See also function_deg2rad category_trigonometry deg2rad Returns X in degrees converted to radians. This is equivalent to X*pi/180. Syntax result = deg2rad(X) Arguments X: The value which is to be converted to radians. This can be any number (integer, real, complex) or a matrix. See also function_rad2deg category_trigonometry float Returns the string X converted to a real number. Syntax result = float(X) Arguments X: A string. strlen Returns the length of the string X. Syntax result = strlen(X) Arguments X: A string. See also function_nelements min Returns the minimum value of an array or the minimum of two real numbers. Undefined values (INF and NaN) are ignored. Syntax result = min(X [, ignore] [,/x | /y | /z | /xy | /xz | /yz])
result = min(a, b) Arguments X: A matrix. ignore: An optional value which should be ignored. a: A real number. b: A real number Switches /x: Calculate the minimum along the first axis /y: Calculate the minimum along the second axis /z: Calculate the minimum along the third axis /xy: Calculate the minimum along the first and second axes /xz: Calculate the minimum along the first and third axes /yz: Calculate the minimum along the second and third axes Examples To get a 1D vector of the minima of all slices along a 3D cube: result = min(cube, /xy) See also function_max function_avg function_total function_median function_stddev function_meddev function_variance max Returns the maximum value of an array or the maximum of two real numbers. Undefined values (INF and NaN) are ignored. Syntax result = max(X [, ignore] [,/x | /y | /z | /xy | /xz | /yz])
result = max(a, b) Arguments X: A matrix. ignore: An optional value which should be ignored. a: A real number. b: A real number. Switches /x: Calculate the maximum along the first axis /y: Calculate the maximum along the second axis /z: Calculate the maximum along the third axis /xy: Calculate the maximum along the first and second axes /xz: Calculate the maximum along the first and third axes /yz: Calculate the maximum along the second and third axes Examples To get a 1D vector of the maxima of all slices along a 3D cube: result = max(cube, /xy) See also function_min function_avg function_total function_median function_stddev function_meddev function_variance avg Returns the average value of X, optionally omitting a value. Undefined values (INF and NaN) are ignored. Syntax result = avg(X [, omit [,/x | /y | /z | /xy | /xz | /yz]]) Arguments X: A matrix. omit: A value to be omitted when taking the average. Switches /x: Calculate the average along the first axis /y: Calculate the average along the second axis /z: Calculate the average along the third axis /xy: Calculate the average along the first and second axes /xz: Calculate the average along the first and third axes /yz: Calculate the average along the second and third axes Examples Find the average of the values 0,1,2,3,4 (which is 2): print avg([0:4])
Calculate an average image of a 3D cube: result = avg(cube, /z)
This is the same as: result = cubeavg(cube) See also function_max function_min function_total function_median function_stddev function_meddev function_cubeavg function_variance total Returns the sum of all values in X. Undefined values (INF and NaN) are ignored. Syntax result = total(X [, ignore] [,/x | /y | /z | /xy | /xz | /yz]) Arguments X: A matrix. ignore: An optional value which should be ignored. Switches /x: Calculate the sum along the first axis /y: Calculate the sum along the second axis /z: Calculate the sum along the third axis /xy: Calculate the sum along the first and second axes /xz: Calculate the sum along the first and third axes /yz: Calculate the sum along the second and third axes Examples Calculate a sum image of a 3D cube: result = total(cube, /z) See also function_max function_min function_avg function_median function_stddev function_meddev median Returns the median value of X, optionally neglecting a value. Syntax result = median(X [, omit] [,/x | /y | /z | /xy | /xz | /yz]) Arguments X: A matrix. omit: A value which should be omitted when taking the median. Switches /x: Calculate the sum along the first axis /y: Calculate the sum along the second axis /z: Calculate the sum along the third axis /xy: Calculate the sum along the first and second axes /xz: Calculate the sum along the first and third axes /yz: Calculate the sum along the second and third axes Examples Calculate a median image of a 3D cube: result = median(cube, /z)
This is the same as: result = cubemedian(cube) See also function_max function_min function_total function_avg function_stddev function_meddev function_cubemedian naxis Returns the number of axes in X. Syntax result = naxis(X [, extension]) Arguments X: A matrix or a file name extension: Integer number specifying which extension to read. See also function_nelements function_naxis1 function_naxis2 function_naxis3 naxis1 Returns the length of axis #1 in X. Syntax result = naxis1(X [, extension]) Arguments X: A matrix or a file name extension: Integer number specifying which extension to read. See also function_nelements function_naxis function_naxis2 function_naxis3 naxis2 Returns the length of axis #2 in X. Syntax result = naxis2(X [, extension]) Arguments X: A matrix or a file name extension: Integer number specifying which extension to read. See also function_nelements function_naxis function_naxis1 function_naxis3 naxis3 Returns the length of axis #3 in X. Syntax result = naxis3(X [, extension]) Arguments X: A matrix or a file name extension: Integer number specifying which extension to read. See also function_nelements function_naxis function_naxis1 function_naxis2 xmax Returns the x coordinate of the maximum in X. Syntax result = xmax(X) Arguments X: A matrix. See also function_ymax function_xmin function_ymin function_xcen function_ycen function_maxima function_centroids procedure_centroid ymax Returns the y coordinate of the maximum in X. Syntax result = ymax(X) Arguments X: A matrix. See also function_xmax function_xmin function_ymin function_xcen function_ycen function_maxima function_centroids procedure_centroid xmin Returns the x coordinate of the minimum in X. Syntax result = xmin(X) Arguments X: A matrix. See also function_ymin function_xmax function_ymax function_xcen function_ycen function_maxima function_centroids procedure_centroid ymin Returns the y coordinate of the minimum in X. Syntax result = ymin(X) Arguments X: A matrix. See also function_xmin function_xmax function_ymax function_xcen function_ycen function_maxima function_centroids procedure_centroid xcen Returns the x coordinate of the centroid in X. Syntax result = xcen(X) Arguments X: A matrix. See also function_xmax function_ymax function_xmin function_ymin function_ycen function_maxima function_centroids procedure_centroid ycen Returns the y coordinate of the centroid in X. Syntax result = ycen(X) Arguments X: A matrix. See also function_xmax function_ymax function_xmin function_ymin function_xcen function_maxima function_centroids procedure_centroid real Returns the real part of the complex number X. Syntax result = real(X) Arguments X: The value whose real part is to be returned. This can be a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. See also function_imag function_arg function_abs function_complex function_conj imag Returns the imaginary part of the complex number X. If X is not a complex number, 0 is returned. Syntax result = imag(X) Arguments X: The value whose imaginary part is to be returned. This can be a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. See also function_real function_arg function_abs function_complex function_conj arg Returns the argument of the complex number X (the angle of the polar representation of a complex number). Syntax result = arg(X) Arguments X: The value whose imaginary part is to be returned. This can be a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation. See also function_real function_imag function_abs function_complex function_conj jd Returns the Julian Date of given date. Hour, minute, and second default to 0. Syntax result = jd(day, month, year [, hour [, minute [,second]]]) Arguments day: An integer number. month: An integer number. year: An integer number. hour: An integer number. minute: An integer number. second: A real number. See also function_jdnumber function_jdfraction function_calday function_now jdnumber Returns the integer part of the Julian Date of given date. Hour, minute, and second default to 0. Syntax result = jdnumber(day, month, year [, hour [, minute [,second]]]) Arguments day: An integer number. month: An integer number. year: An integer number. hour: An integer number. minute: An integer number. second: A real number. See also function_jd function_jdfraction function_calday function_now jdfraction Returns the fractional part of the Julian Date of given date. Hour, minute, and second default to 0. Syntax result = jdfraction(day, month, year [, hour [, minute [,second]]]) Arguments day: An integer number. month: An integer number. year: An integer number. hour: An integer number. minute: An integer number. second: A real number. See also function_jd function_jdnumber function_calday function_now upper Converts the string X to upper case. Syntax result = upper(X) Arguments X: A string. See also function_lower procedure_upper lower Converts the string X to lower case. Syntax result = lower(X) Arguments X: A string. See also function_upper procedure_lower string Converts the number X to a string. Syntax result = string(X [,/time] [,/deg] [,/rad] Arguments X: Any number (integer, real, complex). Switches /time: Convert to hours, minutes, and seconds /deg: Convert to degrees, arcminutes, and arcseconds /rad: Same as /deg, but the argument is converted to degrees calday Returns a nicely formatted string telling the calendar date of given Julian Date JD. If JD_fraction is nonzero, it describes the fractional part. Syntax result = calday(JD, JD_fraction) Arguments JD: The julian date JD_fraction: If nonzero, the calendar date for JD+JD_fraction will be returned See also function_jd function_now header Returns the FITS header of X. Syntax result = header(X [, extension]) Arguments X: A matrix or a file name extension: Integer number specifying which extension to read. dayofweek Returns the day of the week of specified (julian) date. Syntax result = dayofweek(DAY, MONTH, YEAR)
result = dayofweek(JD [,JD_fraction]) Arguments DAY: An integer number. MONTH: An integer number. YEAR: An integer number. JD: Julian Date. JD_fraction: A real number. Examples A person who was born an Feb 14, 1970 was born on a Saturday: print dayofweek(14,2,1970) See also function_calday function_jd fits Creates an array (or a matrix) of size X x Y x Z. The arguments Y and Z are optional. The resulting matrix will be of type R4 (single precision). Syntax result = fits(X [, Y [, Z]]) Arguments X: An integer number giving the length of the first dimension. Y: An integer number giving the length of the second dimension. Z: An integer number giving the length of the third dimension. See also function_bytearray function_shortarray function_longarray function_floatarray function_doublearray function_complexarray gauss Creates an elliptical Gaussian. This is defined by respective FWHM1 and FWHM2, axis position angle (in degrees) and Gaussian center position (x, y) in the array. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables. If only one argument is given, return the value of a gauss as determined from exp(-4ln(2)*x^2). Syntax result = gauss(X0)
result = gauss(X, Y, FWHM1 [, FWHM2 [, ANGLE]] [, naxis1=value] [, naxis2 = value]) Arguments X0: A 1D vector or single number where to evaluate the function exp(-4ln(2)*X^2) X: The center of the gaussian in the x-axes Y: The center of the gaussian in the y-axes FWHM1: Full-width at half maximum of the major axes FWHM2: Optional, full-width at half maximum of the minor axes ANGLE: Optional, position angle of the gaussian naxis1=value: Optional, the size of the resulting array in the first dimension naxis2=value: Optional, the size of the resulting array in the second dimension See also function_quickgauss circle Creates a circle centered on X, Y with the respective radius. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables. Syntax result = circle(X, Y, RADIUS [, naxis1=value] [, naxis2 = value]) Arguments X: The center of the circle in the x-axes Y: The center of the circle in the y-axes RADIUS: The radius of the circle naxis1=value: Optional, the size of the resulting array in the first dimension naxis2=value: Optional, the size of the resulting array in the second dimension See also function_ellipse ellipse Creates an ellipse. This is defined by respective RADIUS1 and RADIUS2, axis position angle (in degrees) and Ellipse center position (x, y) in the array. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables. Syntax result = ellipse(X, Y, RADIUS1 [, RADIUS2 [, ANGLE]] [, naxis1=value] [, naxis2 = value]) Arguments X: The center of the ellipse in the x-axes Y: The center of the ellipse in the y-axes RADIUS1: Radius of the major axes RADIUS2: Optional, radius of the minor axes ANGLE: Optional, position angle of the ellipse naxis1=value: Optional, the size of the resulting array in the first dimension naxis2=value: Optional, the size of the resulting array in the second dimension See also function_circle rect Creates a rectangular filter. This is defined by: Respective width and height and center position (X, Y) in the array. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables. Syntax result = rect(X, Y, WIDTH, HEIGHT [, naxis1=value] [, naxis2 = value]) Arguments X: The center of the rectangle in the x-axes Y: The center of the rectangle in the y-axes WIDTH: The width of the rectangle HEIGHT: the height of the rectangle naxis1=value: Optional, the size of the resulting array in the first dimension naxis2=value: Optional, the size of the resulting array in the second dimension delta Creates a delta function. This is defined by: All values in the array 0 except for (x, y) which is set to value. If value is not set, 1 will be used. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables. Syntax result = delta(X, Y [, VALUE] [, naxis1=value] [, naxis2 = value]) Arguments X: The x-position of the nonzero pixel Y: The y-position of the nonzero pixel VALUE: Optional, the value of the nonzero pixel naxis1=value: Optional, the size of the resulting array in the first dimension naxis2=value: Optional, the size of the resulting array in the second dimension cosbell Creates a cosine bell filter. This is defined by: Center position (x, y), inner radius r1, and outer radius r2. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables. Syntax result = cosbell(X, Y, RADIUS1, RADIUS2 [, naxis1=value] [, naxis2 = value]) Arguments X: The center of the cosine bell filter in the x-axes Y: The center of the cosine bell filter in the y-axes RADIUS1: The inner radius where the filter is equal to 1 RADIUS2: The outer radius where the filter is equal to 0 naxis1=value: Optional, the size of the resulting array in the first dimension naxis2=value: Optional, the size of the resulting array in the second dimension chinhat Creates a chinese hat filter. This is defined by: Center position (x, y) and radius. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables. Syntax result = chinhat(X, Y, RADIUS [, naxis1=value] [, naxis2 = value]) Arguments X: The center of the chinese hat filter in the first dimension Y: The center of the chinese hat filter in the second dimension RADIUS: The radius of the chinese hat filter naxis1=value: Optional, the size of the resulting array in the first dimension naxis2=value: Optional, the size of the resulting array in the second dimension airy Creates an airy function at the center of the array. This is defined by: Telescope diameter [meters], pixel scale [arcsec/pixel], and wavelength [microns]. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables. Syntax result = airy(DIAMETER, PIXELSCALE, WAVELENGTH [, naxis1=value] [, naxis2 = value]) Arguments DIAMETER: The telescope diameter in meters PIXELSCALE: The size of a pixel in arcseconds WAVELENGTH: The observing wavelength in microns naxis1=value: Optional, the size of the resulting array in the first dimension naxis2=value: Optional, the size of the resulting array in the second dimension cubemedian Does a median of all images in X. The value reject can be used to exclude a value to be taken when calculating the median. Syntax result = cubemedian(X [, reject]) Arguments X: A matrix or a FITS file name. If a FITS file name is given, the global variable tmpmem determines how many bytes of data are read in at a time. reject: Optional, a value which should be discarded. See also function_collapse Notes If reject is given and no pixel along the cube is different from reject, a value of 0 will be inserted. cubeavg Does an average of all images in X. Optionally, a rejection value can be given which will not be used in the averaging process. Syntax result = cubeavg(X [, reject]) Arguments X: A matrix or a FITS file name. If a FITS file name is given, only one image is read into memory at a time thus saving memory. reject: Optional, the value to disregard Notes If reject is given and no pixel along the cube is different from reject, a value of 0 will be inserted. ssa Calculates the simple shift-and-add of all images in the x datacube. If x is a fits file, a memory saving method will be used to do the ssa. If x is a string, this points to a text file where an arbitrary amount of fits filenames is given as a list. The first image in each of these files will be used for the ssa. If sky, flat, dpl, mask are given, they will be used. An optional keyword method can be given: method = 0 : Shift the brightest pixel to xcen, ycen method = 1 : Integer shift the centroid to xcen, ycen method = 2 : Subpixel shift the centroid to xcen, ycen If method < 0, the same is done as if method were set to 0, but the brightest pixel is searched in a smoothed version of the image. The smoothing is done by convolving with a gaussian of fwhm the negative of method. Syntax result = ssa(X, XCENTER, YCENTER, SKY, FLAT, DPL, MASK [, METHOD] [, /resize]) Arguments X: A FITS datacube XCENTER: The pixel where to shift in the first dimension YCENTER: The pixel where to shift in the second dimension SKY: A sky to be subtracted FLAT: A flatfield to be multiplied DPL: A dead pixel list to be applied MASK: The peak pixel will be searched for in an image multiplied by this mask METHOD: Optional, controls how the SSA will be done: METHOD = 0: Shift the brightest pixel to XCENTER, YCENTER (default) METHOD = 1: Integer shift the centroid to XCENTER, YCENTER METHOD = 2: Subpixel shift the centroid to XCENTER, YCENTER METHOD < 0: the same is done as if METHOD were set to 0, but the brightest pixel is searched in a smoothed version of the image. The smoothing is done by convolving with a gaussian of fwhm the negative of method. Switches /resize: The resulting images will be resized in the way, that in each direction the respective extend of MASK is added twice. mosaic Make a mosaic of the images specified in the file pointed to by FNAME. The file formatis as follows: 3(4) Columns: Filename, xshift, yshift, (scale factor). Negative Shifts result in clipping of the image. Syntax result = mosaic(FNAME)
result = mosaic(filename, xshift, yshift [, scale factor]) Arguments FNAME: A string specifying the file name to use. shift Shifts (and optionally wraps) X by specified values. Syntax result = shift(X, xs, ys [, zs] [, /wrap]) Arguments X: The array to be shifted xs: Shift vector in the first dimension ys: Shift vector in the second dimension zs: Shift vector in the third dimension Switches wrap: Pixels shifted off the array will be wrapped to the opposide side. Notes If either shift vector is non-integer, a subpixel shift is applied and the array type changed to R4. Subpixel shift is only supported in 2 dimensions. rotate Rotates X by ANGLE (in degrees, counterclockwise) Syntax result = rotate(X, ANGLE [, XCENTER, YCENTER]) Arguments X: The matrix to be rotated ANGLE: Rotation angle in degrees. Rotation will we counterclockwise XCENTER: Optional, the center of the rotation in the first dimension (defaults to the center of X). YCENTER: Optional, the center of the rotation in the second dimension (defaults to the center of X). fft Calculates the fast fourier transform of X. If X is real, the forward transform is computed. If X is complex, the inverse transform is computed. Syntax result = fft(X) Arguments X: A matrix. Notes The fft function uses the FFTW (Fastest Fourier Transform in the West) library, which is not limited to any array size. Still, computing a fft is fastest for arrays of size 2^N (N being an integer number). reass Reassembles X. Syntax result = reass(X) Arguments X: A matrix. norm Normalizes X. Syntax result = norm(X [, /unity] [, /total] [, /average]) Arguments X: A matrix. Switches /unity: All values are scaled to be between 0 and 1 (default) /total: The total flux in the resulting array will be 1 /average: The average flux in the resulting array will be 1 clip Clips values in X. If VALUE is not set, all values below low will be set to low, and all values above high will be set to high. If value is set, all values above low AND below high are set to value. Syntax result = clip(X, LOW, HIGH [, VALUE]) Arguments X: The matrix to be clipped LOW: All values below this value will be set to LOW HIGH: All values above this value will be set to HIGH. If HIGH < LOW, no upper clipping will be done VALUE: Optional, if given then all values above LOW and below HIGH will be set to this value (inclusive clipping) smooth Smooths X by multiplying with a gaussian of width FWHM in fourier space. The total flux is kept constant. This is equivalent to reass(fft(fft(X)*fft(gauss(naxis1(X)/2+1,naxis2(X)/2+1,FWHM)))) Syntax result = smooth(X, FWHM [,/x | /y | /z | /xy]) Arguments X: A matrix. FWHM: The full width at half maximum of the gaussian used for smoothing. Switches /x: Smooth along the first axis /y: Smooth along the second axis /z: Smooth along the third axis /xy: 2D Smooth along the first and second axes (default) Examples Smooth each spectrum in a 3D cube (if the spectra are along the 3rd dimension): result = smooth(cube, /z) See also function_boxcar boxcar Computes a running boxcar with radius WIDTH. By default, the value is replaces by the average in the box. This can be changed by specifying one of the switches /minimum, /maximum, or /median. Syntax result = boxcar(X, WIDTH [, /minimum | /maximum | /median] [,/x | /y | /z | /xy]) Arguments X: A matrix. WIDTH: An integer number specifying the radius of the box. Switches /minimum: Each value is replaced with the minimum within a box with radius WIDTH /maximum: Each value is replaced with the maximum within a box with radius WIDTH /median: Each value is replaced with the median within a box with radius WIDTH /x: Boxcar along the first axis /y: Boxcar along the second axis /z: Boxcar along the third axis /xy: 2D boxcar along the first and second axes (default) See also function_smooth 3dexpand Replaces all values in the single images of a datacube by the average in the respective images. Syntax result = 3dexpand(X) Arguments X: A matrix. dpixcreate Creates a dead pixel list of X using a magic threshold. Boxsize defaults to 3 and gives the radius of the running boxcar used. NPASS defaults to 3 and gives the number of passes used. Syntax result = dpixcreate(X, THRESHOLD [, BOXSIZE [, NPASS]]) Arguments X: On this array the dead pixel list will be created THRESHOLD: Sensitivity of the algorithm (use 5 for a start) BOXSIZE: Optional, the size of the square box for comparing pixel values (default: 3) NPASS: Optional, number of iterations dpixapply Corrects dead pixels in X using DPL by interpolation. BOXSIZE defaults to 1 and gives the radius of the boxcar used. Each value where DPL is not 0 will be regarded as a dead pixel. Those are not used in the interpolation process. Syntax result = dpixapply(X, DPL [, BOXSIZE [, method = value]] [,/spiffik [,/bezier]]) Arguments X: The array to be corrected for dead pixels DPL: A dead pixel list in which all non-zero pixels mark dead pixels in X BOXSIZE: Optional, gives the size of the averaging box for interpolation method = value: Optional, gives the type of correction: method = 0: Interpolation from boxcar average (default) method = 1: Interpolation along first dimension method = 2: Interpolation along second dimension Switches /spiffik : obsolete /bezier : obsolete flip Flips X by specified AXIS Syntax result = flip(X, AXIS) Arguments X: The array to be flipped AXIS: Which axis to flip: 1 = x, 2 = y enlarge Enlarges X by specified integer SCALE. Syntax result = enlarge(X, SCALE [, method]) Arguments X: The array to be enlarged SCALE: The resulting array will be SIZE times bigger than X method: Optional, determines how to enlarge: method = 0: Center original image (default) method = 1: Center original image, edge values are mean of edge method = 2: Blow up pixels resize Resizes X to the new axis lengths. The argument NAXIS3 is optional. If the new dimension is smaller than in X, the image will be clipped, else the image will be in the lower left corner. Syntax result = resize(X, NAXIS1, NAXIS2 [, NAXIS3]) Arguments X: A matrix. NAXIS1: The new length in the first dimension. NAXIS2: The new length in the second dimension. NAXIS3: The new length in the third dimension. wien Performs a wiener filtered deconvolution of X using PSF as dirty beam. HEIGHT gives the maximum of the delta function used as filter function and defaults to 1. Syntax result = wien(X, PSF [, HEIGHT]) Arguments X: A matrix. PSF: A matrix. HEIGHT: A real number. See also function_lucy function_clean Notes The memory required for wiener deconvolution (in bytes) calculates as 33*(Number of pixels in the image). lucy Performs a lucy deconvolution of X using PSF as dirty beam and N iterations. THRESHOLD defaults to 0.000003. LUCY DECONVOLUTION ALGORITHM. "Lucy has shown that his iterative scheme is related to the maximum likelihood solution of the deconvolution problem and would converge to that solution after an infinite number of iterations." iteration number : k dirty beam : dbeam dirty map : dmap estimated object : o(k) reconvolved estimated object : oc(k) correctin function : t(k) multiplication : * convolution : (*) start: o(0) = dmap iteration: oc(k) = o(k) (*) dbeam t(k) = (dmap/oc(k)) (*) dbeam o(k+1)= o(k) * t(k) Due to calculation of the quotient for t(k) the algorithm is sensitive to noise. Therefore a weighting function has been implemented which is unity if the dmap signal is larger than "thresh" and zero elsewhere. t(k) is only calculated in that area and hence the deconvolution is only effective there. Threshold equals input if positive. If input is negative thresh is determined via mean and rms in the area below abs(thresh). If thresh is zero thresh is determined in the area below -0.1 times the maximum flux in dmap. The redetermined threshold is mean value plus 3 times rms. To check on convergence of algorithm the rms between input dmap and current lucy deconvolved map reconvolved with dbeam is calculated. Syntax result = lucy(X, PSF, N [, THRESHOLD]) Arguments X: A matrix. PSF: A matrix. N: An integer number. THRESHOLD: A real number. See also function_clean function_wien Notes The memory required for lucy deconvolution (in bytes) calculates as 44*(Number of pixels in the image). center Shifts the brightest pixel in X to the center. Syntax result = center(X) Arguments X: A matrix. 3dnorm (obsolete) Normalizes a 3D datacube. Syntax result = 3dnorm(X, filename) Arguments X: A matrix. filename: Path to a file conj Returns the complex conjugate of X. Syntax result = conj(X) Arguments X: A matrix or a complex number. See also function_complex function_real function_imag function_arg function_abs correl Returns the cross-correlation of X and Y. Syntax result = correl(X, Y) Arguments X: A matrix. Y: A matrix. readfits Read specified FITS file into memory. The optional arguments x1, x2, y1, y2, z1, z2 can be used to read in a part of a FITS file. The combination 0, 0 specifies that the complete range of the respective axis should be read in. Syntax result = readfits(FILENAME [, x1, x2 [, y1, y2 [, z1, z2]]]) Arguments FILENAME: A string. x1, x2: Range in first dimension, defaults to 0, 0 y1, y2: Range in second dimension, defaults to 0, 0 z1, z2: Range in third dimension, defaults to 0, 0 Examples Read in the 150th to 160th slice of a datacube: subcube = readfits("cube.fits", 0, 0, 0, 0, 150, 160) See also function_readfitsextension function_readfitsall 3dspec Returns an average 3D spectrum of X (dispersion along the third dimension) using the mask Y (2-dim) or the center (x,y) with radii r1 and r2. Syntax result = 3dspec(X, Y)
result = 3dspec(X, xcenter, ycenter [, r1 [, r2]]) Arguments X: A three dimensional matrix. Y: A two dimensional matrix. xcenter: The central pixel of the spectrum in the first dimension. ycenter: The central pixel of the spectrum in the second dimension. r1: The radius of the circular aperture to be used. r2: The scaled average of all values in the annulus defined by r1 and r2 will be subtracted from the spectrum (local sky subtraction). stddev Returns the standard deviation of X, optionally omitting a value. Syntax result = stddev(X [, omit]) Arguments X: A matrix. omit: A value to be omitted when calculating the standard deviation. Switches /x: Calculate the standard deviation along the first axis /y: Calculate the standard deviation along the second axis /z: Calculate the standard deviation along the third axis /xy: Calculate the standard deviation along the first and second axes /xz: Calculate the standard deviation along the first and third axes /yz: Calculate the standard deviation along the second and third axes Examples To get a 1D vector of the standard deviation of all slices along a 3D cube: v = stddev(cube, /xy) See also function_max function_min function_avg function_total function_median function_stddev function_variance function_meddev variance Returns the variance of X. Syntax result = variance(X) Arguments X: A matrix. Switches /x: Calculate the variance along the first axis /y: Calculate the variance along the second axis /z: Calculate the variance along the third axis /xy: Calculate the variance along the first and second axes /xz: Calculate the variance along the first and third axes /yz: Calculate the variance along the second and third axes Examples To get a 1D vector of the variance of all slices along a 3D cube: v = variance(cube, /xy) See also function_max function_min function_avg function_total function_median function_stddev function_variance function_meddev meddev Returns the median deviation from the median in X. Syntax result = meddev(X) Arguments X: A matrix. Switches /x: Calculate the median deviation along the first axis /y: Calculate the median deviation along the second axis /z: Calculate the median deviation along the third axis /xy: Calculate the median deviation along the first and second axes /xz: Calculate the median deviation along the first and third axes /yz: Calculate the median deviation along the second and third axes Examples To get a 1D vector of the median deviation of all slices along a 3D cube: v = meddev(cube, /xy) See also function_max function_min function_avg function_total function_median function_stddev saomark Interactively mark pixels in ds9 which are marked on the display. The resulting array will have a value of 1 in each marked pixel, a value of 0 elsewhere. Press any key to mark a point, press 'd' to delete an already marked point, press 'q' to quit. (Use ds9 v5.2 or newer!) Syntax result = saomark() Arguments none random Returns a random number between 0 and 1. If SEED is not set, a seed based on the current time is used. Syntax result = random([SEED]) Arguments SEED: An integer number. See also function_randomg import Imports a text file. If the first character in the file is numeric, the values in the file are written into a numerical array. The number of lines in the file then determine NAXIS2, the number of individual entries in the first line of the file determines NAXIS1. Else the text file will be written into a string array. Syntax result = import(FILENAME [, /text] [, /number]) Arguments FILENAME: A string. Switches /text: Force to read into a string array /number: Force to read into a numerical array rebin Rebins X to the new axis lengths X1 and X2 using a bilinear interpolation. The aspect ratio is not preserved. Syntax result = rebin(X, X1, X2) Arguments X: A matrix. X1: An integer number. X2: An integer number. stringarray Returns a string array. If X is an integer number, a string array will have X entries which are all initialized to empty strings. If X is a string, the string array will initially have one element which is set to X. Syntax result = stringarray(X) Arguments X: A positive integer number. nelements Returns the number of elements in X. For a matrix, this is the total number of pixels, for a string, the number of characters, and for a stringarray, the number of strings. Syntax result = nelements(X) Arguments X: A matrix, string, or string array. ssastat Returns statistics for ssa. Arguments like ssa. The resulting array will be [xshift, yshift, min, max, flux, fwhm, flag]. Syntax result = ssastat(X, XCENTER, YCENTER, SKY, FLAT, DPL, MASK [, METHOD]) Arguments X: A FITS datacube XCENTER: The pixel where to shift in the first dimension YCENTER: The pixel where to shift in the second dimension SKY: A sky to be subtracted FLAT: A flatfield to be multiplied DPL: A dead pixel list to be applied MASK: The peak pixel will be searched for in an image multiplied by this mask METHOD: Optional, controls how the SSA will be done: METHOD = 0: Shift the brightest pixel to XCENTER, YCENTER (default) METHOD = 1: Integer shift the centroid to XCENTER, YCENTER METHOD = 2: Subpixel shift the centroid to XCENTER, YCENTER METHOD < 0: the same is done as if METHOD were set to 0, but the brightest pixel is searched in a smoothed version of the image. The smoothing is done by convolving with a gaussian of fwhm the negative of method. See also function_ssa function_sssa sssa Calculates the simple shift-and-add of all images in X. If X is a FITS file, a memory saving method will be used to do the ssa. Syntax result = sssa(X, STATS, SKY, FLAT, DPL, MASK [, METHOD]) Arguments X: A FITS datacube STATS: An array created with the ssastat function. If its flag is not 1, the image will be skipped SKY: A sky to be subtracted FLAT: A flatfield to be multiplied DPL: A dead pixel list to be applied MASK: The peak pixel will be searched for in an image multiplied by this mask METHOD: Optional, controls how the SSA will be done: METHOD = 0: Shift the brightest pixel to XCENTER, YCENTER (default) METHOD = 1: Integer shift the centroid to XCENTER, YCENTER METHOD = 2: Subpixel shift the centroid to XCENTER, YCENTER See also function_ssa function_ssastat ssaselect Obsolete function maxentropy Maximum entropy deconvolution of X using PSF. Syntax result = maxentropy(X, PSF, N [, MASK]) Arguments X: A matrix. PSF: A matrix. N: An integer number. MASK: An optional mask of image regions to be used. cubeminimum Returns the minimum of each pixel along the 3rd axis if X is a cube. Syntax result = cubeminimum(X) Arguments X: A matrix or a FITS file name. If a FITS file name is given, only one image is read into memory at a time thus saving memory. cubemaximum Returns the maximum of each pixel along the 3rd axis if X is a cube. Syntax result = cubemaximum(X) Arguments X: A matrix or a FITS file name. If a FITS file name is given, only one image is read into memory at a time thus saving memory. fwhm Returns the second order moment of X centered at [XCENTER, YCENTER] within RADIUS, which corresponds to the FWHM at that location. The parameter RADIUS is optional. If skipped, a default of 5 pixels will be used. Syntax result = fwhm(X, XCENTER, YCENTER [, RADIUS]) Arguments X: A matrix. XCENTER: An integer number. YCENTER: An integer number. RADIUS: An integer number. setbitpix Change the pixel type of X. Syntax result = setbitpix(X, BITPIX [, BSCALE [, BZERO]]) Arguments X: The array whose pixel type is to be changed BITPIX: Desired pixel type: BITPIX = -128: Complex (note that this does not conform to FITS standard) BITPIX = -64: Floating point, double precision BITPIX = -32: Floating point, single precision BITPIX = 8: Unsigned char BITPIX = 16: Short BITPIX = 32: Long BSCALE, BZERO: For integer BITPIX, optionally BSCALE and BZERO can be given. The value represented by each pixel is given by value * BSCALE + BZERO (the defaults are BSCALE = 1 and BZERO = 0) See also function_getbitpix bytearray Returns an array with bitpix = 8 (all pixels are of type unsigned char). bscale will be set to 1.0, bzero to 0.0. Syntax result = bytearray(X [, Y [, Z]]) Arguments X: An integer number specifying the length of the first dimension. Y: An integer number specifying the length of the second dimension. Z: An integer number specifying the length of the third dimension. See also function_fits function_shortarray function_longarray function_floatarray function_doublearray function_complexarray shortarray Returns an array with bitpix = 16 (all pixels are of type short). bscale will be set to 1.0, bzero to 0.0. Syntax result = short(array(X [, Y [, Z]]) Arguments X: An integer number specifying the length of the first dimension. Y: An integer number specifying the length of the second dimension. Z: An integer number specifying the length of the third dimension. See also function_fits function_bytearray function_longarray function_floatarray function_doublearray function_complexarray longarray Returns an array with bitpix = 32 (all pixels are of type long). bscale will be set to 1.0, bzero to 0.0. Syntax result = longarray(X [, Y [, Z]]) Arguments X: An integer number specifying the length of the first dimension. Y: An integer number specifying the length of the second dimension. Z: An integer number specifying the length of the third dimension. See also function_fits function_bytearray function_shortarray function_floatarray function_doublearray function_complexarray floatarray Returns an array with bitpix = -32 (all pixels are of type float). Syntax result = floatarray(X [, Y [, Z]]) Arguments X: An integer number specifying the length of the first dimension. Y: An integer number specifying the length of the second dimension. Z: An integer number specifying the length of the third dimension. See also function_fits function_bytearray function_shortarray function_longarray function_doublearray function_complexarray doublearray Returns an array with bitpix = -64 (all pixels are of type double). Syntax result = doublearray(X [, Y [, Z]]) Arguments X: An integer number specifying the length of the first dimension. Y: An integer number specifying the length of the second dimension. Z: An integer number specifying the length of the third dimension. See also function_fits function_bytearray function_shortarray function_longarray function_floatarray function_complexarray complexarray Returns an array with bitpix = -128 (all pixels are of type complex). !!! WARNING: bitpix = -128 does NOT conform to the FITS standard !!! Syntax result = complexarray(X [, Y [, Z]]) Arguments X: An integer number specifying the length of the first dimension. Y: An integer number specifying the length of the second dimension. Z: An integer number specifying the length of the third dimension. See also function_fits function_bytearray function_shortarray function_longarray function_floatarray function_doublearray shrink Shrinks X or the specified axis of X by specified FACTOR Syntax result = shrink(X, FACTOR [, AXIS]) Arguments X: A matrix. FACTOR: An integer number. AXIS: optionally, which axis to shrink (1, 2, or 3) getfitskey Returns the value of specified FITS key in the header of X. The returned type can be either a string, an integer number or a real number. If the specified key does not exist, an empty string is returned. Syntax result = getfitskey(X, KEY [, /text]) Arguments X: A matrix or a FITS file. KEY: A string. Switches text: Return the fits key as a string. polyfit Returns a N-th order polynomial fit to X. X must be 1-dimensional. The function returns a vector of size (N+1)*2. The fittet polynomial has the following form: f(x) = a0 + a1 * x + ... + aN * X^N The values a0, ..., aN are returned in the first N elements of the returned vector, their respective errors in the elements N+1...2*N. Syntax result = polyfit(X, N [, CHISQ]) Arguments X: A vector. N: An integer number. CHISQ: If set to a named variable, the variable is overwritten with the chi-squared of the fit. See also function_polyfitxy function_polyfitxyerr function_polyfit2d function_polyfit2derr sprintf RETURNS X (either a real number or an integer) as a string using specified format string. The formatting is done like in the C printf function. The total length of the formatted string is limited to 256 characters. Syntax result = sprintf(FORMAT, X) photometry Perform aperture photometry on X. This function returns a 3xn matrix with the following information: measured counts, normalized counts (Jansky), magnitude. Syntax result = photometry(X, POSLIST, REFLIST, SEARCHBOX, RADIUS, [,/u | /b | /v | /r | /i | /j | /h | /k | /l | /m | /n]) Arguments X: The image on which to do aperture photometry POSLIST: A 2xn matrix containing the positions of the stars REFLIST: A 1xm matrix containing magnitudes of reference stars (in the same order as in poslist), with a value > 20.0 if not to be used SEARCHBOX: Within a box with this radius the local maximum of the stars are searched RADIUS: The radius of the circular aperture used for photometry Switches /u: Do photometry for U-Band (epsilon = 3.274) /b: Do photometry for B-Band (epsilon = 3.674) /v: Do photometry for V-Band (epsilon = 3.581) /r: Do photometry for R-Band (epsilon = 3.479) /i: Do photometry for I-Band (epsilon = 3.386) /j: Do photometry for J-Band (epsilon = 3.248) /h: Do photometry for H-Band (epsilon = 3.08) /k: Do photometry for K-Band (epsilon = 2.8) (default) /l: Do photometry for L-Band (epsilon = 2.49) /m: Do photometry for M-Band (epsilon = 2.26) /n: Do photometry for N-Band (epsilon = 1.63) transcoords Transform a set of coordinates from one image to another. The coordinate transformation matrix is described by a first order polynomial if the number of reference sources is <= 6, else a second order polynomial is used. The transformation function will be calculated using a least squares fit to given coordinates. Note that if either in REFSTARS or in IMSTARS a coordinate is exactly (-1, -1), this star will not be used to calculate the transformation matrix. Syntax result = transcoords(MASTERLIST, REFSTARS, IMSTARS [, xerror, yerror][, /silent] [, /linear] [, /cubic] [, /rotation]) Arguments MASTERLIST: A matrix 2xn with the coordinates to be transformed REFSTARS: A matrix 2xm (m >= 3) with positions of the reference stars in the reference frame (= masterlist) IMSTARS: A matrix 2xm (same size as REFSTARS) with the positions of the same stars in the image to be transformed. xerror: If set to a named variable, the residual error of the coordinate transform in the first axis is returned. yerror: If set to a named variable, the residual error of the coordinate transform in the second axis is returned. Switches /silent: Printing of output is suppressed /linear: A 1st order polynomial is fitted (even when more than 6 reference sources are supplied) /cubic: A 3rd order polynomial is fitted (at least 10 reference sources) /rotation: A rotational transformation is fitted (at least 4 reference sources): x' = x0 + f*cos(a)*x - f*sin(a)*y, y' = y0 + f*sin(a)*x + f*cos(a)*y See also function_transmatrix function_transform findfile Returns all files that satisfy given PATTERN. All occurrences of a backslash are replaced by a slash. Also, a slash is appended to all directories. The search is started from the current directory and is done recursively through the directory structure. Syntax result = findfile(PATTERN) Arguments PATTERN: A string. Examples Find all text files (files with the suffix .txt) from the current working directory: print findfile("*.txt") See also function_dir function_fileexists markpos Mark positions using ds9. The positions are returned as a 2xn matrix, where n denotes the number of positions marked. Pressing the key 'q' will quit marking positions. When typing numbers between 1 and 9 the values are stored at that specific position. This way values can be overwritten. (Use ds9 v5.2 or newer!) Syntax result = markpos(X [, int radius] [, /nocenter]) Arguments X: The image to be displayed on saoimage radius: Optional, the radius around which the brightest pixel is searched for using centroid-method. Switches nocenter: Has no effect when no radius is supplied. Returns the local maximum in the radius around the marked pixel. See also function_saomark lmst Calculate the local mean siderial time for given Julian date. If longitude is given (east negative), the local mean sidereal time for that location is returned, else the lmst for Greenwich (longitude 0). NOTE that timezones for given longitude are not taken into account, so always give jd in Universal Time. Syntax result = lmst(JD [, LATITUDE]) Arguments JD: A real number. LATITUDE: A real number. See also function_jd wsa Compute weighted shift-and-add of the fits cube X (must be a file). The shift location is defined by xcen, ycen. thresh gives the fraction of the maximum pixel which will be regarded as a speckle. speckles determines the maximum number of speckles used (if there are more, then the image will be smoothed until it is not exceeded). smooth optionally gives the fwhm of a gaussian with which the image where speckles are searched for is smoothed. If bigmask is given, the centroid of mask will be shifted to the centroid of bigmask for each individual image. Syntax result = wsa(X, XCENTER, YCENTER, THRESHOLD, SPECKLES, SMOOTH, SKY, FLAT, DPL, MASK [, BIGMASK]) Arguments X: A FITS filename (enclosed in single quotes). XCENTER: An integer number specifying the shift position in the first dimension. YCENTER: An integer number specifying the shift position in the second dimension. THRESHOLD: A real number. SPECKLES: An integer number. SMOOTH: An integer number. SKY: A matrix. FLAT: A matrix. DPL: A matrix. MASK: A matrix. BIGMASK: A matrix. swsa Compute weighted shift-and-add of the fits cube X (must be a file). flags is a 1-dimensional array that has a value of zero for each image that is to be skipped. The shift location is defined by xcen, ycen. thresh gives the fraction of the maximum pixel which will be regarded as a speckle. speckles determines the maximum number of speckles used (if there are more, then the image will be smoothed until it is not exceeded). smooth optionally gives the fwhm of a gaussian with which the image where speckles are searched for is smoothed. If bigmask is given, the centroid of mask will be shifted to the centroid of bigmask for each individual image. Syntax result = wsa(X, FLAGS, XCENTER, YCENTER, THRESHOLD, SPECKLES, SMOOTH, SKY, FLAT, DPL, MASK, BIGMASK) Arguments X: A FITS filename (enclosed in single quotes). FLAGS: A vector. XCENTER: An integer number specifying the shift position in the first dimension. YCENTER: An integer number specifying the shift position in the second dimension. THRESHOLD: A real number. SPECKLES: An integer number. SMOOTH: An integer number. SKY: A matrix. FLAT: A matrix. DPL: A matrix. MASK: A matrix. BIGMASK: A matrix. centroids Returns a 2xn matrix with the centroids (in a RADIUS) on given POSITIONS in X. Syntax result = centroids(X, POSITIONS, RADIUS) Arguments X: A matrix. POSITIONS: A 2xn matrix with initial positions. RADIUS: An integer number. See also function_maxima maxima Refind local maxima in X given POSITIONS around RADIUS. Syntax result = maxima(X, POSITIONS, RADIUS [, /circle, /box]) Arguments X: A matrix. POSITIONS: A 2xn matrix with initial positions. RADIUS: An integer number. Switches /circle: Local maxima are searched for within a circle with RADIUS /box: Local maxima are search for within a quadratic box with RADIUS See also function_centroids fileexists Test for existence of a file. Returns 1 if the file exist, 0 otherwise. Syntax result = fileexists(FILENAME) Arguments FILENAME: A string. See also function_findfile function_dir function_filesize filesize Return the length in bytes of a file. Returns -1 if the file does not exist. Syntax result = filesize(FILENAME) Arguments FILENAME: A string. See also function_findfile function_dir function_fileexists dir Return a directory listing. Syntax result = dir([DIRECTORY], [, /recursive]) Arguments DIRECTORY: Optional, do a directory listing of specified directory, else of the current working directory Switches /recursive: Do a recursive listing Examples To print a recursive listing of the current directory, type print dir("", /recursive) See also function_findfile function_filesize function_fileexists polyfitxy Return an n-th order polynomial fit to the vectors X and Y, where y = f(x). If a variable is given as the 4th argument, it will be overwritten with the chi squared of the fit. Syntax result = polyfitxy(X, Y, N [, CHISQ]) Arguments X: A vector. Y: A vector. N: An integer number. CHISQ: If set to a named variable, the variable is overwritten with the chi-squared of the fit. See also function_polyfit function_polyfitxyerr function_polyfit2d function_polyfit2derr sort Returns an index list of X in ascending order. Syntax result = sort(X [, /reverse]) Arguments X: A matrix, a string or a string array. Switches /reverse: The index list will be in descending order Examples To sort a directory listing in alphabetical order, type: list = dir("/tmp"); list = list[sort(list)] char Returns the ASCII character which number is N. N is truncated to the range 0...255. Syntax result = char(N) Arguments N: An integer number. Examples To print out the ASCII character set, type: for (i = 32; i < 256; i++) print char(i) complex Returns a complex number generated of the two given values. Syntax result = complex(r, i) Arguments r: The real part (either a real number or a matrix) i: the imaginary part (either a real number or a matrix) See also function_real function_imag function_conj function_arg function_abs strpos Returns the position of a substring within a string, or -1 if the substring does not occur. If the first argument is a string array, a matrix with the same number of elements as the string is returned. Syntax result = strpos(X, Y) Arguments X: A string or a string array Y: The substring to be searched for Switches /nocase: The search is done case-insensitive clean Performs "cleaning" of the input image. This iterative deconvolution algorithm searches for the global maximum in the image, shifts the psf to that position and subtracts a scaled psf (multiplied by the gain). The subtracted flux is added to a delta map at the position of the maximum (this is the clean map). Note that clean does not conserve the total flux in the image. Syntax result = clean(IMAGE, PSF, N, GAIN [, variable SUB]) Arguments IMAGE: input map to be cleaned (dirty map) PSF: Point spread function (dirty beam) N: Number of iterations GAIN: Loop gain factor SUB: Optional, the variable SUB will contain an image in which the sources are subtracted See also function_lucy function_wien collapse Collapse one axis of an array. All values along the specified axis will be summed up. The resulting array will have one dimension less than the input. Syntax result = collapse(IMAGE, AXIS) Arguments IMAGE: A matrix. AXIS: An integer number. Examples Do a sum of all images in a datacube: s = collapse(cube, 3) This is exactly the same as: s = cubeavg(cube) * naxis3(cube) See also function_cubeavg magnify Resize given array by the scaling factor. Each pixel in the resized array will be blown up and consequently contain scale^2 pixels. The optional argument smooth gives the fwhm of a gaussian with which the resultant array will we smoothed. The total flux in the array will be conserved. Syntax result = magnify(IMAGE, scale [, fwhm]) Arguments IMAGE: A matrix scale: An integer number. fwhm: A real number. wsastat Compute statistics for the weighted shift-and-add of the fits cube X (must be a file). The shift location is defined by xcen, ycen. thresh gives the fraction of the maximum pixel which will be regarded as a speckle. speckles determines the maximum number of speckles used (if there are more, then the image will be smoothed until it is not exceeded). smooth optionally gives the fwhm of a gaussian with which the image where speckles are searched for is smoothed. If bigmask is given, the centroid of mask will be shifted to the centroid of bigmask for each individual image. Syntax result = wsastat(X, XCENTER, YCENTER, THRESHOLD, SPECKLES, SMOOTH, SKY, FLAT, DPL, MASK, BIGMASK) Arguments X: A FITS filename (enclosed in single quotes). XCENTER: An integer number specifying the shift position in the first dimension. YCENTER: An integer number specifying the shift position in the second dimension. THRESHOLD: A real number. SPECKLES: An integer number. SMOOTH: An integer number. SKY: A matrix. FLAT: A matrix. DPL: A matrix. MASK: A matrix. BIGMASK: A matrix. gaussfit Fit a one-dimensional gaussian to a vector. The gauss function is defined as G(x) = A + B*exp(-4ln2*(x-x0)^2/fwhm^2). Syntax result = gaussfit(X, Y, errors, estimate [, chisq]) Arguments X: A vector containing the x values to be fit Y: A vector containing the y values to be fit errors: The errors in Y estimate: Initial estimate for the fit of the form [A, B, x0, fwhm] chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit. Returns The returned vector contains the best-fit parameters in the form [A, B, x0, fwhm, d_A, d_B, d_x0, d_fwhm] See also function_evalgaussfit gauss2dfit Fit a two-dimensional gaussian to a rectangular grid (i.e. an image). Syntax result = gauss2dfit(image, errors, estimate [, chisq]) Arguments image: The image to be fit errors: The errors in the image values estimate: Initial estimate for the fit of the form [Offset,Max,x0,y0,fwhm1,fwhm2,angle] chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit. Returns The returned vector contains the best-fit parameters in the form [Offset, Max, x0, y0, fwhm1, fwhm2, angle, d_Offset, d_Max, d_x0, d_y0, d_fwhm1, d_fwhm2, d_angle] See also function_gauss2dsimplefit function_multigauss2dfit polyfitxyerr Return an n-th order polynomial fit to the vectors X and Y, where y = f(x). The typical error of the dependent variables is given in ERROR. If a variable is given as the 4th argument, it will be overwritten with the chi squared of the fit. Syntax result = polyfitxyerr(X, Y, N, ERROR [, CHISQ]) Arguments X: A vector. Y: A vector. N: An integer number. ERROR: The error of the Y-values. If this is a real number, all X-values are assumed to have the same error. If ERROR is a vector, it must have the same length as X and Y and gives the error or each individual X value. CHISQ: If set to a named variable, the variable is overwritten with the chi-squared of the fit. See also function_polyfit function_polyfitxy function_polyfit2d function_polyfit2derr psf Return the average (or median, minimum, maximum) of several stars in an image. The stars locations are given in the second argument. Syntax result = psf(X, POSITIONS [, /median] [, /average] [, /minimum] [, /maximum]) Arguments X: A matrix. POSITIONS: A 2xn matrix giving the positions of the stars to be averaged. Switches /median: Return the median of the stars (default). /average: Return the average of the stars. /minimum: Return the minimum of the stars. /maximum: Return the maximum of the stars. pwd Return the absolute path of the current directory. Syntax result = pwd() Arguments none Returns A string with the absolute path of the current directory. See also function_dir procedure_cd quickgauss Create a circular gaussian. Syntax result = quickgauss(X, Y, FWHM, speed [, naxis1=value] [, naxis2=value]) Arguments X: The center of the gaussian in the x-axes Y: The center of the gaussian in the y-axes FWHM: Full-width at half maximum of the circular gaussian speed: The gaussian is calculated up to a distance of speed*FWHM from the center location naxis1=value: Optional, the size of the resulting array in the first dimension naxis2=value: Optional, the size of the resulting array in the second dimension Returns A two-dimensional circular gaussian. See also function_gauss getenv Return the content of an environment variable. Syntax result = getenv(S) Arguments S: A string with the name of the environment variable. Returns A string with the content of the environment variable. If the environment variable does not exist, an empty string is returned. See also procedure_setenv cblank Replace all undefined values (like NaN or Inf) by another value. If no value is specified, these values will be replace by 0.0. Syntax result = cblank(ARRAY [, value]) Arguments ARRAY: A matrix value: Optional, the value to be assigned (defaults to 0) See also procedure_cblank now Return the julian date of the current system time. The timezone (and daylight saving time, if appropriate) are taken into account. Syntax result = now() Arguments none See also function_jd function_calday polar Returns a complex number generated of the two given values in polar representation. This is equivalent to complex(a * cos(b), a * sin(b)). Syntax result = polar(ampl, arg) Arguments ampl: The amplitude (either a real number or a matrix) arg: The argument (either a real number or a matrix) See also function_complex function_real function_imag function_conj function_arg function_abs transmatrix Compute the transformation matrix for two reference coordinate systems. It is described by a first order polynomial if the number of reference sources is <= 6, else a second order polynomial is used. The transformation function will be calculated using a least squares fit to given coordinates. Note that if either in REFSTARS or in IMSTARS a coordinate is exactly (-1, -1), this star will not be used to calculate the transformation matrix. Syntax result = transmatrix(REFSTARS, IMSTARS [, xerror, yerror][, /silent] [, /linear] [, /cubic] [, /rotation]) Arguments REFSTARS: A matrix 2xm (m >= 3) with positions of the reference stars in the reference frame (= masterlist) IMSTARS: A matrix 2xm (same size as REFSTARS) with the positions of the same stars in the image to be transformed. xerror: If set to a named variable, the residual error of the coordinate transform in the first axis is returned. yerror: If set to a named variable, the residual error of the coordinate transform in the second axis is returned. Switches /silent: Printing of output is suppressed /linear: A 1st order polynomial is fitted (even when more than 6 reference sources are supplied) /cubic: A 3rd order polynomial is fitted (at least 10 reference sources) /rotation: A rotational transformation is fitted (at least 4 reference sources): x' = x0 + f*cos(a)*x - f*sin(a)*y, y' = y0 + f*sin(a)*x + f*cos(a)*y Returns For 1st and 2nd order polynomials: A matrix 2x6 which describes the coordinate transformation matrix: x' = result[1,1] + result[1,2]*x + result[1,3]*y + result[1,4]*xy + result[1,5]*x^2 + result[1,6]*y^2 y' = result[2,1] + result[2,2]*x + result[2,3]*y + result[2,4]*xy + result[2,5]*x^2 + result[2,6]*y^2
For 3rd order polynomials: A matrix 2x10 which describes the coordinate transformation matrix: x' = result[1,1] + result[1,2]*x + result[1,3]*y + result[1,4]*xy + result[1,5]*x^2 + result[1,6]*y^2 + result[1,7]*x^2y + result[1,8]*xy^2 + result[1,9]*x^3 + result[1,10]*y^3 y' = result[2,1] + result[2,2]*x + result[2,3]*y + result[2,4]*xy + result[2,5]*x^2 + result[2,6]*y^2 + result[2,7]*x^2y + result[2,8]*xy^2 + result[2,9]*x^3 + result[2,10]*y^3
For rotational transformation: A matrix 1x4 which describes the coordinate transformation matrix: x' = result[1] + result[3] * cos(result[4])*x - result[3] * sin(result[4])*y y' = result[2] + result[3] * sin(result[4])*x + result[3] * cos(result[4])*y See also function_transcoords function_transform transform Apply a transformation matrix to a set of coordinates. Syntax result = transform(COORDS, TRANS) Arguments COORDS: A matrix 2xN with the initial coordinates. TRANS: A matrix 2x6 which contains the coordinate transformation matrix. Returns A matrix 2xN with the transformed coordinates. See also function_transcoords function_transmatrix invert Return the inverse of a 2-dimensional, square matrix. Syntax result = invert(X) Arguments X: A 2-dimensional, square matrix. Returns The inverse of X. Examples print X # invert(X), /values< will return a unity matrix transpose Return the matrix X transposed, i.e. rows and columns are interchanged. Syntax result = transpose(X) Arguments X: A vector or a 2-dimensional matrix. isvariable Check whether given variable name (as a string) exists in memory. Syntax result = isvariable(S) Arguments S: A string with the variable name Returns 1 if the variable exists, 0 otherwise pi Return the number PI. It will be computet as 2 * acos(0). Syntax result = pi() Arguments none Examples Print the number pi to 15 significant digits: DPUSER> print sprintf("%.15f", pi()) 3.141592653589793 See also category_trigonometry convolve Convolve an image with a kernel. The resulting array is returned with bitpix -32. Syntax result = convolve(a, b) Arguments a: The array to be convolved. b: The kernel to convolve the image with. Notes If a and b are of exactly the same size, the two are multiplied in fourier space. If b is smaller than a and a square matrix, a convolved with the kernel b is returned. gammp Return the incomplete gamma function P(a, x). Syntax result = gammp(a, x) Arguments a: A number > 0 x: A number > 0, the value where to evaluate the incomplete gamma function reform Resize an array without actually moving data. The number of new elements must exactly match the number of elements in the array to be resized. If no size arguments are given, all array axes with length 1 are removed. Syntax result = reform(a, [n1 [, n2 [, n3]]]) Arguments a: The array to be resized n1: New axis length n2: New axis length n3: New axis length find [This documentation is copied literally from IDL's astrolib] Find positive brightness perturbations (i.e stars) in an image. Also returns centroids and shape parameters (roundness & sharpness). Adapted from 1986 STSDAS version of DAOPHOT. Syntax result = find(image, hmin, fwhm [, roundlim [, sharplim]] [, /silent]) Arguments image: 2 dimensional image array for which one wishes to identify the stars present. hmin: Threshold intensity for a point source - should generally be 3 or 4 sigma above background. fwhm: FWHM to be used in the convolve filter. sharplim: 2 element vector giving low and high cutoff for the sharpness statistic (Default: [0.2,1.0]). Change this default only if the stars have significantly larger or or smaller concentration than a Gaussian. roundlim: 2 element vector giving low and high cutoff for the roundness statistic (Default: [-1.0,1.0]). Change this default only if the stars are significantly elongated. Switches silent: Normally, FIND will write out each star that meets all selection criteria. If the SILENT keyword is set then this printout is suppressed. Returns The find function returns an array of size 5xnstars with the following entries:
x: vector containing x position of all stars identified by FIND
y: vector containing y position of all stars identified by FIND
flux: vector containing flux of identified stars as determined by a gaussian fit. Fluxes are NOT converted to magnitudes.
sharp: vector containing sharpness statistic for identified stars
round: vector containing roundness statistic for identified stars Notes The sharpness statistic compares the central pixel to the mean of the surrounding pixels. If this difference is greater than the originally estimated height of the Gaussian or less than 0.2 the height of the Gaussian (for the default values of SHARPLIM) then the star will be rejected. histogram Create a histogram of given array. Syntax result = histogram(a [, min [, max [, binsize]]] [, /reverse]) Arguments a: 1D or 2D Array min: Datapoints with a value smaller than min are neglected. max: Datapoints with a value greater than max are neglected. binsize: Default is 1. Values between are rounded Switches /reverse: Create the reverse indices of a histogram meandev Calculate the mean deviation of given array, optionally omitting a value. This is defined as 1/sqrt(n-1)*stddev(a). Syntax result = meandev(a [, omit]) Arguments a: The array which mean deviation from the average should be returned. omit: An optional value which should be ignored. See also function_stddev function_avg version Return the version string of the currently used DPUSER. Syntax result = version() Arguments none spifficube (obsolete) Create a cube of a SPIFFI raw frame. The wavelength of each slitlet is shifted to one pixel accuracy. The wavelength scale is not being linearized. Syntax result = spifficube(inframe, [HK], [K]) Arguments inframe: A raw SPIFFI frame (1024 x 1024 pixels) Switches HK: The shift in wavelength scale is done for the HK grism. K: The shift in wavelength scale is done for the K grism. See also function_spiffiuncube function_spiffishift spiffiuncube (obsolete) Undo cube creation done with spifficube. The resulting frame will be 1024 x 1024 (as for spiffi raw data). Syntax result = spiffiuncube(incube, [HK], [K]) Arguments incube: A SPIFFI cube created with spifficube Switches HK: The shift in wavelength scale is done for the HK grism. K: The shift in wavelength scale is done for the K grism. See also function_spifficube function_spiffishift spiffishift (obsolete) Shift slitlets of a raw SPIFFI frame so that the wavelength of each slitlet is shifted to one pixel accuracy. The wavelength scale is not being linearized. Syntax result = spiffishift(inframe, [HK], [K]) Arguments inframe: A raw SPIFFI frame (1024 x 1024 pixels) Switches HK: The shift in wavelength scale is done for the HK grism. K: The shift in wavelength scale is done for the K grism. See also function_spifficube function_spiffiuncube bezier (obsolete) xxx Syntax result = bezier(xxx [, xxx]) Arguments xxx: xxx xxx: xxx See also function_bezier1d bezier1d (obsolete) xxx Syntax result = bezier1d(xxx , xxx) Arguments xxx: xxx xxx: xxx See also function_bezier moffat Create an elliptical moffat function. Syntax result = moffat(x, y, power, fwhm1 [, fwhm2 [, angle]] [, naxis1=value] [, naxis2 = value]) Arguments X: The center of the moffat in the x-axes Y: The center of the moffat in the y-axes power: The power index of the moffat function fwhm1: Full-width at half maximum of the major axes fwhm2: Optional, full-width at half maximum of the minor axes angle: Optional, position angle of the moffat naxis1=value: Optional, the size of the resulting array in the first dimension naxis2=value: Optional, the size of the resulting array in the second dimension readfitsextension Read specified FITS file extension into memory. The optional arguments x1, x2, y1, y2, z1, z2 can be used to read in a part of a FITS file. The combination 0, 0 specifies that the complete range of the respective axis should be read in. Syntax result = readfitsextension(FILENAME, extension [, x1, x2 [, y1, y2 [, z1, z2]]]) Arguments FILENAME: A string. extension: Integer number specifying which extension to read. x1, x2: Range in first dimension, defaults to 0, 0 y1, y2: Range in second dimension, defaults to 0, 0 z1, z2: Range in third dimension, defaults to 0, 0 See also function_readfits function_readfitsall multigauss2dfit Fit a number of circular gaussians to an image. All gaussians have the save FWHM. Syntax result = multigauss2dfit(image, errors, estimate [, chisq]) Arguments image: The image to be fit errors: The errors in the image values estimate: Initial estimate for the fit of the form [Offset,fwhm,height_1,x_1,y_1,height_2,x_2,y_2,...,height_n,x_n,y_n] chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit. Returns The returned vector contains the best-fit parameters in the form [Offset,fwhm,height_1,x_1,y_1,...,height_n,x_n,y_n,d_Offset,d_fwhm,d_height_1,d_x_1,d_y_1,...,d_height_n,d_x_n,d_y_n] See also function_gauss2dfit function_gauss2dsimplefit sincfit Fit a sinc function to a set of data points. The function fit is y(x)=A+B*sinc((x+phi)/width) Syntax result = sincfit(X, Y, errors, estimate [, chisq]) Arguments X: A vector containing the x values to be fit Y: A vector containing the y values to be fit (in radians) errors: The errors in Y estimate: Initial estimate for the fit of the form [A,B,phi,width] chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit. Returns The returned vector contains the best-fit parameters in the form [A,B,phi,width,d_A,d_B,d_phi,d_width] rebin1d Rebin a one-dimensional vector to new values. Syntax result = rebin1d(spectrum, xstart, xend, xdelta [, xvalues]) Arguments spectrum: A one-dimensional FITS. It should have the correct FITS keywords (CRVAL1, CRPIX1, and CDELT1) or the optional argument xvalues should be given. xstart: The first channel in the rebinned data xend: The last channel in the rebinned data xdelta: The increment step size for the rebinned data xvalues: A vector of same length as spectrum with the corresponding x-values. Returns The returned vector has the data rebinned with the appropritate FITS keywords set. See also function_interpol velmap Go through a datacube and fit a gaussian to a line. The arguments center and fwhm are used as initial estimate for the gauss-fit. Syntax result = velmap(cube, center, fwhm [, threshold]) Arguments cube: A datacube center: The approximate center (wavelength) of the line to fit fwhm: The approximate FWHM of the line to fit threshold: A lower limit under which no fit is attempted (given as percentage of peak flux) Returns A datacube with the following slices:
result[*,*,1]: fit background
result[*,*,2]: fit continuum
result[*,*,3]: fit line center
result[*,*,4]: fit line FWHM
result[*,*,5]: error in background fit
result[*,*,6]: error in continuum fit
result[*,*,7]: error in line center fit
result[*,*,8]: error in line FWHM fit
result[*,*,9]: chi squared of fit
fxcor Compute the cross-correlation of two spectra. The spectra will be rebinned to the lowest dispersion, continuum subtracted and normalised prior to the cross-correlation. Syntax result = fxcor(template, spectrum) Arguments template: The template spectrum spectrum: The object spectrum Returns The cross-correlation of the two spectra See also function_correlmap correlmap Compute the cross-correlation maximum of a datacube and a template spectrum. Syntax result = correlmap(cube, template) Arguments cube: The datacube to be cross-correlated template: The template spectrum Returns A 2D-map with the maximum of the cross-correlation See also function_fxcor longslit Create a pseudo-longslit from a datacube. Syntax result = longslit(cube, x, y, theta, width) Arguments cube: A datacube x: The x center for the longslit y: The y center for the longslit theta: The position angle, in degrees width: The width of the longslit, in pixels Returns A 2D longslit spectrum See also function_twodcut evalvelmap Evaluate the result of velmap. Syntax result = evalvelmap(fit, template) Arguments fit: The result of the velmap function template: A template cube which defines how big the resulting cube will be. Returns The evaluated cube, with gaussians at the appropriate places along the third dimension. See also function_velmap sinfit Fit a sine curve to a set of data points. The function fit is y(x)=A+B*sin(x+phi) Syntax result = sinfit(X, Y, errors, estimate [, chisq]) Arguments X: A vector containing the x values to be fit Y: A vector containing the y values to be fit (in radians) errors: The errors in Y estimate: Initial estimate for the fit of the form [A,B,phi] chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit. Returns The returned vector contains the best-fit parameters in the form [A,B,phi,d_A,d_B,d_phi] indexbase Return the base index: 0 for C-notation, 1 for Fortran-notation Syntax result = indexbase() Arguments none Returns The index base See also procedure_cnotation procedure_fortrannotation procedure_setindexbase voronoi Perform adaptive spatial binning of Integral-Field Spectroscopic (IFS) data to reach a chosen constant signal-to-noise ratio per bin. This method is required for the proper analysis of IFS observations, but can also be used for standard photometric imagery or any other two-dimensional data. Further information on VORONOI_2D_BINNING algorithm can be found in Cappellari M., Copin Y., 2003, MNRAS, 342, 345 Syntax result = voronoi(signal, noise, target, targetSN [, /map]) Arguments signal: A 2D map with the signal in each pixel noise: A 2D map specifying the noise in each pixel. Pixels with a noise value of zero will be neglected in the voronoi binning target: The image which should be binned (can be the same as the signal map) targetSN: The Signal/Noise value which should be reached Switches /map: Instead of applying the binning to an image, return a map with regions and their respective IDs Returns Either the binned image or the map of regions Notes The original IDL code was written by Michele Cappellari, Leiden Observatory, The Netherlands cappellari@strw.leidenuniv.nl. If you have found this software useful for your research, he would appreciate an acknowledgment to use of `the Voronoi 2D-binning method by Cappellari & Copin (2003)'. gauss2dsimplefit Fit a two-dimensional gaussian to a rectangular grid (i.e. an image). Syntax result = gauss2dsimplefit(image, x, y, width [, chisq]) Arguments image: The image to be fit x: The x-position of the fit center y: The x-position of the fit center width: The half-width of the fitting window chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit. Returns The returned vector contains the best-fit parameters in the form [Offset,Max,x0,y0,fwhm1,fwhm2,angle,d_Offset,d_Max,d_x0,d_y0,d_fwhm1,d_fwhm2,d_angle] See also function_gauss2dfit function_multigauss2dfit transpoly Compute the transformation matrix for two reference coordinate systems, with errors. It is described by a second order polynomial. The number of reference sources must be >= 6. The transformation function will be calculated using a least squares fit to given coordinates. Note that if either in REFSTARS or in IMSTARS a coordinate is exactly (-1, -1), this star will not be used to calculate the transformation matrix. Syntax result = transmatrix(REFSTARS, IMSTARS, ERRORS) Arguments REFSTARS: A matrix 2xm (m >= 6) with positions of the reference stars in the reference frame (= masterlist) IMSTARS: A matrix 2xm (same size as REFSTARS) with the positions of the same stars in the image to be transformed. ERRORS: A matrix 2xm (same size as REFSTARS) with the errors of the positions in REFSTARS. Returns A matrix 2x12 which describes the coordinate transformation matrix: x' = result[1,1] + result[2,1]*x + result[1,2]*y + result[2,2]*xy + result[1,3]*x^2 + result[2,3]*y^2 y' = result[1,4] + result[2,4]*x + result[1,5]*y + result[2,5]*xy + result[1,6]*x^2 + result[2,6]*y^2
The remaining coordinates [1:2,7:12] are the errors of the respective elements of the transformation matrix. See also function_transcoords function_transform strtrim Removes leading and/or trailing blank from the input String. Syntax result = strtrim(str) Arguments str: A string Returns Returns a copy of the string with removed blanks. right Tail of a string. Syntax result = right(str, n) Arguments str: A text string n: An integer Returns Return the last n characters from string str. ten Transforms hours:minutes:seconds into decimal notation Syntax result = ten(hh , mm, ss) Arguments hh: hours mm: minutes ss: seconds Returns A decimal value with hours as unit Examples Transform 1h, 29min, 60 sec to decimal: print = ten(1, 29, 60) 1.5 primes Creates a vector of given length with prime numbers. Syntax result = primes(n) Arguments n: The number of prime numbers to return Returns A vector of length n with the first n prime numbers. twodcut Create a 2D-cut from an image. Syntax result = twodcut(image, x, y, theta, width) Arguments image: An image x: The x center for the 2D-cut y: The y center for the 2D-cut theta: The position angle, in degrees width: The width of the cut, in pixels Returns A 1D spectrum See also function_longslit simplifywhitespace Strip all whitespaces at the beginning and the end, and replace all multiple occurrences of whitespaces by one single space. Syntax result = simplifywhitespace(s) Arguments s: The string to be simplified strsplit Split a string into a string array Syntax result = strsplit(s [, delimiter]) Arguments s: The string to be split delimiter: A single character at which to split (defaults to ' ') sersic2dfit Fit a two-dimensional sersic function to a rectangular grid (i.e. an image).
The 2D sersic function is defined as I(x,y) = c + Ie * exp(-bn * (R/Re)^(1/n) - 1).
R is an elliptical equation: R = sqrt(xp^2 + (yp / q)^2).
xp and yp describe a rotation: xp = (x - x0) * cos(angle) + (y - y0) * sin(angle), yp = - (x - x0) * sin(angle) + (y - y0) * cos(angle) and bn = 1.9992 * n - 0.3271 Syntax result = sersic2dfit(image, errors, estimate [, chisq]) Arguments image: The image to be fit errors: The errors in the image values estimate: Initial estimate for the fit of the form [c, Ie, Re, x0, y0, angle, q, n]. If n is provided with a negative sign, it won't be fitted and assumed as fixed (with positive sign, of course). chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit. Returns The returned vector contains the best-fit parameters in the form [c, Ie, Re, x0, y0, angle, q, n] or [c, Ie, Re, x0, y0, angle, q] if n was kept fixed. See also function_sersic2dsimplefit sersic2dsimplefit Fit a two-dimensional sersic function to a rectangular grid (i.e. an image) without any given estimates.
The 2D sersic function is defined as I(x,y) = c + Ie * exp(-bn * (R/Re)^(1/n) - 1).
R is an elliptical equation: R = sqrt(xp^2 + (yp / q)^2).
xp and yp describe a rotation: xp = (x - x0) * cos(angle) + (y - y0) * sin(angle), yp = - (x - x0) * sin(angle) + (y - y0) * cos(angle) and bn = 1.9992 * n - 0.3271. Syntax result = sersic2dsimplefit(image, x_cen, y_cen, width [, chisq [, n]]) Arguments image: The image to be fit x_cen: The x-position of the fit center y_cen: The x-position of the fit center width: The half-width of the fitting window chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit. n: If n should be fixed and not fitted. Returns The returned vector contains the best-fit parameters in the form [c, Ie, Re, x0, y0, angle, q, n] or [c, Ie, Re, x0, y0, angle, q] if n was kept fixed. Angle is in degrees. When the negative reciprocal value in q is returned, then the angle is also increased by 90 degrees. See also function_sersic2dfit sersicfit Fit a one-dimensional sersic function to a vector. The sersic function is defined as y(x) = c + Ie * exp(-bn * (x/Re)^(1/n) - 1), with bn = 1.9992 * n - 0.3271. Syntax result = sersicfit(X, Y, errors, estimates [, chisq]) Arguments X: A vector containing the x values to be fit Y: A vector containing the y values to be fit errors: The errors in Y estimate: Initial estimate for the fit of the form [c, Ie, Re, n]. If n is provided with a negative sign, it won't be fitted and assumed as fixed (with positive sign, of course). chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit. Returns The returned vector contains the best-fit parameters in the form [c, Ie, Re, n] or [c, Ie, Re] if n was kept fixed. When the negative reciprocal value in q is returned, then the angle is also increased by 90 degrees. sersic2d Creates a 2D sersic. The sersic function is defined as y(x) = exp(-bn * (x/Re)^(1/n) - 1), with bn = 1.9992 * n - 0.3271. Syntax result = sersic2d(c, x0, y0, angle, q, n [, naxis1=value] [, naxis2 = value]) Arguments Re: Effective radius that encloses half of the total light x0: x-position of center y0: y-position of center angle: angle in degrees q: diskiness n: shape of light model (0.5 = gaussian, 1 = exponential, 4 = de Vaucouleurs) Examples result = sersic2d(10,80,70,870,-2,1, naxis1=128, naxis2=128) randomg Returns a random number drawn from a Gaussian distribution centered on 0 with width SIGMA. If no SEED is given, a seed based on the current time is used. Syntax result = randomg(SIGMA [, SEED]) Arguments SIGMA: Width of the Gaussian profile from which the number is drawn (real number). SEED: Seed of the random number algorithm (integer number). Returns A random number See also function_random poly Create a polynomial Syntax result = poly(x, c) Arguments x: An array or real number c: The coefficients of the polynomial Returns The polynomial of form c[1] + c[2]*x + c[3]*x^2 + ... polyfit2d Returns a 2D N-th order polynomial fit to X. X must be 2-dimensional. The function returns a vector of size sum(i+1)*2 (for i=0 to N). The fittet polynomial has the following form: for N=3: f(x,y) = a0 + a1*x + a2*y + a3*x^2 + a4*x*y + a5*y^2 + a6*x^3 + a7*x^2*y + a8*x*y^2 + a9*y^3 The values a0, ..., a9 are returned in the first 10 elements of the returned vector, their respective errors in the elements 11...20. Syntax result = polyfit2d(X, N [, CHISQ]) Arguments X: A vector. N: An integer number. CHISQ: If set to a named variable, the variable is overwritten with the chi-squared of the fit. See also function_polyfit function_polyfitxy function_polyfitxyerr function_polyfit2derr polyfit2derr Returns a 2D N-th order polynomial fit to X. X must be 2-dimensional. The function returns a vector of size sum(i+1)*2 (for i=0 to N). The fittet polynomial has the following form: for N=3: f(x,y) = a0 + a1*x + a2*y + a3*x^2 + a4*x*y + a5*y^2 + a6*x^3 + a7*x^2*y + a8*x*y^2 + a9*y^3 The values a0, ..., a9 are returned in the first 10 elements of the returned vector, their respective errors in the elements 11...20. Syntax result = polyfit2d(X, N, ERROR [, CHISQ]) Arguments X: A vector. N: An integer number. ERROR: The error of the X-values. If this is a real number, all X-values are assumed to have the same error. If ERROR is a vector, it must have the same length as X and gives the error or each individual X value. CHISQ: If set to a named variable, the variable is overwritten with the chi-squared of the fit. See also function_polyfit function_polyfitxy function_polyfitxyerr function_polyfit2derr getbitpix Get the pixel type of X. Syntax result = getbitpix(X) Arguments X: The array whose pixel type is to be output Returns -128: Complex (note that this does not conform to FITS standard)
-64: Floating point, double precision
-32: Floating point, single precision
8: Unsigned char
16: Short
32: Long See also function_setbitpix isnan Returns a non-zero value if value is 'not-a-number' (NaN), and 0 otherwise. Syntax result = isnan(a) Arguments a: The value to check See also function_isinf isinf Returns -1 if value represents negative infinity, 1 if value represents positive infinity, and 0 otherwise. If the value is complex and 'inf + -inf i' or '-inf + inf i' then -0.5 will be returned. Syntax result = isinf(a) Arguments a: The value to check See also function_isnan identifylines This function attempts to find the reference pattern LINES in a list of observed positions PEAKS. In the following documentation a terminology drawn from the context of arc lamp spectra calibration is used for simplicity: the reference pattern is then a list of wavelengths corresponding to a set of reference arc lamp emission lines - the so-called line catalog; while the observed positions are the positions (in pixel) on the CCD, measured along the dispersion direction, of any significant peak of the signal. To identify the observed peaks means to associate them with the right reference wavelength. This is attempted here with a point-pattern matching technique, where the pattern is contained in the vector LINES, and is searched in the vector PEAKS. In order to work, this method just requires a rough expectation value of the spectral dispersion (in Angstrom/pixel), and a line catalog. The line catalog LINES should just include lines that are expected somewhere in the CCD exposure of the calibration lamp (note, however, that a catalog including extra lines at its blue and/or red ends is still allowed). Typically, the arc lamp lines candidates PEAKS will include light contaminations, hot pixels, and other unwanted signal, but only in extreme cases this prevents the pattern-recognition algorithm from identifying all the spectral lines. The pattern is detected even in the case PEAKS contained more arc lamp lines than actually listed in the input line catalog. This method is based on the assumption that the relation between wavelengths and CCD positions is with good approximation locally linear (this is always true, for any modern spectrograph). The ratio between consecutive intervals pairs in wavelength and in pixel is invariant to linear transformations, and therefore this quantity can be used in the recognition of local portions of the searched pattern. All the examined sub-patterns will overlap, leading to the final identification of the whole pattern, notwithstanding the overall non-linearity of the relation between pixels and wavelengths. Ambiguous cases, caused by exceptional regularities in the pattern, or by a number of undetected (but expected) peaks that disrupt the pattern on the data, are recovered by linear interpolation and extrapolation of the safely identified peaks. Syntax result = identifylines(PEAKS, LINES, MIN_DISP, MAX_DISP, TOLERANCE) Arguments PEAKS: A 1D-Fits, List of observed positions (e.g., of emission peaks) LINES: A 1D-Fits, List of positions in searched pattern (e.g., wavelengths) MIN_DISP: Min expected scale (e.g., spectral dispersion in A/pixel) MAX_DISP: Max expected scale (e.g., spectral dispersion in A/pixel) TOLERANCE: Tolerance for interval ratio comparison evalgaussfit Evaluate a gaussfit along a vector of x values. Syntax result = evalgaussfit(X, fit) Arguments X: A vector of x values at which to evaluate the gaussian fit fit: The gaussian fit, as returned by the gaussfit function Returns A vectors, same length as X, with the gaussian evaluated at the X positions supplied. See also function_gaussfit polyroots Return the roots of a polynomial. The polynomial is defined as P(x) = P[1] + P[2]*x + P[3]*x^2 + ... + P[n]*x^(n-1) Syntax result = polyroots(P [, derivative]) Arguments P: The polynomial derivative: Optional, if an integer number is given, the nth derivative is returned. Returns A vector with the roots (or derivatives of) the polynomial Examples Calculate the roots of the polynomias 1 + x^2 = 0: print polyroots([1, 0, 1]), /values interpolate Returns the interpolated value of a given position (x,y). If x and y are integers the value at that position is returned without any interpolation. Syntax result = interpolate(A, x, y [, kernel_size]) Arguments A: A 2D-image. x: An real number. x: An real number. kernel_size: Any integer number, default is 4. Remember that points near the image border can't be interpolated (border-size is half the kernel-size) radialprofile Returns a radial profile centered on (x,y) Syntax result = radialprofile(A, x, y) Arguments A: A 2D-image x: An integer number, the x center of the profile y: An integer number, the y center of the profile See also function_ellipticalprofile ellipticalprofile Returns an elliptical profile centered on (x,y) with position angle a, aspect ratio r, and width w. Syntax result = radialprofile(A, x, y, a, r, w) Arguments A: A 2D-image x: An integer number, the x center of the profile y: An integer number, the y center of the profile a: A real number denoting the angle of the ellipse r: A real number denoting the aspect ratio of the ellipse w: An integer number giving the width of single elements of the ellipse See also function_radialprofile multigaussfit Fit multiple gaussians to a vector. The gauss function is defined as G(x) = SUM_i [A_i + B_i*exp(-4ln2*(x-x0_i)^2/fwhm_i^2)]. Syntax result = multigaussfit(X, Y, errors, estimate [, chisq]) Arguments X: A vector containing the x values to be fit Y: A vector containing the y values to be fit errors: The errors in Y estimate: Initial estimate for the fit of the form [A, B, x0, fwhm] chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit. Returns The returned vector contains the best-fit parameters in the form [A1, B1, x01, fwhm1, A2, ..., d_A1, d_B1, d_x01, d_fwhm1, d_A2, ...] See also function_gaussfit readfitsall Read a FITS file and all its extensions. The FITS will be stored in a variable to type dpuserTypeList. Syntax result = readfitsall(filename) Arguments filename: A string pointing to the file to be read See also function_readfits function_readfitsextension cubequantile Does a quantile of all images in X. Syntax result = cubequantile(X, quantile) Arguments X: A matrix or a FITS file name. If a FITS file name is given, the global variable tmpmem determines how many bytes of data are read in at a time. quantile: The quantile to be returned (0...1). See also function_cubemedian quantile Compute the quantile of X. Syntax result = quantile(X, quantile) Arguments X: A matrix. quantile: The quantile to be returned (0...1). See also function_median sersic2dsmoothfit Fit a two-dimensional smoothed sersic function to a rectangular grid (i.e. an image).
The 2D sersic function is defined as I(x,y) = c + Ie * exp(-bn * (R/Re)^(1/n) - 1).
R is an elliptical equation: R = sqrt(xp^2 + (yp / q)^2).
xp and yp describe a rotation: xp = (x - x0) * cos(angle) + (y - y0) * sin(angle), yp = - (x - x0) * sin(angle) + (y - y0) * cos(angle) and bn = 1.9992 * n - 0.3271
The resulting 2D sersic function is then smoothed by convolving with a gaussian with a FWHM given by the smooth parameter. Syntax result = sersic2dsmoothfit(image, errors, smooth, estimate [, chisq]) Arguments image: The image to be fit errors: The errors in the image values smooth: The FWHM for the gaussian smoothing estimate: Initial estimate for the fit of the form [c, Ie, Re, x0, y0, angle, q, n]. If n is provided with a negative sign, it won't be fitted and assumed as fixed (with positive sign, of course). chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit. Returns The returned vector contains the best-fit parameters in the form [c, Ie, Re, x0, y0, angle, q, n] or [c, Ie, Re, x0, y0, angle, q] if n was kept fixed. See also function_sersic2dfit function_sersic2dsmoothsimplefit sersic2dsmoothsimplefit Fit a two-dimensional smoothed sersic function to a rectangular grid (i.e. an image).
The 2D sersic function is defined as I(x,y) = c + Ie * exp(-bn * (R/Re)^(1/n) - 1).
R is an elliptical equation: R = sqrt(xp^2 + (yp / q)^2).
xp and yp describe a rotation: xp = (x - x0) * cos(angle) + (y - y0) * sin(angle), yp = - (x - x0) * sin(angle) + (y - y0) * cos(angle) and bn = 1.9992 * n - 0.3271
The resulting 2D sersic function is then smoothed by convolving with a gaussian with a FWHM given by the smooth parameter. Syntax result = sersic2dsmoothsimplefit(image, errors, x0, y0, width, smooth [, chisq]) Arguments image: The image to be fit errors: The errors in the image values x0, y0: The center coordinates of the window to fit width: The width of the window to fit smooth: The FWHM for the gaussian smoothing chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit. Returns The returned vector contains the best-fit parameters in the form [c, Ie, Re, x0, y0, angle, q, n] or [c, Ie, Re, x0, y0, angle, q] if n was kept fixed. See also function_sersic2dfit function_sersic2dsmoothfit readfitsbintable Read a FITS binary table from disk file Syntax result = readfitsbintable(file, extension, column) Arguments file: The FITS file to be read extension: Which extension to read, either an integer number >= 1, or a string with the EXTNAME column: Which column to read, either an integer number >= 1, or a string with the Column Name Returns The column of the specified FITS binary table listfitsextensions List extension names of all extensions in a FITS file Syntax result = listfitsextensions(fname) Arguments fname: A string containing the FITS file name Returns A string array with all FITS extension names listtablecolumns List FITS binary table column names of specified extension in a FITS file Syntax result = listtablecolumns(fname, extension) Arguments fname: A string containing the FITS file name extension: Which extension to read, either an integer number >= 1, or a string with the EXTNAME Returns A string array with all FITS binary table column names interpol 1D cubic spline interpolation. Syntax result = interpol(y, x, x_new) Arguments y: The given y-values as array. x: The given x-values as array. The arrays x and y must be of same length. x_new: The new x-values as array. Returns The new y-values at given points in x_new. See also function_rebin1d where Create a one-dimensional array of indices which satisfy a given expression. Syntax result = where(array comparison scalar) Arguments array: An array of any dimension that is to be evaluated comparison: Any of the known comparison operators (==, !=, >, >=, <, <=) scalar: A scalar value Returns A one-dimensional vector of the indices in array which satisfied the comparison Examples Create a sine curve and set all negative values to 0: sine = sin([0:1000]/100) sine[where(sine < 0)] = 0 list Create a FITS list Syntax result = list(arg1, ..., arg10) Arguments arg1...arg10: Up to 10 FITS or StringArray to be included in the list Returns A FITS list with copies of the given arguments straightlinefit Fit a straight line to data with errors in both coordinates Syntax result = straightlinefit(x, y, dx, dy [, chisq]) Arguments x: the x values of the data to fit y: the y values of the data to fit dx: the errors in x dy: the errors in y chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit. Returns The returned vector contains the best-fit parameters dpusersrc/dpuser/doc/graphs.dpuser0000644000175100003160000001333410735765731015671 0ustar ottirsetenv "PGPLOT_PNG_WIDTH", "320" setenv "PGPLOT_PNG_HEIGHT", "240" x = [1:2*pi*1000]/1000 lw = 5 plotdevice="sin.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv 0, 2*pi, -1, 1, 0, 0 pgslw lw pgline nelements(x), x, sin(x) pgend plotdevice="cos.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv 0, 2*pi, -1, 1, 0, 0 pgslw lw pgline nelements(x), x, cos(x) pgend x = [-pi*1000:pi*1000]/1000 plotdevice="tan.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv -pi, pi, -5, 5, 0, 0 pgslw lw pgline nelements(x), x, tan(x) pgend x = [-1000:1000] / 100 plotdevice="sinh.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv -4, 4, -15, 15, 0, 0 pgslw lw pgline nelements(x), x, sinh(x) pgend plotdevice="cosh.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv -4, 4, 0, 15, 0, 0 pgslw lw pgline nelements(x), x, cosh(x) pgend plotdevice="tanh.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv -4, 4, -1, 1, 0, 0 pgslw lw pgline nelements(x), x, tanh(x) pgend x = [-1000:1000] / 1000 plotdevice="asin.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv -1, 1, -pi/2, pi/2, 0, 0 pgslw lw pgline nelements(x), x, asin(x) pgend plotdevice="acos.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv -1, 1, 0, pi, 0, 0 pgslw lw pgline nelements(x), x, acos(x) pgend x = [-1000:1000] / 100 plotdevice="atan.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv -10, 10, -pi/2, pi/2, 0, 0 pgslw lw pgline nelements(x), x, atan(x) pgend plotdevice="asinh.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv -10, 10, -pi, pi, 0, 0 pgslw lw pgline nelements(x), x, asinh(x) pgend x = [1:1000] / 100 + 1 plotdevice="acosh.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv 0, 10, -pi, pi, 0, 0 pgslw lw pgline nelements(x), x, acosh(x) pgend x = [-999:999] / 1000 plotdevice="atanh.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv -1, 1, -pi, pi, 0, 0 pgslw lw pgline nelements(x), x, atanh(x) pgend x = [-10000:10000] / 1000 plotdevice="exp.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv -5, 2.5, 0, 10, 0, 0 pgslw lw pgline nelements(x), x, exp(x) pgend x = [1:10000] / 1000 plotdevice="log.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv 0, 10, -2.5, 1, 0, 0 pgslw lw pgline nelements(x), x, log(x) pgend plotdevice="ln.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv 0, 10, -2.5, 2.5, 0, 0 pgslw lw pgline nelements(x), x, ln(x) pgend plotdevice="sqrt.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv 0, 5, 0, 2.5, 0, 0 pgslw lw pgline nelements(x), x, sqrt(x) pgend x = [-5000:5000]/1000 plotdevice="erf.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv -2, 2, -1, 1, 0, 0 pgslw lw y = x for i=1, nelements(x) y[i] = erf(x[i]) pgline nelements(x), x, y pgend x = [-30000:30000]/1000 plotdevice="bessel.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv -30, 30, -.5, 1, 0, 0 pgslw lw y = x for i=1, nelements(x) y[i] = bessel(x[i],1,0) pgline nelements(x), x, y pgsch 4 pgtext 2, 0.8, "J\\d0,1\\u(x)" pgend x = [1:1000]/100 plotdevice="gammp.png/png" pgbeg 0, plotdevice, 1, 1 pgscr 0, 1, 1, 1 pgscr 1, 0, 0, 0 pgenv 0, 10, -0.1, 1.1, 0, 0 pgslw lw y = x for i=1, nelements(x) y[i] = gammp(0.5, x[i]) pgline nelements(x), x, y for i=1, nelements(x) y[i] = gammp(3, x[i]) pgline nelements(x), x, y for i=1, nelements(x) y[i] = gammp(5, x[i]) pgline nelements(x), x, y pgsch 2 pgslw 1 pgtext 0.8, 0.7, "a=0.5" pgtext 4, 0.7, "a=3" pgtext 6.5, 0.7, "a=5" pgend naxis1=naxis2=256 setenv "PGPLOT_PNG_WIDTH", "256" setenv "PGPLOT_PNG_HEIGHT", "256" hhh = gauss(129, 129, 100, 140, 70) plotdevice="gauss.png/png" pgbeg 0, plotdevice, 1, 1 pgswin 1, 256, 1, 256 pgsvp 0, 1, 0, 1 pggray hhh, 256, 256, 1, 256, 1, 256, 0, 1, [0, 1, 0, 0, 0, 1] pgend hhh = circle(129, 129, 120) plotdevice="circle.png/png" pgbeg 0, plotdevice, 1, 1 pgswin 1, 256, 1, 256 pgsvp 0, 1, 0, 1 pggray hhh, 256, 256, 1, 256, 1, 256, 0, 1, [0, 1, 0, 0, 0, 1] pgend hhh = ellipse(129, 129, 100, 129, 70) plotdevice="ellipse.png/png" pgbeg 0, plotdevice, 1, 1 pgswin 1, 256, 1, 256 pgsvp 0, 1, 0, 1 pggray hhh, 256, 256, 1, 256, 1, 256, 0, 1, [0, 1, 0, 0, 0, 1] pgend hhh = rect(129, 129, 120, 100, 70) plotdevice="rect.png/png" pgbeg 0, plotdevice, 1, 1 pgswin 1, 256, 1, 256 pgsvp 0, 1, 0, 1 pggray hhh, 256, 256, 1, 256, 1, 256, 0, 1, [0, 1, 0, 0, 0, 1] pgend hhh = delta(129, 129) plotdevice="delta.png/png" pgbeg 0, plotdevice, 1, 1 pgswin 1, 256, 1, 256 pgsvp 0, 1, 0, 1 pggray hhh, 256, 256, 1, 256, 1, 256, 0, 1, [0, 1, 0, 0, 0, 1] pgend hhh = cosbell(129, 129, 30, 120) plotdevice="cosbell.png/png" pgbeg 0, plotdevice, 1, 1 pgswin 1, 256, 1, 256 pgsvp 0, 1, 0, 1 pggray hhh, 256, 256, 1, 256, 1, 256, 0, 1, [0, 1, 0, 0, 0, 1] pgend hhh = chinhat(129, 129, 100) plotdevice="chinhat.png/png" pgbeg 0, plotdevice, 1, 1 pgswin 1, 256, 1, 256 pgsvp 0, 1, 0, 1 pggray hhh, 256, 256, 1, 256, 1, 256, 0, 1, [0, 1, 0, 0, 0, 1] pgend hhh = airy(3.5, .01, 2.2) * 100 plotdevice="airy.png/png" pgbeg 0, plotdevice, 1, 1 pgswin 1, 256, 1, 256 pgsvp 0, 1, 0, 1 pggray hhh, 256, 256, 1, 256, 1, 256, 0, 1, [0, 1, 0, 0, 0, 1] pgend hhh = quickgauss(129, 129, 100, 3) plotdevice="quickgauss.png/png" pgbeg 0, plotdevice, 1, 1 pgswin 1, 256, 1, 256 pgsvp 0, 1, 0, 1 pggray hhh, 256, 256, 1, 256, 1, 256, 0, 1, [0, 1, 0, 0, 0, 1] pgend hhh = moffat(129, 129, 1.5, 100, 50, 30) plotdevice="moffat.png/png" pgbeg 0, plotdevice, 1, 1 pgswin 1, 256, 1, 256 pgsvp 0, 1, 0, 1 pggray hhh, 256, 256, 1, 256, 1, 256, 0, 1, [0, 1, 0, 0, 0, 1] pgend dpusersrc/dpuser/doc/help.h0000644000175100003160000046614212745376311014266 0ustar ottirchar *help_funcs[] = { "sin", "Returns the trigonometric sine of its argument. The returned value will be real, complex, or a matrix, depending on the argument. By default, the argument is in radians. This can be changed by specifying the switch /deg.", "Syntax", "result = sin(angle [, /deg])", "Arguments", "angle: a number (integer, real, complex) or a matrix, specifying the angle for which the sine is to be calculated. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "Switches", "/deg: The argument is in degrees", "Examples", "To find the sine of the angle 90 degrees, type:", "print sin(90, /deg)", "See also", "function cos", "function tan", "category_trigonometry", "", "cos", "Returns the trigonometric cosine of its argument. The returned value will be real, complex, or a matrix, depending on the argument. By default, the argument is in radians. This can be changed by specifying the switch /deg.", "Syntax", "result = cos(angle [, /deg])", "Arguments", "angle: a number (integer, real, complex) or a matrix, specifying the angle for which the cosine is to be calculated. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "Switches", "/deg: The argument is in degrees", "Examples", "To find the cosine of the angle 90 degrees, type:", "print cos(90, /deg)", "See also", "function sin", "function tan", "category_trigonometry", "", "tan", "Returns the trigonometric tangent of its argument. The returned value will be real, complex, or a matrix, depending on the argument. By default, the argument is in radians. This can be changed by specifying the switch /deg.", "Syntax", "result = tan(angle [, /deg])", "Arguments", "angle: a number (integer, real, complex) or a matrix, specifying the angle for which the tangent is to be calculated. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "Switches", "/deg: The argument is in degrees", "Examples", "To find the tangent of the angle 45 degrees, type:", "print tan(45, /deg)", "See also", "function sin", "function cos", "category_trigonometry", "", "sinh", "Returns the hyperbolic sine of its argument. The returned value will be real, complex, or a matrix, depending on the argument. By default, the argument is in radians. This can be changed by specifying the switch /deg.", "Syntax", "result = sinh(angle [, /deg])", "Arguments", "angle: a number (integer, real, complex) or a matrix, specifying the angle for which the hyperbolic sine is to be calculated. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "Switches", "/deg: The argument is in degrees", "Examples", "To find the hyperbolic sine of the angle 90 degrees, type:", "print sinh(90, /deg)", "See also", "function cosh", "function tanh", "category_trigonometry", "", "cosh", "Returns the hyperbolic cosine of its argument. The returned value will be real, complex, or a matrix, depending on the argument. By default, the argument is in radians. This can be changed by specifying the switch /deg.", "Syntax", "result = cosh(angle [, /deg])", "Arguments", "angle: a number (integer, real, complex) or a matrix, specifying the angle for which the hyperbolic cosine is to be calculated. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "Switches", "/deg: The argument is in degrees", "Examples", "To find the hyperbolic cosine of the angle 90 degrees, type:", "print cosh(90, /deg)", "See also", "function sinh", "function tanh", "category_trigonometry", "", "tanh", "Returns the hyperbolic tangent of its argument. The returned value will be real, complex, or a matrix, depending on the argument. By default, the argument is in radians. This can be changed by specifying the switch /deg.", "Syntax", "result = tanh(angle [, /deg])", "Arguments", "angle:a number (integer, real, complex) or a matrix, specifying the angle for which the hyperbolic tangent is to be calculated. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "Switches", "/deg: The argument is in degrees", "Examples", "To find the hyperbolic tangent of the angle 45 degrees, type:", "print tanh(45, /deg)", "See also", "function sinh", "function cosh", "category_trigonometry", "", "asin", "Returns the arcus sine of its argument, which can be either real, complex or a matrix. The returned value's type is changed to complex if necessary (when the absolute value of the argument is greater than 1). By default, the returned value is in radians. This can be changed by specifying the switch /deg.", "Syntax", "result = asin(X [, /deg])", "Arguments", "X: a number (integer, real, complex) or a matrix, specifying the sine of the angle to be returned. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "Switches", "/deg: The result will be in degrees", "Examples", "To find the angle (in degrees) whose sine is 0.5, type:", "print asin(0.5, /deg)", "See also", "function acos", "function atan", "category_trigonometry", "", "acos", "Returns the arcus cosine of its argument, which can be either real, complex or a matrix. The returned value's type is changed to complex if necessary (when the absolute value of the argument is greater than 1). By default, the returned value is in radians. This can be changed by specifying the switch /deg.", "Syntax", "result = acos(X [, /deg])", "Arguments", "X: a number (integer, real, complex) or a matrix, specifying the cosine of the angle to be returned. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "Switches", "/deg: The result will be in degrees", "Examples", "To find the angle (in degrees) whose cosine is 0.5, type:", "print acos(0.5, /deg)", "See also", "function asin", "function atan", "category_trigonometry", "", "atan", "Returns the arcus tangent of its argument, which can be either real, complex", "or a matrix. The returned value has the same type as the argument. By default, the returned value is in radians. This can be changed by specifying the switch /deg.", "Syntax", "result = atan(X [, Y] [, /deg])", "Arguments", "X: a number (integer, real, complex) or a matrix, specifying the tangent of the angle to be returned. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "Y: a real number. If given, returns atan(X / Y) for real numbers, quadrant correct.", "Switches", "/deg: The result will be in degrees", "Examples", "To find the angle (in degrees) whose tangent is 0.5, type:", "print atan(0.5, /deg)", "See also", "function asin", "function acos", "category_trigonometry", "", "asinh", "Returns the hyperbolic arcus sine of its argument, which can be either real, complex or a matrix. By default, the returned value is in radians. This can be changed by specifying the switch /deg.", "Syntax", "result = asinh(X [, /deg])", "Arguments", "X: a number (integer, real, complex) or a matrix, specifying the hyperbolic sine of the angle to be returned. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "Switches", "/deg: The result will be in degrees", "Examples", "To find the angle (in degrees) whose hyperbolic sine is 0.5, type:", "print asinh(0.5, /deg)", "See also", "function acosh", "function atanh", "category_trigonometry", "", "acosh", "Returns the hyperbolic arcus cosine of its argument, which can be either real, complex or a matrix. By default, the returned value is in radians. This can be changed by specifying the switch /deg.", "Syntax", "result = acosh(X [, /deg])", "Arguments", "X: a number (integer, real, complex) or a matrix, specifying the hyperbolic cosine of the angle to be returned. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "Switches", "/deg: The result will be in degrees", "Examples", "To find the angle (in degrees) whose hyperbolic cosine is 0.5, type:", "print acosh(0.5, /deg)", "See also", "function asinh", "function atanh", "category_trigonometry", "", "atanh", "Returns the hyperbolic arcus tangent of X, which can be either real, complex or a matrix. By default, the returned value is in radians. This can be changed by specifying the switch /deg.", "Syntax", "result = atanh(X [, /deg])", "Arguments", "X: a number (integer, real, complex) or a matrix, specifying the hyperbolic tangent of the angle to be returned. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "Switches", "/deg: The result will be in degrees", "Examples", "To find the angle (in degrees) whose hyperbolic tangent is 0.5, type:", "print atanh(0.5, /deg)", "See also", "function acosh", "function asinh", "category_trigonometry", "", "exp", "Returns the exponential function of X. The returned value will be real, complex, or a matrix, depending on the argument. ", "Syntax", "result = exp(X)", "Arguments", "X: a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "See also", "function ln", "", "log", "Returns the logarithm of X. If no base is supplied, the logarithm to the base 10 is returned.", "Syntax", "result = log(X [, base])", "Arguments", "X: The value whose logarithm is to be returned. This can be a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "base: If given, the logarithm of X to this base will be returned", "See also", "function ln", "", "ln", "Returns the logarithm of X to the base e (the natural logarithm).", "Syntax", "result = ln(X)", "Arguments", "X: The value whose logarithm is to be returned. This can be a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "See also", "function log", "", "sqrt", "Returns the square root of X.", "Syntax", "result = sqrt(X)", "Arguments", "X: The value whose square root is to be returned. This can be a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "", "erf", "Returns the error function of X.", "Syntax", "result = erf(X)", "Arguments", "X: A real number.", "", "bessel", "Returns the bessel function of X.", "Syntax", "result = bessel(X, kind, order)", "Arguments", "X: A real number.", "kind: An integer number (1 or 2), specifying the kind of the bessel function to be computed.", "order: An integer number >= 0, specifying the order of the bessel function to be computed.", "", "int", "Returns the integer part of X.", "Syntax", "result = int(X)", "Arguments", "X: a real number.", "Examples", "To print the integer part of the real number -6.7 which is -6, type:", "print int(-6.7)", "See also", "function round", "", "round", "Returns X rounded to the nearest integer.", "Syntax", "result = round(X)", "Arguments", "X: a real number.", "See also", "function int", "", "frac", "Returns the fractional part of X.", "Syntax", "result = frax(X)", "Arguments", "X: a real number.", "", "abs", "Returns the absolute value of X.", "Syntax", "result = abs(X)", "Arguments", "X: The value whose absolute value is to be returned. This can be a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "See also", "function sign", "function arg", "function real", "function imag", "", "sign", "Returns the sign of X.", "Syntax", "result = sign(X)", "Arguments", "X: a real number.", "See also", "function abs", "", "rad2deg", "Returns X in radians converted to degrees. This is equivalent to X*180/pi.", "Syntax", "result = rad2deg(X)", "Arguments", "X: The value which is to be converted to degrees. This can be any number (integer, real, complex) or a matrix.", "See also", "function deg2rad", "category_trigonometry", "", "deg2rad", "Returns X in degrees converted to radians. This is equivalent to X*pi/180.", "Syntax", "result = deg2rad(X)", "Arguments", "X: The value which is to be converted to radians. This can be any number (integer, real, complex) or a matrix.", "See also", "function rad2deg", "category_trigonometry", "", "float", "Returns the string X converted to a real number.", "Syntax", "result = float(X)", "Arguments", "X: A string.", "", "strlen", "Returns the length of the string X.", "Syntax", "result = strlen(X)", "Arguments", "X: A string.", "See also", "function nelements", "", "min", "Returns the minimum value of an array or the minimum of two real numbers. Undefined values (INF and NaN) are ignored.", "Syntax", "result = min(X [, ignore] [,/x | /y | /z | /xy | /xz | /yz])", "result = min(a, b)", "Arguments", "X: A matrix.", "ignore: An optional value which should be ignored.", "a: A real number.", "b: A real number", "Switches", "/x: Calculate the minimum along the first axis", "/y: Calculate the minimum along the second axis", "/z: Calculate the minimum along the third axis", "/xy: Calculate the minimum along the first and second axes", "/xz: Calculate the minimum along the first and third axes", "/yz: Calculate the minimum along the second and third axes", "Examples", "To get a 1D vector of the minima of all slices along a 3D cube:", "result = min(cube, /xy)", "See also", "function max", "function avg", "function total", "function median", "function stddev", "function meddev", "function variance", "", "max", "Returns the maximum value of an array or the maximum of two real numbers. Undefined values (INF and NaN) are ignored.", "Syntax", "result = max(X [, ignore] [,/x | /y | /z | /xy | /xz | /yz])", "result = max(a, b)", "Arguments", "X: A matrix.", "ignore: An optional value which should be ignored.", "a: A real number.", "b: A real number.", "Switches", "/x: Calculate the maximum along the first axis", "/y: Calculate the maximum along the second axis", "/z: Calculate the maximum along the third axis", "/xy: Calculate the maximum along the first and second axes", "/xz: Calculate the maximum along the first and third axes", "/yz: Calculate the maximum along the second and third axes", "Examples", "To get a 1D vector of the maxima of all slices along a 3D cube:", "result = max(cube, /xy)", "See also", "function min", "function avg", "function total", "function median", "function stddev", "function meddev", "function variance", "", "avg", "Returns the average value of X, optionally omitting a value. Undefined values (INF and NaN) are ignored.", "Syntax", "result = avg(X [, omit [,/x | /y | /z | /xy | /xz | /yz]])", "Arguments", "X: A matrix.", "omit: A value to be omitted when taking the average.", "Switches", "/x: Calculate the average along the first axis", "/y: Calculate the average along the second axis", "/z: Calculate the average along the third axis", "/xy: Calculate the average along the first and second axes", "/xz: Calculate the average along the first and third axes", "/yz: Calculate the average along the second and third axes", "Examples", "Find the average of the values 0,1,2,3,4 (which is 2):", "print avg([0:4])", "Calculate an average image of a 3D cube:", "result = avg(cube, /z)", "This is the same as:", "result = cubeavg(cube)", "See also", "function max", "function min", "function total", "function median", "function stddev", "function meddev", "function cubeavg", "function variance", "", "total", "Returns the sum of all values in X. Undefined values (INF and NaN) are ignored.", "Syntax", "result = total(X [, ignore] [,/x | /y | /z | /xy | /xz | /yz])", "Arguments", "X: A matrix.", "ignore: An optional value which should be ignored.", "Switches", "/x: Calculate the sum along the first axis", "/y: Calculate the sum along the second axis", "/z: Calculate the sum along the third axis", "/xy: Calculate the sum along the first and second axes", "/xz: Calculate the sum along the first and third axes", "/yz: Calculate the sum along the second and third axes", "Examples", "Calculate a sum image of a 3D cube:", "result = total(cube, /z)", "See also", "function max", "function min", "function avg", "function median", "function stddev", "function meddev", "", "median", "Returns the median value of X, optionally neglecting a value.", "Syntax", "result = median(X [, omit] [,/x | /y | /z | /xy | /xz | /yz])", "Arguments", "X: A matrix.", "omit: A value which should be omitted when taking the median.", "Switches", "/x: Calculate the sum along the first axis", "/y: Calculate the sum along the second axis", "/z: Calculate the sum along the third axis", "/xy: Calculate the sum along the first and second axes", "/xz: Calculate the sum along the first and third axes", "/yz: Calculate the sum along the second and third axes", "Examples", "Calculate a median image of a 3D cube:", "result = median(cube, /z)", "This is the same as:", "result = cubemedian(cube)", "See also", "function max", "function min", "function total", "function avg", "function stddev", "function meddev", "function cubemedian", "", "naxis", "Returns the number of axes in X.", "Syntax", "result = naxis(X [, extension])", "Arguments", "X: A matrix or a file name", "extension: Integer number specifying which extension to read.", "See also", "function nelements", "function naxis1", "function naxis2", "function naxis3", "", "naxis1", "Returns the length of axis #1 in X.", "Syntax", "result = naxis1(X [, extension])", "Arguments", "X: A matrix or a file name", "extension: Integer number specifying which extension to read.", "See also", "function nelements", "function naxis", "function naxis2", "function naxis3", "", "naxis2", "Returns the length of axis #2 in X.", "Syntax", "result = naxis2(X [, extension])", "Arguments", "X: A matrix or a file name", "extension: Integer number specifying which extension to read.", "See also", "function nelements", "function naxis", "function naxis1", "function naxis3", "", "naxis3", "Returns the length of axis #3 in X.", "Syntax", "result = naxis3(X [, extension])", "Arguments", "X: A matrix or a file name", "extension: Integer number specifying which extension to read.", "See also", "function nelements", "function naxis", "function naxis1", "function naxis2", "", "xmax", "Returns the x coordinate of the maximum in X.", "Syntax", "result = xmax(X)", "Arguments", "X: A matrix.", "See also", "function ymax", "function xmin", "function ymin", "function xcen", "function ycen", "function maxima", "function centroids", "procedure centroid", "", "ymax", "Returns the y coordinate of the maximum in X.", "Syntax", "result = ymax(X)", "Arguments", "X: A matrix.", "See also", "function xmax", "function xmin", "function ymin", "function xcen", "function ycen", "function maxima", "function centroids", "procedure centroid", "", "xmin", "Returns the x coordinate of the minimum in X.", "Syntax", "result = xmin(X)", "Arguments", "X: A matrix.", "See also", "function ymin", "function xmax", "function ymax", "function xcen", "function ycen", "function maxima", "function centroids", "procedure centroid", "", "ymin", "Returns the y coordinate of the minimum in X.", "Syntax", "result = ymin(X)", "Arguments", "X: A matrix.", "See also", "function xmin", "function xmax", "function ymax", "function xcen", "function ycen", "function maxima", "function centroids", "procedure centroid", "", "xcen", "Returns the x coordinate of the centroid in X.", "Syntax", "result = xcen(X)", "Arguments", "X: A matrix.", "See also", "function xmax", "function ymax", "function xmin", "function ymin", "function ycen", "function maxima", "function centroids", "procedure centroid", "", "ycen", "Returns the y coordinate of the centroid in X.", "Syntax", "result = ycen(X)", "Arguments", "X: A matrix.", "See also", "function xmax", "function ymax", "function xmin", "function ymin", "function xcen", "function maxima", "function centroids", "procedure centroid", "", "real", "Returns the real part of the complex number X.", "Syntax", "result = real(X)", "Arguments", "X: The value whose real part is to be returned. This can be a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "See also", "function imag", "function arg", "function abs", "function complex", "function conj", "", "imag", "Returns the imaginary part of the complex number X. If X is not a complex number, 0 is returned.", "Syntax", "result = imag(X)", "Arguments", "X: The value whose imaginary part is to be returned. This can be a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "See also", "function real", "function arg", "function abs", "function complex", "function conj", "", "arg", "Returns the argument of the complex number X (the angle of the polar representation of a complex number).", "Syntax", "result = arg(X)", "Arguments", "X: The value whose imaginary part is to be returned. This can be a number (integer, real, complex) or a matrix. If X is a matrix, a matrix of the same size is returned where each element represents the result of the operation.", "See also", "function real", "function imag", "function abs", "function complex", "function conj", "", "jd", "Returns the Julian Date of given date. Hour, minute, and second default to 0.", "Syntax", "result = jd(day, month, year [, hour [, minute [,second]]])", "Arguments", "day: An integer number.", "month: An integer number. ", "year: An integer number.", "hour: An integer number.", "minute: An integer number.", "second: A real number.", "See also", "function jdnumber", "function jdfraction", "function calday", "function now", "", "jdnumber", "Returns the integer part of the Julian Date of given date. Hour, minute, and second default to 0.", "Syntax", "result = jdnumber(day, month, year [, hour [, minute [,second]]])", "Arguments", "day: An integer number.", "month: An integer number. ", "year: An integer number.", "hour: An integer number.", "minute: An integer number.", "second: A real number.", "See also", "function jd", "function jdfraction", "function calday", "function now", "", "jdfraction", "Returns the fractional part of the Julian Date of given date. Hour, minute, and second default to 0.", "Syntax", "result = jdfraction(day, month, year [, hour [, minute [,second]]])", "Arguments", "day: An integer number.", "month: An integer number. ", "year: An integer number.", "hour: An integer number.", "minute: An integer number.", "second: A real number.", "See also", "function jd", "function jdnumber", "function calday", "function now", "", "upper", "Converts the string X to upper case.", "Syntax", "result = upper(X)", "Arguments", "X: A string.", "See also", "function lower", "procedure upper", "", "lower", "Converts the string X to lower case.", "Syntax", "result = lower(X)", "Arguments", "X: A string.", "See also", "function upper", "procedure lower", "", "string", "Converts the number X to a string.", "Syntax", "result = string(X [,/time] [,/deg] [,/rad]", "Arguments", "X: Any number (integer, real, complex).", "Switches", "/time: Convert to hours, minutes, and seconds", "/deg: Convert to degrees, arcminutes, and arcseconds", "/rad: Same as /deg, but the argument is converted to degrees", "", "calday", "Returns a nicely formatted string telling the calendar date of given Julian Date JD. If JD_fraction is nonzero, it describes the fractional part.", "Syntax", "result = calday(JD, JD_fraction)", "Arguments", "JD: The julian date", "JD_fraction: If nonzero, the calendar date for JD+JD_fraction will be returned", "See also", "function jd", "function now", "", "header", "Returns the FITS header of X.", "Syntax", "result = header(X [, extension])", "Arguments", "X: A matrix or a file name", "extension: Integer number specifying which extension to read.", "", "dayofweek", "Returns the day of the week of specified (julian) date.", "Syntax", "result = dayofweek(DAY, MONTH, YEAR)", "result = dayofweek(JD [,JD_fraction])", "Arguments", "DAY: An integer number.", "MONTH: An integer number.", "YEAR: An integer number.", "JD: Julian Date.", "JD_fraction: A real number.", "Examples", "A person who was born an Feb 14, 1970 was born on a Saturday:", "print dayofweek(14,2,1970)", "See also", "function calday", "function jd", "", "fits", "Creates an array (or a matrix) of size X x Y x Z. The arguments Y and Z are optional. The resulting matrix will be of type R4 (single precision).", "Syntax", "result = fits(X [, Y [, Z]])", "Arguments", "X: An integer number giving the length of the first dimension.", "Y: An integer number giving the length of the second dimension.", "Z: An integer number giving the length of the third dimension.", "See also", "function bytearray", "function shortarray", "function longarray", "function floatarray", "function doublearray", "function complexarray", "", "gauss", "Creates an elliptical Gaussian. This is defined by respective FWHM1 and FWHM2, axis position angle (in degrees) and Gaussian center position (x, y) in the array. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables. If only one argument is given, return the value of a gauss as determined from exp(-4ln(2)*x^2).", "Syntax", "result = gauss(X0)", "result = gauss(X, Y, FWHM1 [, FWHM2 [, ANGLE]] [, naxis1=value] [, naxis2 = value])", "Arguments", "X0: A 1D vector or single number where to evaluate the function exp(-4ln(2)*X^2)", "X: The center of the gaussian in the x-axes", "Y: The center of the gaussian in the y-axes", "FWHM1: Full-width at half maximum of the major axes", "FWHM2: Optional, full-width at half maximum of the minor axes", "ANGLE: Optional, position angle of the gaussian", "naxis1=value: Optional, the size of the resulting array in the first dimension", "naxis2=value: Optional, the size of the resulting array in the second dimension", "See also", "function quickgauss", "", "circle", "Creates a circle centered on X, Y with the respective radius. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables.", "Syntax", "result = circle(X, Y, RADIUS [, naxis1=value] [, naxis2 = value])", "Arguments", "X: The center of the circle in the x-axes", "Y: The center of the circle in the y-axes", "RADIUS: The radius of the circle", "naxis1=value: Optional, the size of the resulting array in the first dimension", "naxis2=value: Optional, the size of the resulting array in the second dimension", "See also", "function ellipse", "", "ellipse", "Creates an ellipse. This is defined by respective RADIUS1 and RADIUS2, axis position angle (in degrees) and Ellipse center position (x, y) in the array. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables.", "Syntax", "result = ellipse(X, Y, RADIUS1 [, RADIUS2 [, ANGLE]] [, naxis1=value] [, naxis2 = value])", "Arguments", "X: The center of the ellipse in the x-axes", "Y: The center of the ellipse in the y-axes", "RADIUS1: Radius of the major axes", "RADIUS2: Optional, radius of the minor axes", "ANGLE: Optional, position angle of the ellipse", "naxis1=value: Optional, the size of the resulting array in the first dimension", "naxis2=value: Optional, the size of the resulting array in the second dimension", "See also", "function circle", "", "rect", "Creates a rectangular filter. This is defined by: Respective width and height and center position (X, Y) in the array. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables.", "Syntax", "result = rect(X, Y, WIDTH, HEIGHT [, naxis1=value] [, naxis2 = value])", "Arguments", "X: The center of the rectangle in the x-axes", "Y: The center of the rectangle in the y-axes", "WIDTH: The width of the rectangle", "HEIGHT: the height of the rectangle", "naxis1=value: Optional, the size of the resulting array in the first dimension", "naxis2=value: Optional, the size of the resulting array in the second dimension", "", "delta", "Creates a delta function. This is defined by: All values in the array 0 except for (x, y) which is set to value. If value is not set, 1 will be used. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables.", "Syntax", "result = delta(X, Y [, VALUE] [, naxis1=value] [, naxis2 = value])", "Arguments", "X: The x-position of the nonzero pixel", "Y: The y-position of the nonzero pixel", "VALUE: Optional, the value of the nonzero pixel", "naxis1=value: Optional, the size of the resulting array in the first dimension", "naxis2=value: Optional, the size of the resulting array in the second dimension", "", "cosbell", "Creates a cosine bell filter. This is defined by: Center position (x, y), inner radius r1, and outer radius r2. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables.", "Syntax", "result = cosbell(X, Y, RADIUS1, RADIUS2 [, naxis1=value] [, naxis2 = value])", "Arguments", "X: The center of the cosine bell filter in the x-axes", "Y: The center of the cosine bell filter in the y-axes", "RADIUS1: The inner radius where the filter is equal to 1", "RADIUS2: The outer radius where the filter is equal to 0", "naxis1=value: Optional, the size of the resulting array in the first dimension", "naxis2=value: Optional, the size of the resulting array in the second dimension", "", "chinhat", "Creates a chinese hat filter. This is defined by: Center position (x, y) and radius. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables.", "Syntax", "result = chinhat(X, Y, RADIUS [, naxis1=value] [, naxis2 = value])", "Arguments", "X: The center of the chinese hat filter in the first dimension", "Y: The center of the chinese hat filter in the second dimension", "RADIUS: The radius of the chinese hat filter", "naxis1=value: Optional, the size of the resulting array in the first dimension", "naxis2=value: Optional, the size of the resulting array in the second dimension", "", "airy", "Creates an airy function at the center of the array. This is defined by: Telescope diameter [meters], pixel scale [arcsec/pixel], and wavelength [microns]. Optional keywords are naxis1, naxis2 which determine the size of the array. If not set, the size of the array is determined from global variables.", "Syntax", "result = airy(DIAMETER, PIXELSCALE, WAVELENGTH [, naxis1=value] [, naxis2 = value])", "Arguments", "DIAMETER: The telescope diameter in meters", "PIXELSCALE: The size of a pixel in arcseconds", "WAVELENGTH: The observing wavelength in microns", "naxis1=value: Optional, the size of the resulting array in the first dimension", "naxis2=value: Optional, the size of the resulting array in the second dimension", "", "cubemedian", "Does a median of all images in X. The value reject can be used to exclude a value to be taken when calculating the median.", "Syntax", "result = cubemedian(X [, reject])", "Arguments", "X: A matrix or a FITS file name. If a FITS file name is given, the global variable tmpmem determines how many bytes of data are read in at a time.", "reject: Optional, a value which should be discarded.", "See also", "function collapse", "Notes", "If reject is given and no pixel along the cube is different from reject, a value of 0 will be inserted.", "", "cubeavg", "Does an average of all images in X. Optionally, a rejection value can be given", "which will not be used in the averaging process.", "Syntax", "result = cubeavg(X [, reject])", "Arguments", "X: A matrix or a FITS file name. If a FITS file name is given, only one image is read into memory at a time thus saving memory.", "reject: Optional, the value to disregard", "Notes", "If reject is given and no pixel along the cube is different from reject, a value of 0 will be inserted.", "", "ssa", "Calculates the simple shift-and-add of all images in the x datacube. If x is a fits file, a memory saving method will be used to do the ssa. If x is a string, this points to a text file where an arbitrary amount of fits filenames is given as a list. The first image in each of these files will be used for the ssa. If sky, flat, dpl, mask are given, they will be used. An optional keyword method can be given: method = 0 : Shift the brightest pixel to xcen, ycen method = 1 : Integer shift the centroid to xcen, ycen method = 2 : Subpixel shift the centroid to xcen, ycen If method < 0, the same is done as if method were set to 0, but the brightest pixel is searched in a smoothed version of the image. The smoothing is done by convolving with a gaussian of fwhm the negative of method.", "Syntax", "result = ssa(X, XCENTER, YCENTER, SKY, FLAT, DPL, MASK [, METHOD] [, /resize])", "Arguments", "X: A FITS datacube", "XCENTER: The pixel where to shift in the first dimension", "YCENTER: The pixel where to shift in the second dimension", "SKY: A sky to be subtracted", "FLAT: A flatfield to be multiplied", "DPL: A dead pixel list to be applied", "MASK: The peak pixel will be searched for in an image multiplied by this mask", "METHOD: Optional, controls how the SSA will be done:", "METHOD = 0: Shift the brightest pixel to XCENTER, YCENTER (default)", "METHOD = 1: Integer shift the centroid to XCENTER, YCENTER", "METHOD = 2: Subpixel shift the centroid to XCENTER, YCENTER", "METHOD < 0: the same is done as if METHOD were set to 0, but the brightest pixel is searched in a smoothed version of the image. The smoothing is done by convolving with a gaussian of fwhm the negative of method.", "Switches", "/resize: The resulting images will be resized in the way, that in each direction the respective extend of MASK is added twice.", "", "mosaic", "Make a mosaic of the images specified in the file pointed to by FNAME. The file formatis as follows: 3(4) Columns: Filename, xshift, yshift, (scale factor). Negative Shifts result in clipping of the image.", "Syntax", "result = mosaic(FNAME)", "result = mosaic(filename, xshift, yshift [, scale factor])", "Arguments", "FNAME: A string specifying the file name to use.", "", "shift", "Shifts (and optionally wraps) X by specified values.", "Syntax", "result = shift(X, xs, ys [, zs] [, /wrap])", "Arguments", "X: The array to be shifted", "xs: Shift vector in the first dimension", "ys: Shift vector in the second dimension", "zs: Shift vector in the third dimension", "Switches", "wrap: Pixels shifted off the array will be wrapped to the opposide side.", "Notes", "If either shift vector is non-integer, a subpixel shift is applied and the array type changed to R4. Subpixel shift is only supported in 2 dimensions.", "", "rotate", "Rotates X by ANGLE (in degrees, counterclockwise)", "Syntax", "result = rotate(X, ANGLE [, XCENTER, YCENTER])", "Arguments", "X: The matrix to be rotated", "ANGLE: Rotation angle in degrees. Rotation will we counterclockwise", "XCENTER: Optional, the center of the rotation in the first dimension (defaults to the center of X).", "YCENTER: Optional, the center of the rotation in the second dimension (defaults to the center of X).", "", "fft", "Calculates the fast fourier transform of X. If X is real, the forward transform is computed. If X is complex, the inverse transform is computed.", "Syntax", "result = fft(X)", "Arguments", "X: A matrix.", "Notes", "The fft function uses the FFTW (Fastest Fourier Transform in the West) library, which is not limited to any array size. Still, computing a fft is fastest for arrays of size 2^N (N being an integer number).", "", "reass", "Reassembles X.", "Syntax", "result = reass(X)", "Arguments", "X: A matrix.", "", "norm", "Normalizes X.", "Syntax", "result = norm(X [, /unity] [, /total] [, /average])", "Arguments", "X: A matrix.", "Switches", "/unity: All values are scaled to be between 0 and 1 (default)", "/total: The total flux in the resulting array will be 1", "/average: The average flux in the resulting array will be 1", "", "clip", "Clips values in X. If VALUE is not set, all values below low will be set to low, and all values above high will be set to high. If value is set, all values above low AND below high are set to value.", "Syntax", "result = clip(X, LOW, HIGH [, VALUE])", "Arguments", "X: The matrix to be clipped", "LOW: All values below this value will be set to LOW", "HIGH: All values above this value will be set to HIGH. If HIGH < LOW, no upper clipping will be done", "VALUE: Optional, if given then all values above LOW and below HIGH will be set to this value (inclusive clipping)", "", "smooth", "Smooths X by multiplying with a gaussian of width FWHM in fourier space. The total flux is kept constant. This is equivalent to reass(fft(fft(X)*fft(gauss(naxis1(X)/2+1,naxis2(X)/2+1,FWHM))))", "Syntax", "result = smooth(X, FWHM [,/x | /y | /z | /xy])", "Arguments", "X: A matrix.", "FWHM: The full width at half maximum of the gaussian used for smoothing.", "Switches", "/x: Smooth along the first axis", "/y: Smooth along the second axis", "/z: Smooth along the third axis", "/xy: 2D Smooth along the first and second axes (default)", "Examples", "Smooth each spectrum in a 3D cube (if the spectra are along the 3rd dimension):", "result = smooth(cube, /z)", "See also", "function boxcar", "", "boxcar", "Computes a running boxcar with radius WIDTH. By default, the value is replaces by the average in the box. This can be changed by specifying one of the switches /minimum, /maximum, or /median.", "Syntax", "result = boxcar(X, WIDTH [, /minimum | /maximum | /median] [,/x | /y | /z | /xy])", "Arguments", "X: A matrix.", "WIDTH: An integer number specifying the radius of the box.", "Switches", "/minimum: Each value is replaced with the minimum within a box with radius WIDTH", "/maximum: Each value is replaced with the maximum within a box with radius WIDTH", "/median: Each value is replaced with the median within a box with radius WIDTH", "/x: Boxcar along the first axis", "/y: Boxcar along the second axis", "/z: Boxcar along the third axis", "/xy: 2D boxcar along the first and second axes (default)", "See also", "function smooth", "", "3dexpand", "Replaces all values in the single images of a datacube by the average in the respective images.", "Syntax", "result = 3dexpand(X)", "Arguments", "X: A matrix.", "", "dpixcreate", "Creates a dead pixel list of X using a magic threshold. Boxsize defaults to 3 and gives the radius of the running boxcar used. NPASS defaults to 3 and gives the number of passes used.", "Syntax", "result = dpixcreate(X, THRESHOLD [, BOXSIZE [, NPASS]])", "Arguments", "X: On this array the dead pixel list will be created", "THRESHOLD: Sensitivity of the algorithm (use 5 for a start)", "BOXSIZE: Optional, the size of the square box for comparing pixel values (default: 3)", "NPASS: Optional, number of iterations", "", "dpixapply", "Corrects dead pixels in X using DPL by interpolation. BOXSIZE defaults to 1 and gives the radius of the boxcar used. Each value where DPL is not 0 will be regarded as a dead pixel. Those are not used in the interpolation process.", "Syntax", " result = dpixapply(X, DPL [, BOXSIZE [, method = value]] [,/spiffik [,/bezier]])", "Arguments", "X: The array to be corrected for dead pixels", "DPL: A dead pixel list in which all non-zero pixels mark dead pixels in X", "BOXSIZE: Optional, gives the size of the averaging box for interpolation", "method = value: Optional, gives the type of correction:", "method = 0: Interpolation from boxcar average (default)", "method = 1: Interpolation along first dimension", "method = 2: Interpolation along second dimension", "Switches", "/spiffik : obsolete", "/bezier : obsolete", "", "flip", "Flips X by specified AXIS", "Syntax", "result = flip(X, AXIS)", "Arguments", "X: The array to be flipped", "AXIS: Which axis to flip: 1 = x, 2 = y", "", "enlarge", "Enlarges X by specified integer SCALE.", "Syntax", "result = enlarge(X, SCALE [, method])", "Arguments", "X: The array to be enlarged", "SCALE: The resulting array will be SIZE times bigger than X", "method: Optional, determines how to enlarge:", "method = 0: Center original image (default)", "method = 1: Center original image, edge values are mean of edge", "method = 2: Blow up pixels", "", "resize", "Resizes X to the new axis lengths. The argument NAXIS3 is optional. If the new dimension is smaller than in X, the image will be clipped, else the image will be in the lower left corner.", "Syntax", "result = resize(X, NAXIS1, NAXIS2 [, NAXIS3])", "Arguments", "X: A matrix.", "NAXIS1: The new length in the first dimension.", "NAXIS2: The new length in the second dimension.", "NAXIS3: The new length in the third dimension.", "", "wien", "Performs a wiener filtered deconvolution of X using PSF as dirty beam. HEIGHT gives the maximum of the delta function used as filter function and defaults to 1.", "Syntax", "result = wien(X, PSF [, HEIGHT])", "Arguments", "X: A matrix.", "PSF: A matrix.", "HEIGHT: A real number.", "See also", "function lucy", "function clean", "Notes", "The memory required for wiener deconvolution (in bytes) calculates as 33*(Number of pixels in the image).", "", "lucy", "Performs a lucy deconvolution of X using PSF as dirty beam and N iterations. THRESHOLD defaults to 0.000003.", " ", "LUCY DECONVOLUTION ALGORITHM. \"Lucy has shown that his iterative scheme is related to the maximum likelihood solution of the deconvolution problem and would converge to that solution after an infinite number of iterations.\"", " ", "iteration number : k", "dirty beam : dbeam", "dirty map : dmap", "estimated object : o(k)", "reconvolved estimated", "object : oc(k)", "correctin function : t(k)", "multiplication : *", "convolution : (*)", " ", "start: o(0) = dmap", " ", "iteration:", "oc(k) = o(k) (*) dbeam", "t(k) = (dmap/oc(k)) (*) dbeam", "o(k+1)= o(k) * t(k)", " ", "Due to calculation of the quotient for t(k) the algorithm is sensitive to noise. Therefore a weighting function has been implemented which is unity if the dmap signal is larger than \"thresh\" and zero elsewhere. t(k) is only calculated in that area and hence the deconvolution is only effective there. Threshold equals input if positive. If input is negative thresh is determined via mean and rms in the area below abs(thresh). If thresh is zero thresh is determined in the area below -0.1 times the maximum flux in dmap. The redetermined threshold is mean value plus 3 times rms.", " ", "To check on convergence of algorithm the rms between input dmap and current lucy deconvolved map reconvolved with dbeam is calculated.", " ", "Syntax", "result = lucy(X, PSF, N [, THRESHOLD])", "Arguments", "X: A matrix.", "PSF: A matrix.", "N: An integer number.", "THRESHOLD: A real number.", "See also", "function clean", "function wien", "Notes", "The memory required for lucy deconvolution (in bytes) calculates as 44*(Number of pixels in the image).", "", "center", "Shifts the brightest pixel in X to the center.", "Syntax", "result = center(X)", "Arguments", "X: A matrix.", "", "3dnorm (obsolete)", "Normalizes a 3D datacube.", "Syntax", "result = 3dnorm(X, filename)", "Arguments", "X: A matrix.", "filename: Path to a file", "", "conj", "Returns the complex conjugate of X.", "Syntax", "result = conj(X)", "Arguments", "X: A matrix or a complex number.", "See also", "function complex", "function real", "function imag", "function arg", "function abs", "", "correl", "Returns the cross-correlation of X and Y.", "Syntax", "result = correl(X, Y)", "Arguments", "X: A matrix.", "Y: A matrix.", "", "readfits", "Read specified FITS file into memory. The optional arguments x1, x2, y1, y2, z1, z2 can be used to read in a part of a FITS file. The combination 0, 0 specifies that the complete range of the respective axis should be read in.", "Syntax", "result = readfits(FILENAME [, x1, x2 [, y1, y2 [, z1, z2]]])", "Arguments", "FILENAME: A string.", "x1, x2: Range in first dimension, defaults to 0, 0", "y1, y2: Range in second dimension, defaults to 0, 0", "z1, z2: Range in third dimension, defaults to 0, 0", "Examples", "Read in the 150th to 160th slice of a datacube:", "subcube = readfits(\"cube.fits\", 0, 0, 0, 0, 150, 160)", "See also", "function readfitsextension", "function readfitsall", "", "3dspec", "Returns an average 3D spectrum of X (dispersion along the third dimension) using the mask Y (2-dim) or the center (x,y) with radii r1 and r2.", "Syntax", "result = 3dspec(X, Y)", "result = 3dspec(X, xcenter, ycenter [, r1 [, r2]])", "Arguments", "X: A three dimensional matrix.", "Y: A two dimensional matrix.", "xcenter: The central pixel of the spectrum in the first dimension.", "ycenter: The central pixel of the spectrum in the second dimension.", "r1: The radius of the circular aperture to be used.", "r2: The scaled average of all values in the annulus defined by r1 and r2 will be subtracted from the spectrum (local sky subtraction).", "", "stddev", "Returns the standard deviation of X, optionally omitting a value.", "Syntax", "result = stddev(X [, omit])", "Arguments", "X: A matrix.", "omit: A value to be omitted when calculating the standard deviation.", "Switches", "/x: Calculate the standard deviation along the first axis", "/y: Calculate the standard deviation along the second axis", "/z: Calculate the standard deviation along the third axis", "/xy: Calculate the standard deviation along the first and second axes", "/xz: Calculate the standard deviation along the first and third axes", "/yz: Calculate the standard deviation along the second and third axes", "Examples", "To get a 1D vector of the standard deviation of all slices along a 3D cube:", "v = stddev(cube, /xy)", "See also", "function max", "function min", "function avg", "function total", "function median", "function stddev", "function variance", "function meddev", "", "variance", "Returns the variance of X.", "Syntax", "result = variance(X)", "Arguments", "X: A matrix.", "Switches", "/x: Calculate the variance along the first axis", "/y: Calculate the variance along the second axis", "/z: Calculate the variance along the third axis", "/xy: Calculate the variance along the first and second axes", "/xz: Calculate the variance along the first and third axes", "/yz: Calculate the variance along the second and third axes", "Examples", "To get a 1D vector of the variance of all slices along a 3D cube:", "v = variance(cube, /xy)", "See also", "function max", "function min", "function avg", "function total", "function median", "function stddev", "function variance", "function meddev", "", "meddev", "Returns the median deviation from the median in X.", "Syntax", "result = meddev(X)", "Arguments", "X: A matrix.", "Switches", "/x: Calculate the median deviation along the first axis", "/y: Calculate the median deviation along the second axis", "/z: Calculate the median deviation along the third axis", "/xy: Calculate the median deviation along the first and second axes", "/xz: Calculate the median deviation along the first and third axes", "/yz: Calculate the median deviation along the second and third axes", "Examples", "To get a 1D vector of the median deviation of all slices along a 3D cube:", "v = meddev(cube, /xy)", "See also", "function max", "function min", "function avg", "function total", "function median", "function stddev", "", "saomark", "Interactively mark pixels in ds9 which are marked on the display. The resulting array will have a value of 1 in each marked pixel, a value of 0 elsewhere. Press any key to mark a point, press 'd' to delete an already marked point, press 'q' to quit. (Use ds9 v5.2 or newer!)", "Syntax", "result = saomark()", "Arguments", "none", "", "random", "Returns a random number between 0 and 1. If SEED is not set, a seed based on the current time is used.", "Syntax", "result = random([SEED])", "Arguments", "SEED: An integer number.", "See also", "function randomg", "", "import", "Imports a text file. If the first character in the file is numeric, the values in the file are written into a numerical array. The number of lines in the file then determine NAXIS2, the number of individual entries in the first line of the file determines NAXIS1. Else the text file will be written into a string array.", "Syntax", "result = import(FILENAME [, /text] [, /number])", "Arguments", "FILENAME: A string.", "Switches", "/text: Force to read into a string array", "/number: Force to read into a numerical array", "", "rebin", "Rebins X to the new axis lengths X1 and X2 using a bilinear interpolation. The aspect ratio is not preserved.", "Syntax", "result = rebin(X, X1, X2)", "Arguments", "X: A matrix.", "X1: An integer number.", "X2: An integer number.", "", "stringarray", "Returns a string array. If X is an integer number, a string array will have X entries which are all initialized to empty strings. If X is a string, the string array will initially have one element which is set to X.", "Syntax", "result = stringarray(X)", "Arguments", "X: A positive integer number.", "", "nelements", "Returns the number of elements in X. For a matrix, this is the total number of pixels, for a string, the number of characters, and for a stringarray, the number of strings.", "Syntax", "result = nelements(X)", "Arguments", "X: A matrix, string, or string array.", "", "ssastat", "Returns statistics for ssa. Arguments like ssa. The resulting array will be [xshift, yshift, min, max, flux, fwhm, flag].", "Syntax", "result = ssastat(X, XCENTER, YCENTER, SKY, FLAT, DPL, MASK [, METHOD])", "Arguments", "X: A FITS datacube", "XCENTER: The pixel where to shift in the first dimension", "YCENTER: The pixel where to shift in the second dimension", "SKY: A sky to be subtracted", "FLAT: A flatfield to be multiplied", "DPL: A dead pixel list to be applied", "MASK: The peak pixel will be searched for in an image multiplied by this mask", "METHOD: Optional, controls how the SSA will be done:", "METHOD = 0: Shift the brightest pixel to XCENTER, YCENTER (default)", "METHOD = 1: Integer shift the centroid to XCENTER, YCENTER", "METHOD = 2: Subpixel shift the centroid to XCENTER, YCENTER", "METHOD < 0: the same is done as if METHOD were set to 0, but the brightest pixel is searched in a smoothed version of the image. The smoothing is done by convolving with a gaussian of fwhm the negative of method.", "See also", "function ssa", "function sssa", "", "sssa", "Calculates the simple shift-and-add of all images in X. If X is a FITS file, a memory saving method will be used to do the ssa.", "Syntax", "result = sssa(X, STATS, SKY, FLAT, DPL, MASK [, METHOD])", "Arguments", "X: A FITS datacube", "STATS: An array created with the ssastat function. If its flag is not 1, the image will be skipped", "SKY: A sky to be subtracted", "FLAT: A flatfield to be multiplied", "DPL: A dead pixel list to be applied", "MASK: The peak pixel will be searched for in an image multiplied by this mask", "METHOD: Optional, controls how the SSA will be done:", "METHOD = 0: Shift the brightest pixel to XCENTER, YCENTER (default)", "METHOD = 1: Integer shift the centroid to XCENTER, YCENTER", "METHOD = 2: Subpixel shift the centroid to XCENTER, YCENTER", "See also", "function ssa", "function ssastat", "", "ssaselect", "Obsolete function", "", "maxentropy", "Maximum entropy deconvolution of X using PSF.", "Syntax", "result = maxentropy(X, PSF, N [, MASK])", "Arguments", "X: A matrix.", "PSF: A matrix.", "N: An integer number.", "MASK: An optional mask of image regions to be used.", "", "cubeminimum", "Returns the minimum of each pixel along the 3rd axis if X is a cube.", "Syntax", "result = cubeminimum(X)", "Arguments", "X: A matrix or a FITS file name. If a FITS file name is given, only one image is read into memory at a time thus saving memory.", "", "cubemaximum", "Returns the maximum of each pixel along the 3rd axis if X is a cube.", "Syntax", "result = cubemaximum(X)", "Arguments", "X: A matrix or a FITS file name. If a FITS file name is given, only one image is read into memory at a time thus saving memory.", "", "fwhm", "Returns the second order moment of X centered at [XCENTER, YCENTER] within RADIUS, which corresponds to the FWHM at that location. The parameter RADIUS is optional. If skipped, a default of 5 pixels will be used.", "Syntax", "result = fwhm(X, XCENTER, YCENTER [, RADIUS])", "Arguments", "X: A matrix.", "XCENTER: An integer number.", "YCENTER: An integer number.", "RADIUS: An integer number.", "", "setbitpix", "Change the pixel type of X.", "Syntax", "result = setbitpix(X, BITPIX [, BSCALE [, BZERO]])", "Arguments", "X: The array whose pixel type is to be changed", "BITPIX: Desired pixel type:", "BITPIX = -128: Complex (note that this does not conform to FITS standard)", "BITPIX = -64: Floating point, double precision", "BITPIX = -32: Floating point, single precision", "BITPIX = 8: Unsigned char", "BITPIX = 16: Short", "BITPIX = 32: Long", "BSCALE, BZERO: For integer BITPIX, optionally BSCALE and BZERO can be given. The value represented by each pixel is given by value * BSCALE + BZERO (the defaults are BSCALE = 1 and BZERO = 0)", "See also", "function getbitpix", "", "bytearray", "Returns an array with bitpix = 8 (all pixels are of type unsigned char). bscale will be set to 1.0, bzero to 0.0.", "Syntax", "result = bytearray(X [, Y [, Z]])", "Arguments", "X: An integer number specifying the length of the first dimension.", "Y: An integer number specifying the length of the second dimension.", "Z: An integer number specifying the length of the third dimension.", "See also", "function fits", "function shortarray", "function longarray", "function floatarray", "function doublearray", "function complexarray", "", "shortarray", "Returns an array with bitpix = 16 (all pixels are of type short). bscale will be set to 1.0, bzero to 0.0.", "Syntax", "result = short(array(X [, Y [, Z]])", "Arguments", "X: An integer number specifying the length of the first dimension.", "Y: An integer number specifying the length of the second dimension.", "Z: An integer number specifying the length of the third dimension.", "See also", "function fits", "function bytearray", "function longarray", "function floatarray", "function doublearray", "function complexarray", "", "longarray", "Returns an array with bitpix = 32 (all pixels are of type long). bscale will be set to 1.0, bzero to 0.0.", "Syntax", "result = longarray(X [, Y [, Z]])", "Arguments", "X: An integer number specifying the length of the first dimension.", "Y: An integer number specifying the length of the second dimension.", "Z: An integer number specifying the length of the third dimension.", "See also", "function fits", "function bytearray", "function shortarray", "function floatarray", "function doublearray", "function complexarray", "", "floatarray", "Returns an array with bitpix = -32 (all pixels are of type float).", "Syntax", "result = floatarray(X [, Y [, Z]])", "Arguments", "X: An integer number specifying the length of the first dimension.", "Y: An integer number specifying the length of the second dimension.", "Z: An integer number specifying the length of the third dimension.", "See also", "function fits", "function bytearray", "function shortarray", "function longarray", "function doublearray", "function complexarray", "", "doublearray", "Returns an array with bitpix = -64 (all pixels are of type double).", "Syntax", "result = doublearray(X [, Y [, Z]])", "Arguments", "X: An integer number specifying the length of the first dimension.", "Y: An integer number specifying the length of the second dimension.", "Z: An integer number specifying the length of the third dimension.", "See also", "function fits", "function bytearray", "function shortarray", "function longarray", "function floatarray", "function complexarray", "", "complexarray", "Returns an array with bitpix = -128 (all pixels are of type complex). !!! WARNING: bitpix = -128 does NOT conform to the FITS standard !!!", "Syntax", "result = complexarray(X [, Y [, Z]])", "Arguments", "X: An integer number specifying the length of the first dimension.", "Y: An integer number specifying the length of the second dimension.", "Z: An integer number specifying the length of the third dimension.", "See also", "function fits", "function bytearray", "function shortarray", "function longarray", "function floatarray", "function doublearray", "", "shrink", "Shrinks X or the specified axis of X by specified FACTOR", "Syntax", "result = shrink(X, FACTOR [, AXIS])", "Arguments", "X: A matrix.", "FACTOR: An integer number.", "AXIS: optionally, which axis to shrink (1, 2, or 3)", "", "getfitskey", "Returns the value of specified FITS key in the header of X. The returned type can be either a string, an integer number or a real number. If the specified key does not exist, an empty string is returned.", "Syntax", "result = getfitskey(X, KEY [, /text])", "Arguments", "X: A matrix or a FITS file.", "KEY: A string.", "Switches", "text: Return the fits key as a string.", "", "polyfit", "Returns a N-th order polynomial fit to X. X must be 1-dimensional. The function returns a vector of size (N+1)*2. The fittet polynomial has the following form:", "f(x) = a0 + a1 * x + ... + aN * X^N", "The values a0, ..., aN are returned in the first N elements of the returned vector, their respective errors in the elements N+1...2*N.", "Syntax", "result = polyfit(X, N [, CHISQ])", "Arguments", "X: A vector.", "N: An integer number.", "CHISQ: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "See also", "function polyfitxy", "function polyfitxyerr", "function polyfit2d", "function polyfit2derr", "", "sprintf", "RETURNS X (either a real number or an integer) as a string using specified format string. The formatting is done like in the C printf function. The total length of the formatted string is limited to 256 characters.", "Syntax", "result = sprintf(FORMAT, X)", "", "photometry", "Perform aperture photometry on X. This function returns a 3xn matrix with the following information: measured counts, normalized counts (Jansky), magnitude.", "Syntax", "result = photometry(X, POSLIST, REFLIST, SEARCHBOX, RADIUS, [,/u | /b | /v | /r | /i | /j | /h | /k | /l | /m | /n])", "Arguments", "X: The image on which to do aperture photometry", "POSLIST: A 2xn matrix containing the positions of the stars", "REFLIST: A 1xm matrix containing magnitudes of reference stars (in the same order as in poslist), with a value > 20.0 if not to be used", "SEARCHBOX: Within a box with this radius the local maximum of the stars are searched", "RADIUS: The radius of the circular aperture used for photometry", "Switches", "/u: Do photometry for U-Band (epsilon = 3.274)", "/b: Do photometry for B-Band (epsilon = 3.674)", "/v: Do photometry for V-Band (epsilon = 3.581)", "/r: Do photometry for R-Band (epsilon = 3.479)", "/i: Do photometry for I-Band (epsilon = 3.386)", "/j: Do photometry for J-Band (epsilon = 3.248)", "/h: Do photometry for H-Band (epsilon = 3.08)", "/k: Do photometry for K-Band (epsilon = 2.8) (default)", "/l: Do photometry for L-Band (epsilon = 2.49)", "/m: Do photometry for M-Band (epsilon = 2.26)", "/n: Do photometry for N-Band (epsilon = 1.63)", "", "transcoords", "Transform a set of coordinates from one image to another. The coordinate transformation matrix is described by a first order polynomial if the number of reference sources is <= 6, else a second order polynomial is used. The transformation function will be calculated using a least squares fit to given coordinates. Note that if either in REFSTARS or in IMSTARS a coordinate is exactly (-1, -1), this star will not be used to calculate the transformation matrix.", "Syntax", "result = transcoords(MASTERLIST, REFSTARS, IMSTARS [, xerror, yerror][, /silent] [, /linear] [, /cubic] [, /rotation])", "Arguments", "MASTERLIST: A matrix 2xn with the coordinates to be transformed", "REFSTARS: A matrix 2xm (m >= 3) with positions of the reference stars in the reference frame (= masterlist)", "IMSTARS: A matrix 2xm (same size as REFSTARS) with the positions of the same stars in the image to be transformed.", "xerror: If set to a named variable, the residual error of the coordinate transform in the first axis is returned.", "yerror: If set to a named variable, the residual error of the coordinate transform in the second axis is returned.", "Switches", "/silent: Printing of output is suppressed", "/linear: A 1st order polynomial is fitted (even when more than 6 reference sources are supplied)", "/cubic: A 3rd order polynomial is fitted (at least 10 reference sources)", "/rotation: A rotational transformation is fitted (at least 4 reference sources): x' = x0 + f*cos(a)*x - f*sin(a)*y, y' = y0 + f*sin(a)*x + f*cos(a)*y", "See also", "function transmatrix", "function transform", "", "findfile", "Returns all files that satisfy given PATTERN. All occurrences of a backslash are replaced by a slash. Also, a slash is appended to all directories. The search is started from the current directory and is done recursively through the directory structure.", "Syntax", "result = findfile(PATTERN)", "Arguments", "PATTERN: A string.", "Examples", "Find all text files (files with the suffix .txt) from the current working directory:", "print findfile(\"*.txt\")", "See also", "function dir", "function fileexists", "", "markpos", "Mark positions using ds9. The positions are returned as a 2xn matrix, where n denotes the number of positions marked. Pressing the key 'q' will quit marking positions. When typing numbers between 1 and 9 the values are stored at that specific position. This way values can be overwritten. (Use ds9 v5.2 or newer!)", "Syntax", "result = markpos(X [, int radius] [, /nocenter])", "Arguments", "X: The image to be displayed on saoimage", "radius: Optional, the radius around which the brightest pixel is searched for using centroid-method.", "Switches", "nocenter: Has no effect when no radius is supplied. Returns the local maximum in the radius around the marked pixel.", "See also", "function saomark", "", "lmst", "Calculate the local mean siderial time for given Julian date. If longitude is given (east negative), the local mean sidereal time for that location is returned, else the lmst for Greenwich (longitude 0). NOTE that timezones for given longitude are not taken into account, so always give jd in Universal Time.", "Syntax", "result = lmst(JD [, LATITUDE])", "Arguments", "JD: A real number.", "LATITUDE: A real number.", "See also", "function jd", "", "wsa", "Compute weighted shift-and-add of the fits cube X (must be a file). The shift location is defined by xcen, ycen. thresh gives the fraction of the maximum pixel which will be regarded as a speckle. speckles determines the maximum number of speckles used (if there are more, then the image will be smoothed until it is not exceeded). smooth optionally gives the fwhm of a gaussian with which the image where speckles are searched for is smoothed. If bigmask is given, the centroid of mask will be shifted to the centroid of bigmask for each individual image.", "Syntax", "result = wsa(X, XCENTER, YCENTER, THRESHOLD, SPECKLES, SMOOTH, SKY, FLAT, DPL, MASK [, BIGMASK])", "Arguments", "X: A FITS filename (enclosed in single quotes).", "XCENTER: An integer number specifying the shift position in the first dimension.", "YCENTER: An integer number specifying the shift position in the second dimension.", "THRESHOLD: A real number.", "SPECKLES: An integer number.", "SMOOTH: An integer number.", "SKY: A matrix.", "FLAT: A matrix.", "DPL: A matrix.", "MASK: A matrix.", "BIGMASK: A matrix.", "", "swsa", "Compute weighted shift-and-add of the fits cube X (must be a file). flags is a 1-dimensional array that has a value of zero for each image that is to be skipped. The shift location is defined by xcen, ycen. thresh gives the fraction of the maximum pixel which will be regarded as a speckle. speckles determines the maximum number of speckles used (if there are more, then the image will be smoothed until it is not exceeded). smooth optionally gives the fwhm of a gaussian with which the image where speckles are searched for is smoothed. If bigmask is given, the centroid of mask will be shifted to the centroid of bigmask for each individual image.", "Syntax", "result = wsa(X, FLAGS, XCENTER, YCENTER, THRESHOLD, SPECKLES, SMOOTH, SKY, FLAT, DPL, MASK, BIGMASK)", "Arguments", "X: A FITS filename (enclosed in single quotes).", "FLAGS: A vector.", "XCENTER: An integer number specifying the shift position in the first dimension.", "YCENTER: An integer number specifying the shift position in the second dimension.", "THRESHOLD: A real number.", "SPECKLES: An integer number.", "SMOOTH: An integer number.", "SKY: A matrix.", "FLAT: A matrix.", "DPL: A matrix.", "MASK: A matrix.", "BIGMASK: A matrix.", "", "centroids", "Returns a 2xn matrix with the centroids (in a RADIUS) on given POSITIONS in X.", "Syntax", "result = centroids(X, POSITIONS, RADIUS)", "Arguments", "X: A matrix.", "POSITIONS: A 2xn matrix with initial positions.", "RADIUS: An integer number.", "See also", "function maxima", "", "maxima", "Refind local maxima in X given POSITIONS around RADIUS.", "Syntax", "result = maxima(X, POSITIONS, RADIUS [, /circle, /box])", "Arguments", "X: A matrix.", "POSITIONS: A 2xn matrix with initial positions.", "RADIUS: An integer number.", "Switches", "/circle: Local maxima are searched for within a circle with RADIUS", "/box: Local maxima are search for within a quadratic box with RADIUS", "See also", "function centroids", "", "fileexists", "Test for existence of a file. Returns 1 if the file exist, 0 otherwise.", "Syntax", "result = fileexists(FILENAME)", "Arguments", "FILENAME: A string.", "See also", "function findfile", "function dir", "function filesize", "", "filesize", "Return the length in bytes of a file. Returns -1 if the file does not exist.", "Syntax", "result = filesize(FILENAME)", "Arguments", "FILENAME: A string.", "See also", "function findfile", "function dir", "function fileexists", "", "dir", "Return a directory listing.", "Syntax", "result = dir([DIRECTORY], [, /recursive])", "Arguments", "DIRECTORY: Optional, do a directory listing of specified directory, else of the current working directory", "Switches", "/recursive: Do a recursive listing", "Examples", "To print a recursive listing of the current directory, type", "print dir(\"\", /recursive)", "See also", "function findfile", "function filesize", "function fileexists", "", "polyfitxy", "Return an n-th order polynomial fit to the vectors X and Y, where y = f(x). If a variable is given as the 4th argument, it will be overwritten with the chi squared of the fit.", "Syntax", "result = polyfitxy(X, Y, N [, CHISQ])", "Arguments", "X: A vector.", "Y: A vector.", "N: An integer number.", "CHISQ: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "See also", "function polyfit", "function polyfitxyerr", "function polyfit2d", "function polyfit2derr", "", "sort", "Returns an index list of X in ascending order.", "Syntax", "result = sort(X [, /reverse])", "Arguments", "X: A matrix, a string or a string array.", "Switches", "/reverse: The index list will be in descending order", "Examples", "To sort a directory listing in alphabetical order, type:", "list = dir(\"/tmp\"); list = list[sort(list)]", "", "char", "Returns the ASCII character which number is N. N is truncated to the range 0...255.", "Syntax", "result = char(N)", "Arguments", "N: An integer number.", "Examples", "To print out the ASCII character set, type:", "for (i = 32; i < 256; i++) print char(i)", "", "complex", "Returns a complex number generated of the two given values.", "Syntax", "result = complex(r, i)", "Arguments", "r: The real part (either a real number or a matrix)", "i: the imaginary part (either a real number or a matrix)", "See also", "function real", "function imag", "function conj", "function arg", "function abs", "", "strpos", "Returns the position of a substring within a string, or -1 if the substring does not occur. If the first argument is a string array, a matrix with the same number of elements as the string is returned.", "Syntax", "result = strpos(X, Y)", "Arguments", "X: A string or a string array", "Y: The substring to be searched for", "Switches", "/nocase: The search is done case-insensitive", "", "clean", "Performs \"cleaning\" of the input image. This iterative deconvolution algorithm", "searches for the global maximum in the image, shifts the psf to that position and subtracts a scaled psf (multiplied by the gain). The subtracted flux is added to a delta map at the position of the maximum (this is the clean map). Note that clean does not conserve the total flux in the image.", "Syntax", "result = clean(IMAGE, PSF, N, GAIN [, variable SUB])", "Arguments", "IMAGE: input map to be cleaned (dirty map)", "PSF: Point spread function (dirty beam)", "N: Number of iterations", "GAIN: Loop gain factor", "SUB: Optional, the variable SUB will contain an image in which the sources are subtracted", "See also", "function lucy", "function wien", "", "collapse", "Collapse one axis of an array. All values along the specified axis will be summed up. The resulting array will have one dimension less than the input.", "Syntax", "result = collapse(IMAGE, AXIS)", "Arguments", "IMAGE: A matrix.", "AXIS: An integer number.", "Examples", "Do a sum of all images in a datacube:", "s = collapse(cube, 3)", "This is exactly the same as:", "s = cubeavg(cube) * naxis3(cube)", "See also", "function cubeavg", "", "magnify", "Resize given array by the scaling factor. Each pixel in the resized array will be blown up and consequently contain scale^2 pixels. The optional argument smooth gives the fwhm of a gaussian with which the resultant array will we smoothed. The total flux in the array will be conserved.", "Syntax", "result = magnify(IMAGE, scale [, fwhm])", "Arguments", "IMAGE: A matrix", "scale: An integer number.", "fwhm: A real number.", "", "wsastat", "Compute statistics for the weighted shift-and-add of the fits cube X (must be a file). The shift location is defined by xcen, ycen. thresh gives the fraction of the maximum pixel which will be regarded as a speckle. speckles determines the maximum number of speckles used (if there are more, then the image will be smoothed until it is not exceeded). smooth optionally gives the fwhm of a gaussian with which the image where speckles are searched for is smoothed. If bigmask is given, the centroid of mask will be shifted to the centroid of bigmask for each individual image.", "Syntax", "result = wsastat(X, XCENTER, YCENTER, THRESHOLD, SPECKLES, SMOOTH, SKY, FLAT, DPL, MASK, BIGMASK)", "Arguments", "X: A FITS filename (enclosed in single quotes).", "XCENTER: An integer number specifying the shift position in the first dimension.", "YCENTER: An integer number specifying the shift position in the second dimension.", "THRESHOLD: A real number.", "SPECKLES: An integer number.", "SMOOTH: An integer number.", "SKY: A matrix.", "FLAT: A matrix.", "DPL: A matrix.", "MASK: A matrix.", "BIGMASK: A matrix.", "", "gaussfit", "Fit a one-dimensional gaussian to a vector. The gauss function is defined as G(x) = A + B*exp(-4ln2*(x-x0)^2/fwhm^2).", "Syntax", "result = gaussfit(X, Y, errors, estimate [, chisq])", "Arguments", "X: A vector containing the x values to be fit", "Y: A vector containing the y values to be fit", "errors: The errors in Y", "estimate: Initial estimate for the fit of the form [A, B, x0, fwhm]", "chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "Returns", "The returned vector contains the best-fit parameters in the form [A, B, x0, fwhm, d_A, d_B, d_x0, d_fwhm]", "See also", "function evalgaussfit", "", "gauss2dfit", "Fit a two-dimensional gaussian to a rectangular grid (i.e. an image).", "Syntax", "result = gauss2dfit(image, errors, estimate [, chisq])", "Arguments", "image: The image to be fit", "errors: The errors in the image values", "estimate: Initial estimate for the fit of the form [Offset,Max,x0,y0,fwhm1,fwhm2,angle]", "chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "Returns", "The returned vector contains the best-fit parameters in the form [Offset, Max, x0, y0, fwhm1, fwhm2, angle, d_Offset, d_Max, d_x0, d_y0, d_fwhm1, d_fwhm2, d_angle]", "See also", "function gauss2dsimplefit", "function multigauss2dfit", "", "polyfitxyerr", "Return an n-th order polynomial fit to the vectors X and Y, where y = f(x). The typical error of the dependent variables is given in ERROR. If a variable is given as the 4th argument, it will be overwritten with the chi squared of the fit.", "Syntax", "result = polyfitxyerr(X, Y, N, ERROR [, CHISQ])", "Arguments", "X: A vector.", "Y: A vector.", "N: An integer number.", "ERROR: The error of the Y-values. If this is a real number, all X-values are assumed to have the same error. If ERROR is a vector, it must have the same length as X and Y and gives the error or each individual X value.", "CHISQ: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "See also", "function polyfit", "function polyfitxy", "function polyfit2d", "function polyfit2derr", "", "psf", "Return the average (or median, minimum, maximum) of several stars in an image. The stars locations are given in the second argument.", "Syntax", "result = psf(X, POSITIONS [, /median] [, /average] [, /minimum] [, /maximum])", "Arguments", "X: A matrix.", "POSITIONS: A 2xn matrix giving the positions of the stars to be averaged.", "Switches", "/median: Return the median of the stars (default).", "/average: Return the average of the stars.", "/minimum: Return the minimum of the stars.", "/maximum: Return the maximum of the stars.", "", "pwd", "Return the absolute path of the current directory.", "Syntax", "result = pwd()", "Arguments", "none", "Returns", "A string with the absolute path of the current directory.", "See also", "function dir", "procedure cd", "", "quickgauss", "Create a circular gaussian.", "Syntax", "result = quickgauss(X, Y, FWHM, speed [, naxis1=value] [, naxis2=value])", "Arguments", "X: The center of the gaussian in the x-axes", "Y: The center of the gaussian in the y-axes", "FWHM: Full-width at half maximum of the circular gaussian", "speed: The gaussian is calculated up to a distance of speed*FWHM from the center location", "naxis1=value: Optional, the size of the resulting array in the first dimension", "naxis2=value: Optional, the size of the resulting array in the second dimension", "Returns", "A two-dimensional circular gaussian.", "See also", "function gauss", "", "getenv", "Return the content of an environment variable.", "Syntax", "result = getenv(S)", "Arguments", "S: A string with the name of the environment variable.", "Returns", "A string with the content of the environment variable. If the environment variable does not exist, an empty string is returned.", "See also", "procedure setenv", "", "cblank", "Replace all undefined values (like NaN or Inf) by another value. If no value is specified, these values will be replace by 0.0.", "Syntax", "result = cblank(ARRAY [, value])", "Arguments", "ARRAY: A matrix", "value: Optional, the value to be assigned (defaults to 0)", "See also", "procedure cblank", "", "now", "Return the julian date of the current system time. The timezone (and daylight saving time, if appropriate) are taken into account.", "Syntax", "result = now()", "Arguments", "none", "See also", "function jd", "function calday", "", "polar", "Returns a complex number generated of the two given values in polar representation. This is equivalent to complex(a * cos(b), a * sin(b)).", "Syntax", "result = polar(ampl, arg)", "Arguments", "ampl: The amplitude (either a real number or a matrix)", "arg: The argument (either a real number or a matrix)", "See also", "function complex", "function real", "function imag", "function conj", "function arg", "function abs", "", "transmatrix", "Compute the transformation matrix for two reference coordinate systems. It is described by a first order polynomial if the number of reference sources is <= 6, else a second order polynomial is used. The transformation function will be calculated using a least squares fit to given coordinates. Note that if either in REFSTARS or in IMSTARS a coordinate is exactly (-1, -1), this star will not be used to calculate the transformation matrix.", "Syntax", "result = transmatrix(REFSTARS, IMSTARS [, xerror, yerror][, /silent] [, /linear] [, /cubic] [, /rotation])", "Arguments", "REFSTARS: A matrix 2xm (m >= 3) with positions of the reference stars in the reference frame (= masterlist)", "IMSTARS: A matrix 2xm (same size as REFSTARS) with the positions of the same stars in the image to be transformed.", "xerror: If set to a named variable, the residual error of the coordinate transform in the first axis is returned.", "yerror: If set to a named variable, the residual error of the coordinate transform in the second axis is returned.", "Switches", "/silent: Printing of output is suppressed", "/linear: A 1st order polynomial is fitted (even when more than 6 reference sources are supplied)", "/cubic: A 3rd order polynomial is fitted (at least 10 reference sources)", "/rotation: A rotational transformation is fitted (at least 4 reference sources): x' = x0 + f*cos(a)*x - f*sin(a)*y, y' = y0 + f*sin(a)*x + f*cos(a)*y", "Returns", "For 1st and 2nd order polynomials: A matrix 2x6 which describes the coordinate transformation matrix:", "x' = result[1,1] + result[1,2]*x + result[1,3]*y + result[1,4]*xy + result[1,5]*x^2 + result[1,6]*y^2", "y' = result[2,1] + result[2,2]*x + result[2,3]*y + result[2,4]*xy + result[2,5]*x^2 + result[2,6]*y^2", "For 3rd order polynomials: A matrix 2x10 which describes the coordinate transformation matrix:", "x' = result[1,1] + result[1,2]*x + result[1,3]*y + result[1,4]*xy + result[1,5]*x^2 + result[1,6]*y^2 + result[1,7]*x^2y + result[1,8]*xy^2 + result[1,9]*x^3 + result[1,10]*y^3", "y' = result[2,1] + result[2,2]*x + result[2,3]*y + result[2,4]*xy + result[2,5]*x^2 + result[2,6]*y^2 + result[2,7]*x^2y + result[2,8]*xy^2 + result[2,9]*x^3 + result[2,10]*y^3 ", "For rotational transformation: A matrix 1x4 which describes the coordinate transformation matrix:", "x' = result[1] + result[3] * cos(result[4])*x - result[3] * sin(result[4])*y", "y' = result[2] + result[3] * sin(result[4])*x + result[3] * cos(result[4])*y", "See also", "function transcoords", "function transform", "", "transform", "Apply a transformation matrix to a set of coordinates.", "Syntax", "result = transform(COORDS, TRANS)", "Arguments", "COORDS: A matrix 2xN with the initial coordinates.", "TRANS: A matrix 2x6 which contains the coordinate transformation matrix.", "Returns", "A matrix 2xN with the transformed coordinates.", "See also", "function transcoords", "function transmatrix", "", "invert", "Return the inverse of a 2-dimensional, square matrix.", "Syntax", "result = invert(X)", "Arguments", "X: A 2-dimensional, square matrix.", "Returns", "The inverse of X.", "Examples", "print X # invert(X), /values<", "will return a unity matrix", "", "transpose", "Return the matrix X transposed, i.e. rows and columns are interchanged.", "Syntax", "result = transpose(X)", "Arguments", "X: A vector or a 2-dimensional matrix.", "", "isvariable", "Check whether given variable name (as a string) exists in memory.", "Syntax", "result = isvariable(S)", "Arguments", "S: A string with the variable name", "Returns", "1 if the variable exists, 0 otherwise", "", "pi", "Return the number PI. It will be computet as 2 * acos(0).", "Syntax", "result = pi()", "Arguments", "none", "Examples", "Print the number pi to 15 significant digits:", "DPUSER> print sprintf(\"%.15f\", pi())", "3.141592653589793", "See also", "category_trigonometry", "", "convolve", "Convolve an image with a kernel. The resulting array is returned with bitpix -32.", "Syntax", "result = convolve(a, b)", "Arguments", "a: The array to be convolved.", "b: The kernel to convolve the image with.", "Notes", "If a and b are of exactly the same size, the two are multiplied in fourier space. If b is smaller than a and a square matrix, a convolved with the kernel b is returned.", "", "gammp", "Return the incomplete gamma function P(a, x).", "Syntax", "result = gammp(a, x)", "Arguments", "a: A number > 0", "x: A number > 0, the value where to evaluate the incomplete gamma function", "", "reform", "Resize an array without actually moving data. The number of new elements must exactly match the number of elements in the array to be resized. If no size arguments are given, all array axes with length 1 are removed.", "Syntax", "result = reform(a, [n1 [, n2 [, n3]]])", "Arguments", "a: The array to be resized", "n1: New axis length", "n2: New axis length", "n3: New axis length", "", "find", "[This documentation is copied literally from IDL's astrolib]", " ", "Find positive brightness perturbations (i.e stars) in an image. Also returns centroids and shape parameters (roundness & sharpness). Adapted from 1986 STSDAS version of DAOPHOT.", "Syntax", "result = find(image, hmin, fwhm [, roundlim [, sharplim]] [, /silent])", "Arguments", "image: 2 dimensional image array for which one wishes to identify the stars present.", "hmin: Threshold intensity for a point source - should generally be 3 or 4 sigma above background.", "fwhm: FWHM to be used in the convolve filter.", "sharplim: 2 element vector giving low and high cutoff for the sharpness statistic (Default: [0.2,1.0]). Change this default only if the stars have significantly larger or or smaller concentration than a Gaussian.", "roundlim: 2 element vector giving low and high cutoff for the roundness statistic (Default: [-1.0,1.0]). Change this default only if the stars are significantly elongated.", "Switches", "silent: Normally, FIND will write out each star that meets all selection criteria. If the SILENT keyword is set then this printout is suppressed.", "Returns", "The find function returns an array of size 5xnstars with the following entries:", "x: vector containing x position of all stars identified by FIND ", "y: vector containing y position of all stars identified by FIND", "flux: vector containing flux of identified stars as determined by a gaussian fit. Fluxes are NOT converted to magnitudes.", "sharp: vector containing sharpness statistic for identified stars", "round: vector containing roundness statistic for identified stars", "Notes", "The sharpness statistic compares the central pixel to the mean of the surrounding pixels. If this difference is greater than the originally estimated height of the Gaussian or less than 0.2 the height of the Gaussian (for the default values of SHARPLIM) then the star will be rejected.", "", "histogram", "Create a histogram of given array.", "Syntax", "result = histogram(a [, min [, max [, binsize]]] [, /reverse])", "Arguments", "a: 1D or 2D Array", "min: Datapoints with a value smaller than min are neglected.", "max: Datapoints with a value greater than max are neglected.", "binsize: Default is 1. Values between are rounded", "Switches", "/reverse: Create the reverse indices of a histogram", "", "meandev", "Calculate the mean deviation of given array, optionally omitting a value. This is defined as 1/sqrt(n-1)*stddev(a).", "Syntax", "result = meandev(a [, omit])", "Arguments", "a: The array which mean deviation from the average should be returned.", "omit: An optional value which should be ignored.", "See also", "function stddev", "function avg", "", "version", "Return the version string of the currently used DPUSER.", "Syntax", "result = version()", "Arguments", "none", "", "spifficube (obsolete)", "Create a cube of a SPIFFI raw frame. The wavelength of each slitlet is shifted to one pixel accuracy. The wavelength scale is not being linearized.", "Syntax", "result = spifficube(inframe, [HK], [K])", "Arguments", "inframe: A raw SPIFFI frame (1024 x 1024 pixels)", "Switches", "HK: The shift in wavelength scale is done for the HK grism.", "K: The shift in wavelength scale is done for the K grism.", "See also", "function spiffiuncube", "function spiffishift", "", "spiffiuncube (obsolete)", "Undo cube creation done with spifficube. The resulting frame will be 1024 x 1024 (as for spiffi raw data).", "Syntax", "result = spiffiuncube(incube, [HK], [K])", "Arguments", "incube: A SPIFFI cube created with spifficube", "Switches", "HK: The shift in wavelength scale is done for the HK grism.", "K: The shift in wavelength scale is done for the K grism.", "See also", "function spifficube", "function spiffishift", "", "spiffishift (obsolete)", "Shift slitlets of a raw SPIFFI frame so that the wavelength of each slitlet is shifted to one pixel accuracy. The wavelength scale is not being linearized.", "Syntax", "result = spiffishift(inframe, [HK], [K])", "Arguments", "inframe: A raw SPIFFI frame (1024 x 1024 pixels)", "Switches", "HK: The shift in wavelength scale is done for the HK grism.", "K: The shift in wavelength scale is done for the K grism.", "See also", "function spifficube", "function spiffiuncube", "", "bezier (obsolete)", "xxx", "Syntax", "result = bezier(xxx [, xxx])", "Arguments", "xxx: xxx", "xxx: xxx", "See also", "function bezier1d", "", "bezier1d (obsolete)", "xxx", "Syntax", "result = bezier1d(xxx , xxx)", "Arguments", "xxx: xxx", "xxx: xxx", "See also", "function bezier", "", "moffat", "Create an elliptical moffat function.", "Syntax", "result = moffat(x, y, power, fwhm1 [, fwhm2 [, angle]] [, naxis1=value] [, naxis2 = value])", "Arguments", "X: The center of the moffat in the x-axes", "Y: The center of the moffat in the y-axes", "power: The power index of the moffat function", "fwhm1: Full-width at half maximum of the major axes", "fwhm2: Optional, full-width at half maximum of the minor axes", "angle: Optional, position angle of the moffat", "naxis1=value: Optional, the size of the resulting array in the first dimension", "naxis2=value: Optional, the size of the resulting array in the second dimension", "", "readfitsextension", "Read specified FITS file extension into memory. The optional arguments x1, x2, y1, y2, z1, z2 can be used to read in a part of a FITS file. The combination 0, 0 specifies that the complete range of the respective axis should be read in.", "Syntax", "result = readfitsextension(FILENAME, extension [, x1, x2 [, y1, y2 [, z1, z2]]])", "Arguments", "FILENAME: A string.", "extension: Integer number specifying which extension to read.", "x1, x2: Range in first dimension, defaults to 0, 0", "y1, y2: Range in second dimension, defaults to 0, 0", "z1, z2: Range in third dimension, defaults to 0, 0", "See also", "function readfits", "function readfitsall", "", "multigauss2dfit", "Fit a number of circular gaussians to an image. All gaussians have the save FWHM.", "Syntax", "result = multigauss2dfit(image, errors, estimate [, chisq])", "Arguments", "image: The image to be fit", "errors: The errors in the image values", "estimate: Initial estimate for the fit of the form [Offset,fwhm,height_1,x_1,y_1,height_2,x_2,y_2,...,height_n,x_n,y_n]", "chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "Returns", "The returned vector contains the best-fit parameters in the form [Offset,fwhm,height_1,x_1,y_1,...,height_n,x_n,y_n,d_Offset,d_fwhm,d_height_1,d_x_1,d_y_1,...,d_height_n,d_x_n,d_y_n]", "See also", "function gauss2dfit", "function gauss2dsimplefit", "", "sincfit", "Fit a sinc function to a set of data points. The function fit is y(x)=A+B*sinc((x+phi)/width)", "Syntax", "result = sincfit(X, Y, errors, estimate [, chisq])", "Arguments", "X: A vector containing the x values to be fit", "Y: A vector containing the y values to be fit (in radians)", "errors: The errors in Y", "estimate: Initial estimate for the fit of the form [A,B,phi,width]", "chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "Returns", "The returned vector contains the best-fit parameters in the form [A,B,phi,width,d_A,d_B,d_phi,d_width]", "", "rebin1d", "Rebin a one-dimensional vector to new values.", "Syntax", "result = rebin1d(spectrum, xstart, xend, xdelta [, xvalues])", "Arguments", "spectrum: A one-dimensional FITS. It should have the correct FITS keywords (CRVAL1, CRPIX1, and CDELT1) or the optional argument xvalues should be given.", "xstart: The first channel in the rebinned data", "xend: The last channel in the rebinned data", "xdelta: The increment step size for the rebinned data", "xvalues: A vector of same length as spectrum with the corresponding x-values.", "Returns", "The returned vector has the data rebinned with the appropritate FITS keywords set.", "See also", "function interpol", "", "velmap", "Go through a datacube and fit a gaussian to a line. The arguments center and fwhm are used as initial estimate for the gauss-fit.", "Syntax", "result = velmap(cube, center, fwhm [, threshold])", "Arguments", "cube: A datacube", "center: The approximate center (wavelength) of the line to fit", "fwhm: The approximate FWHM of the line to fit", "threshold: A lower limit under which no fit is attempted (given as percentage of peak flux)", "Returns", "A datacube with the following slices:", "result[*,*,1]: fit background", "result[*,*,2]: fit continuum", "result[*,*,3]: fit line center", "result[*,*,4]: fit line FWHM", "result[*,*,5]: error in background fit", "result[*,*,6]: error in continuum fit", "result[*,*,7]: error in line center fit", "result[*,*,8]: error in line FWHM fit", "result[*,*,9]: chi squared of fit", "", "fxcor", "Compute the cross-correlation of two spectra. The spectra will be rebinned to the lowest dispersion, continuum subtracted and normalised prior to the cross-correlation.", "Syntax", "result = fxcor(template, spectrum)", "Arguments", "template: The template spectrum", "spectrum: The object spectrum", "Returns", "The cross-correlation of the two spectra", "See also", "function correlmap", "", "correlmap", "Compute the cross-correlation maximum of a datacube and a template spectrum.", "Syntax", "result = correlmap(cube, template)", "Arguments", "cube: The datacube to be cross-correlated", "template: The template spectrum", "Returns", "A 2D-map with the maximum of the cross-correlation", "See also", "function fxcor", "", "longslit", "Create a pseudo-longslit from a datacube.", "Syntax", "result = longslit(cube, x, y, theta, width)", "Arguments", "cube: A datacube", "x: The x center for the longslit", "y: The y center for the longslit", "theta: The position angle, in degrees", "width: The width of the longslit, in pixels", "Returns", "A 2D longslit spectrum", "See also", "function twodcut", "", "evalvelmap", "Evaluate the result of velmap.", "Syntax", "result = evalvelmap(fit, template)", "Arguments", "fit: The result of the velmap function", "template: A template cube which defines how big the resulting cube will be.", "Returns", "The evaluated cube, with gaussians at the appropriate places along the third dimension.", "See also", "function velmap", "", "sinfit", "Fit a sine curve to a set of data points. The function fit is y(x)=A+B*sin(x+phi)", "Syntax", "result = sinfit(X, Y, errors, estimate [, chisq])", "Arguments", "X: A vector containing the x values to be fit", "Y: A vector containing the y values to be fit (in radians)", "errors: The errors in Y", "estimate: Initial estimate for the fit of the form [A,B,phi]", "chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "Returns", "The returned vector contains the best-fit parameters in the form [A,B,phi,d_A,d_B,d_phi]", "", "indexbase", "Return the base index: 0 for C-notation, 1 for Fortran-notation", "Syntax", "result = indexbase()", "Arguments", "none", "Returns", "The index base", "See also", "procedure cnotation", "procedure fortrannotation", "procedure setindexbase", "", "voronoi", "Perform adaptive spatial binning of Integral-Field Spectroscopic (IFS) data to reach a chosen constant signal-to-noise ratio per bin. This method is required for the proper analysis of IFS observations, but can also be used for standard photometric imagery or any other two-dimensional data. Further information on VORONOI_2D_BINNING algorithm can be found in Cappellari M., Copin Y., 2003, MNRAS, 342, 345", "Syntax", "result = voronoi(signal, noise, target, targetSN [, /map])", "Arguments", "signal: A 2D map with the signal in each pixel", "noise: A 2D map specifying the noise in each pixel. Pixels with a noise value of zero will be neglected in the voronoi binning", "target: The image which should be binned (can be the same as the signal map)", "targetSN: The Signal/Noise value which should be reached", "Switches", "/map: Instead of applying the binning to an image, return a map with regions and their respective IDs", "Returns", "Either the binned image or the map of regions", "Notes", "The original IDL code was written by Michele Cappellari, Leiden Observatory, The Netherlands cappellari@strw.leidenuniv.nl. If you have found this software useful for your research, he would appreciate an acknowledgment to use of `the Voronoi 2D-binning method by Cappellari & Copin (2003)'.", "", "gauss2dsimplefit", "Fit a two-dimensional gaussian to a rectangular grid (i.e. an image).", "Syntax", "result = gauss2dsimplefit(image, x, y, width [, chisq])", "Arguments", "image: The image to be fit", "x: The x-position of the fit center", "y: The x-position of the fit center", "width: The half-width of the fitting window", "chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "Returns", "The returned vector contains the best-fit parameters in the form [Offset,Max,x0,y0,fwhm1,fwhm2,angle,d_Offset,d_Max,d_x0,d_y0,d_fwhm1,d_fwhm2,d_angle]", "See also", "function gauss2dfit", "function multigauss2dfit", "", "transpoly", "Compute the transformation matrix for two reference coordinate systems, with errors. It is described by a second order polynomial. The number of reference sources must be >= 6. The transformation function will be calculated using a least squares fit to given coordinates. Note that if either in REFSTARS or in IMSTARS a coordinate is exactly (-1, -1), this star will not be used to calculate the transformation matrix.", "Syntax", "result = transmatrix(REFSTARS, IMSTARS, ERRORS)", "Arguments", "REFSTARS: A matrix 2xm (m >= 6) with positions of the reference stars in the reference frame (= masterlist)", "IMSTARS: A matrix 2xm (same size as REFSTARS) with the positions of the same stars in the image to be transformed.", "ERRORS: A matrix 2xm (same size as REFSTARS) with the errors of the positions in REFSTARS.", "Returns", "A matrix 2x12 which describes the coordinate transformation matrix:", "x' = result[1,1] + result[2,1]*x + result[1,2]*y + result[2,2]*xy + result[1,3]*x^2 + result[2,3]*y^2", "y' = result[1,4] + result[2,4]*x + result[1,5]*y + result[2,5]*xy + result[1,6]*x^2 + result[2,6]*y^2", "The remaining coordinates [1:2,7:12] are the errors of the respective elements of the transformation matrix.", "See also", "function transcoords", "function transform", "", "strtrim", "Removes leading and/or trailing blank from the input String.", "Syntax", "result = strtrim(str)", "Arguments", "str: A string", "Returns", "Returns a copy of the string with removed blanks.", "", "right", "Tail of a string.", "Syntax", "result = right(str, n)", "Arguments", "str: A text string", "n: An integer ", "Returns", "Return the last n characters from string str.", "", "ten", "Transforms hours:minutes:seconds into decimal notation", "Syntax", "result = ten(hh , mm, ss)", "Arguments", "hh: hours", "mm: minutes", "ss: seconds", "Returns", "A decimal value with hours as unit", "Examples", "Transform 1h, 29min, 60 sec to decimal:", "print = ten(1, 29, 60)", " 1.5", "", "primes", "Creates a vector of given length with prime numbers.", "Syntax", "result = primes(n)", "Arguments", "n: The number of prime numbers to return", "Returns", "A vector of length n with the first n prime numbers.", "", "twodcut", "Create a 2D-cut from an image.", "Syntax", "result = twodcut(image, x, y, theta, width)", "Arguments", "image: An image", "x: The x center for the 2D-cut", "y: The y center for the 2D-cut", "theta: The position angle, in degrees", "width: The width of the cut, in pixels", "Returns", "A 1D spectrum", "See also", "function longslit", "", "simplifywhitespace", "Strip all whitespaces at the beginning and the end, and replace all multiple occurrences of whitespaces by one single space.", "Syntax", "result = simplifywhitespace(s)", "Arguments", "s: The string to be simplified", "", "strsplit", "Split a string into a string array", "Syntax", "result = strsplit(s [, delimiter])", "Arguments", "s: The string to be split", "delimiter: A single character at which to split (defaults to ' ')", "", "sersic2dfit", "Fit a two-dimensional sersic function to a rectangular grid (i.e. an image).", "The 2D sersic function is defined as I(x,y) = c + Ie * exp(-bn * (R/Re)^(1/n) - 1).", "R is an elliptical equation: R = sqrt(xp^2 + (yp / q)^2).", "xp and yp describe a rotation: xp = (x - x0) * cos(angle) + (y - y0) * sin(angle), yp = - (x - x0) * sin(angle) + (y - y0) * cos(angle) and bn = 1.9992 * n - 0.3271", "Syntax", "result = sersic2dfit(image, errors, estimate [, chisq])", "Arguments", "image: The image to be fit", "errors: The errors in the image values", "estimate: Initial estimate for the fit of the form [c, Ie, Re, x0, y0, angle, q, n]. If n is provided with a negative sign, it won't be fitted and assumed as fixed (with positive sign, of course).", "chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "Returns", "The returned vector contains the best-fit parameters in the form [c, Ie, Re, x0, y0, angle, q, n] or [c, Ie, Re, x0, y0, angle, q] if n was kept fixed.", "See also", "function sersic2dsimplefit", "", "sersic2dsimplefit", "Fit a two-dimensional sersic function to a rectangular grid (i.e. an image) without any given estimates.", "The 2D sersic function is defined as I(x,y) = c + Ie * exp(-bn * (R/Re)^(1/n) - 1).", "R is an elliptical equation: R = sqrt(xp^2 + (yp / q)^2).", "xp and yp describe a rotation: xp = (x - x0) * cos(angle) + (y - y0) * sin(angle), yp = - (x - x0) * sin(angle) + (y - y0) * cos(angle) and bn = 1.9992 * n - 0.3271.", "Syntax", "result = sersic2dsimplefit(image, x_cen, y_cen, width [, chisq [, n]])", "Arguments", "image: The image to be fit", "x_cen: The x-position of the fit center", "y_cen: The x-position of the fit center", "width: The half-width of the fitting window", "chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "n: If n should be fixed and not fitted.", "Returns", "The returned vector contains the best-fit parameters in the form [c, Ie, Re, x0, y0, angle, q, n] or [c, Ie, Re, x0, y0, angle, q] if n was kept fixed. Angle is in degrees. When the negative reciprocal value in q is returned, then the angle is also increased by 90 degrees.", "See also", "function sersic2dfit", "", "sersicfit", "Fit a one-dimensional sersic function to a vector. The sersic function is defined as y(x) = c + Ie * exp(-bn * (x/Re)^(1/n) - 1), with bn = 1.9992 * n - 0.3271.", "Syntax", "result = sersicfit(X, Y, errors, estimates [, chisq])", "Arguments", "X: A vector containing the x values to be fit", "Y: A vector containing the y values to be fit", "errors: The errors in Y", "estimate: Initial estimate for the fit of the form [c, Ie, Re, n]. If n is provided with a negative sign, it won't be fitted and assumed as fixed (with positive sign, of course).", "chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "Returns", "The returned vector contains the best-fit parameters in the form [c, Ie, Re, n] or [c, Ie, Re] if n was kept fixed. When the negative reciprocal value in q is returned, then the angle is also increased by 90 degrees.", "", "sersic2d", "Creates a 2D sersic. The sersic function is defined as y(x) = exp(-bn * (x/Re)^(1/n) - 1), with bn = 1.9992 * n - 0.3271.", "Syntax", "result = sersic2d(c, x0, y0, angle, q, n [, naxis1=value] [, naxis2 = value])", "Arguments", "Re: Effective radius that encloses half of the total light", "x0: x-position of center", "y0: y-position of center", "angle: angle in degrees", "q: diskiness", "n: shape of light model (0.5 = gaussian, 1 = exponential, 4 = de Vaucouleurs)", "Examples", "result = sersic2d(10,80,70,870,-2,1, naxis1=128, naxis2=128)", "", "randomg", "Returns a random number drawn from a Gaussian distribution centered on 0 with width SIGMA. If no SEED is given, a seed based on the current time is used.", "Syntax", "result = randomg(SIGMA [, SEED])", "Arguments", "SIGMA: Width of the Gaussian profile from which the number is drawn (real number).", "SEED: Seed of the random number algorithm (integer number).", "Returns", "A random number", "See also", "function random", "", "poly", "Create a polynomial", "Syntax", "result = poly(x, c)", "Arguments", "x: An array or real number", "c: The coefficients of the polynomial", "Returns", "The polynomial of form c[1] + c[2]*x + c[3]*x^2 + ...", "", "polyfit2d", "Returns a 2D N-th order polynomial fit to X. X must be 2-dimensional. The function returns a vector of size sum(i+1)*2 (for i=0 to N). The fittet polynomial has the following form:", "for N=3: f(x,y) = a0 + a1*x + a2*y + a3*x^2 + a4*x*y + a5*y^2 + a6*x^3 + a7*x^2*y + a8*x*y^2 + a9*y^3", "The values a0, ..., a9 are returned in the first 10 elements of the returned vector, their respective errors in the elements 11...20.", "Syntax", "result = polyfit2d(X, N [, CHISQ])", "Arguments", "X: A vector.", "N: An integer number.", "CHISQ: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "See also", "function polyfit", "function polyfitxy", "function polyfitxyerr", "function polyfit2derr", "", "polyfit2derr", "Returns a 2D N-th order polynomial fit to X. X must be 2-dimensional. The function returns a vector of size sum(i+1)*2 (for i=0 to N). The fittet polynomial has the following form:", "for N=3: f(x,y) = a0 + a1*x + a2*y + a3*x^2 + a4*x*y + a5*y^2 + a6*x^3 + a7*x^2*y + a8*x*y^2 + a9*y^3", "The values a0, ..., a9 are returned in the first 10 elements of the returned vector, their respective errors in the elements 11...20.", "Syntax", "result = polyfit2d(X, N, ERROR [, CHISQ])", "Arguments", "X: A vector.", "N: An integer number.", "ERROR: The error of the X-values. If this is a real number, all X-values are assumed to have the same error. If ERROR is a vector, it must have the same length as X and gives the error or each individual X value.", "CHISQ: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "See also", "function polyfit", "function polyfitxy", "function polyfitxyerr", "function polyfit2derr", "", "getbitpix", "Get the pixel type of X.", "Syntax", "result = getbitpix(X)", "Arguments", "X: The array whose pixel type is to be output", "Returns", "-128: Complex (note that this does not conform to FITS standard)", "-64: Floating point, double precision", "-32: Floating point, single precision", "8: Unsigned char", "16: Short", "32: Long", "See also", "function setbitpix", "", "isnan", "Returns a non-zero value if value is 'not-a-number' (NaN), and 0 otherwise.", "Syntax", "result = isnan(a)", "Arguments", "a: The value to check", "See also", "function isinf", "", "isinf", "Returns -1 if value represents negative infinity, 1 if value represents positive infinity, and 0 otherwise.", "If the value is complex and 'inf + -inf i' or '-inf + inf i' then -0.5 will be returned.", "Syntax", "result = isinf(a)", "Arguments", "a: The value to check", "See also", "function isnan", "", "identifylines", "This function attempts to find the reference pattern LINES in a list of observed positions PEAKS. In the following documentation a terminology drawn from the context of arc lamp spectra calibration is used for simplicity: the reference pattern is then a list of wavelengths corresponding to a set of reference arc lamp emission lines - the so-called line catalog; while the observed positions are the positions (in pixel) on the CCD, measured along the dispersion direction, of any significant peak of the signal. To identify the observed peaks means to associate them with the right reference wavelength. This is attempted here with a point-pattern matching technique, where the pattern is contained in the vector LINES, and is searched in the vector PEAKS. In order to work, this method just requires a rough expectation value of the spectral dispersion (in Angstrom/pixel), and a line catalog. The line catalog LINES should just include lines that are expected somewhere in the CCD exposure of the calibration lamp (note, however, that a catalog including extra lines at its blue and/or red ends is still allowed). Typically, the arc lamp lines candidates PEAKS will include light contaminations, hot pixels, and other unwanted signal, but only in extreme cases this prevents the pattern-recognition algorithm from identifying all the spectral lines. The pattern is detected even in the case PEAKS contained more arc lamp lines than actually listed in the input line catalog. This method is based on the assumption that the relation between wavelengths and CCD positions is with good approximation locally linear (this is always true, for any modern spectrograph). The ratio between consecutive intervals pairs in wavelength and in pixel is invariant to linear transformations, and therefore this quantity can be used in the recognition of local portions of the searched pattern. All the examined sub-patterns will overlap, leading to the final identification of the whole pattern, notwithstanding the overall non-linearity of the relation between pixels and wavelengths. Ambiguous cases, caused by exceptional regularities in the pattern, or by a number of undetected (but expected) peaks that disrupt the pattern on the data, are recovered by linear interpolation and extrapolation of the safely identified peaks.", "Syntax", "result = identifylines(PEAKS, LINES, MIN_DISP, MAX_DISP, TOLERANCE)", "Arguments", "PEAKS: A 1D-Fits, List of observed positions (e.g., of emission peaks)", "LINES: A 1D-Fits, List of positions in searched pattern (e.g., wavelengths)", "MIN_DISP: Min expected scale (e.g., spectral dispersion in A/pixel)", "MAX_DISP: Max expected scale (e.g., spectral dispersion in A/pixel)", "TOLERANCE: Tolerance for interval ratio comparison", "", "evalgaussfit", "Evaluate a gaussfit along a vector of x values.", "Syntax", "result = evalgaussfit(X, fit)", "Arguments", "X: A vector of x values at which to evaluate the gaussian fit", "fit: The gaussian fit, as returned by the gaussfit function", "Returns", "A vectors, same length as X, with the gaussian evaluated at the X positions supplied.", "See also", "function gaussfit", "", "polyroots", "Return the roots of a polynomial. The polynomial is defined as P(x) = P[1] + P[2]*x + P[3]*x^2 + ... + P[n]*x^(n-1)", "Syntax", "result = polyroots(P [, derivative])", "Arguments", "P: The polynomial", "derivative: Optional, if an integer number is given, the nth derivative is returned.", "Returns", "A vector with the roots (or derivatives of) the polynomial", "Examples", "Calculate the roots of the polynomias 1 + x^2 = 0:", "print polyroots([1, 0, 1]), /values", "", "interpolate", "Returns the interpolated value of a given position (x,y). If x and y are integers the value at that position is returned without any interpolation.", "Syntax", "result = interpolate(A, x, y [, kernel_size])", "Arguments", "A: A 2D-image.", "x: An real number.", "x: An real number.", "kernel_size: Any integer number, default is 4. Remember that points near the image border can't be interpolated (border-size is half the kernel-size)", "", "radialprofile", "Returns a radial profile centered on (x,y)", "Syntax", "result = radialprofile(A, x, y)", "Arguments", "A: A 2D-image", "x: An integer number, the x center of the profile", "y: An integer number, the y center of the profile", "See also", "function ellipticalprofile", "", "ellipticalprofile", "Returns an elliptical profile centered on (x,y) with position angle a, aspect ratio r, and width w.", "Syntax", "result = radialprofile(A, x, y, a, r, w)", "Arguments", "A: A 2D-image", "x: An integer number, the x center of the profile", "y: An integer number, the y center of the profile", "a: A real number denoting the angle of the ellipse", "r: A real number denoting the aspect ratio of the ellipse", "w: An integer number giving the width of single elements of the ellipse", "See also", "function radialprofile", "", "multigaussfit", "Fit multiple gaussians to a vector. The gauss function is defined as G(x) = SUM_i [A_i + B_i*exp(-4ln2*(x-x0_i)^2/fwhm_i^2)].", "Syntax", "result = multigaussfit(X, Y, errors, estimate [, chisq])", "Arguments", "X: A vector containing the x values to be fit", "Y: A vector containing the y values to be fit", "errors: The errors in Y", "estimate: Initial estimate for the fit of the form [A, B, x0, fwhm]", "chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "Returns", "The returned vector contains the best-fit parameters in the form [A1, B1, x01, fwhm1, A2, ..., d_A1, d_B1, d_x01, d_fwhm1, d_A2, ...]", "See also", "function gaussfit", "", "readfitsall", "Read a FITS file and all its extensions. The FITS will be stored in a variable to type dpuserTypeList.", "Syntax", "result = readfitsall(filename)", "Arguments", "filename: A string pointing to the file to be read", "See also", "function readfits", "function readfitsextension", "", "cubequantile", "Does a quantile of all images in X.", "Syntax", "result = cubequantile(X, quantile)", "Arguments", "X: A matrix or a FITS file name. If a FITS file name is given, the global variable tmpmem determines how many bytes of data are read in at a time.", "quantile: The quantile to be returned (0...1).", "See also", "function cubemedian", "", "quantile", "Compute the quantile of X.", "Syntax", "result = quantile(X, quantile)", "Arguments", "X: A matrix.", "quantile: The quantile to be returned (0...1).", "See also", "function median", "", "sersic2dsmoothfit", "Fit a two-dimensional smoothed sersic function to a rectangular grid (i.e. an image).", "The 2D sersic function is defined as I(x,y) = c + Ie * exp(-bn * (R/Re)^(1/n) - 1).", "R is an elliptical equation: R = sqrt(xp^2 + (yp / q)^2).", "xp and yp describe a rotation: xp = (x - x0) * cos(angle) + (y - y0) * sin(angle), yp = - (x - x0) * sin(angle) + (y - y0) * cos(angle) and bn = 1.9992 * n - 0.3271", "The resulting 2D sersic function is then smoothed by convolving with a gaussian with a FWHM given by the smooth parameter.", "Syntax", "result = sersic2dsmoothfit(image, errors, smooth, estimate [, chisq])", "Arguments", "image: The image to be fit", "errors: The errors in the image values", "smooth: The FWHM for the gaussian smoothing", "estimate: Initial estimate for the fit of the form [c, Ie, Re, x0, y0, angle, q, n]. If n is provided with a negative sign, it won't be fitted and assumed as fixed (with positive sign, of course).", "chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "Returns", "The returned vector contains the best-fit parameters in the form [c, Ie, Re, x0, y0, angle, q, n] or [c, Ie, Re, x0, y0, angle, q] if n was kept fixed.", "See also", "function sersic2dfit", "function sersic2dsmoothsimplefit", "", "sersic2dsmoothsimplefit", "Fit a two-dimensional smoothed sersic function to a rectangular grid (i.e. an image).", "The 2D sersic function is defined as I(x,y) = c + Ie * exp(-bn * (R/Re)^(1/n) - 1).", "R is an elliptical equation: R = sqrt(xp^2 + (yp / q)^2).", "xp and yp describe a rotation: xp = (x - x0) * cos(angle) + (y - y0) * sin(angle), yp = - (x - x0) * sin(angle) + (y - y0) * cos(angle) and bn = 1.9992 * n - 0.3271", "The resulting 2D sersic function is then smoothed by convolving with a gaussian with a FWHM given by the smooth parameter.", "Syntax", "result = sersic2dsmoothsimplefit(image, errors, x0, y0, width, smooth [, chisq])", "Arguments", "image: The image to be fit", "errors: The errors in the image values", "x0, y0: The center coordinates of the window to fit", "width: The width of the window to fit", "smooth: The FWHM for the gaussian smoothing", "chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "Returns", "The returned vector contains the best-fit parameters in the form [c, Ie, Re, x0, y0, angle, q, n] or [c, Ie, Re, x0, y0, angle, q] if n was kept fixed.", "See also", "function sersic2dfit", "function sersic2dsmoothfit", "", "readfitsbintable", "Read a FITS binary table from disk file", "Syntax", "result = readfitsbintable(file, extension, column)", "Arguments", "file: The FITS file to be read", "extension: Which extension to read, either an integer number >= 1, or a string with the EXTNAME", "column: Which column to read, either an integer number >= 1, or a string with the Column Name", "Returns", "The column of the specified FITS binary table", "", "listfitsextensions", "List extension names of all extensions in a FITS file", "Syntax", "result = listfitsextensions(fname)", "Arguments", "fname: A string containing the FITS file name", "Returns", "A string array with all FITS extension names", "", "listtablecolumns", "List FITS binary table column names of specified extension in a FITS file", "Syntax", "result = listtablecolumns(fname, extension)", "Arguments", "fname: A string containing the FITS file name", "extension: Which extension to read, either an integer number >= 1, or a string with the EXTNAME", "Returns", "A string array with all FITS binary table column names", "", "interpol", "1D cubic spline interpolation.", "Syntax", "result = interpol(y, x, x_new)", "Arguments", "y: The given y-values as array.", "x: The given x-values as array. The arrays x and y must be of same length.", "x_new: The new x-values as array.", "Returns", "The new y-values at given points in x_new.", "See also", "function rebin1d", "", "where", "Create a one-dimensional array of indices which satisfy a given expression.", "Syntax", "result = where(array comparison scalar)", "Arguments", "array: An array of any dimension that is to be evaluated", "comparison: Any of the known comparison operators (==, !=, >, >=, <, <=)", "scalar: A scalar value", "Returns", "A one-dimensional vector of the indices in array which satisfied the comparison", "Examples", "Create a sine curve and set all negative values to 0:", "sine = sin([0:1000]/100)", "sine[where(sine < 0)] = 0", "", "list", "Create a FITS list", "Syntax", "result = list(arg1, ..., arg10)", "Arguments", "arg1...arg10: Up to 10 FITS or StringArray to be included in the list", "Returns", "A FITS list with copies of the given arguments", "", "straightlinefit", "Fit a straight line to data with errors in both coordinates", "Syntax", "result = straightlinefit(x, y, dx, dy [, chisq])", "Arguments", "x: the x values of the data to fit", "y: the y values of the data to fit", "dx: the errors in x", "dy: the errors in y", "chisq: If set to a named variable, the variable is overwritten with the chi-squared of the fit.", "Returns", "The returned vector contains the best-fit parameters", "", "", "" }; char *help_pg[] = { "writefits", "Writes the array X to disk as a FITS file with specified filename, optionally as an extension. If X is a Fits List, a multiple extension FITS file is written.", "Syntax", "writefits FILENAME, X [, /ext]", "Arguments", "FILENAME: A string", "X: A matrix or a Fits List", "Switches", "/ext: If specified, the matrix is written as a FITS image extension. If the file FILENAME exists already, the extension is appended (in which case the original FITS file must not be compressed), else an empty primary HDU is written and the extension appended.", "", "contour", "Draw a contour map of X. levels give the contour levels in percent of the maximum value.", "Syntax", "contour fits X, fits levels [,title=string] [,xtitle=string] [,ytitle=string]", "", "display", "Displays a grayscale image of X. If min and max are set, the display of the image is clipped at these values. An optional keyword method can have 3 values:", "method = 0: linear scaling", "method = 1: log scaling", "method = 2: square root scaling", "Syntax", "display fits [, float min, float max]", "", "exec", "Execute cmd (which is given as a character string). Control is returned to DPUSER when cmd is finished.", "Syntax", "exec cmd", "Arguments", "cmd: A string containing the command to be executed.", "Examples", "Do a directory listing:", "exec \"dir\"", "", "sleep", "Sleep for the specified amount of seconds.", "Syntax", "sleep seconds", "Arguments", "seconds: An integer number.", "", "print", "prints the argument. Depending on the argument, the following happens:", " integer, real number, complex number, string, string array: the value is printed.", " matrix: some statistics on the array are printed.", "Syntax", "print argument", "", "mem", "Prints information on all local variables, user defined or compiled functions and procedures.", "Syntax", "mem", "", "shift", "Shifts (and optionally wraps) X by specified values.", "Syntax", "shift X, xs, ys [, zs] [, /wrap]", "Arguments", "X: The array to be shifted", "xs: Shift vector in the first dimension", "ys: Shift vector in the second dimension", "zs: Shift vector in the third dimension", "Switches", "wrap: Pixels shifted off the array will be wrapped to the opposide side.", "Notes", "If either shift vector is non-integer, a subpixel shift is applied and the array type changed to R4. Subpixel shift is only supported in 2 dimensions.", "See also", "function shift", "", "center", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "center X", "See also", "function center", "", "centroid", "Returns the centroid of X in the variables x, y, and z.", "y and z are optional.", "Syntax", "centroid X, VARIABLE x [, VARIABLE y [, VARIABLE z]]", "", "upper", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "upper X", "See also", "function upper", "", "lower", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "lower X", "See also", "function lower", "", "export", "Export what to fname. If what is a stringarray, each string in the array is printed as a separate line. If what is a fits, all values are printed as floating point numbers, separated by a single whitespace (\" \"). In this case, optionally a precision can be given (default: 2 decimal places).", "Syntax", "export string filename, stringarray|fits what [, int precision]", "", "replace", "replaces all occurrences of the string s by the string r.", "Syntax", "replace string|stringarray where, string s, string r", "", "rotate", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "rotate X, angle [, xcen, ycen]", "See also", "function rotate", "", "fft", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "fft X", "See also", "function fft", "", "reass", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "reass X", "See also", "function reass", "", "norm", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "norm X [, /unity, /total, /average]", "See also", "function norm", "", "clip", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "clip X, low, high [, value]", "See also", "function clip", "", "smooth", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "smooth X, fwhm", "See also", "function smooth", "", "boxcar", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "boxcar X, width [, /average, /minimum, /maximum, /median]", "See also", "function boxcar", "", "flip", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "flip X, axis", "See also", "function flip", "", "enlarge", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "enlarge X, scale, method = 0", "See also", "function enlarge", "", "resize", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "resize X, naxis1, naxis2, naxis3", "See also", "function resize", "", "wien", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "wien X, PSF [, height]", "See also", "function wien", "", "lucy", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "lucy X, PSF, niter [, threshold]", "See also", "function lucy", "", "3dnorm", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "3dnorm X", "See also", "function 3dnorm", "", "correl", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "correl X, Y", "See also", "function correl", "", "rebin", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "rebin X, x1, x2", "See also", "function rebin", "", "ssaplot", "Plot ssa statistics. The first argument must be created with ssastat Optionally, a title can be given as second argument which will be printed above all plots.", "Syntax", "ssaplot fits x [, string title]", "See also", "function ssastat", "", "freddy", "Draw an isometric plot of x.", "Syntax", "freddy fits x, int xsize, int ysize, float scale, float angle", "", "surface", "Draw an isosurface of x. This is seen under the angle. If skip is specified and > 1, only every nth line is drawn.", "Syntax", "surface fits x, float angle [, int skip]", "", "imexa", "Display X in ds9. Interactively, the following can be done pressing keys in the viewer: ", "key action", " c contour plot", " s isosurface", " h horizontal cut", " v vertical cut", " r radial average", " i increase window size", " d decrease window size", " q quit and return to dpuser", "(Use ds9 v5.2 or newer!)", "Syntax", "imexa X", "See also", "procedure sao", "", "sbfint", "Initialises the software buffer for crystal-plotting. It should be called just once per plot (buffer), after PGWINDOW but before any crystal-related routines.", "Syntax", "sbfint RGB,IC,IBMODE,IBUF,MAXBUF", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "RGB: R*4 I 3 The RGB values for the background.", "IC: I*4 I - The index for the background colour.", "IBMODE: I*4 I - Buffering mode for initialisation:", " 1 = Ordinary, default.", " 2 = Will want to save later.", " 3 = Initialise from saved buffers.", "IBUF: I*4 I - Software buffer to be used (>=1).", "MAXBUF: I*4 O - Maximum number of buffers available.", "", "sbfbkg", "Sets the shading for the background. This routine should be called after SBFINT, and COLINT or COLTAB, but before any objects are plotted.", "Syntax", "sbfbkg IC1,IC2,ISHADE", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "IC1,IC2: I*4 I - Lowest & highest colour-index to be", " used for the shading.", "ISHADE: I*4 I - Order of shading (IC1-->IC2 - IC1):", " 1 - Bottom to top.", " 2 - Left to right.", " 3 - Bottom-left to top-right.", " 4 - Top-left to bottom-right.", " 5 - Bottom, middle and top.", " 6 - Left, middle and right.", " 7 - Rectangular zoom to centre.", " 8 - Elliptical zoom to centre.", "", "sbfsav", "Save a rendered picture-buffer, and its Z-buffer, for subsequent use in re-initialisation with SBFINT.", "Syntax", "sbfsav IBUF", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "IBUF: I*4 I - Software buffer to be saved (>=1).", "", "sbfcls", "Closes the software buffer for crystal-plotting, by outputting it to the screen or writing out a postscript file (as appropriate).", "Syntax", "sbfcls IBUF", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "IBUF: I*4 I - Software buffer to be output (>=1).", "", "colint", "Initialises a colour table for a geometrical object. In general, it is recommended that SHINE = 0.0 if DIFUSE > 0.0 and vice versa.", "Syntax", "colint RGB,IC1,IC2,DIFUSE,SHINE,POLISH", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "RGB: R*4 I 3 Red, green and blue intenisty for ", " fully-lit non-shiny object (0-1).", "IC1,IC2: I*4 I - Lowest & highest colour-index to be", " used for shading.", "DIFUSE: R*4 I - Diffusiveness of object (0-1).", "SHINE: R*4 I - Whiteness of bright spot (0-1).", "POLISH: R*4 I - Controls size of bright spot.", "", "coltab", "Initialises a colour table for a \"grey-scale\" map.", "Syntax", "coltab RGB,NCOL,ALFA,IC1,IC2", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "RGB: R*4 I 3 X NCOL Red, green and blue intenisty for ", " the colour table.", "NCOL: I*4 I - No. of colours in the input table.", "ALFA: R*4 I - Contrast-factor (linear=1).", "IC1,IC2: I*4 I - Lowest & highest colour-index to be", " used for the output.", "", "colsrf", "Initialises a colour table for a 3-D surface rendering of a 2-D array of \"data\".", "Syntax", "colsrf RGB,NCOL,ALFA,IC1,IC2,NCBAND,DIFUSE,SHINE,POLISH", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "RGB: R*4 I 3 X NCOL Red, green and blue intenisty for ", " the colour table.", "NCOL: I*4 I - No. of colours in the input table.", "ALFA: R*4 I - Contrast-factor (linear=1).", "IC1,IC2: I*4 I - Lowest and highest colour-index to", " be used for the rendering.", "NCBAND: I*4 I - Number of colour-bands for the", " height, so that the number of shades", " per band = (IC2-IC1+1)/NCBAND.", "DIFUSE: R*4 I - Diffusiveness of object (0-1).", "SHINE: R*4 I - Whiteness of bright spot (0-1).", "POLISH: R*4 I - Controls size of bright spot.", "", "sbball", "This subroutine plots a shiny or matt coloured ball. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the ball-centre should be negative (< -radius); the viewing-screen is fixed at z=0.", "Syntax", "sbball EYE,CENTRE,RADIUS,IC1,IC2,LIGHT,LSHINE,X0,Y0,R0", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "EYE: R*4 I 3 (x,y,z) coordinate of eye-position.", "CENTRE: R*4 I 3 (x,y,z) coordinate of ball-centre.", "RADIUS: R*4 I - Radius of ball.", "IC1,IC2: I*4 I - Lowest & highest colour-index to be", " used for shading.", "LIGHT: R*4 I 3 (x,y,z) direction of flood-light.", "LSHINE: L*1 I - Shiny ball if .TRUE., else diffuse.", "X0,Y0: R*4 O - Centre of projected ball.", "R0: R*4 O - Average radius of projected ball.", "", "sbtbal", "This subroutine plots a semi-transparent shiny or matt coloured ball. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the ball-centre should be negative (< -radius); the viewing-screen is fixed at z=0.", "Syntax", "sbtbal EYE,CENTRE,RADIUS,IC1,IC2,LIGHT,LSHINE,X0,Y0,R0,ITRANS", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "EYE: R*4 I 3 (x,y,z) coordinate of eye-position.", "CENTRE: R*4 I 3 (x,y,z) coordinate of ball-centre.", "RADIUS: R*4 I - Radius of ball.", "IC1,IC2: I*4 I - Lowest & highest colour-index to be", " used for shading.", "LIGHT: R*4 I 3 (x,y,z) direction of flood-light.", "LSHINE: L*1 I - Shiny ball if .TRUE., else diffuse.", "X0,Y0: R*4 O - Centre of projected ball.", "R0: R*4 O - Average radius of projected ball.", "ITRANS: I*4 I - Level of transparency:", " 1 = 25%; 2 = 50%; 3 = 75%.", "", "sbplan", "This subroutine plots a diffusively-lit coloured plane; the user must ensure that all the verticies lie in a flat plane, and that the bounding polygon be convex (so that the angle at any vertex <= 180 degs). All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the vertices should be negative; the viewing-screen is fixed at z=0.", "Syntax", "sbplan EYE,NV,VERT,IC1,IC2,LIGHT", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "EYE: R*4 I 3 (x,y,z) coordinate of eye-position.", "NV: R*4 I - No. of verticies (>=3).", "VERT: R*4 I 3 x NV (x,y,z) coordinate of verticies.", "IC1,IC2: I*4 I - Lowest & highest colour-index to be", " used for the shading.", "LIGHT: R*4 I 3 (x,y,z) direction of flood-light.", "", "sbplnt", "This subroutine plots a diffusively-lit, semi-transparent, coloured plane; the use must ensure that all the verticies lie in a flat plane, and that the bounding polygon be convex (so that the angle at any vertex <= 180 degs). All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the vertices should be negative; the viewing-screen is fixed at z=0.", "Syntax", "sbplnt EYE,NV,VERT,IC1,IC2,LIGHT,ITRANS", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "EYE: R*4 I 3 (x,y,z) coordinate of eye-position.", "NV: R*4 I - No. of verticies (>=3).", "VERT: R*4 I 3 x NV (x,y,z) coordinate of verticies.", "IC1,IC2: I*4 I - Lowest & highest colour-index to be", " used for the shading.", "LIGHT: R*4 I 3 (x,y,z) direction of flood-light.", "ITRANS: I*4 I - Level of transparency:", " 1 = 25%; 2 = 50%; 3 = 75%.", "", "sbrod", "This subroutine plots a diffusively-shaded coloured rod. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the rod-ends should be negative (< -radius); the viewing-screen is fixed at z=0.", "Syntax", "sbrod EYE,END1,END2,RADIUS,IC1,IC2,LIGHT,NSIDES,LEND", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "EYE: R*4 I 3 (x,y,z) coordinate of eye-position.", "END1: R*4 I 3 (x,y,z) coordinate of rod-end 1.", "END2: R*4 I 3 (x,y,z) coordinate of rod-end 2.", "RADIUS: R*4 I - Radius of cylinderical rod.", "IC1,IC2: I*4 I - Lowest & highest colour-index to be", " used for the shading.", "LIGHT: R*4 I 3 (x,y,z) direction of flood-light.", "NSIDES: I*4 I - The order of the polygon to be used", " for the cross-section of the rod.", "LEND: L*1 I - If true, plot the end of the rod.", "", "sbcone", "This subroutine plots a diffusively-shaded coloured right-angular cone. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the base and appex of the cone should be negative (< -radius); the viewing-screen is fixed at z=0.", "Syntax", "sbcone EYE,BASE,APEX,RADIUS,IC1,IC2,LIGHT,NSIDES", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "EYE: R*4 I 3 (x,y,z) coordinate of eye-position.", "BASE: R*4 I 3 (x,y,z) coordinate of the centre of", " the base of the cone.", "APEX: R*4 I 3 (x,y,z) coordinate of the apex.", "RADIUS: R*4 I - Radius of the base of the cone.", "IC1,IC2: I*4 I - Lowest & highest colour-index to be", " used for the shading.", "LIGHT: R*4 I 3 (x,y,z) direction of flood-light.", "NSIDES: I*4 I - The order of the polygon to be used", " for the cross-section of the cone.", "", "sbelip", "This subroutine plots a shiny or matt coloured elliptical ball. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the ball-centre should be negative (< -radius); the viewing-screen is fixed at z=0.", "Syntax", "sbelip EYE,CENTRE,PAXES,IC1,IC2,LIGHT,LSHINE,ICLINE,ANGLIN,X0,Y0,R0", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "EYE: R*4 I 3 (x,y,z) coordinate of eye-position.", "CENTRE: R*4 I 3 (x,y,z) coordinate of ball-centre.", "PAXES: R*4 I 3 x 3 Principal axes of the elliposid.", "IC1,IC2: I*4 I - Lowest & highest colour-index to be", " used for shading.", "LIGHT: R*4 I 3 (x,y,z) direction of flood-light.", "LSHINE: L*1 I - Shiny ball if .TRUE., else diffuse.", "ICLINE: I*4 I - If >=0, colour index for lines on", " surface of ellipsoid.", "ANGLIN: R*4 I - Width of lines: +/- degs.", "X0,Y0: R*4 O - Centre of projected ball.", "R0: R*4 O - Average radius of projected ball.", "", "sbline", "This subroutine draws a straight line between two points. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive, while that of both the ends should be negative; the viewing-screen is fixed at z=0.", "Syntax", "sbline EYE,END1,END2,ICOL,LDASH", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "EYE: R*4 I 3 (x,y,z) coordinate of eye-position.", "END1: R*4 I 3 (x,y,z) coordinate of end-1.", "END2: R*4 I 3 (x,y,z) coordinate of end-2.", "ICOL: I*4 I - Colour-index for line.", "LDASH: L*1 I - Dashed line if .TRUE. (else cont.).", "", "sbtext", "Write a text string in 3-d perspective. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the text string should be negative; the viewing-screen is fixed at z=0.", "Syntax", "sbtext EYE,TEXT,ICOL,PIVOT,FJUST,ORIENT,SIZE", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "EYE: R*4 I 3 (x,y,z) coordinate of eye-position.", "TEXT: C*1 I * The text string to be written.", "ICOL: I*4 I - Colour index for text.", "PIVOT: R*4 I 3 (x,y,z) coordinate of pivot point.", "FJUST: R*4 I - Position of pivot along the text: ", " 0.0=left, 0.5=centre, 1.0=right.", "ORIENT: R*4 I 3 x 2 (x,y,z) for X-length and Y-height", " directions of the text.", "SIZE: R*4 I - Height of the reference symbol \"A\".", "", "sbsurf", "This subroutine plots an iso-surface through a unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0.", "Syntax", "sbsurf EYE,LATICE,DENS,N1,N2,N3,DSURF,IC1,IC2,LIGHT,LSHINE", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "EYE: R*4 I 3 (x,y,z) coordinate of eye-position.", "LATICE: R*4 I 3 x 4 (x,y,z) coordinates of the origin", " and the a, b & C lattice-vertices.", "DENS: R*4 I (N1+1) The density at regular points within", " x (N2+1) the unit cell, wrapped around so", " x (N3+1) that DENS(0,J,K)=DENS(N1,J,K) etc..", "N1,N2,N3: I*4 I - The dimensions of the unit-cell grid.", "DSURF: R*4 I - Density for the iso-surface.", "IC1,IC2: I*4 I - Lowest & highest colour-index to be", " used for the shading.", "LIGHT: R*4 I 3 (x,y,z) direction of flood-light.", "LSHINE: L*1 I - Shiny surface if TRUE, else diffuse.", "", "sbtsur", "This subroutine plots a semi-transparent iso-surface through a unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0.", "Syntax", "sbtsur EYE,LATICE,DENS,N1,N2,N3,DSURF,IC1,IC2,LIGHT,LSHINE,ITRANS", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "EYE: R*4 I 3 (x,y,z) coordinate of eye-position.", "LATICE: R*4 I 3 x 4 (x,y,z) coordinates of the origin", " and the a, b & C lattice-vertices.", "DENS: R*4 I (N1+1) The density at regular points within", " x (N2+1) the unit cell, wrapped around so", " x (N3+1) that DENS(0,J,K)=DENS(N1,J,K) etc..", "N1,N2,N3: I*4 I - The dimensions of the unit-cell grid.", "DSURF: R*4 I - Density for the iso-surface.", "IC1,IC2: I*4 I - Lowest & highest colour-index to be", " used for the shading.", "LIGHT: R*4 I 3 (x,y,z) direction of flood-light.", "LSHINE: L*1 I - Shiny surface if TRUE, else diffuse.", "ITRANS: I*4 I - Level of transparency:", " 1 = 25%; 2 = 50%; 3 = 75%.", "", "sbslic", "This subroutine plots a \"grey-scale\" slice through a unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0.", "Syntax", "sbslic EYE,LATICE,DENS,N1,N2,N3,DLOW,DHIGH,IC1,IC2,SLNORM,APOINT,ICEDGE", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "EYE: R*4 I 3 (x,y,z) coordinate of eye-position.", "LATICE: R*4 I 3 x 4 (x,y,z) coordinates of the origin", " and the a, b & C lattice-vertices.", "DENS: R*4 I (N1+1) The density at regular points within", " x (N2+1) the unit cell, wrapped around so", " x (N3+1) that DENS(0,J,K)=DENS(N1,J,K) etc..", "N1,N2,N3: I*4 I - The dimensions of the unit-cell grid.", "DLOW: R*4 I - Density for the lowest colour-index.", "DHIGH: R*4 I - Density for the highest colour-index.", "IC1,IC2: I*4 I - Lowest & highest colour-index to be", " used for the shading.", "SLNORM: R*4 I 3 (x,y,z) direction of the normal to ", " the slice to be \"grey-scaled\".", "APONIT: R*4 I 3 (x,y,z) coordinate of a point within", " the slice to be \"grey-scaled\".", "ICEDGE: I*4 I - If >=0, it's the colour-index for the", " boundary of the \"grey-scaled\" slice.", "", "sbcpln", "This subroutine plots a diffusively-lit, semi-transparent, coloured plane through a unit cell. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0.", "Syntax", "sbcpln EYE,LATICE,IC1,IC2,LIGHT,SLNORM,APOINT,ICEDGE,ITRANS", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "EYE: R*4 I 3 (x,y,z) coordinate of eye-position.", "LATICE: R*4 I 3 x 4 (x,y,z) coordinates of the origin", " and the a, b & C lattice-vertices.", "IC1,IC2: I*4 I - Lowest & highest colour-index to be", " used for the shading.", "LIGHT: R*4 I 3 (x,y,z) direction of flood-light.", "SLNORM: R*4 I 3 (x,y,z) direction of normal to plane.", "APONIT: R*4 I 3 (x,y,z) coordinate of a point within", " the plane.", "ICEDGE: I*4 I - If >=0, it's the colour-index for", " the boundary of the plane.", "ITRANS: I*4 I - Level of transparency:", " 0 = 0%; 1 = 25%; 2 = 50%; 3 = 75%.", "", "sb2srf", "This subroutine plots a 3-d surface given a 2-d unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0.", "Syntax", "sb2srf EYE,LATICE,DENS,N1,N2,DLOW,DHIGH,DVERT,IC1,IC2,NCBAND,LIGHT,LSHINE", "Arguments", "ARGUMENT TYPE I/O DIMENSION DESCRIPTION", "EYE: R*4 I 3 (x,y,z) coordinate of eye-position.", "LATICE: R*4 I 3 x 3 (x,y,z) coordinates of the origin", " and the a and b lattice-vertices.", "DENS: R*4 I (N1+1) The density at regular points within", " x (N2+1) the unit cell, wrapped around so", " that DENS(0,J)=DENS(N1,J) etc..", "N1,N2: I*4 I - The dimensions of the unit-cell grid.", "DLOW: R*4 I - Lowest density to be plotted.", "DHIGH: R*4 I - Highest density to be plotted.", "DVERT: R*4 I - \"Vertical\" world-coordinate length", " corresponding to density-range.", "IC1,IC2: I*4 I - Lowest and highest colour-index to", " be used for the rendering.", "NCBAND: I*4 I - Number of colour-bands for the", " height, so that the number of shades", " per band = (IC2-IC1+1)/NCBAND.", "LIGHT: R*4 I 3 (x,y,z) direction of flood-light.", "LSHINE: L*1 I - Shiny surface if TRUE, else diffuse.", "", "radialplot", "plots a radial average of x centered at [xcenter, ycenter] with a radius of r", "Syntax", "radialplot fits x, int xcenter, int ycenter, int r [,title=string] [,xtitle=string] [,ytitle=string]", "", "setfitskey", "add or change a FITS key in the header. value can be any of string, integer or double.", "Syntax", "setfitskey fits x, string key, value, string comment", "See also", "function getfitskey", "", "setbitpix", "Change pixel type of X.", "Syntax", "setbitpix fits x, int bitpix, double bscale = 1.0, double bzero = 0.0", "See also", "function setbitpix", "", "cd", "change the current working directory.", "Syntax", "cd string", "", "setwcs", "set WCS information in the FITS header.", "Syntax", "setwcs fits, crpix1, crpix2, crval1, crval2, cdelt1 [, cdelt2]", "", "shrink", "See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable.", "Syntax", "shrink X, factor [, axis]", "See also", "function shrink", "", "view", "Uses qtfitsview to display specified fits.", "Syntax", "view X", "", "limits", "Returns the limits for which the array is non-zero in the given variables. At least xlow and xhigh must be given.", "Syntax", "limits fits, xlow, xhigh [, ylow, yhigh, zlow, zhigh]", "", "printf", "Print the value (either a real number or an integer) using specified format string. The formatting is done like in the C printf function. The total length of the formatted string is limited to 256 characters.", "Syntax", "printf format, value", "", "writebmp", "Write a bitmap (.bmp) file. If only red is given, this will be a grayscale image, else both green and blue must be given (which must be of the same size as red) and a color image will be written. The values in the fits are supposed to be scaled between 0 and 255.", "Syntax", "writebmp filename, red [, green, blue]", "Arguments", "filename: A string giving the file name of the bitmap", "red: 2-dimensional array", "green: A 2-dimensional array of the same size as red", "blue: A 2-dimensional array of the same size as red", "Examples", "Write out a grayscale bitmap of a circular gaussian:", "writebmp \"gauss.bmp\", gauss(129,129,30)*255", "", "swapbytes", "Swap the bytes of given fits, which must be a variable.", "Syntax", "swapbytes fits", "", "read", "Print prompt and read in up to 9 variables. The variables can be of integer, floating point or string type and must exist before the call.", "Syntax", "read prompt, v1 [, v2, v3, v4, v5, v6, v7, v8, v9]", "", "shade", "Plot an image in a variety of ways - as provided by PGXTAL. This procedure asks for plot options interactively. Possible plots are contour, shaded surface, and colour plots with various colourtables.", "Syntax", "shade fits", "", "saomarkpoint", "Draws a marker in ds9 at specified x,y coordinates with size s. (Use ds9 v5.2 or newer!)", "Syntax", "saomarkpoint x, y, size, type", "Arguments", "x: X-axes coordinate of the center of the circle", "y: Y-axes coordinate of the center of the circle", "size: The size of the marker to be drawn", "type: Marker type, give one of the following (can be OR'ed)", "POINT: 2", "BOX: 4", "DIAMOND: 32", "CIRCLE: 64", "See also", "procedure sao", "procedure saomarklabel", "procedure saoclear", "", "saoclear", "Clear ds9 of all markers drawn. (Use ds9 v5.2 or newer!)", "Syntax", "saoclear", "See also", "procedure sao", "procedure saomarkpoint", "procedure saomarklabel", "", "saomarklabel", "Draws a text label in ds9 at specified x,y coordinates. (Use ds9 v5.2 or newer!)", "Syntax", "saomarklabel x, y, label", "Arguments", "x: X-axes coordinate of the center of the circle", "y: Y-axes coordinate of the center of the circle", "label: A string to be printed next to the marker", "See also", "procedure sao", "procedure saomarkpoint", "procedure saoclear", "", "cblank", "Replace all undefined values (like NaN or Inf) by another value. If no value is specified, 0.0 will be replaced.", "Syntax", "cblank ARRAY [, value]", "Arguments", "ARRAY: A variable holding an array", "value: Optional, the value to be assigned (defaults to 0)", "See also", "function cblank", "", "cubemerge", "Merges several fits datacubes. All files must have the same array size (in the first two dimensions) and bitpix. The file name of the result must not be the same as any of the input names. The FITS header is copied from the first file and the NAXIS3 keyword is updated.", "Syntax", "cubemerge result, cubes", "Arguments", "result: The filename where the datacube is written to", "cubes: A string array with the file names to be merged", "", "setenv", "Set or change an environment variable.", "Syntax", "setenv VARIABLE, VALUE", "Arguments", "VARIABLE: A string with the name of the new environment variable", "VALUE: A string with the value of the new environment variable", "See also", "function getenv", "", "break", "Stop any currently running script or loop.", "Syntax", "break", "Arguments", "none", "", "run", "Execute a script. This is equivalent to entering @script.", "Syntax", "run S", "Arguments", "S: A string with the file name of the script to be executed.", "", "echo", "Turn on or off echo mode. Echo mode determines if external scripts are echoed to the console.", "Syntax", "echo mode", "Arguments", "mode: An integer number. 0 means echo off, any other number echo on.", "", "precess", "Precess coordinates from one epoch to another.", "Syntax", "precess RAh, RAm, RAs, DECd, DECm, DECs, fromepoch, toepoch", "Arguments", "RAh, RAm, RAs: Right Ascension of the object", "DECd, DECm, DECs: Declination of the object", "fromepoch: Epoch in which the coordinates are given", "toepoch: Epoch to which the coordinates should be precessed", "", "pwd", "Print current working directory", "Syntax", "pwd", "Arguments", "None", "", "dir", "Print directory listing.", "Syntax", "dir [filter]", "Arguments", "filter: Print directory listing of files matching given pattern", "", "setindexbase", "Set the base for array indexing", "Syntax", "setindexbase base", "Arguments", "base: The index base, 0 for C-notation, 1 for Fortran-notation (the default)", "See also", "procedure cnotation", "procedure fortrannotation", "function indexbase", "", "fortrannotation", "Set the base for array indexing to 1 (the default for dpuser)", "Syntax", "fortrannotation", "Arguments", "none", "See also", "procedure setindexbase", "procedure cnotation", "function indexbase", "", "cnotation", "Set the base for array indexing to 0", "Syntax", "cnotation", "Arguments", "none", "See also", "procedure setindexbase", "procedure fortrannotation", "function indexbase", "", "userDialog", "Create a dialog box for QFitsView", "Syntax", "userDialog function, labels [, types [, values] ]", "Arguments", "title: A string with the dpuser function to be executed. This will be shown also as the caption of the dialog box.", "labels: A string array with the description of the parameters to be entered", "types: Optional types of the arguments (as a string array): Can be either int, real, fits, or anything, in which case it will be treated as a string.", "values: Optionally, default values for the entries can be given (as a string array).", "Examples", "Create a dialog box for the velmap function:", "userDialog \"myvelmap\", [\"cube\", \"wavelength center\", \"fwhm\"], [\"fits\", \"real\", \"real\"], [\"\", \"2.13\", \".001\"]", "", "compile", "Converts a dpuser-script into C-code, compiles it and links it at runtime into the running dpuser-session. Unlike with user defined functions or procedures, it is not allowed to compile a function with the same name as aalready compiled procedure and vice versa.", "Syntax", "compile \"filename\"", "Arguments", "filename: The filename of the dpuser-script to convert", "Switches", "/c: Adds needed headers and forward declarations to existing C-code and links it on runtime. The general data type to use must be 'dpuserType'. Functions and procedures must begin like shown in the examples below.", "/reset: Unloads all compiled functions and procedures. See example below.", "Examples", "To compile c-code, functions must be defined as follows:", "extern \"C\" dpuserType funcName(dpuserType &a, ...) { ... }", " ...;", " return funcName;", "}", "Procedures must be defined as follows:", "extern \"C\" void procName(dpuserType &a, ...) {", " ...;", " return;", "}", "To unload all functions and procedures:", "compile \"\", /reset", "", "spec3d", "Draw an averaged spectrum of the cube multiplied by the mask.", "Syntax", "spec3d cube, mask [,title=string] [,xtitle=string] [,ytitle=string]", "Arguments", "cube: A 3-dimensional matrix", "mask: A 2-dimensional matrix", "", "plot", "Plots the 1-dimensional vector y. If x is given, x versus y is plot, else the running number versus y is plot. ymin and ymax can be specified to set the plot range in the y axes. If symbol is given and >= -31, each point will be represented by a symbol, else the lines will be connected by a polyline. See \"help pgpt\" for a description of available symbols.", "Syntax", "plot [x, ] y [,title=string] [,xtitle=string] [,ytitle=string] [,symbol=integer] [, ymin] [, ymax] [, /xlog] [, /ylog] [, /noclose]", "See also", "pgplot_pgpt", "", "free", "Release all memory taken by local variables.", "Syntax", "free", "", "sao", "Uses ds9 to display X. ds9 v5.2 or newer needs to be running.", "Syntax", "sao X [, min, max] [, /log, /zscale]", "Arguments", "X: A 2-dimensional matrix", "min, max: Minimum and maximum array value for display scaling", "Switches", "/log: display the image in logarithmic scaling.", "/zscale: Use a display representation similar to IRAF's zscale.", "", "cirrange", "Reduce a number to the range [0,360[ or [0,pi[.", "Syntax", "cirrange VAR [, /deg, /rad]", "Arguments", "VAR: A named variable whose value should be reduced. This can be a real number or a vector/matrix.", "Switches", "/deg: Reduce to [0,360[ (default)", "/rad: Reduce to [0,pi[", "", "swapaxes", "Swap axes of a 3D array", "Syntax", "swapaxes VAR, newx, newy, newz", "Arguments", "VAR: A named variable which contains a 3D FITS", "newx: Integer numer (1..3) which tells which axis shall become the X axis", "newy: Integer numer (1..3) which tells which axis shall become the Y axis", "newz: Integer numer (1..3) which tells which axis shall become the Z axis", "Notes", "The following FITS header keys are updated, if they exist:", "CRVAL, CRPIX, CDELT, CD matrix, CTYPE, CUNIT", "Examples", "OSIRIS 3D data come in the format [lambda,x,y]. To convert this to [x,y,lambda]:", "swapaxes buffer, 2, 3, 1", "", "debug", "Turn on or off debug information.", "Syntax", "debug mode", "Arguments", "mode: An integer number. 0 means debugging information off, any other number display debugging information.", "", "copyheader", "Copy the FITS header from one matrix to another", "Syntax", "copyheader VAR, source", "Arguments", "VAR: A named variable of type fits which should receive the FITS header", "source: The matrix with the FITS header to be copied", "", "setfitstype", "Set the (FITS extension) type info of given fits to either image or bintable", "Syntax", "setfitstype VAR [, extension], [ /image, /bintable]", "Arguments", "VAR: A named variable which contains a FITS, a FITS list, or a string array", "extension: Optional in case of a FITS list, which element to set", "Switches", "/image: set the FITS type to image", "/bintable: set the FITS type to bintable", "", "", "" }; dpusersrc/dpuser/doc/history.html0000644000175100003160000004475612733215062015547 0ustar ottir DPUSER - The Next Generation: History

Revision history

Version 3.2 Version 3.0 Version 2.0
Version 1.2 Version 1.1 Version 1.0
Version 0.99 Version 0.96 Version 0.95 Version 0.9 Version 0.8 Version 0.7

Version 3.2

Released June 2016

This version adds support for reading FITS binary tables. A new data type list has been added which can act as a container for FITS or String Array. The dependency on the external files grfont.dat and rgb.txt has been removed.

New functions:

New procedures:

  • setfitstype set the FITS header type (binary table or image).

Version 3.0

Released July 2011

New functions:

  • getbitpix Get the pixel type.
  • isnan tests for not-a-number.
  • isinf tests for infinity.
  • polyfit2d performs a 2D N-th order polynomial fit.
  • polyfit2derr performs a 2D N-th order polynomial fit with errors.
  • interpolate returns the interpolated value of a given 2D position.
  • radialprofile returns a radial profile centered on a 2D position.
  • ellipticalprofile returns an elliptical profile centered on a 2D position.
  • multigaussfit fits multiple gaussians to a vector.
  • evalgaussfit evaluates a gaussfit along a vector of x values.
  • polyroots return the roots of a polynomial.
  • xmin returns the x coordinate of the minimum value in a 2D array.
  • ymin returns the x coordinate of the minimum value in a 2D array.
  • readfitsall reads a FITS file and all its extensions.
  • cubequantile does a quantile of all images in a cube.
  • quantile computes a quantile.

New procedures:

  • copyheader copies the FITS header from one matrix to another.
  • swapaxes swaps axes of a 3D array.

Version 2.0

Released July 2008

This is a major release after 2.5 years of silence.
  • The CDL (Client Display Library) used to communicate with saoimage has been replaced by XPA (X Public Access).
  • The dependence of the QT library is removed
  • Numerous bugs have been fixed.

New functions:

  • gauss2dsimplefit fits a two-dimensional gauss function to data (without initial guess).
  • transpoly calculates the transformation matrix between two coordinate systems (with errors).
  • strtrim trims a string.
  • right returns the right part of a string.
  • ten converts a sexigesimal number to decimal.
  • primes calculates prime numbers.
  • twodcut creates a longslit spectrum from a datacube.
  • simplifywhitespace simplifies white spaces in a string.
  • strsplit splits a string to a string array.
  • interpol interpolates a vector.
  • sersic2dfit fits a two-dimensional sersic function to data.
  • sersic2dsimplefit fits a two-dimensional sersic function to data (without initial guess).
  • sersicfit fits a one-dimensional sersic function to data.
  • sersic2d creates a two-dimensional sersic function.
  • randomg random number generation.
  • poly creates a polynomial.

New procedures:

  • userDialog supply a user defined dialog box for QFitsView.
  • compile compile code at runtime.
  • cirrange reduce a number to circular range.
  • debug enable debugging messages.

Version 1.2

Released September 2005

  • A bug when using naxis1=... and similar inside user defined functions and procedures has been fixed.

New functions:

  • sinfit fits a sine function to data.
  • sincfit fits a sinc finction to data.
  • rebin1d rebins one-dimensional data.
  • velmap creates a velocity map from a datacube.
  • fxcor cross-correlates two spectra and fits a sinc.
  • correlmap cross-correlates a datacube with a spectrum.
  • longslit creates a longslit spectrum from a datacube.
  • evalvelmap evaluates the result from velmap.
  • voronoi computes the voronoi tesselation of an image.
  • indexbase returns the index base for array subscripting.

New procedures:

  • setindexbase sets the index base for array subscripting.
  • cnotation sets the index base for array subscripting to 0.
  • fortrannotation sets the index base for array subscripting to 1.

Version 1.1

Never really released

This is a maintenance release.
  • The readfits function can now also read in only a part of a fits file.
  • The maxentropy function finally works.
  • A bug in the string function when the argument was a complex number has been fixed.

New functions:


Version 1.0

Released August 12, 2004

This version adds a few new functions and procedures. Mostly, existing functions have been expanded, namely the ability to handle FITS file extensions. Also, the documentation has been extended. The main change is that DPUSER - The Next Generation now is fully integrated into the QFitsView program also written by me, and DPUSER now uses free code only (notably the GNU Scientific Library).
  • The header, naxis, naxis1, naxis2, and naxis3 functions can now also handle FITS extensions.
  • The readfits function can now also read in bitmap files.
  • The getfitskey function has a new switch /text and handles non-existing FITS keys.
  • The handling of user defined functions and procedures has been improved. Also, a bug when using nested functions/procedures was fixed.
  • The parser can now handle code like this:
    print = 10
    print print

New functions:

New procedures:

  • precess coordinates from one epoch to another.
  • pwd prints the current working directory.
  • dir prints a directory listing.

Version 0.99

This is the last version of the 0.9x series. It is mainly a bug fix release. If you have any knowledge of bugs or inconsistent features, please let me know ASAP - I'll try to fix them before the release of version 1.0.

New functions:

Version 0.99 introduces no new functions or procedures.

Version 0.96

  • I have introduced a modulus operator ("%") applicable to integer arguments.

  • For the Win32 version of DPUSER, I was able to dig out a native port of rxvt for Windows. This offers many more features than the windpuser.exe program distributed with ealier versions. I slightly modified rxvt by adding a DPUSER icon.

  • The linux binary distribution is now statically linked against QT (as advertised in the Install section). This prevents an immediate core dump on RedHat linux.

  • Some memory leaks have been removed.

  • The median function now returns the single element value if applied to a matrix with only one element (instead of zero).

  • The nelements function now returns a value of one if not applied to a matrix but a number (either integer, double precision or complex).

  • Several bugs in reading huge FITS cubes (>256 MB) have been fixed. Now files up to a size of 2 GB can be read.

  • The rotate function used to multiply the total counts in an image by a factor of 4. This has been fixed.

  • The reass function had a bug when applied to matrices with an uneven axes length. This also affects the smooth function. Fixed.

  • The shift function has some new features.

New functions:


Version 0.95

  • In this version, some matrix arithmetics functions were added. This includes the "#" operator which does matrix multiplication.

  • Beginning with this version, it is possible to write user defined procedures and functions. Some examples are provided in the dpuserlib/ directory.
    !!!Feedback on this new feature is extremely welcome!!!

  • If a file named "startup.dpuser" is located either in your home directory or in a directory pointed to by the DPUSER environment variable, it will be executed during startup of DPUSER. An example is provided in the dpuserlib/ directory.

  • Some minor bugs (especially concerning arithmetics including double and single precision numbers) have been fixed.

New functions:

New procedures:

  • break stops any script or loop.
  • run executes a script.
  • echo turns on/off echo mode.

Version 0.9

  • The functions naxis, naxis1, naxis2, and naxis3 read in the values much faster when applied to FITS files (used to read in the complete file).

  • The ssa function is now a lot quicker when using the /resize switch.

  • A bug in the cubemedian function when applied to FITS files with NAXIS2 not a integer power of 2 has been fixed.

  • Subtracting a matrix from a real number resulted in wrong results. This also applies to complex numbers and FITS files. Along with this, a print -'hhh' didn't to the correct thing. This has been fixed.

New functions:

New procedures:


Version 0.8

  • Switch to cross-platform library QT. This affects strings, string arrays, as well as the dir and findfile functions. The interface doesn't change. This removed a memory leak in string arrays and fixes problems with findfile which would not list all files. The SFL library now is no longer needed to build DPUSER.

  • A new integer global variable "tmpmem" which gives the number of bytes which can be used for temporary storage. At the moment, this only affects the function cubemedian. The interface doesn't change.

  • A bug has been fixed in cubemerge which sometimes would not update the FITS header correctly.

  • Extended documentation.

New functions:


Version 0.7

  • The procedure sao accepts lower and upper limits; added /zscale and /log switch

  • dpusersrc/dpuser/doc/ifandloop.html0000644000175100003160000000736210735765731016026 0ustar ottir DPUSER - The Next Generation: Conditional statements, Loops and Statement blocks

    Conditional statements, Loops and Statement blocks

    DPUSER provides language elements that allow to take action only when a certain condition is met (commonly called if-then-else statements). Also, you can construct loops using the for and the while constructs.

    Conditional statements

    There are two ways to evaluate conditional statements in DPUSER, as well as two kinds of loops. Both have in common that they can execute statement blocks. The general syntax for a conditional statement is:
    if (boolean) {
      do something
      ...
    } else {
      do something else
      ...
    }
    The else part is optional.
    The second way to evaluate a conditional statement is using the following:
    boolean ? do this : do that

    Examples

    if (a == 1) {
      print "A is one"
    } else {
      print "A is not one but " + a
    }

    The same thing in one line:
    print "A is " + (a == 1 ? "one" : "not one but " + a)

    Note that nesting conditional statements is not allowed. Therefore, the following code creates a syntax error:
    if (a == 1) {
      print "one"
    } else if (a == 2) {   <== THIS IS NOT ALLOWED
      print "two"
    } else {
      print "neither one or two"
    }
    If you want to do something like this, do the following:
    if (a == 1) {
      print "one"
    } else {
      if (a == 2) {
        print "two"
      } else {
        print "neither one or two"
      }
    }
    Or, as a (complicated) one-liner, since nesting is allowed using the second construct:
    print (a == 1 ? "one" : (a == 2 ? "two" : "neither one or two"))
    (You can leave out all the parentesis, but for readibility it is better to use them)

    Loops

    A loop can be constructed using the for  as well as the while statements. The general syntax for the for loop is:
    for (start_condition; boolean; change_condition) {
      do something
      ...
    }
    A while loop is constructed like this:
    while (condition) {
      do something
      ...
    }

    Examples

    Print out all numbers from 1 to 9
    for (i = 1; i < 10; i++) print i

    i = 1
    while (i < 10) {
      print i
      i++
    }

    Note that in the second example, it is easy to create an endless loop if you forget the i++ statement. You can always use curly brackets to execute more than one statement in a loop or as a result of a conditional statement.

    Assign the ASCII character set to a string variable:

    s = ""
    for (i = 32; i <= 255; i++) s += char(i)
    dpusersrc/dpuser/doc/index.html0000644000175100003160000000666411562743100015147 0ustar ottir DPUSER - The Next Generation

    Introduction

    DPUSER is an interactive language that is capable of handling numbers (both real and complex), strings, and matrices. Its main aim is to do astronomical image analysis, for which it provides a comprehensive set of functions, but it can also be used for many other applications.

    QFitsView is a FITS file viewer. In addition to displaying two-dimensional images, it also provides means to explore three-dimensional data cubes.

    List of available documentation

    The DPUSER Language Command Reference QFitsView
    Command Syntax Alphabetical function list GUI elements
    Operators Alphabetical procedure list
    Data types and variables Alphabetical list of pgplot routines
    Plotting Category index
    Handling of FITS files
    Conditional statements and loops
    Examples

    Obtaining DPUSER

    DPUSER has been ported to several platforms. For instructions how to get and install DPUSER, go to the installing page.

    Using DPUSER

    DPUSER is a text-console program and therefore can be run on any terminal. On startup, you are greeted by a short message and the DPUSER> prompt appears. Now you are ready to type commands. As in a UNIX-shell, you can use the up- and down keys to browse previously typed commands. Filename expansion using the tab-key is also supported. When run in the Windows Environment, a GUI frontend called windpuser can be started which provides similar functionality.

    The Author

    DPUSER was written by Thomas Ott as a software package for reducing astronomical speckle data. If you have comments or suggestions regarding DPUSER, please feel free to contact me.

    Credits

    The following packages and code snippets were used in developing DPUSER - The Next Generation:

    Warranty

    Provided as is... dpusersrc/dpuser/doc/installing.html0000644000175100003160000002230510735765731016211 0ustar ottir DPUSER - The Next Generation: Installing

    Installing DPUSER

    There are two ways to install DPUSER: Either you grab the binary, or you compile it yourself. Both steps are described in the following.

    Binary installation

    Binary versions of DPUSER are available for Linux and Windows. Grab either the dpuser.tgz (Linux) or dpuser.zip (Windows) files. Note that the Linux binary is statically linked (to avoid problems with missing libraries) which means it is rather big (several MB). If you want to avoid this, you have to compile DPUSER yourself.

    • Linux: Extract the files to a directory in your PATH. Also, you have to set an environment variable PGPLOT_DIR to this directory. The tar-file contains the following files:
      • dpuser - This is the DPUSER program itself
      • pgxwin_server - PGPLOT server program for X-Windows
      • rgb.txt, grfont.dat - PGPLOT support files
    • Windows: Extract the files somewhere in a directory, e.g. C:\Programme\dpuser. Start the dpuser.exe programme. The zip-file contains the following files:
      • dpuser.exe - This is the DPUSER console application
      • cygwin1.dll, cygpng2.dll, cygz.dll - Support libraries
      • rgb.txt, grfont.dat - PGPLOT support files

    Compiling DPUSER

    If you want to compile DPUSER yourself, grab the dpusersrc.tgz file. Priour to compiling DPUSER itself, you have to compile support libraries which are used by DPUSER (the link in the following list points to where you can get the library):

    These are the detailed steps (these apply to LINUX and WINDOWS using the cygwin environment). Replace DPUSERDIR by the directory name where you extracted the dpusersrc.tgz archive:

    1. Unpack the DPUSER source archive:
      tar -xvzf dpusersrc.tgz
    2. Create two additional directories:
      mkdir DPUSERDIR/lib
      mkdir DPUSERDIR/include
    3. Compile FFTW: I usually do the following:
      ./configure --prefix=/tmp/brgx --enable-i386-hacks
      make
      (You can drink some coffee now)
      make install
      cp /tmp/brgx/include/*.h DPUSERDIR/include
      cp /tmp/brgx/lib/*.a DPUSERDIR/lib
      rm -rf /tmp/brgx
    4. Compile PGPLOT. If you are using WINDOWS, follow the steps described at the end.
      cp *.a DPUSERDIR/lib
      cp cpgplot.h DPUSERDIR/include
    5. Compile CDL, but first replace the file cdl.c by an updated version:
      cp Makefile.generic Makefile
      make
      cp libcdl.a DPUSERDIR/lib
      cp cdl.h DPUSERDIR/include
    6. Now compile DPUSER itself:
      cd DPUSERDIR/src
      cp config.[whatever your system is] config.h
      cd ..
      make

    Compiling these libraries should be straight-forward and is well documented. Note that for pgplot, you need a Fortran77 Compiler. Place all the libraries together with their include files in a directory named "external". If you already have some of these libraries on your system, you of course don't need to compile them again.

    Next step is to untar the dpusersrc.tgz file. This will create three more directories: dpuser, libfits, and utils. A top-level Makefile is generated and can be used to compile DPUSER. At the end, you should end up with a dpuser executable. After compiling, follow the instructions in the "Binary installation" section of this document to get going.

    Notes on specific platforms

    • Windows: The Client Display Library does not work with the Microsoft Compiler. If you need that functionality, you have to use the Cygwin environment. Also, the readline library is not compatible with Windows. Use the windpuser.exe programme which provides similar functionality.
    • All platforms: The cdl library lacks a feature to display images without zScale-ing. Grab an updated cdl.c.
    • Compiling PGPLOT using Visual Studio: Do the following:
      • Create a Directory "vcpgplot"; Copy the following files to this directory:
        • all files in the pgplot/src directory
        • the selected drivers from pgplot/drivers (nudriv.f, psdriv.f, widriv.c in my case)
        • all Fortran files in the pgplot/sys directory
        • the file pgplot/sys/grdate.c
        • the file pgplot/sys_dos/gruser.f
        • a suitable grexec.f file (Create yourself or copy from here)
        • the files pgplot/cpg/pgbind.c and pgplot/cpg/pgbind_prototypes
        • the files pgplot/fonts/grfont.txt and pgplot/fonts/pgpack.f
        • the file pgplot/rgb.txt
      • Get f2c for windows and copy the files f2c.exe, f2c.h, and vcf2c.lib to the directory
      • In Visual Studio, create a project "pgbind" (Console Application) and add the pgbind.c file. Compile and execute "pgbind bsd -h -w -suffix "_" -case lower pgbind_prototypes" (I add this as a post-build step)
      • Create another Console Application "pgpack", add pgpack.f with Custom Build Rule (running f2c), add pgpack.c, compile and execute "pgpack < grfont.txt" (I add this as a post-build step)
      • Create a new project "libpgplot" (Static Library) and add all Fortran files (except pgpack.f). Select all of them and edit the Custom Build Settings:
        • Commands: f2c $(InputPath)
        • Outputs: $(InputName).c
      • Compile the library. Then add all C-Files (except pgbind.c and pgpack.c) and all H-Files to the project. In the project Settings, the C preprocessor must define a symbol PG_PPU (This is in the C/C++ Tab, Category General). Compile the library again. Now you have created a "libpgplot.lib".
      • As a last step, you can compile the example programs. Note that the Fortran files again need the f2c Custom Build Setting.

    PGPLOT with WINDOWS

    PGPLOT comes without satisfactory display driver for WINDOWS. I have written a simple one which you can download here (widriv.c). To get PGPLOT going, do the following:

    1. Follow the standard instructions first:
      mkdir pgdist
      cp pgplot/drivers.list pgdist

      Edit pgdist/drivers.list and include the drivers you want (I use NUDRIV, PSDRIV, and PNDRIV
      cd pgdist
      ../pgplot/makemake ../pgplot linux g77_gcc
    2. Now you have to edit the file grexec.f:
      • Locate the line
              PARAMETER (NDEV=7)
        Replace this by:
              PARAMETER (NDEV=8)
      • In the line where it says something like
         GOTO(1,2,3,4,5,6,7) IDEV
        add one more number (in this example GOTO(1,2,3,4,5,6,7,8) IDEV)
      • Just before the end of the file, add the following lines:
        8     CALL WIDRIV(IFUNC,RBUF,NBUF,CHR,LCHR)
              RETURN
    3. You also have to edit makefile:
      Locate these lines:
      #
      # Loader command for PGPLOT library
      #
      and add -lgdi32 to both PGPLOT_LIB and CPGPLOT_LIB
      Locate the DRIVERS= line and add widriv.o
      Locate these lines:
      #-----------------------------------------------------------------------
      # Rules for compiling the .o files
      #-----------------------------------------------------------------------
      At the end of this section (which is pretty long), add these lines:
      widriv.o: widriv.c
        $(CCOMPL) -c $(CFLAGC) widriv.c
    4. Copy the file widriv.c to the pgdist directory.
    5. Do a
      make
      For me, this bails out when trying to build the shared library. You can safely ignore this error.
      make cpg
    6. Now copy the files libpgplot.a, libcpgplot.a to DPUSERDIR/lib and cpgplot.h to DPUSERDIR/include
    dpusersrc/dpuser/doc/makec.dpuser0000644000175100003160000000216310735765731015463 0ustar ottirtext = stringarray(0) text += "char *help_funcs[] = {" functions = import("functions.txt") //replace functions, "\\", "\\\\" //AA: commented, since it has no effect and produces a lot of output when executing ("trailing\") replace functions, "\"", "\\\"" replace functions, "", "" replace functions, "
    ", "" replace functions, "function_", "function " replace functions, "procedure_", "procedure " for i=1, nelements(functions) functions[i] = "\"" + functions[i] + "\"," text += functions text += "\"\"," text += "\"\"" text += "}" + ";" text += "" text += "char *help_pg[] = {" functions = import("procedures.txt") //replace functions, "\\", "\\\\" //AA: commented, since it has no effect and produces a lot of output when executing ("trailing\") replace functions, "\"", "\\\"" replace functions, "", "" replace functions, "
    ", "" replace functions, "function_", "function " replace functions, "procedure_", "procedure " for i=1, nelements(functions) functions[i] = "\"" + functions[i] + "\"," text += functions text += "\"\"," text += "\"\"" text += "};" text += "" export "help.h", text dpusersrc/dpuser/doc/makec.sh0000644000175100003160000000062512357043526014565 0ustar ottirecho "char *help_funcs[] = {" > hhh.h sed -n '/\/\*\!/,/\*\//p' ../dpuser2c/functions.cpp | awk {'if ($1!="/*!") if ($1=="*/") print "\"\","; else print "\""$0"\","'} >> hhh.h echo "\"\"\n};\n" >> hhh.h echo "char *help_pg[] = {" >> hhh.h sed -n '/\/\*\!/,/\*\//p' ../dpuser2c/procedures.cpp | awk {'if ($1!="/*!") if ($1=="*/") print "\"\","; else print "\""$0"\","'} >> hhh.h echo "\"\"\n};\n" >> hhh.h dpusersrc/dpuser/doc/makehelp.dpuser0000644000175100003160000000012310735765731016163 0ustar ottir@makehtml.dpuser cd "www" @makewww.dpuser @makesearch.dpuser cd ".." @makec.dpuser dpusersrc/dpuser/doc/makehtml.dpuser0000644000175100003160000002132310763535450016176 0ustar ottir@graphs.dpuser @makehtmlsum.dpuser text = import("functions.txt") replace text, "result = ", "result = " replace text, "Syntax", "

    Syntax
    " replace text, "Arguments", "

    Arguments
    " replace text, "Switches", "

    Switches
    " replace text, "Examples", "

    Examples
    " replace text, "See also", "

    See also
    " replace text, " > ", " > " replace text, " < ", " < " for i=1, nelements(text) { if (text[i] == "Returns") text[i] = "

    Returns
    " if (text[i] == "Notes") text[i] = "

    Notes
    " if (strlen(text[i]) > 6) { if (text[i][1:6] == "") text[i] = "
       " + text[i][7:strlen(text[i])] + "" } } function makehtmlfunctionheader, topic { header = stringarray(0) header += "" header += "" header += " " //header += " DPUSER - The Next Generation" header += " DPUSER - The Next Generation: Function " + topic + "" header += "" header += "" header += "" header += "" header += "" makehtmlfunctionheader = header } footer = stringarray(0) footer += "" footer += "" footer += "" while (nelements(text) > 0) { i = 1 while(text[i] != "" && i < nelements(text)) i++ function = text[1:i] print function[1] if (i < nelements(text)) { text = text[i+1:nelements(text)] } else { text = stringarray(0) } title = stringarray(0) // title += "" // title += "
    " + "function " + function[1] + "
    " title += "

    function " + function[1] + "

    " title += "

    " if (fileexists(function[1] + ".png")) title += "" table = 0 for i = 2, nelements(function) { if (function[i] == "

    Syntax
    ") if (table == 1) table = -1 if (function[i] == "

    Examples
    ") if (table == 1) table = -1 if (function[i] == "

    See also
    ") if (table == 1) table = -1 if (function[i] == "

    Returns
    ") if (table == 1) table = -1 if (function[i] == "

    Notes
    ") if (table == 1) table = -1 if (function[i] == "

    Arguments
    ") { if (table == 1) { table = 3 } else { table = 2 } } if (function[i] == "

    Switches
    ") { if (table == 1) { table = 3 } else { table = 2 } } if (strlen(function[i]) > 10) { if (function[i][1:9] == "function_") { function[i] = "function " + function[i][10:strlen(function[i])] + "
    } if (function[i][1:10] == "procedure_") { function[i] = "procedure " + function[i][11:strlen(function[i])] + "
    } if (function[i][1:9] == "category_") { function[i] = "category index: " + function[i][10:strlen(function[i])] + "
    } } if (table == 3) { title += "" table = 2 } if (function[i] == " ") function[i] = "

    " if (table == 2) { title += function[i] title += "" } if (table == -1) { title += "
    " table = 0 } if (table == 1) { pos = strpos(function[i], ":") if (pos == -1) pos = strpos(function[i], " ") if (pos > 0) { title += "" + function[i][1:pos] + "  \n" + function[i][pos + 1:strlen(function[i])] + "" } else { title += function[i] } table = 1 } else { if (table != 2) title += function[i] } if (table == 2) table = 1 } if (table == 1) title += "" // test if function name is obsolete ("function_name (obsolete)"). When true the " (obsolete)"-string will be removed for the file-name filename = function[1] if (strpos(filename, "obsolete") != -1) { filename_len = nelements(filename) filename = filename[1:filename_len-11] } export "function_" + filename + ".html", makehtmlfunctionheader(function[1]) + title + footer } text = import("procedures.txt") replace text, "Syntax", "

    Syntax
    " replace text, "Arguments", "

    Arguments
    " replace text, "Switches", "

    Switches
    " replace text, "Examples", "

    Examples
    " replace text, "Notes", "

    Notes
    " replace text, "See also", "

    See also
    " replace text, " > ", " > " replace text, " < ", " < " for i=1, nelements(text) { if (strlen(text[i]) > 6) { if (text[i][1:6] == "") text[i] = "
       " + text[i][7:strlen(text[i])] + "" } } function makehtmlprocedureheader, topic { header = stringarray(0) header += "" header += "" header += " " //header += " DPUSER - The Next Generation" header += " DPUSER - The Next Generation: Procedure " + topic + "" header += "" header += "" header += "" header += "" header += "" makehtmlprocedureheader = header } footer = stringarray(0) footer += "" footer += "" footer += "" while (nelements(text) > 0) { i = 1 while(strlen(text[i]) > 0 && i < nelements(text)) i++ function = text[1:i] print function[1] if (i < nelements(text)) { text = text[i+1:nelements(text)] } else { text = stringarray(0) } title = stringarray(0) // title += "" // title += "
    " + "procedure " + function[1] + "

    " title += "

    procedure " + function[1] + "

    " table = 0 title += "

    " for i = 2, nelements(function) { if (function[i] == "

    Syntax
    ") if (table == 1) table = -1 if (function[i] == "

    Examples
    ") if (table == 1) table = -1 if (function[i] == "

    Notes
    ") if (table == 1) table = -1 if (function[i] == "

    See also
    ") if (table == 1) table = -1 if (function[i] == "

    Arguments
    ") { if (table == 1) { table = 3 } else { table = 2 } } if (function[i] == "

    Switches
    ") { if (table == 1) { table = 3 } else { table = 2 } } if (strlen(function[i]) > 10) { if (function[i][1:9] == "function_") { function[i] = "function " + function[i][10:strlen(function[i])] + "" } if (function[i][1:10] == "procedure_") { function[i] = "procedure " + function[i][11:strlen(function[i])] + "" } } if (table == 3) { title += "" table = 2 } if (table == 2) { title += function[i] title += "" } if (table == -1) { title += "
    " table = 0 } if (function[i] == " ") function[i] = "

    " if (table == 1) { pos = strpos(function[i], ":") if (pos == -1) pos = strpos(function[i], " ") if (pos > 0) { title += "" + function[i][1:pos] + "  \n" + function[i][pos + 1:strlen(function[i])] + "" } else { title += function[i] } table = 1 } else { if (table != 2) title += function[i] } if (table == 2) table = 1 } if (table == 1) title += "" // test if procedure name is obsolete ("procedure_name (obsolete)"). When true the " (obsolete)"-string will be removed for the file-name filename = function[1] if (strpos(filename, "obsolete") != -1) { filename_len = nelements(filename) filename = filename[1:filename_len-11] } export "procedure_" + filename + ".html", makehtmlprocedureheader(function[1]) + title + footer } dpusersrc/dpuser/doc/makehtmlsum.dpuser0000644000175100003160000000721710735765731016737 0ustar ottirtext = import("functions.txt") html = stringarray(0) html += "" html += "" html += " " html += " DPUSER - The Next Generation: Alphabetical function index" html += "" html += "" html += "" html += "

    Alphabetical function index

    " summary = stringarray(0) while (nelements(text) > 0) { i = 1 while(text[i] != "" && i < nelements(text)) i++ function = text[1:i] summary += function[1] if (i < nelements(text)) { text = text[i+1:nelements(text)] } else { text = stringarray(0) } } summary = summary[sort(summary)] current = "3" html += "3D
    " html += "" count = 0 for i=1, nelements(summary) { if (summary[i][1] != current) { for j=count, 4 html += "" current = summary[i][1] html += "
     

    " html += "" + upper(current) + "
    " html += "" count = 0 } count++ if (count > 5) { html += "" count = 1 } if (count == 1) html += "" // test if function name is obsolete ("function_name (obsolete)"). When true the " (obsolete)"-string will be removed for the file-name filename = summary[i] if (strpos(filename, "obsolete") != -1) { filename_len = nelements(filename) filename = filename[1:filename_len-11] } html += "" if (i == nelements(summary)) { for j=count, 4 html += "" html += "
    " + filename + " 
    " } } html += "" html += "" export "functions.html", html text = import("procedures.txt") html = stringarray(0) html += "" html += "" html += " " html += " DPUSER - The Next Generation: Alphabetical procedure index" html += "" html += "" html += "" html += "

    Alphabetical procedure index

    " summary = stringarray(0) while (nelements(text) > 0) { i = 1 while(text[i] != "" && i < nelements(text)) i++ function = text[1:i] summary += function[1] if (i < nelements(text)) { text = text[i+1:nelements(text)] } else { text = stringarray(0) } } summary = summary[sort(summary)] current = "3" html += "3D
    " html += "" count = 0 for i=1, nelements(summary) { if (summary[i][1] != current) { for j=count, 4 html += "" current = summary[i][1] html += "
     

    " html += "" + upper(current) + "
    " html += "" count = 0 } count++ if (count > 5) { html += "" count = 1 } if (count == 1) html += "" // test if procedure name is obsolete ("procedure_name (obsolete)"). When true the " (obsolete)"-string will be removed for the file-name filename = summary[i] if (strpos(filename, "obsolete") != -1) { filename_len = nelements(filename) filename = filename[1:filename_len-11] } html += "" if (i == nelements(summary)) { for j=count, 4 html += "" html += "
    " + filename + " 
    " } } html += "" html += "" export "procedures.html", html dpusersrc/dpuser/doc/maketxt.sh0000644000175100003160000000041112357247703015156 0ustar ottirsed -n '/\/\*\!/,/\*\//p' ../dpuser2c/functions.cpp | awk {'if ($1!="/*!") if ($1=="*/") print ""; else print $0'} > functions.hhh sed -n '/\/\*\!/,/\*\//p' ../dpuser2c/procedures.cpp | awk {'if ($1!="/*!") if ($1=="*/") print ""; else print $0'} > procedures.hhh dpusersrc/dpuser/doc/operators.html0000644000175100003160000002272010735765731016064 0ustar ottir DPUSER - The Next Generation: Operators

    Operators

    In DPUSER, operators are used to combine expressions. There are several types of operators:

    Assignment

    To assign a value to a variable, the assignment operator is used. The general syntax of an assignment is:
    VARIABLE  = value
    VARIABLE += value
    ...
    or, if you wish to assign a value to a subset of a matrix:
    VARIABLE[range]  = value
    VARIABLE[range] += value
    ...
    Like in the C programming language, several assignment operators are possible.
     
    Operator Syntax Operands
    Assignment VARIABLE = value Number, matrix, string, string array
    Increment VARIABLE++ Number, matrix
    Decrement VARIABLE-- Number, matrix
    Multiplication VARIABLE *= value Number, matrix
    Division VARIABLE /= value Number, matrix
    Addition VARIABLE += value Number, matrix, string, string array
    Subtraction VARIABLE -= value Number, matrix

    If the "+=" operator is applied to a string array, the string at the right hand side of the statement will be appended to the string array.
    The assignment operator "=" can be used to write a matrix as a FITS file. The syntax for doing this is 'filename'=matrix, i.e. you assign a matrix to a filename, which is in single quotes. Note that writing FITS files is also possible using the writefits procedure.

    Examples

    var = 6 creates a new variable named var and assigns a value of 6
    'gauss.fits' = gauss(129, 129, 30) writes a 2-dimensional gaussian to a disk file named gauss.fits
    var[100:200, *]++ Increments elements 100 through 200 in the first dimension and all elements in the second dimension

    Parentesis

    Parentesis are used in two ways: To enclose arguments to a function, and to group expressions. Parentesis can be used to override operator precedence.

    Examples

    print sin(pi()) prints out the sine of pi
    var =  2 + 3  * 5  yields 17
    var = (2 + 3) * 5 yields 25

    Ranges

    With ranges, you can create matrices and string arrays, and you can access subscripts of arrays. To access a single elements of a matrix, supply the coordinates like [5,3]. To access a range, give the inclusive range, separated by a colon like [100:300, 50:60]. You can use the asterisk (*) to access all elements in an axes. Ranges in DPUSER are 1-based like in fortran. The arguments in a range can be the result of an expression.

    Examples

    mvar = [1, sin(pi()), 3+5] creates a 1-dimensional matrix with the values 1, 0, 8
    nvar = [-3600:3600] / 10 creates a 1D matrix with the values -360, -359.9, ..., 360
    svar = ["test", "string"] creates a string array with 2 elements
    print mvar[2] prints the second element of mvar, which is 0
    print svar[1] prints out "test"
    print svar[2][strlen(svar[2])] prints out the last character of the second element of svar, which is a "g"
    newvar = nvar[3601:3700] creates a new matrix variable with 100 elements and assigns the values 0, 0.1, ..., 9.9

    Mathematical operators

    The basic mathematical operators are used in DPUSER. Depending on the type of associated variables, different actions (described below) are taken. If a matrix is combined with another matrix or a number, the result will be a matrix in which the operation is performed on each element. The available operators in precedence order are:
     
    Operator Syntax Arguments Return Value
    Exponentation x ^ y Number, Matrix Number if both x and y are numbers
    Matrix if either x or y is a matrix
    Multiplication x * y Number, Matrix Number if both x and y are numbers
    Matrix if either x or y is a matrix
    Matrix multiplication x # y Matrix or vector Matrix
    Division x / y Number, Matrix Number if both x and y are numbers
    Matrix if either x or y is a matrix
    Modulus x % y Integer number Integer number
    Addition x + y Number, Matrix Number if both x and y are numbers
    Matrix if either x or y is a matrix
    Number, String String if either x or y is a string
    String, String array String array if either x or y is a string array
    Subtraction x - y Number, Matrix Number if both x and y are numbers
    Matrix if either x or y is a matrix

    Boolean operators

    Conditional statements can be given using the following operators. The list is in precedence order:
     
    Operator Syntax Arguments Return Value
    Not !x Boolean Boolean
    Not equals x != y Number, String Boolean
    Equals x == y Number, String Boolean
    Greater than x > y Number, String Boolean
    Greater or equal x >= y Number, String Boolean
    Less than x < y Number, String Boolean
    Less than or equal to x <= y Number, String Boolean
    And x && y Boolean Boolean
    Or x || y Boolean Boolean
    dpusersrc/dpuser/doc/plotting.html0000644000175100003160000000760610735765731015714 0ustar ottir DPUSER - The Next Generation: Plotting

    Plotting

    DPUSER incorporates the complete PGPLOT package. All modules of this package are realized as procedures (see list of available PGPLOT procedures). The PGPLOT documentation provided here is a verbatim copy of the online documentation of PGPLOT.
    DPUSER uses a global variable plotdevice to control graphics output. Available devices depend on your installation of PGPLOT. The default graphics device on UNIX workstations is "/xserve". This can be changed by assigning a new string value to the variable. A typical use of PGPLOT looks like this:

    plotdevice = "/tmp/test.eps/ps"      // Write ps output to /tmp/test.eps
    x = [-3600:3600]/10                  // create x-axes
    y = sin(x, /deg)                     // create sine function (y-axes)
    pgopen plotdevice                    // Start plotting
    pgenv -360, 360, -1, 1, 0, 0         // draw labeled frame
    pglab "angle", "sine", "test plot"   // annotate plot
    pgline 7201, x, y                    // draw the sine function
    pgend                                // end plotting
    plotdevice = "/xserve"               // reset graph output to X
    Since plotting a x-y graph is, amongs others, a very common task, DPUSER provides several convenience procedures to do things like this: plot, contour, surface, and shade. The above example using the plot command looks like this:
    plotdevice = "/tmp/test.eps/ps"      // Write ps output to /tmp/test.eps
    x = [-3600:3600]/10                  // create x-axes
    y = sin(x, /deg)                     // create sine function (y-axes)
    plot x, y, xtitle="angle", ytitle="sine", title="test plot"
                                         // do the plot
    plotdevice = "/xserve"               // reset graph output to X
    This can be done even shorter:
    plot sin([-3600:3600]/10)
    will plot a sine function without any annotation to the current plot device, overriding any previous plot. A very simple contour plot can also be done:
    contour gauss(129,129,30,50,30), [1:9]*10
    will do a contour plot of an elliptical gaussian with contour levels 10%, 20%, ..., 90%. dpusersrc/dpuser/doc/procedures.txt0000644000175100003160000011465512733175136016077 0ustar ottirwritefits Writes the array X to disk as a FITS file with specified filename, optionally as an extension. If X is a Fits List, a multiple extension FITS file is written. Syntax writefits FILENAME, X [, /ext] Arguments FILENAME: A string X: A matrix or a Fits List Switches /ext: If specified, the matrix is written as a FITS image extension. If the file FILENAME exists already, the extension is appended (in which case the original FITS file must not be compressed), else an empty primary HDU is written and the extension appended. contour Draw a contour map of X. levels give the contour levels in percent of the maximum value. Syntax contour fits X, fits levels [,title=string] [,xtitle=string] [,ytitle=string] display Displays a grayscale image of X. If min and max are set, the display of the image is clipped at these values. An optional keyword method can have 3 values: method = 0: linear scaling method = 1: log scaling method = 2: square root scaling Syntax display fits [, float min, float max] exec Execute cmd (which is given as a character string). Control is returned to DPUSER when cmd is finished. Syntax exec cmd Arguments cmd: A string containing the command to be executed. Examples Do a directory listing: exec "dir" sleep Sleep for the specified amount of seconds. Syntax sleep seconds Arguments seconds: An integer number. print prints the argument. Depending on the argument, the following happens: integer, real number, complex number, string, string array: the value is printed. matrix: some statistics on the array are printed. Syntax print argument mem Prints information on all local variables, user defined or compiled functions and procedures. Syntax mem shift Shifts (and optionally wraps) X by specified values. Syntax shift X, xs, ys [, zs] [, /wrap] Arguments X: The array to be shifted xs: Shift vector in the first dimension ys: Shift vector in the second dimension zs: Shift vector in the third dimension Switches wrap: Pixels shifted off the array will be wrapped to the opposide side. Notes If either shift vector is non-integer, a subpixel shift is applied and the array type changed to R4. Subpixel shift is only supported in 2 dimensions. See also function_shift center See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax center X See also function_center centroid Returns the centroid of X in the variables x, y, and z. y and z are optional. Syntax centroid X, VARIABLE x [, VARIABLE y [, VARIABLE z]] upper See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax upper X See also function_upper lower See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax lower X See also function_lower export Export what to fname. If what is a stringarray, each string in the array is printed as a separate line. If what is a fits, all values are printed as floating point numbers, separated by a single whitespace (" "). In this case, optionally a precision can be given (default: 2 decimal places). Syntax export string filename, stringarray|fits what [, int precision] replace replaces all occurrences of the string s by the string r. Syntax replace string|stringarray where, string s, string r rotate See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax rotate X, angle [, xcen, ycen] See also function_rotate fft See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax fft X See also function_fft reass See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax reass X See also function_reass norm See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax norm X [, /unity, /total, /average] See also function_norm clip See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax clip X, low, high [, value] See also function_clip smooth See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax smooth X, fwhm See also function_smooth boxcar See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax boxcar X, width [, /average, /minimum, /maximum, /median] See also function_boxcar flip See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax flip X, axis See also function_flip enlarge See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax enlarge X, scale, method = 0 See also function_enlarge resize See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax resize X, naxis1, naxis2, naxis3 See also function_resize wien See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax wien X, PSF [, height] See also function_wien lucy See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax lucy X, PSF, niter [, threshold] See also function_lucy 3dnorm See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax 3dnorm X See also function_3dnorm correl See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax correl X, Y See also function_correl rebin See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax rebin X, x1, x2 See also function_rebin ssaplot Plot ssa statistics. The first argument must be created with ssastat Optionally, a title can be given as second argument which will be printed above all plots. Syntax ssaplot fits x [, string title] See also function_ssastat freddy Draw an isometric plot of x. Syntax freddy fits x, int xsize, int ysize, float scale, float angle surface Draw an isosurface of x. This is seen under the angle. If skip is specified and > 1, only every nth line is drawn. Syntax surface fits x, float angle [, int skip] imexa Display X in ds9. Interactively, the following can be done pressing keys in the viewer: key action c contour plot s isosurface h horizontal cut v vertical cut r radial average i increase window size d decrease window size q quit and return to dpuser (Use ds9 v5.2 or newer!) Syntax imexa X See also procedure_sao sbfint Initialises the software buffer for crystal-plotting. It should be called just once per plot (buffer), after PGWINDOW but before any crystal-related routines. Syntax sbfint RGB,IC,IBMODE,IBUF,MAXBUF Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION RGB: R*4 I 3 The RGB values for the background. IC: I*4 I - The index for the background colour. IBMODE: I*4 I - Buffering mode for initialisation: 1 = Ordinary, default. 2 = Will want to save later. 3 = Initialise from saved buffers. IBUF: I*4 I - Software buffer to be used (>=1). MAXBUF: I*4 O - Maximum number of buffers available. sbfbkg Sets the shading for the background. This routine should be called after SBFINT, and COLINT or COLTAB, but before any objects are plotted. Syntax sbfbkg IC1,IC2,ISHADE Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. ISHADE: I*4 I - Order of shading (IC1-->IC2 - IC1): 1 - Bottom to top. 2 - Left to right. 3 - Bottom-left to top-right. 4 - Top-left to bottom-right. 5 - Bottom, middle and top. 6 - Left, middle and right. 7 - Rectangular zoom to centre. 8 - Elliptical zoom to centre. sbfsav Save a rendered picture-buffer, and its Z-buffer, for subsequent use in re-initialisation with SBFINT. Syntax sbfsav IBUF Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION IBUF: I*4 I - Software buffer to be saved (>=1). sbfcls Closes the software buffer for crystal-plotting, by outputting it to the screen or writing out a postscript file (as appropriate). Syntax sbfcls IBUF Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION IBUF: I*4 I - Software buffer to be output (>=1). colint Initialises a colour table for a geometrical object. In general, it is recommended that SHINE = 0.0 if DIFUSE > 0.0 and vice versa. Syntax colint RGB,IC1,IC2,DIFUSE,SHINE,POLISH Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION RGB: R*4 I 3 Red, green and blue intenisty for fully-lit non-shiny object (0-1). IC1,IC2: I*4 I - Lowest & highest colour-index to be used for shading. DIFUSE: R*4 I - Diffusiveness of object (0-1). SHINE: R*4 I - Whiteness of bright spot (0-1). POLISH: R*4 I - Controls size of bright spot. coltab Initialises a colour table for a "grey-scale" map. Syntax coltab RGB,NCOL,ALFA,IC1,IC2 Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION RGB: R*4 I 3 X NCOL Red, green and blue intenisty for the colour table. NCOL: I*4 I - No. of colours in the input table. ALFA: R*4 I - Contrast-factor (linear=1). IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the output. colsrf Initialises a colour table for a 3-D surface rendering of a 2-D array of "data". Syntax colsrf RGB,NCOL,ALFA,IC1,IC2,NCBAND,DIFUSE,SHINE,POLISH Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION RGB: R*4 I 3 X NCOL Red, green and blue intenisty for the colour table. NCOL: I*4 I - No. of colours in the input table. ALFA: R*4 I - Contrast-factor (linear=1). IC1,IC2: I*4 I - Lowest and highest colour-index to be used for the rendering. NCBAND: I*4 I - Number of colour-bands for the height, so that the number of shades per band = (IC2-IC1+1)/NCBAND. DIFUSE: R*4 I - Diffusiveness of object (0-1). SHINE: R*4 I - Whiteness of bright spot (0-1). POLISH: R*4 I - Controls size of bright spot. sbball This subroutine plots a shiny or matt coloured ball. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the ball-centre should be negative (< -radius); the viewing-screen is fixed at z=0. Syntax sbball EYE,CENTRE,RADIUS,IC1,IC2,LIGHT,LSHINE,X0,Y0,R0 Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. CENTRE: R*4 I 3 (x,y,z) coordinate of ball-centre. RADIUS: R*4 I - Radius of ball. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. LSHINE: L*1 I - Shiny ball if .TRUE., else diffuse. X0,Y0: R*4 O - Centre of projected ball. R0: R*4 O - Average radius of projected ball. sbtbal This subroutine plots a semi-transparent shiny or matt coloured ball. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the ball-centre should be negative (< -radius); the viewing-screen is fixed at z=0. Syntax sbtbal EYE,CENTRE,RADIUS,IC1,IC2,LIGHT,LSHINE,X0,Y0,R0,ITRANS Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. CENTRE: R*4 I 3 (x,y,z) coordinate of ball-centre. RADIUS: R*4 I - Radius of ball. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. LSHINE: L*1 I - Shiny ball if .TRUE., else diffuse. X0,Y0: R*4 O - Centre of projected ball. R0: R*4 O - Average radius of projected ball. ITRANS: I*4 I - Level of transparency: 1 = 25%; 2 = 50%; 3 = 75%. sbplan This subroutine plots a diffusively-lit coloured plane; the user must ensure that all the verticies lie in a flat plane, and that the bounding polygon be convex (so that the angle at any vertex <= 180 degs). All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the vertices should be negative; the viewing-screen is fixed at z=0. Syntax sbplan EYE,NV,VERT,IC1,IC2,LIGHT Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. NV: R*4 I - No. of verticies (>=3). VERT: R*4 I 3 x NV (x,y,z) coordinate of verticies. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. sbplnt This subroutine plots a diffusively-lit, semi-transparent, coloured plane; the use must ensure that all the verticies lie in a flat plane, and that the bounding polygon be convex (so that the angle at any vertex <= 180 degs). All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the vertices should be negative; the viewing-screen is fixed at z=0. Syntax sbplnt EYE,NV,VERT,IC1,IC2,LIGHT,ITRANS Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. NV: R*4 I - No. of verticies (>=3). VERT: R*4 I 3 x NV (x,y,z) coordinate of verticies. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. ITRANS: I*4 I - Level of transparency: 1 = 25%; 2 = 50%; 3 = 75%. sbrod This subroutine plots a diffusively-shaded coloured rod. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the rod-ends should be negative (< -radius); the viewing-screen is fixed at z=0. Syntax sbrod EYE,END1,END2,RADIUS,IC1,IC2,LIGHT,NSIDES,LEND Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. END1: R*4 I 3 (x,y,z) coordinate of rod-end 1. END2: R*4 I 3 (x,y,z) coordinate of rod-end 2. RADIUS: R*4 I - Radius of cylinderical rod. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. NSIDES: I*4 I - The order of the polygon to be used for the cross-section of the rod. LEND: L*1 I - If true, plot the end of the rod. sbcone This subroutine plots a diffusively-shaded coloured right-angular cone. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the base and appex of the cone should be negative (< -radius); the viewing-screen is fixed at z=0. Syntax sbcone EYE,BASE,APEX,RADIUS,IC1,IC2,LIGHT,NSIDES Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. BASE: R*4 I 3 (x,y,z) coordinate of the centre of the base of the cone. APEX: R*4 I 3 (x,y,z) coordinate of the apex. RADIUS: R*4 I - Radius of the base of the cone. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. NSIDES: I*4 I - The order of the polygon to be used for the cross-section of the cone. sbelip This subroutine plots a shiny or matt coloured elliptical ball. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the ball-centre should be negative (< -radius); the viewing-screen is fixed at z=0. Syntax sbelip EYE,CENTRE,PAXES,IC1,IC2,LIGHT,LSHINE,ICLINE,ANGLIN,X0,Y0,R0 Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. CENTRE: R*4 I 3 (x,y,z) coordinate of ball-centre. PAXES: R*4 I 3 x 3 Principal axes of the elliposid. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. LSHINE: L*1 I - Shiny ball if .TRUE., else diffuse. ICLINE: I*4 I - If >=0, colour index for lines on surface of ellipsoid. ANGLIN: R*4 I - Width of lines: +/- degs. X0,Y0: R*4 O - Centre of projected ball. R0: R*4 O - Average radius of projected ball. sbline This subroutine draws a straight line between two points. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive, while that of both the ends should be negative; the viewing-screen is fixed at z=0. Syntax sbline EYE,END1,END2,ICOL,LDASH Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. END1: R*4 I 3 (x,y,z) coordinate of end-1. END2: R*4 I 3 (x,y,z) coordinate of end-2. ICOL: I*4 I - Colour-index for line. LDASH: L*1 I - Dashed line if .TRUE. (else cont.). sbtext Write a text string in 3-d perspective. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the text string should be negative; the viewing-screen is fixed at z=0. Syntax sbtext EYE,TEXT,ICOL,PIVOT,FJUST,ORIENT,SIZE Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. TEXT: C*1 I * The text string to be written. ICOL: I*4 I - Colour index for text. PIVOT: R*4 I 3 (x,y,z) coordinate of pivot point. FJUST: R*4 I - Position of pivot along the text: 0.0=left, 0.5=centre, 1.0=right. ORIENT: R*4 I 3 x 2 (x,y,z) for X-length and Y-height directions of the text. SIZE: R*4 I - Height of the reference symbol "A". sbsurf This subroutine plots an iso-surface through a unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0. Syntax sbsurf EYE,LATICE,DENS,N1,N2,N3,DSURF,IC1,IC2,LIGHT,LSHINE Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. LATICE: R*4 I 3 x 4 (x,y,z) coordinates of the origin and the a, b & C lattice-vertices. DENS: R*4 I (N1+1) The density at regular points within x (N2+1) the unit cell, wrapped around so x (N3+1) that DENS(0,J,K)=DENS(N1,J,K) etc.. N1,N2,N3: I*4 I - The dimensions of the unit-cell grid. DSURF: R*4 I - Density for the iso-surface. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. LSHINE: L*1 I - Shiny surface if TRUE, else diffuse. sbtsur This subroutine plots a semi-transparent iso-surface through a unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0. Syntax sbtsur EYE,LATICE,DENS,N1,N2,N3,DSURF,IC1,IC2,LIGHT,LSHINE,ITRANS Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. LATICE: R*4 I 3 x 4 (x,y,z) coordinates of the origin and the a, b & C lattice-vertices. DENS: R*4 I (N1+1) The density at regular points within x (N2+1) the unit cell, wrapped around so x (N3+1) that DENS(0,J,K)=DENS(N1,J,K) etc.. N1,N2,N3: I*4 I - The dimensions of the unit-cell grid. DSURF: R*4 I - Density for the iso-surface. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. LSHINE: L*1 I - Shiny surface if TRUE, else diffuse. ITRANS: I*4 I - Level of transparency: 1 = 25%; 2 = 50%; 3 = 75%. sbslic This subroutine plots a "grey-scale" slice through a unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0. Syntax sbslic EYE,LATICE,DENS,N1,N2,N3,DLOW,DHIGH,IC1,IC2,SLNORM,APOINT,ICEDGE Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. LATICE: R*4 I 3 x 4 (x,y,z) coordinates of the origin and the a, b & C lattice-vertices. DENS: R*4 I (N1+1) The density at regular points within x (N2+1) the unit cell, wrapped around so x (N3+1) that DENS(0,J,K)=DENS(N1,J,K) etc.. N1,N2,N3: I*4 I - The dimensions of the unit-cell grid. DLOW: R*4 I - Density for the lowest colour-index. DHIGH: R*4 I - Density for the highest colour-index. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. SLNORM: R*4 I 3 (x,y,z) direction of the normal to the slice to be "grey-scaled". APONIT: R*4 I 3 (x,y,z) coordinate of a point within the slice to be "grey-scaled". ICEDGE: I*4 I - If >=0, it's the colour-index for the boundary of the "grey-scaled" slice. sbcpln This subroutine plots a diffusively-lit, semi-transparent, coloured plane through a unit cell. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0. Syntax sbcpln EYE,LATICE,IC1,IC2,LIGHT,SLNORM,APOINT,ICEDGE,ITRANS Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. LATICE: R*4 I 3 x 4 (x,y,z) coordinates of the origin and the a, b & C lattice-vertices. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. SLNORM: R*4 I 3 (x,y,z) direction of normal to plane. APONIT: R*4 I 3 (x,y,z) coordinate of a point within the plane. ICEDGE: I*4 I - If >=0, it's the colour-index for the boundary of the plane. ITRANS: I*4 I - Level of transparency: 0 = 0%; 1 = 25%; 2 = 50%; 3 = 75%. sb2srf This subroutine plots a 3-d surface given a 2-d unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0. Syntax sb2srf EYE,LATICE,DENS,N1,N2,DLOW,DHIGH,DVERT,IC1,IC2,NCBAND,LIGHT,LSHINE Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. LATICE: R*4 I 3 x 3 (x,y,z) coordinates of the origin and the a and b lattice-vertices. DENS: R*4 I (N1+1) The density at regular points within x (N2+1) the unit cell, wrapped around so that DENS(0,J)=DENS(N1,J) etc.. N1,N2: I*4 I - The dimensions of the unit-cell grid. DLOW: R*4 I - Lowest density to be plotted. DHIGH: R*4 I - Highest density to be plotted. DVERT: R*4 I - "Vertical" world-coordinate length corresponding to density-range. IC1,IC2: I*4 I - Lowest and highest colour-index to be used for the rendering. NCBAND: I*4 I - Number of colour-bands for the height, so that the number of shades per band = (IC2-IC1+1)/NCBAND. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. LSHINE: L*1 I - Shiny surface if TRUE, else diffuse. radialplot plots a radial average of x centered at [xcenter, ycenter] with a radius of r Syntax radialplot fits x, int xcenter, int ycenter, int r [,title=string] [,xtitle=string] [,ytitle=string] setfitskey add or change a FITS key in the header. value can be any of string, integer or double. Syntax setfitskey fits x, string key, value, string comment See also function_getfitskey setbitpix Change pixel type of X. Syntax setbitpix fits x, int bitpix, double bscale = 1.0, double bzero = 0.0 See also function_setbitpix cd change the current working directory. Syntax cd string setwcs set WCS information in the FITS header. Syntax setwcs fits, crpix1, crpix2, crval1, crval2, cdelt1 [, cdelt2] shrink See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax shrink X, factor [, axis] See also function_shrink view Uses qtfitsview to display specified fits. Syntax view X limits Returns the limits for which the array is non-zero in the given variables. At least xlow and xhigh must be given. Syntax limits fits, xlow, xhigh [, ylow, yhigh, zlow, zhigh] printf Print the value (either a real number or an integer) using specified format string. The formatting is done like in the C printf function. The total length of the formatted string is limited to 256 characters. Syntax printf format, value writebmp Write a bitmap (.bmp) file. If only red is given, this will be a grayscale image, else both green and blue must be given (which must be of the same size as red) and a color image will be written. The values in the fits are supposed to be scaled between 0 and 255. Syntax writebmp filename, red [, green, blue] Arguments filename: A string giving the file name of the bitmap red: 2-dimensional array green: A 2-dimensional array of the same size as red blue: A 2-dimensional array of the same size as red Examples Write out a grayscale bitmap of a circular gaussian: writebmp "gauss.bmp", gauss(129,129,30)*255 swapbytes Swap the bytes of given fits, which must be a variable. Syntax swapbytes fits read Print prompt and read in up to 9 variables. The variables can be of integer, floating point or string type and must exist before the call. Syntax read prompt, v1 [, v2, v3, v4, v5, v6, v7, v8, v9] shade Plot an image in a variety of ways - as provided by PGXTAL. This procedure asks for plot options interactively. Possible plots are contour, shaded surface, and colour plots with various colourtables. Syntax shade fits saomarkpoint Draws a marker in ds9 at specified x,y coordinates with size s. (Use ds9 v5.2 or newer!) Syntax saomarkpoint x, y, size, type Arguments x: X-axes coordinate of the center of the circle y: Y-axes coordinate of the center of the circle size: The size of the marker to be drawn type: Marker type, give one of the following (can be OR'ed) POINT: 2 BOX: 4 DIAMOND: 32 CIRCLE: 64 See also procedure_sao procedure_saomarklabel procedure_saoclear saoclear Clear ds9 of all markers drawn. (Use ds9 v5.2 or newer!) Syntax saoclear See also procedure_sao procedure_saomarkpoint procedure_saomarklabel saomarklabel Draws a text label in ds9 at specified x,y coordinates. (Use ds9 v5.2 or newer!) Syntax saomarklabel x, y, label Arguments x: X-axes coordinate of the center of the circle y: Y-axes coordinate of the center of the circle label: A string to be printed next to the marker See also procedure_sao procedure_saomarkpoint procedure_saoclear cblank Replace all undefined values (like NaN or Inf) by another value. If no value is specified, 0.0 will be replaced. Syntax cblank ARRAY [, value] Arguments ARRAY: A variable holding an array value: Optional, the value to be assigned (defaults to 0) See also function_cblank cubemerge Merges several fits datacubes. All files must have the same array size (in the first two dimensions) and bitpix. The file name of the result must not be the same as any of the input names. The FITS header is copied from the first file and the NAXIS3 keyword is updated. Syntax cubemerge result, cubes Arguments result: The filename where the datacube is written to cubes: A string array with the file names to be merged setenv Set or change an environment variable. Syntax setenv VARIABLE, VALUE Arguments VARIABLE: A string with the name of the new environment variable VALUE: A string with the value of the new environment variable See also function_getenv break Stop any currently running script or loop. Syntax break Arguments none run Execute a script. This is equivalent to entering @script. Syntax run S Arguments S: A string with the file name of the script to be executed. echo Turn on or off echo mode. Echo mode determines if external scripts are echoed to the console. Syntax echo mode Arguments mode: An integer number. 0 means echo off, any other number echo on. precess Precess coordinates from one epoch to another. Syntax precess RAh, RAm, RAs, DECd, DECm, DECs, fromepoch, toepoch Arguments RAh, RAm, RAs: Right Ascension of the object DECd, DECm, DECs: Declination of the object fromepoch: Epoch in which the coordinates are given toepoch: Epoch to which the coordinates should be precessed pwd Print current working directory Syntax pwd Arguments None dir Print directory listing. Syntax dir [filter] Arguments filter: Print directory listing of files matching given pattern setindexbase Set the base for array indexing Syntax setindexbase base Arguments base: The index base, 0 for C-notation, 1 for Fortran-notation (the default) See also procedure_cnotation procedure_fortrannotation function_indexbase fortrannotation Set the base for array indexing to 1 (the default for dpuser) Syntax fortrannotation Arguments none See also procedure_setindexbase procedure_cnotation function_indexbase cnotation Set the base for array indexing to 0 Syntax cnotation Arguments none See also procedure_setindexbase procedure_fortrannotation function_indexbase userDialog Create a dialog box for QFitsView Syntax userDialog function, labels [, types [, values] ] Arguments title: A string with the dpuser function to be executed. This will be shown also as the caption of the dialog box. labels: A string array with the description of the parameters to be entered types: Optional types of the arguments (as a string array): Can be either int, real, fits, or anything, in which case it will be treated as a string. values: Optionally, default values for the entries can be given (as a string array). Examples Create a dialog box for the velmap function: userDialog "myvelmap", ["cube", "wavelength center", "fwhm"], ["fits", "real", "real"], ["", "2.13", ".001"] compile Converts a dpuser-script into C-code, compiles it and links it at runtime into the running dpuser-session. Unlike with user defined functions or procedures, it is not allowed to compile a function with the same name as aalready compiled procedure and vice versa. Syntax compile "filename" Arguments filename: The filename of the dpuser-script to convert Switches /c: Adds needed headers and forward declarations to existing C-code and links it on runtime. The general data type to use must be 'dpuserType'. Functions and procedures must begin like shown in the examples below. /reset: Unloads all compiled functions and procedures. See example below. Examples To compile c-code, functions must be defined as follows: extern "C" dpuserType funcName(dpuserType &a, ...) { ... } ...; return funcName; }
    Procedures must be defined as follows: extern "C" void procName(dpuserType &a, ...) { ...; return; }
    To unload all functions and procedures: compile "", /reset spec3d Draw an averaged spectrum of the cube multiplied by the mask. Syntax spec3d cube, mask [,title=string] [,xtitle=string] [,ytitle=string] Arguments cube: A 3-dimensional matrix mask: A 2-dimensional matrix plot Plots the 1-dimensional vector y. If x is given, x versus y is plot, else the running number versus y is plot. ymin and ymax can be specified to set the plot range in the y axes. If symbol is given and >= -31, each point will be represented by a symbol, else the lines will be connected by a polyline. See "help pgpt" for a description of available symbols. Syntax plot [x, ] y [,title=string] [,xtitle=string] [,ytitle=string] [,symbol=integer] [, ymin] [, ymax] [, /xlog] [, /ylog] [, /noclose] See also pgplot_pgpt free Release all memory taken by local variables. Syntax free sao Uses ds9 to display X. ds9 v5.2 or newer needs to be running. Syntax sao X [, min, max] [, /log, /zscale] Arguments X: A 2-dimensional matrix min, max: Minimum and maximum array value for display scaling Switches /log: display the image in logarithmic scaling. /zscale: Use a display representation similar to IRAF's zscale. cirrange Reduce a number to the range [0,360[ or [0,pi[. Syntax cirrange VAR [, /deg, /rad] Arguments VAR: A named variable whose value should be reduced. This can be a real number or a vector/matrix. Switches /deg: Reduce to [0,360[ (default) /rad: Reduce to [0,pi[ swapaxes Swap axes of a 3D array Syntax swapaxes VAR, newx, newy, newz Arguments VAR: A named variable which contains a 3D FITS newx: Integer numer (1..3) which tells which axis shall become the X axis newy: Integer numer (1..3) which tells which axis shall become the Y axis newz: Integer numer (1..3) which tells which axis shall become the Z axis Notes The following FITS header keys are updated, if they exist:
    CRVAL, CRPIX, CDELT, CD matrix, CTYPE, CUNIT Examples OSIRIS 3D data come in the format [lambda,x,y]. To convert this to [x,y,lambda]: swapaxes buffer, 2, 3, 1 debug Turn on or off debug information. Syntax debug mode Arguments mode: An integer number. 0 means debugging information off, any other number display debugging information. copyheader Copy the FITS header from one matrix to another Syntax copyheader VAR, source Arguments VAR: A named variable of type fits which should receive the FITS header source: The matrix with the FITS header to be copied setfitstype Set the (FITS extension) type info of given fits to either image or bintable Syntax setfitstype VAR [, extension], [ /image, /bintable] Arguments VAR: A named variable which contains a FITS, a FITS list, or a string array extension: Optional in case of a FITS list, which element to set Switches /image: set the FITS type to image /bintable: set the FITS type to bintable dpusersrc/dpuser/doc/syntax.html0000644000175100003160000001151210735765731015371 0ustar ottir DPUSER - The Next Generation: Syntax

    Command Syntax

    The syntax of DPUSER is similar to the C programming language. DPUSER supports a set of types (integers, real numbers, complex numbers, matrices, strings, and string arrays). You can use operators (^, *, /, +, -) to modify values. Functions and Procedures are available, as well as procedural commands like loops and conditional statements. For powerful plotting capabilities, the complete PGPLOT library (including 3D extensions) is available in DPUSER.
    Have a look at some examples to see how DPUSER is used.

    Scripts

    If you wish to save your work, two methods are used. Firstly, DPUSER writes a file history.dpuser when exiting in the current working directory. This file is read in when DPUSER is started again in this directory. Secondly, DPUSER is able to execute scripts. Those use exactly the same syntax as the interactive prompt. You just have to create a plain text input file. Execution of this file is then accomplished using the following syntax:

    @script.dpuser
    Which is equivalent to:
    run "script.dpuser"
    Wp> will execute every command in the text file "script.dpuser". Control is returned to the user when the script is finished.

    User defined procedures

    It is possible to write user defined procedures and store them in local memory. Arguments given to the procedure can be changed. Note, however, that all locally defined variables inside the procedure are local and are not preserved when exiting from the procedure. Also, variables defined outside the procedure are not accessible from within the procedure.
    The syntax for defining a procedure is as follows:

    procedure NAME, ARG1, ARG2, ... {
      BODY
    }

    The number of arguments can be anything from 0 to Infinity. To give an example:

    procedure test, a, b, c {
      print a
      print b
      c = a + b
    }

    It this procedure is called like this: a=0;test 1,2,a, the values 1 and 2 will be printed to the screen, and a will have a value of 3. Note that the variables a, b, c inside the procedure are not visible to the outside program.

    User defined functions

    Functions are similar to procedures (what concerns local variables and passing their values), but they in addition return a value. The syntax for a user written function is:

    function NAME, ARG1, ARG2, ... {
      BODY
      NAME = value
    }


    The return value of the function thus is assigned by creating a variable with the function's name inside the function and assign the return value to it (This is similar to Fortran77). To give an example:

    function sqr, a {
      sqr = a * a
    }


    This function then can be used as any other function, nesting also is allowed:

    print sqr(sqr(3)+2)/sqr(4) prints out 7.5625.

    External commands

    DPUSER provides two methods of executing external commands. The procedure exec allows to execute a command giving a string, which is useful if you like to build the command non-ineractively (eg. in a script). Alternatively, any command can be executed using the following syntax:

    !ls -l /tmp (UNIX)
    !dir \tmp (WINDOWS)
    for example will print out a long listing of the /tmp directory.

    Interaction with other programs

    If you start up a program like saoimage or ds9, you are able to use the DPUSER commands sao and others, which use the common display library to display and evaluate images (similar to IRAF).

    Comments

    If you wish to add comments to your scripts (or at the interactive prompt), you can use exactly the same syntax as the C++ programming language. All characters after a // until the end of a line will be regarded as a comment, as is everything embraced by /* ... */:

    print "a comment"   // prints out the string "a comment"
    print "a longer comment"
    /* nothing
       ....
       will be done here
    */
    print "but here again"
    dpusersrc/dpuser/doc/variables.html0000644000175100003160000000423610735765731016020 0ustar ottir DPUSER - The Next Generation: Data types and variables

    Data types and variables

    DPUSER knows about 6 different data types:
    • integer numbers
    • real numbers
    • complex numbers
    • up to 3-dimensional matrices
    • strings
    • string arrays
    Those types are cast dynamically. So if you do a print acos(2), the result will not be integer (which would not make sense), but a complex number. Complex numbers can be constructed by appending an i (without spaces) to a number:
    variable = 1 + 2i
    Strings are defined by embracing in double quotes:
    variable = "This is a string".
    Variable names can include any letter in the range [a-zA-Z] and numbers [0-9] but must not begin with a number. Variables are created on the fly by assigning a value to them. If you supply a value to an already existing variable, it is overwritten:
    n = 1                     // n is an integer number
    n++                       // n is still integer with value 2
    n = sqrt(n)               // n now is a real number
    n = -(n^2)                // n is still a real number with value -2.0
    n = n^(1/2)               // n now is a complex number
    n = "a string"            // n is a string with value "a string"
    n = fits(100, 100)        // n is now a matrix with 100x100 elements
    dpusersrc/dpuser/doc/procedures.txt.old.old0000644000175100003160000011275110735765731017432 0ustar ottirwritefits Writes the array X to disk as a FITS file with specified filename. If the optional argument bitpix is given, the following can be used: bitpix = 32: signed long integer (32 bits per pixel) bitpix = 16: unsigned short integer (16 bits per pixel) bitpix = 8: unsigned char integer ( 8 bits per pixel) bitpix = -32: single precision floating point (32 bits per pixel) bitpix = -64: double precicion floating point (64 pits per pixel) bitpix defaults to -32. Syntax writefits FILENAME, X [, bitpix] Arguments FILENAME: A string X: A matrix. bitpix: An integer number. contour Draw a contour map of X. levels give the contour levels in percent of the maximum value. Syntax contour fits X, fits levels [,title=string] [,xtitle=string] [,ytitle=string] display Displays a grayscale image of X. If min and max are set, the display of the image is clipped at these values. An optional keyword method can have 3 values: method = 0: linear scaling method = 1: log scaling method = 2: square root scaling Syntax display fits [, float min, float max] exec Execute cmd (which is given as a character string). Control is returned to DPUSER when cmd is finished. Syntax exec cmd Arguments cmd: A string containing the command to be executed. Examples Do a directory listing: exec "dir" sleep Sleep for the specified amount of seconds. Syntax sleep seconds Arguments seconds: An integer number. spec3d Draw an averaged spectrum of the cube multiplied by the mask. Syntax spec3d cube, mask [,title=string] [,xtitle=string] [,ytitle=string] Arguments cube: A 3-dimensional matrix mask: A 2-dimensional matrix print prints the argument. Depending on the argument, the following happens: integer, real number, complex number, string, string array: the value is printed. matrix: some statistics on the array are printed. Syntax print argument mem Prints information on all local variables. Syntax mem plot Plots the 1-dimensional vector y. If x is given, x versus y is plot, else the running number versus y is plot. ymin and ymax can be specified to set the plot range in the y axes. If symbol is given and >= -31, each point will be represented by a symbol, else the lines will be connected by a polyline. See "help pgpt" for a description of available symbols. Syntax plot [x, ] y [,title=string] [,xtitle=string] [,ytitle=string] [,symbol=integer] [, ymin] [, ymax] [, /xlog] [, /ylog] [, /noclose] See also pgplot_pgpt free Release all memory taken by local variables. Syntax free sao Uses IRAF imtool to display X. An image display server needs to be running. Programs supported at the time are: saoimage, ximtool, saotng, ds9 (which is, in addition to UNIX, also available on the Microsoft Windows platform). Syntax sao X [, min, max] [, /log, /zscale] Arguments X: A 2-dimensional matrix min, max: Minimum and maximum array value for display scaling Switches /log: display the image in logarithmic scaling. /zscale: Use a display representation similar to IRAF's zscale. shift Shifts (and optionally wraps) X by specified values. Syntax shift X, xs, ys [, zs] [, /wrap] Arguments X: The array to be shifted xs: Shift vector in the first dimension ys: Shift vector in the second dimension zs: Shift vector in the third dimension Switches wrap: Pixels shifted off the array will be wrapped to the opposide side. Notes If either shift vector is non-integer, a subpixel shift is applied and the array type changed to R4. Subpixel shift is only supported in 2 dimensions. See also function_shift center See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax center X See also function_center centroid Returns the centroid of X in the variables x, y, and z. y and z are optional. Syntax centroid X, VARIABLE x [, VARIABLE y [, VARIABLE z]] upper See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax upper X See also function_upper lower See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax lower X See also function_lower rotate See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax rotate X, angle [, xcen, ycen] See also function_rotate fft See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax fft X See also function_fft reass See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax reass X See also function_reass norm See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax norm X [, /unity, /total, /average] See also function_norm clip See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax clip X, low, high [, value] See also function_clip smooth See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax smooth X, fwhm See also function_smooth boxcar See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax boxcar X, width [, /average, /minimum, /maximum, /median] See also function_boxcar 3dmerge See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax 3dmerge X, Y, tweak See also function_3dmerge 3dmegacal See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax 3dmegacal X, run, band See also function_3dmegacal 3dcal See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax 3dcal X, calset See also function_3dcal 3dcubin See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax 3dcubin X, year, band, scale See also function_3dcubin 3dexpand See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax 3dexpand X See also function_3dexpand flip See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax flip X, axis See also function_flip enlarge See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax enlarge X, scale, method = 0 See also function_enlarge resize See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax resize X, naxis1, naxis2, naxis3 See also function_resize wien See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax wien X, PSF [, height] See also function_wien lucy See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax lucy X, PSF, niter [, threshold] See also function_lucy 3dnorm See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax 3dnorm X See also function_3dnorm correl See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax correl X, Y See also function_correl rebin See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax rebin X, x1, x2 See also function_rebin ssaplot Plot ssa statistics. The first argument must be created with ssastat Optionally, a title can be given as second argument which will be printed above all plots. Syntax ssaplot fits x [, string title] See also function_ssastat freddy Draw an isometric plot of x. Syntax freddy fits x, int xsize, int ysize, float scale, float angle surface Draw an isosurface of x. This is seen under the angle. If skip is specified and > 1, only every nth line is drawn. Syntax surface fits x, float angle [, int skip] imexa Display X on an associated FITS viewer (like saoimage). Interactively, the following can be done pressing keys in the viewer: key action c contour plot s isosurface h horizontal cut v vertical cut r radial average i increase window size d decrease window size q quit and return to dpuser Syntax imexa X See also procedure_sao sbfint Initialises the software buffer for crystal-plotting. It should be called just once per plot (buffer), after PGWINDOW but before any crystal-related routines. Syntax sbfint RGB,IC,IBMODE,IBUF,MAXBUF Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION RGB: R*4 I 3 The RGB values for the background. IC: I*4 I - The index for the background colour. IBMODE: I*4 I - Buffering mode for initialisation: 1 = Ordinary, default. 2 = Will want to save later. 3 = Initialise from saved buffers. IBUF: I*4 I - Software buffer to be used (>=1). MAXBUF: I*4 O - Maximum number of buffers available. sbfbkg Sets the shading for the background. This routine should be called after SBFINT, and COLINT or COLTAB, but before any objects are plotted. Syntax sbfbkg IC1,IC2,ISHADE Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. ISHADE: I*4 I - Order of shading (IC1-->IC2 - IC1): 1 - Bottom to top. 2 - Left to right. 3 - Bottom-left to top-right. 4 - Top-left to bottom-right. 5 - Bottom, middle and top. 6 - Left, middle and right. 7 - Rectangular zoom to centre. 8 - Elliptical zoom to centre. sbfsav Save a rendered picture-buffer, and its Z-buffer, for subsequent use in re-initialisation with SBFINT. Syntax sbfsav IBUF Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION IBUF: I*4 I - Software buffer to be saved (>=1). sbfcls Closes the software buffer for crystal-plotting, by outputing it to the screen or writing out a postscript file (as appropriate). Syntax sbfcls IBUF Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION IBUF: I*4 I - Software buffer to be output (>=1). colint Initialises a colour table for a geometrical object. In general, it is recommended that SHINE = 0.0 if DIFUSE > 0.0 and vice versa. Syntax colint RGB,IC1,IC2,DIFUSE,SHINE,POLISH Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION RGB: R*4 I 3 Red, green and blue intenisty for fully-lit non-shiny object (0-1). IC1,IC2: I*4 I - Lowest & highest colour-index to be used for shading. DIFUSE: R*4 I - Diffusiveness of object (0-1). SHINE: R*4 I - Whiteness of bright spot (0-1). POLISH: R*4 I - Controls size of bright spot. coltab Initialises a colour table for a "grey-scale" map. Syntax coltab RGB,NCOL,ALFA,IC1,IC2 Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION RGB: R*4 I 3 X NCOL Red, green and blue intenisty for the colour table. NCOL: I*4 I - No. of colours in the input table. ALFA: R*4 I - Contrast-factor (linear=1). IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the output. colsrf Initialises a colour table for a 3-D surface rendering of a 2-D array of "data". Syntax colsrf RGB,NCOL,ALFA,IC1,IC2,NCBAND,DIFUSE,SHINE,POLISH Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION RGB: R*4 I 3 X NCOL Red, green and blue intenisty for the colour table. NCOL: I*4 I - No. of colours in the input table. ALFA: R*4 I - Contrast-factor (linear=1). IC1,IC2: I*4 I - Lowest and highest colour-index to be used for the rendering. NCBAND: I*4 I - Number of colour-bands for the height, so that the number of shades per band = (IC2-IC1+1)/NCBAND. DIFUSE: R*4 I - Diffusiveness of object (0-1). SHINE: R*4 I - Whiteness of bright spot (0-1). POLISH: R*4 I - Controls size of bright spot. sbball This subroutine plots a shiny or matt coloured ball. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the ball-centre should be negative (< -radius); the viewing-screen is fixed at z=0. Syntax sbball EYE,CENTRE,RADIUS,IC1,IC2,LIGHT,LSHINE,X0,Y0,R0 Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. CENTRE: R*4 I 3 (x,y,z) coordinate of ball-centre. RADIUS: R*4 I - Radius of ball. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. LSHINE: L*1 I - Shiny ball if .TRUE., else diffuse. X0,Y0: R*4 O - Centre of projected ball. R0: R*4 O - Average radius of projected ball. sbtbal This subroutine plots a semi-transparent shiny or matt coloured ball. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the ball-centre should be negative (< -radius); the viewing-screen is fixed at z=0. Syntax sbtbal EYE,CENTRE,RADIUS,IC1,IC2,LIGHT,LSHINE,X0,Y0,R0,ITRANS Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. CENTRE: R*4 I 3 (x,y,z) coordinate of ball-centre. RADIUS: R*4 I - Radius of ball. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. LSHINE: L*1 I - Shiny ball if .TRUE., else diffuse. X0,Y0: R*4 O - Centre of projected ball. R0: R*4 O - Average radius of projected ball. ITRANS: I*4 I - Level of transparency: 1 = 25%; 2 = 50%; 3 = 75%. sbplan This subroutine plots a diffusively-lit coloured plane; the user must ensure that all the verticies lie in a flat plane, and that the bounding polygon be convex (so that the angle at any vertex <= 180 degs). All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the vertices should be negative; the viewing-screen is fixed at z=0. Syntax sbplan EYE,NV,VERT,IC1,IC2,LIGHT Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. NV: R*4 I - No. of verticies (>=3). VERT: R*4 I 3 x NV (x,y,z) coordinate of verticies. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. sbplnt This subroutine plots a diffusively-lit, semi-transparent, coloured plane; the use must ensure that all the verticies lie in a flat plane, and that the bounding polygon be convex (so that the angle at any vertex <= 180 degs). All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the vertices should be negative; the viewing-screen is fixed at z=0. Syntax sbplnt EYE,NV,VERT,IC1,IC2,LIGHT,ITRANS Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. NV: R*4 I - No. of verticies (>=3). VERT: R*4 I 3 x NV (x,y,z) coordinate of verticies. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. ITRANS: I*4 I - Level of transparency: 1 = 25%; 2 = 50%; 3 = 75%. sbrod This subroutine plots a diffusively-shaded coloured rod. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the rod-ends should be negative (< -radius); the viewing-screen is fixed at z=0. Syntax sbrod EYE,END1,END2,RADIUS,IC1,IC2,LIGHT,NSIDES,LEND Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. END1: R*4 I 3 (x,y,z) coordinate of rod-end 1. END2: R*4 I 3 (x,y,z) coordinate of rod-end 2. RADIUS: R*4 I - Radius of cylinderical rod. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. NSIDES: I*4 I - The order of the polygon to be used for the cross-section of the rod. LEND: L*1 I - If true, plot the end of the rod. sbcone This subroutine plots a diffusively-shaded coloured right-angular cone. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the base and appex of the cone should be negative (< -radius); the viewing-screen is fixed at z=0. Syntax sbcone EYE,BASE,APEX,RADIUS,IC1,IC2,LIGHT,NSIDES Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. BASE: R*4 I 3 (x,y,z) coordinate of the centre of the base of the cone. APEX: R*4 I 3 (x,y,z) coordinate of the apex. RADIUS: R*4 I - Radius of the base of the cone. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. NSIDES: I*4 I - The order of the polygon to be used for the cross-section of the cone. sbelip This subroutine plots a shiny or matt coloured elliptical ball. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the ball-centre should be negative (< -radius); the viewing-screen is fixed at z=0. Syntax sbelip EYE,CENTRE,PAXES,IC1,IC2,LIGHT,LSHINE,ICLINE,ANGLIN,X0,Y0,R0 Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. CENTRE: R*4 I 3 (x,y,z) coordinate of ball-centre. PAXES: R*4 I 3 x 3 Principal axes of the elliposid. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. LSHINE: L*1 I - Shiny ball if .TRUE., else diffuse. ICLINE: I*4 I - If >=0, colour index for lines on surface of ellipsoid. ANGLIN: R*4 I - Width of lines: +/- degs. X0,Y0: R*4 O - Centre of projected ball. R0: R*4 O - Average radius of projected ball. sbline This subroutine draws a straight line between two points. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive, while that of both the ends should be negative; the viewing-screen is fixed at z=0. Syntax sbline EYE,END1,END2,ICOL,LDASH Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. END1: R*4 I 3 (x,y,z) coordinate of end-1. END2: R*4 I 3 (x,y,z) coordinate of end-2. ICOL: I*4 I - Colour-index for line. LDASH: L*1 I - Dashed line if .TRUE. (else cont.). sbtext Write a text string in 3-d perspective. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of the text string should be negative; the viewing-screen is fixed at z=0. Syntax sbtext EYE,TEXT,ICOL,PIVOT,FJUST,ORIENT,SIZE Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. TEXT: C*1 I * The text string to be written. ICOL: I*4 I - Colour index for text. PIVOT: R*4 I 3 (x,y,z) coordinate of pivot point. FJUST: R*4 I - Position of pivot along the text: 0.0=left, 0.5=centre, 1.0=right. ORIENT: R*4 I 3 x 2 (x,y,z) for X-length and Y-height directions of the text. SIZE: R*4 I - Height of the reference symbol "A". sbsurf This subroutine plots an iso-surface through a unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0. Syntax sbsurf EYE,LATICE,DENS,N1,N2,N3,DSURF,IC1,IC2,LIGHT,LSHINE Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. LATICE: R*4 I 3 x 4 (x,y,z) coordinates of the origin and the a, b & C lattice-vertices. DENS: R*4 I (N1+1) The density at regular points within x (N2+1) the unit cell, wrapped around so x (N3+1) that DENS(0,J,K)=DENS(N1,J,K) etc.. N1,N2,N3: I*4 I - The dimensions of the unit-cell grid. DSURF: R*4 I - Density for the iso-surface. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. LSHINE: L*1 I - Shiny surface if TRUE, else diffuse. sbtsur This subroutine plots a semi-transparent iso-surface through a unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0. Syntax sbtsur EYE,LATICE,DENS,N1,N2,N3,DSURF,IC1,IC2,LIGHT,LSHINE,ITRANS Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. LATICE: R*4 I 3 x 4 (x,y,z) coordinates of the origin and the a, b & C lattice-vertices. DENS: R*4 I (N1+1) The density at regular points within x (N2+1) the unit cell, wrapped around so x (N3+1) that DENS(0,J,K)=DENS(N1,J,K) etc.. N1,N2,N3: I*4 I - The dimensions of the unit-cell grid. DSURF: R*4 I - Density for the iso-surface. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. LSHINE: L*1 I - Shiny surface if TRUE, else diffuse. ITRANS: I*4 I - Level of transparency: 1 = 25%; 2 = 50%; 3 = 75%. sbslic This subroutine plots a "grey-scale" slice through a unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0. Syntax sbslic EYE,LATICE,DENS,N1,N2,N3,DLOW,DHIGH,IC1,IC2,SLNORM,APOINT,ICEDGE Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. LATICE: R*4 I 3 x 4 (x,y,z) coordinates of the origin and the a, b & C lattice-vertices. DENS: R*4 I (N1+1) The density at regular points within x (N2+1) the unit cell, wrapped around so x (N3+1) that DENS(0,J,K)=DENS(N1,J,K) etc.. N1,N2,N3: I*4 I - The dimensions of the unit-cell grid. DLOW: R*4 I - Density for the lowest colour-index. DHIGH: R*4 I - Density for the highest colour-index. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. SLNORM: R*4 I 3 (x,y,z) direction of the normal to the slice to be "grey-scaled". APONIT: R*4 I 3 (x,y,z) coordinate of a point within the slice to be "grey-scaled". ICEDGE: I*4 I - If >=0, it's the colour-index for the boundary of the "grey-scaled" slice. sbcpln This subroutine plots a diffusively-lit, semi-transparent, coloured plane through a unit cell. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0. Syntax sbcpln EYE,LATICE,IC1,IC2,LIGHT,SLNORM,APOINT,ICEDGE,ITRANS Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. LATICE: R*4 I 3 x 4 (x,y,z) coordinates of the origin and the a, b & C lattice-vertices. IC1,IC2: I*4 I - Lowest & highest colour-index to be used for the shading. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. SLNORM: R*4 I 3 (x,y,z) direction of normal to plane. APONIT: R*4 I 3 (x,y,z) coordinate of a point within the plane. ICEDGE: I*4 I - If >=0, it's the colour-index for the boundary of the plane. ITRANS: I*4 I - Level of transparency: 0 = 0%; 1 = 25%; 2 = 50%; 3 = 75%. sb2srf This subroutine plots a 3-d surface given a 2-d unit-cell of density. All (x,y,z) values are taken to be given in world coordinates. The z-component of the eye-poisition should be positive and that of all the lattice-vertices should be negative; the viewing-screen is fixed at z=0. Syntax sb2srf EYE,LATICE,DENS,N1,N2,DLOW,DHIGH,DVERT,IC1,IC2,NCBAND,LIGHT,LSHINE Arguments ARGUMENT TYPE I/O DIMENSION DESCRIPTION EYE: R*4 I 3 (x,y,z) coordinate of eye-position. LATICE: R*4 I 3 x 3 (x,y,z) coordinates of the origin and the a and b lattice-vertices. DENS: R*4 I (N1+1) The density at regular points within x (N2+1) the unit cell, wrapped around so that DENS(0,J)=DENS(N1,J) etc.. N1,N2: I*4 I - The dimensions of the unit-cell grid. DLOW: R*4 I - Lowest density to be plotted. DHIGH: R*4 I - Highest density to be plotted. DVERT: R*4 I - "Vertical" world-coordinate length corresponding to density-range. IC1,IC2: I*4 I - Lowest and highest colour-index to be used for the rendering. NCBAND: I*4 I - Number of colour-bands for the height, so that the number of shades per band = (IC2-IC1+1)/NCBAND. LIGHT: R*4 I 3 (x,y,z) direction of flood-light. LSHINE: L*1 I - Shiny surface if TRUE, else diffuse. radialplot plots a radial average of x centered at [xcenter, ycenter] with a radius of r Syntax radialplot fits x, int xcenter, int ycenter, int r [,title=string] [,xtitle=string] [,ytitle=string] setfitskey add or change a FITS key in the header. value can be any of string, integer or double. Syntax setfitskey fits x, string key, value, string comment See also function_getfitskey setbitpix Change pixel type of X. Syntax setbitpix fits x, int bitpix, double bscale = 1.0, double bzero = 0.0 See also function_setbitpix cd change the current working directory. Syntax cd string setwcs set WCS information in the FITS header. Syntax setwcs fits, crpix1, crpix2, crval1, crval2, cdelt1 [, cdelt2] shrink See documentation for the function of the same name. The reason to supply this also as a procedure is that it can be used without creating a temporary copy of the argument in memory. X must be a named variable. Syntax shrink X, factor See also function_shrink view Uses qtfitsview to display specified fits. Syntax view X limits Returns the limits for which the array is non-zero in the given variables. At least xlow and xhigh must be given. Syntax limits fits, xlow, xhigh [, ylow, yhigh, zlow, zhigh] printf Print the value (either a real number or an integer) using specified format string. The formatting is done like in the C printf function. The total length of the formatted string is limited to 256 characters. Syntax printf format, value export Export what to fname. If what is a stringarray, each string in the array is printed as a separate line. If what is a fits, all values are printed as floating point numbers, separated by a single whitespace (" "). In this case, optionally a precision can be given (default: 2 decimal places). Syntax export string filename, stringarray|fits what [, int precision] writebmp Write a bitmap (.bmp) file. If only red is given, this will be a grayscale image, else both green and blue must be given (which must be of the same size as red) and a color image will be written. The values in the fits are supposed to be scaled between 0 and 255. Syntax writebmp filename, red [, green, blue] Arguments filename: A string giving the file name of the bitmap red: 2-dimensional array green: A 2-dimensional array of the same size as red blue: A 2-dimensional array of the same size as red Examples Write out a grayscale bitmap of a circular gaussian: writebmp "gauss.bmp", gauss(129,129,30)*255 swapbytes Swap the bytes of given fits, which must be a variable. Syntax swapbytes fits read Print prompt and read in up to 9 variables. The variables can be of integer, floating point or string type and must exist before the call. Syntax read prompt, v1 [, v2, v3, v4, v5, v6, v7, v8, v9] shade Plot an image in a variety of ways - as provided by PGXTAL. This procedure asks for plot options interactively. Possible plots are contour, shaded surface, and colour plots with various colourtables. Syntax shade fits replace replaces all occurences of the string s by the string r. Syntax replace string|stringarray where, string s, string r saomarkpoint Draws a marker on saoimage at specified x,y coordinates with size s. Optionally a colour can be specified. Syntax saomarkpoint x, y, size, type [,colour] Arguments x: X-axes coordinate of the center of the circle y: Y-axes coordinate of the center of the circle size: The size of the marker to be drawn type: Marker type, give one of the following (can be OR'ed) FILL: 1 POINT: 2 BOX: 4 PLUS: 8 CROSS: 16 DIAMOND: 32 CIRCLE: 64 STAR: 128 HLINE: 256 VLINE: 512 HBLINE: 1024 VBLINE: 2048 colour: Optionally, a color in the range 202-217 can be given BLACK: 202 WHITE: 203 RED: 204 GREEN: 205 BLUE: 206 YELLOW: 207 CYAN: 208 MAGENTA: 209 CORAL: 210 MAROON: 211 ORANGE: 212 KHAKI: 213 ORCHID: 214 TURQUOISE: 215 VIOLET: 216 WHEAT: 217 See also procedure_sao procedure_saomarklabel procedure_saoclear saoclear Clear saoimage of all markers drawn Syntax saoclear See also procedure_sao procedure_saomarkpoint procedure_saomarklabel saomarklabel Draws a marker on saoimage at specified x,y coordinates with size s. Label the point Optionally a colour can be specified. Syntax saomarkpoint x, y, label, size, type [,colour] Arguments x: X-axes coordinate of the center of the circle y: Y-axes coordinate of the center of the circle label: A string to be printed next to the marker size: The size of the marker to be drawn type: Marker type, give one of the following (can be OR'ed) FILL: 1 POINT: 2 BOX: 4 PLUS: 8 CROSS: 16 DIAMOND: 32 CIRCLE: 64 STAR: 128 HLINE: 256 VLINE: 512 HBLINE: 1024 VBLINE: 2048 colour: Optionally, a color in the range 202-217 can be given BLACK: 202 WHITE: 203 RED: 204 GREEN: 205 BLUE: 206 YELLOW: 207 CYAN: 208 MAGENTA: 209 CORAL: 210 MAROON: 211 ORANGE: 212 KHAKI: 213 ORCHID: 214 TURQUOISE: 215 VIOLET: 216 WHEAT: 217 See also procedure_sao procedure_saomarkpoint procedure_saoclear cblank Replace all undefined values (like NaN or Inf) by another value. If no value is specified, 0.0 will be replaced. Syntax cblank ARRAY [, value] Arguments ARRAY: A variable holding an array value: Optional, the value to be assigned (defaults to 0) See also function_cblank cubemerge Merges several fits datacubes. All files must have the same array size (in the first two dimensions) and bitpix. The file name of the result must not be the same as any of the input names. The FITS header is copied from the first file and the NAXIS3 keyword is updated. Syntax cubemerge result, cubes Arguments result: The filename where the datacube is written to cubes: A string array with the file names to be merged setenv Set or change an environment variable. Syntax setenv VARIABLE, VALUE Arguments VARIABLE: A string with the name of the new environment variable VALUE: A string with the value of the new environment variable See also function_getenv break Stop any currently running script or loop. Syntax break Arguments none run Execute a script. This is equivalent to entering @script. Syntax run S Arguments S: A string with the file name of the script to be executed. echo Turn on or off echo mode. Echo mode determines if external scripts are echoed to the console. Syntax echo mode Arguments mode: An integer number. 0 means echo off, any other number echo on. precess Precess coordinates from one epoch to another. Syntax precess RAh, RAm, RAs, DECd, DECm, DECs, fromepoch, toepoch Arguments RAh, RAm, RAs: Right Ascension of the object DECd, DECm, DECs: Declination of the object fromepoch: Epoch in which the coordinates are given toepoch: Epoch to which the coordinates should be precessed pwd Print current working directory Syntax pwd Arguments None dir Print directory listing. Syntax dir [filter] Arguments filter: Print directory listing of files matching given pattern setindexbase Set the base for array indexing Syntax setindexbase base Arguments base: The index base, 0 for C-notation, 1 for Fortran-notation (the default) See also procedure_cnotation procedure_fortrannotation function_indexbase cnotation Set the base for array indexing to 0 Syntax cnotation Arguments none See also procedure_setindexbase procedure_fortrannotation function_indexbase fortrannotation Set the base for array indexing to 1 (the default for dpuser) Syntax fortrannotation Arguments none See also procedure_setindexbase procedure_cnotation function_indexbase dpusersrc/dpuser/doc/www/0000755000175100003160000000000012745402362013770 5ustar ottirdpusersrc/dpuser/doc/www/dpuser.css0000644000175100003160000000304210735765731016014 0ustar ottirbody { margin: 0; background: #C0C0FF; } #header { padding-top: 0.5em; padding-bottom: 0.5em; position: relative; text-align: center; width: 100%; font-size: 200%; font-weight: bold; } #menu { position: absolute; left: 0; top: 0; text-align: center; width: 150px; margin-left: 0px; margin-right: 0px; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-right: 0; padding-top: 0; padding-bottom: 0; font-size: 90%; font-weight: bold; list-style-type: none; overflow: auto; height: 100%; } #menu[ id] { position: fixed; } #menu a { text-decoration: none; font-size: 125%; display: block; } #menu a:link,a:visited { color: #0000FF; } #menu a:hover { color: #FFFFFF; } #menu a.current { color: #000000; background: #A0A0FF; border-color: #A0A0FF; } #menu ul { margin-top: 5em; margin-left: 0; padding: 0; list-style-type: none; } #menu li { border-bottom: .25em; border-top: .25em; border-left: 0; border-right: 0; border-style: solid; border-color: #C0C0FF; } #content { position: relative; margin-left: 150px; padding: 10px; border-style: solid; border-width: 10px; border-color: #A0A0FF; border-right-width: 0px; text-align: justify; background: #FFFFFF; } #content h1 { margin: 0; } #content a:link, a:visited { color: blue; text-decoration: none; } #content h1.declaration { background: #FFFF99; margin: -10px; padding: 10px; } #declaration h1 { margin: 0; } #copyright { position: relative; margin: 0; margin-left: 150px; padding: 10px; font-weight: bold; text-align: center; } dpusersrc/dpuser/doc/www/dpuser.ico0000644000175100003160000000047610735765731016006 0ustar ottir(( Àÿÿÿ‰‰‰NNNÃÃç§§mmmèèèÔÔÔµµµ˜˜˜óóó\\\yyy ÜÜÜ[ã±;±;±x»¹ø´÷P;V%C¦&œ„ãV,]&¦“yãx¸¿¸ôø;±;±;±Kdpusersrc/dpuser/doc/www/makesearch.dpuser0000644000175100003160000000530511140271626017315 0ustar ottir// from www.javascriptkit.com/script/cut154.shtml @tools.dpuser output = stringarray(0) output += "title = new Object();" output += "desc = new Object();" output += "links= new Object();" output += "matched= new Object();" output += "keywords= new Object();" output += "found= new Object();" output += "var temp=0;" // actual location or the item to be searched // description of he location // actual link // percentage match found // keywords as parsed from the input //no of keywords after parsing output += "keywords[0]=0" //no of matches found. output += "found[0]=0" database = stringarray(0) n = 1 text = import("../functions.txt", /text) while (nelements(text) > 0) { i = 1 while(text[i] != "" && i < nelements(text)) i++ function = text[1:i] print function[1] if (i < nelements(text)) { text = text[i+1:nelements(text)] } else { text = stringarray(0) } database += "desc[" + n + "] = \"" + function[1] + " function\"" line = function[1] + " " + function[2] replace line, "\"", "" replace line, "\"", "" line = unify(line) database += "title[" + n + "] = \"" + line + "\"" aga=function[1] replace aga, " \(obsolete\)", "" database += "links[" + n + "] = \"function_" + aga + ".html\"" database += "matched[" + n + "] = 0" n++ } text = import("../procedures.txt", /text) while (nelements(text) > 0) { i = 1 while(text[i] != "" && i < nelements(text)) i++ function = text[1:i] print function[1] if (i < nelements(text)) { text = text[i+1:nelements(text)] } else { text = stringarray(0) } database += "desc[" + n + "] = \"" + function[1] + " procedure\"" line = function[1] + " " + function[2] replace line, "\"", " " replace line, "\"", " " line = unify(line) database += "title[" + n + "] = \"" + line + "\"" aga=function[1] replace aga, " \(obsolete\)", "" database += "links[" + n + "] = \"procedure_" + aga + ".html\"" database += "matched[" + n + "] = 0" n++ } files = ["index.html","installing.html","history.html","syntax.html","operators.html","ifandloop.html","variables.html","plotting.html","fitsfiles.html","examples.html"] for i=1, nelements(files) { print files[i] text = import("../" + files[i], /text) text = nohtml(text) line = "" for j=1, nelements(text) line += text[j] + " " while (strpos(line, " ") != -1) replace line, " ", " " while (strpos(line, "\"") != -1) replace line, "\"", " " line = simplifywhitespace(line) line = unify(line) database += "desc[" + n + "] = \"" + files[i] + "\"" database += "title[" + n + "] = \"" + line + "\"" database += "links[" + n + "] = \"" + files[i] + "\"" database += "matched[" + n + "] = 0" n++ } output += "title[0] = " + (n-1) output += database output += import("searchend.html", /text) export "index.js", output dpusersrc/dpuser/doc/www/makewww.dpuser0000644000175100003160000000400611024501671016666 0ustar ottir@tools.dpuser function fixpgplot, current { fixpgplot = stringarray(0) n = 1 while (strpos(current[n], "" + current[n] + "" n += 2 while (n <= nelements(current)) { fixpgplot += current[n] n++ } } files = ["index.html","history.html","syntax.html","operators.html","ifandloop.html","variables.html","plotting.html","fitsfiles.html","category.html","functions.html","procedures.html","pgplot.html","examples.html"] curdir = pwd() cd ".." files += dir("function_*.html") files += dir("procedure_*.html") files += dir("pgplot_*.html") cd curdir style = import("style.html", /text); for n=1, nelements(files) { print files[n] content = import("../" + files[n], /text) if (strpos(files[n], "pgplot_") != -1) content = fixpgplot(content) output = stringarray(0) j = 1 while (strpos(content[j], "") == -1) { output += content[j] j++ } output += style while (strpos(content[j], "") == -1) { output += content[j] j++ } output += footer() while (j <= nelements(content)) { output += content[j] j++ } export files[n], output } exec "cp ../*.png ." output = stringarray(0) output += "" output += "" output += "DPUSER Search Results" output += style output += "" output += "" output += "" output += menu(html_header(), "nix.html") output += "

    Search Results

    " output += "
    " output += "" output += "This search was created by © Satadip Dutta 1997" output += "
    " output += footer() output += "" output += "" export "search.html", output dpusersrc/dpuser/doc/www/searchbegin.html0000644000175100003160000000464510735765731017152 0ustar ottir search

    Search Results