REBIN

Rebin demodulated SCUBA data onto output map

Description:

This routine rebins the demodulated data from SCUBA MAP observations onto a rectangular mesh by a variety of methods. Currently convolution by weighting functions, spline interpolation and median are supported.

Usage:

rebin ref

Parameters:

GUARD = LOGICAL (Read)
Controls whether the bolometer guard ring should be used during the regridding process. The guard ring enforces zero flux at the edge of the regridded image. Should be turned off if flux is present at the edge. Default is to use the guard ring for LINEAR, BESSEL and GAUSSIAN rebin modes.
IN = CHAR (Read)
The name of the input file to be rebinned. This parameter is requested repeatedly until a NULL value (!) is supplied. LOOP must be TRUE. IN can include a SCUBA section. Like the REF parameter this parameter accepts a text file.
LAT_OUT = CHAR (Read)
The latitude of the output map centre. The supplied default value is that of the map centre of the first map.
LONG_OUT = CHAR (Read)
The longitude of the output map centre. The supplied default value is that of the map centre of the first map.
LOOP = LOGICAL (Read)
Task will ask for multiple input files if true. Only REF is read if noloop.
MSG_FILTER = CHAR (Read)
Message filter level. Allowed values are QUIET, NORM and VERB. Default is NORM. There are no verbose messages.
OUT = NDF (Write)
This is the name of the NDF that will contain the rebinned map. A null value can be supplied to shut down rebin without error. This can be used to determine the size of the output map without creating it.
OUT_COORDS = CHAR (Read)
The coordinate system of the output map. Available coordinate systems are:
  • AZ: Azimuth/elevation offsets

  • NA: Nasmyth offsets

  • PL: RA/Dec Offsets from moving centre (e.g. Planets)

  • RB: RA/Dec (B1950)

  • RJ: RA/Dec (J2000)

  • RD: RA/Dec (epoch of observation)

  • GA: Galactic coordinates (J2000)

For RD current epoch is taken from the first input file.

OUT_OBJECT = CHAR (Read)
The name of the object (ie the NDF title).
PIXSIZE_OUT = REAL (Read)
Size of pixels in the output map. Units are arcsec.
REBIN_METHOD = CHAR (Read)
The rebin method to be used. A number of regridding methods are available:
  • LINEAR: Linear weighting function

  • GAUSSIAN: Gaussian weighting function

  • BESSEL: Bessel weighting function

  • SPLINE1: Interpolating spline (PDA_IDBVIP)

  • SPLINE2: Smoothing spline (PDA_SURFIT)

  • SPLINE3: Interpolating spline (PDA_IDSFFT)

  • MEDIAN: Median regridding

Please refer to the PDA documentation (SUN/194) for more information on the spline fitting algorithms.

REF = CHAR (Read)
The name of the first NDF to be rebinned. The name may also be the name of an ASCII text file containing NDF and parameter values. See the notes. REF can include a SCUBA section.
REFPIX ( 2 ) = INTEGER (Read)
The coordinate of the reference pixel in the output data array. This corresponds to the pixel associated with the specified RA/Dec centre. Default is to use the middle pixel if a size is specified or the optimal pixel if the default size is used (see the SIZE parameter).
TRIM = INTEGER (Read)
This parameter determines the amount of good data that should be trimmed from the final image to correct for edge effects. The supplied value should be in arcseconds. All pixels closer to a bad pixel than this distance will be set to bad in the output image (by setting bit 1 in the quality array). Default is 0.0.
SCALE = REAL (Read)
Radius of one scale size in arcsec. This effectively governs the size of the weighting function. For LINEAR one scale size corresponds to the zero of the cone, for BESSEL it is the first zero of the Bessel function (π) and for Gaussian it is the half-width half maximum (HWHM).
SIZE ( 2 ) = INTEGER (Read)
This array parameter sets the size of the output grid in pixels (nx, ny). The default values are the minimum dimensions required to display the entirety of the mapped area.
SHIFT_DX = REAL (Read)
The pointing shift (in X) to be applied that would bring the maps in line. This is a shift in the output coordinate frame.
SHIFT_DY = REAL (Read)
The pointing shift (in Y) to be applied that would bring the maps in line. This is a shift in the output coordinate frame.
TIMES = LOGICAL (Read)
Store an extra NDF in the output map containing the 2-D histogram of the data. This can be used to make an estimate of the actual number of samples responsible for each point in the output grid. Note that, in general, the number of pixels in the output grid exceeds the number of independent beams in the image. The data can be accessed as OUT.more.reds.times. Default is FALSE.
WEIGHT = REAL (Read)
The relative weight that should be assigned to each dataset.
WEIGHTS = LOGICAL (Read)
This parameter governs whether the convolution weights array will be stored in the output NDF. The default is FALSE (i.e. do not store the weights array).
WTFNRAD = INTEGER (Read)
Size of the weighting function in scale sizes. This parameter is irrelevant for LINEAR regridding. For Gaussian the default is 3 (i.e. a diameter of 3 FWHM for the footprint), and for Bessel it is 10. The smaller the weighting function is (a combination of WTFNRAD and SCALE) the faster the regridding goes.

Examples:

rebin rebin_method=LINEAR out_coords=RJ
Rebin the maps with LINEAR weighting function in J2000 RA/Dec coordinates. You will be asked for input datasets until a null value is given.
rebin rebin_method=BESSEL out=map out_coords=NA
Rebin the maps with Bessel weighting function in Nasmyth coordinates.
rebin noloop accept ref=test.bat out=rebin
Rebin the files specified in test.bat onto a rectangular grid using linear interpolation, 3 arcsecond pixels and RJ coordinates.

Notes:

For each file name that is entered, values for the parameters WEIGHT, SHIFT_DX and SHIFT_DY are requested.

ASCII input files

The REF and IN parameters accept ASCII text files as input. These text files may contain comments (signified by a #), NDF names, values for the parameters WEIGHT, SHIFT_DX and SHIFT_DY, and names of other ASCII files. There is one data file per line. An example file is:

file1{b5} 1.0 0.5 0.0 # Read bolometer 5 from file1.sdf
file2 # Read file 2 but you will still be
# prompted for WEIGHT, and shifts.
file3{i3}- 1.0 0.0 0.0 # Use everything except int 3
test.bat # Read in another text file

Note that the parameters are position dependent and are not necessary. Missing parameters are requested. This means it is not possible to specify SHIFT_DX (position 3) without specifying the WEIGHT. If the file has the .txt extension the NDF system will attempt to convert it to NDF format before processing – this is probably not what you want.

Related Applications

SURF: bolrebin, intrebin, scuquick, extract_data