Joint Astronomy Centre
Show document only
JAC Home
JCMT
UKIRT
Contact info
JAC Divisions
OMP
Outreach
Seminars
Staff-only Wiki
Weather
Web Cameras
____________________

JCMT home
Observing at JCMT
OMP Observation Manager
Telescope
Instrumentation
Schedule
Data Archive
Future Developments
Legacy Surveys
Newsletter & Publications
ORAC-DR Recipe Descriptions

REDUCE_SCIENCE_NARROWLINE

There are currently three variants to this recipe Back to the recipes.

REDUCE_SCIENCE_NARROWLINE

Description: This recipe reduces an ACSIS science observation. It does so by first converting a time-series cube (or more than one, as the case may be) as written by the ACSIS specwriter into a spatial/spectral cube. This cube is then coadded to other cubes in the same group to form a higher signal-to-noise ratio cube.

This recipe differs from REDUCE_SCIENCE in that it uses a [5,5,10] box smooth when finding baselines

Output: For single observations: A spatial/spectral cube whose filename is of the form aYYYYMMDD_NNNNN_SS_MMMM_cube.sdf, where YYYYMMDD is the UT date, NNNNN is the zero-padded observation number, SS is the zero-padded subsystem number, and MMMM is the first zero-padded sub-scan number for the given observation and subsystem.

For group files: A spatial/spectral cube whose filename is of the form gaYYYYMMDD_N, where YYYYMMDD is the UT date, and N is the group number. This is the coadded group file.

Related recipes: REDUCE_SCIENCE
Primitives: Click on a link to take you to a description of each primitive.

_REDUCE_SCIENCE_STEER_
_INSTRUMENT_HELLO_
_QA_WITH_MASKING_
_REMOVE_FREQUENCY_ENDS_ LOWER=2.75 UPPER=3 AXIS=1
_MERGE_HYBRID_MODE_
_THRESHOLD_DATA_ LOW=-150 HIGH=150 NEWLOW=bad NEWHIGH=bad
_SUBTRACT_TIMESERIES_SIGNAL_
_SET_TAG_ TAG=SUBTRACTED_TIMESERIES_SIGNAL
_CREATE_CUBE_FRAME_ SPREAD=nearest
_REMOVE_BASELINE_ GROUP=0 ORDER=1 METHOD=region TAG=1
_CREATE_MOMENTS_MAPS_ GROUP=0 MOMENTS=integ,iwc TAG=integ
_CREATE_NOISE_MAP_ GROUP=0 QA=1
_RETRIEVE_TAG_ TAG=SUBTRACTED_TIMESERIES_SIGNAL
_CREATE_CUBE_GROUP_ SPREAD=nearest
_REMOVE_BASELINE_ GROUP=1 ORDER=2 METHOD=region TAG=1
_CREATE_MOMENTS_MAPS_ GROUP=1 MOMENTS=integ,iwc TAG=integ
_CREATE_NOISE_MAP_ GROUP=1 QA=1

REDUCE_SCIENCE_NARROWLINE_ADV

Description: This recipe first creates a spatial cube from the raw time series data. Then, working on the raw time series data, it subtracts a median time-series signal, thresholds the data, then trims the ends of the frequency range to remove high-noise regions.

After the time-series manipulation has been done to every member of the current group, every member is run through MAKECUBE to create a group spatial cube. This cube then has its baseline removed through a smoothing process, and moments maps are created.

A baseline mask formed from the group cube is run through UNMAKECUBE to form baseline masks for the input time-series data, which are then baselined. The baselined time-series data are then run through MAKECUBE to create observation cubes, from which moments maps are created.

Output: For single observations: A spatial/spectral cube whose filename is of the form aYYYYMMDD_NNNNN_SS_MMMM_cube.sdf, where YYYYMMDD is the UT date, NNNNN is the zero-padded observation number, SS is the zero-padded subsystem number, and MMMM is the first zero-padded sub-scan number for the given observation and subsystem.

For group files: A spatial/spectral cube whose filename is of the form gaYYYYMMDD_N, where YYYYMMDD is the UT date, and N is the group number. This is the coadded group file.

For time-series data:
_tss : median removed from time series
_thr : thresholded time series
_em : noisy ends removed
_tsmask: baseline region only mask
_msk : non-baseline regions
_bl : baseline removed

For spatial cubes:
_cube : baseline removed cube
_blmask : baseline region mask

For group cubes:
_cube : cube
_blmask : basline region mask
_bl : baseline removed cube

For moments maps:
_integ : integrated intensity
_iwc : (intensity weighted) velocity map

Notes: The 'nearest' method is used for creating cubes with MAKECUBE

A 10-pixel box smooth is used in the frequency domain. This may be too large for some narrowline data.

Related recipes: REDUCE_SCIENCE_ADV
Primitives: Click on a link to take you to a description of each primitive.

_STOP_PROCESSING_IF_SIMULATED_
_REDUCE_SCIENCE_STEER_ COPY_FRAME=0
_INSTRUMENT_HELLO_
_QA_WITH_MASKING_
_REMOVE_FREQUENCY_ENDS_ LOWER=2.75 UPPER=3 AXIS=1
_MERGE_HYBRID_MODE_
_THRESHOLD_DATA_ LOW=-150 HIGH=150 NEWLOW=bad NEWHIGH=bad
_SUBTRACT_TIMESERIES_SIGNAL_
_SET_TAG_ TAG=POST_TIMESERIES_REMOVAL
_ITERATIVE_GROUP_PRODUCTION_ SPREAD=nearest FREQUENCY_SMOOTH=10 SPATIAL_SMOOTH=3 ORDER=5 MOMENTS=integ,iwc

REDUCE_SCIENCE_NARROWLINE_GBS

Description: This recipe is the same as REDUCE_SCIENCE_ADV except that it uses quality assurance parameters which are specific to the Gould Belt Survey.

Detailed description of Primitives

_STOP_PROCESSING_IF_SIMULATED_
Description: This primitive examines the SIMULATE header of the current Frame, and if it's true, processing is halted. The ORAC__TERM constant is returned, which causes the pipeline to stop processing the current Frame and go on to the next one.
Notes: This primitive is only called in _ADV scripts and not in standard recipes
Back to top
_REDUCE_SCIENCE_STEER_
Description: Set up steering parameters for REDUCE_SCIENCE recipes.
Arguments: COPY_FRAME = LOGICAL (Given)
Whether or not to copy Frame products to Group products when there's only one member in the group. [1]
Back to top
_INSTRUMENT_HELLO_
Description: Instrument specific initialisation.Any instrument specific initialisation for the spectroscopy pipeline is done in the instrument specific _INSTRUMENT_HELLO_ primitive. This is called close to the start of _SPECTROSCOPY_HELLO_ near the start of processing for each frame. If a given instrument does not require any specific initialisation, it should not have an _INSTRUMENT_HELLO_ primitive, and this generic, null, one will be called instead.
Back to top
_QA_WITH_MASKING_
Description: Run quality assurance tests and mask out spectra that fail a consistency check between Tsys and observed RMS. This primitive performs quality assurance tests on raw timeseries data, then uses information gleaned from those tests to mask out bad data.
Arguments: MASK = STRING (Given)
When QA tests are performed, the various JCMT Legacy Surveys have different thresholds for what counts as bad data. If this string is set, then that given survey's thresholds will be used when masking out data. If it is not set, then the value of the SURVEY header for the current Frame object will be used. If that is not defined, then the default Telescope thresholds (which are much less stringent than survey thresholds) will be used. Case-insensitive. ['tele- scope']

SURVEY_OVERRIDE = STRING (Given)
If defined, override the survey listed in the SURVEY header. The given survey will be used for QA thresholds. ['']

Output: _ts : time series data sorted in time order (See _SORT_TIMESERIES_)
_tsmask : masked time series data
Tasks: None, but see _SORT_TIMESERIES, _QA_SENSITIVITY_VARIATION_, and _QA_RMS_TSYS_CONSISTENCY_
Back to top
_REMOVE_FREQUENCY_ENDS_
Description: Remove the ends of a cube's frequency axis. This primitive removes the ends of a cube's frequency axis by copying out a central portion of the cube to a new file. This primitive differs from _MASK_FREQUENCY_ENDS_ in that this primitive does not create a cube with masked-out bad pixels on either ends of the frequency axis, whereas _MASK_FREQUENCY_ENDS_ does.
Arguments: AXIS = INTEGER (Given)
The axis to trim. For time-series data this should be set to 1. For spatial cubes this should be set to 3. [3]

LOWER = REAL (Given)
The percentage of the total frequency range to trim from the lower end of the frequency range. For example, if a cube has 1024 fre- quency channels, and the percentage to trim is 10%, then 102 chan- nels will be trimmed from the lower end. [undef]

PERCENT = REAL (Given)
The percentage of the total frequency range to trim from either end. For example, if a cube has 1024 frequency channels, and the percentage to trim is 10%, then 102 channels will be trimmed from either end. [10.0]

UPPER = REAL (Given)
The percentage of the total frequency range to trim from the higher end of the frequency range. For example, if a cube has 1024 fre- quency channels, and the percentage to trim is 10%, then 102 chan- nels will be trimmed from the upper end. [undef]

Notes: This primitive will only remove the ends if the Frame's user header SPECTRAL_TRIMMED does not exist or it exists and is false.

If either of the LOWER or UPPER parameters are given, these will be used. Otherwise, if both of them are left undefined, then the PER- CENT parameter will be used.

Output: _em : Cube with masked frequency ends
Tasks: KAPPA: NDFCOPY, NDFTRACE
Back to top
_MERGE_HYBRID_MODE_
Description: Merge hybrid mode observations in the frequency domain. This primitive operates on hybrid mode observations. It first deter- mines a DC-level offset between corresponding subscan observations, using the overlap region to determine statistics. If no overlap region exists, then the entire spectrum is used. The DC offset is added to or removed from the subscan spectra, and the corresponding subscans are mosaicked together to form time-series cubes with a greater frequency extent.
Notes: This primitive is suitable for ACSIS data taken in hybrid mode.

This primitive only operates if the ISHYBRID user header is set for the current Frame object.

This primitive currently only operates on observations with one subscan.

Output: _dc : the DC corrected time-series cubes
_merge : the merged time-series cube
Tasks: KAPPA: COLLAPSE, MANIC, MATHS, NDFTRACE, WCSMOSAIC
Back to top
_THRESHOLD_DATA_
Description: Threshold data lower and/or higher than given values. This recipe thresholds data values that are lower and/or higher than given values. It is essentially a wrapper around the KAPPA THRESH application.
Arguments: HIGH = REAL (Given)
The upper threshold value within the input array. [0]

LOW = REAL (Given)
The lower threshold value within the input array. [0]

NEWHIGH = REAL (Given)
The value to which all input values greater than the upper thresh- old (HIGH parameter) are set. This can be set to "bad", in which case the bad value is substituted. [0]

NEWLOW = REAL (Given)
The value to which all input values smaller than the lower thresh- old (LOW parameter) are set. This can be set to "bad", in which case the bad value is substituted. [0]

Output: _thr : the thresholded data
Tasks: KAPPA: THRESH
Back to top
_SUBTRACT_TIMESERIES_SIGNAL_
Description: This primitive subtracts a gross timeseries signal from raw heterodyne data. It first creates a median instrument spectrum by collapsing along the receptor axis, then collapses along the central 2/3rds of the chan- nel axis. This creates a time-series spectrum, which is then grown to the size of the input cube. The time-series cube is subtracted from the input cube. The median value of the time-series spectrum is added back to the subtracted cube.
Notes: The receptor axis is assumed to be the 2nd axis of the input cube.

This primitive operates on every file in the current Frame.

Back to top
_SET_TAG_
Description: Tag the current Frame for subsequent retrieval. This primitive can be used to tag the current Frame for subsequent retrieval. In conjunction with the _RETRIEVE_TAG_ primitive, this prim- itive can be used to "jump back" to a previous step in processing.
Arguments: TAG = STRING (Given)
The string to tag the current Frame with. This argument is manda- tory, and an error will be thrown if it is not defined.
Back to top
_CREATE_CUBE_FRAME_
Description: Create a cube from a time-series ACSIS observation and stuff it in the Frm object. This primitive takes a time-series ACSIS cube and, using SMURF/MAKE- CUBE, transforms it into a spatial/spectral cube.
Arguments: BYTES_PER_PIXEL = INTEGER (Given)
The number of bytes per pixel. [4]

DETECTORS = STRING (Given)
A comma-separated list of detectors to use when creating the cube. If blank or undefined, all detectors will be used. ['']

MAXSIZE = INTEGER (Given)
The maximum size, in bytes, of the output cube. This value does not include extra information such as variance or weight arrays, FITS headers, or any other NDF extensions. [512000000]

PARAMS = STRING (Given)
An optional array which consists of additional parameters required by the Sinc, SincSinc, SincCos, SincGauss, Somb, SombCos, and Gauss spreading methods (see parameter SPREAD). See documentation for the PARAMS parameter for MAKECUBE. ['']

SPREAD = STRING (Given)
The interpolation method to use when regridding the cube. This can be any of those allowed by MAKECUBE, listed in the SPREAD parameter. ['nearest']

SUFFIX = STRING (Given)
Override the default "_cube" suffix with a new value. This is use- ful when processing an iterative result where we do not want to improve the initial product (the whole point being to retain it). PRODUCT = STRING (Given) Override the default "cube" product designation.

Output: A cube whose filename is of the form aYYYYMMDD_NNNNN_SS_cube.sdf, where YYYYMMDD is the UT date, NNNN is the zero-padded observation number, and SS is the zero-padded susbystem number.
Tasks: SMURF: MAKECUBE
Back to top
_REMOVE_BASELINE_
Description: This primitive removes the baseline from each spectrum in a cube, using spectral windows that are assumed to be free of spectral lines.
Arguments: EDGES = REAL (Given)
Percentage of the full range to fit on either edge of the spectrum. [0]

GROUP = LOGICAL (Given)
Whether or not to operate on the current Group object. [0]

ORDER = INTEGER (Given)
The order of the fit to use for the baseline. Zero (the default) is a constant, one is linear, etc. [0]

METHOD = STRING (Given)
The method used to define the baseline regions in automatic mode. The allowed values are 'region', 'single', and 'global'. This is not used if the EDGES argument is defined. ['region']

TAG = LOGICAL (Given)
Whether or not to tag the resulting cubes as 'reduced'. [0]

Tasks: KAPPA: MFITTREND, NDFTRACE
Back to top
_RETRIEVE_TAG_
Description: Retrieve a tagged Frame. This primitive can be used to retrieve a Frame that has been previously tagged with the _SET_TAG_ primitive or the tagset() Frame method.
Arguments: TAG = STRING (Given)
The tag to retrieve. This argument is mandatory, and an error will be thrown if it is not defined. If the tag has not been previously used, then the current frame will not be changed.

THROW = LOGICAL (Given)
Whether or not to throw an error if the requested tag does not exist. [1]

Back to top
_CREATE_CUBE_GROUP_
Description: Create a cube from a group of time-series ACSIS observations. This primitive takes time-series ACSIS cubes from each observation in the current group and runs MAKECUBE on them to create a spatial/spectral cube.
Arguments: BYTES_PER_PIXEL = INTEGER (Given)
The number of bytes per pixel. [4]

MAXSIZE = INTEGER (Given)
The maximum size, in bytes, of the output cube. This value does not include extra information such as variance or weight arrays, FITS headers, or any other NDF extensions. [512000000]

PARAMS = STRING (Given)
An optional array which consists of additional parameters required by the Sinc, SincSinc, SincCos, SincGauss, Somb, SombCos, and Gauss spreading methods (see parameter SPREAD). See documentation for the PARAMS parameter for MAKECUBE. ['']

SPREAD = STRING (Given)
The interpolation method to use when regridding the cube. This can be any of those allowed by MAKECUBE, listed in the SPREAD parame- ter. ['nearest']

TILEBORDER = INTEGER (Given)
The size of the border to be added to tiles. This is used when smoothing the cube in spatial extent in later processing, so as to not add edge effects. [0]

Output: A cube (or set of cubes) whose filename is of the form gaYYYYM- MDD_NN_SS_cubeMMM.sdf, where YYYYMMDD is the UT date, NN is the observation number, SS is the zero-padded subsystem number, and MMM is the zero-padded tile number. Tiles are numbered starting from 1 and increasing monotonically, counting from the bottom left corner in spatial extent and proceeding in a raster fashion from left to right.
Tasks: KAPPA: NDFTRACE. SMURF: MAKECUBE
Back to top
_CREATE_MOMENTS_MAPS_
Description: Create moments maps by collapsing along spectral axis. This primitive is used to create moments maps. The input cube is simply collapsed along the spectral axis, using the requested estimator.
Arguments: GROUP = INTEGER (Given)
How to process group files. 0 means use the current Frame object. 1 means use the current Group object. 2 means use each Frame member of the current Group object. [0]

MOMENTS = STRING (Given)
The moment maps to create. These are any of the values allowed for the ESTIMATOR parameter to the COLLAPSE method, but in reality this should probably be 'integ', 'iwc', and/or 'itd'. Any number of moments can be given in a comma-separated string. ['integ']

TAG = STRING (Given)
Which moment map to tag as a representative image. ['integ']

Output: The moments map(s) with suffix equal to the given moment(s) by the MOMENTS parameter.
Tasks: None, but see _COMPONENT_EXISTS_
See also: _CREATE_MOMENTS_MAPS_THROUGH_SMOOTHING_
Back to top
_CREATE_NOISE_MAP_
Description: Create a map of the noise for a given cube. This primitive is used to create a noise map. It first masks out emis- sion regions using a previously-defined mask (see _CREATE_BASE- LINE_MASK_), and then collapses the resulting cube along the frequency axis using the RMS estimator.
Arguments: GROUP = INTEGER (Given)
How to process group files. 0 means use the current Frame object. 1 means use the current Group object. 2 means use each Frame member of the current Group object. [0]

QA = LOGICAL (Given)
Whether or not to perform quality assurance calculations on the resulting noise map. [0]

Output: _noise : the noise map
Tasks: KAPPA: ADD, COLLAPSE, PASTE
Back to top
_ITERATIVE_GROUP_PRODUCTION_
Description: This primitive creates a group co-added cube from all members of the current group. It then baselines the cube and creates moments maps.

In the process of baselining the group cube, this primitive also creates a baseline mask file, masking out emission. It then runs this mask through UNMAKECUBE to create time-series masks. These masks are applied to the original time-series data, which are then baselined. The baselined time-series data are then run through MAKECUBE to create individual baselined cubes for each observation. Moments maps are then made from these cubes.

Arguments: FREQUENCY_SMOOTH = INTEGER (Given)
The number of channels to smooth in the frequency axis when smoothing to determine baselines. This number should be small (~10) for narrow-line observations and large (~25) for broad-line observations. [25]

MOMENTS = STRING (Given)
The moment maps to create. These are any of the values allowed for the ESTIMATOR parameter to the COLLAPSE method, but in reality this should probably be 'integ', 'iwc', and/or 'itd'. Any number of moments can be given in a comma-separated string. ['integ']

ORDER = INTEGER (Given)
The polynomial order that will be used when estimating baselines. [5]

PARAMS = STRING (Given)
The parameters to pass to MAKECUBE when using the Sinc, SincSinc, SincCos, SincGauss, Somb, SombCos, and Gauss spreading methods (see SPREAD parameter). ['']

SPATIAL_SMOOTH = INTEGER (Given)
The number of pixels to smooth in both spatial axes when smoothing to determine baselines. [3]

SPREAD = STRING (Given)
The method to use when spreading each input pixel value out between a group of neighbouring output pixels when using MAKECUBE to generate a cube. ['nearest']

Tasks: _CREATE_CUBE_GROUP_, _REMOVE_BASELINE_THROUGH_SMOOTHING_, _CREATE_MOMENTS_MAPS_THROUGH_SMOOTHING_, _RECREATE_MASKED_TIMESERIES_, _REMOVE_BASELINE_MASKED_TIMESERIES_, _CREATE_CUBE_FRAME_FROM_GROUP_
Back to top
Contact: Per Friberg. Updated: Fri Jan 9 16:17:53 HST 2009

Return to top ^