Source code for starlink.smurf

"""
Runs commands from the Starlink SMURF package.

Autogenerated from the starlink .hlp and .ifl files,
by starlink-pywrapper/helperscripts/generate_functions.py.

Starlink version: 2018A
b6ca36bf8884802759017298539489d11795861e (2018-07-06 09:36:39)
"""

from . import wrapper


[docs]def badbolos(in_, bad_columns, bad_rows, bad_bolos, **kwargs): """ Generate a map of random dead bolometers and add it as an NDF Runs the command: $SMURF_DIR/badbolos . Arguments --------- `in_` : str Input Simulated NDF File bad_columns : int Number of bad columns of bolometers bad_rows : int Number of bad rows of bolometers bad_bolos : int Number of additional bad individual bolometers Keyword Arguments ----------------- seed : int [!] ard : str Input ARD Description File method : str Bad bolometer generation method [RANDOM] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_BADBOLOS for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/badbolos", "badbolos", in_, bad_columns, bad_rows, bad_bolos, **kwargs)
[docs]def calcdark(in_, out, **kwargs): """ Calculate the 2d dark frame from dark observation. Runs the command: $SMURF_DIR/calcdark . Arguments --------- `in_` : str,filename Input dark timeseries out : str,filename Processed darks Keyword Arguments ----------------- bbm : str,filename Bad bolometer masks [!] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_CALCDARK for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/calcdark", "calcdark", in_, out, **kwargs)
[docs]def calcflat(in_, out, **kwargs): """ Calculate a flatfield solution from a flatfield observation. Runs the command: $SMURF_DIR/calcflat . Arguments --------- `in_` : str,filename Input flatfield files out : str,filename Processed flatfield file Keyword Arguments ----------------- resist : str Heater resistance information [$STARLINK_DIR/share/smurf/resist.cfg] method : str Flatfield calculation method [POLYNOMIAL] order : int Order of polynomial to use for flatfield fitting [1] resp : str,filename Responsivity map [!] respmask : bool Mask bolometers with bad responsivity? [TRUE] snrmin : float Signal-to-noise threshold for responsivity data [3.0] Returns ------- ngood : int Number of good responsivities Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_CALCFLAT for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/calcflat", "calcflat", in_, out, **kwargs)
[docs]def calcnoise(in_, out, **kwargs): """ Calculate noise image Runs the command: $SMURF_DIR/calcnoise . Arguments --------- `in_` : str,filename Input files containing flatfield parameters out : str,filename Noise images Keyword Arguments ----------------- config : str Configuration parameters for cleaning [current value] flatmeth : str Flatfield calculation method [POLYNOMIAL] flatorder : int Order of polynomial to use for flatfield fitting [1] flatsnr : float Signal-to-noise threshold for responsivity data [3.0] flatusenext : bool Should we compare with following flatfield? [!] flow : float Frequency to use for noise ratio image [0.5] freq : float Frequency limits for white noise calculation [2,10] nepcliphigh : float Clip NEP values this many standard deviations above median [!] nepcliplog : bool Clip based on log of the NEP [TRUE] nepcliplow : float Clip NEP values this many standard deviations below median [3] noicliphigh : float Clip NOISE values this many standard deviations above median [!] noicliplog : bool Clip based on log of the NOISE [TRUE] noicliplow : float Clip NOISE values this many standard deviations below median [3] outfiles : str Text file in which to put the output NDF names [!] power : str,filename Power spectra files [!] resist : str Heater resistance information [$STARLINK_DIR/share/smurf/resist.cfg] respmask : bool Mask bolometers with bad responsivity? [TRUE] tseries : str,filename Cleaned time-series files [!] Returns ------- effnep : float Effective NEP of subarray effnoise : float Effective noise of subarray nepgoodbol : int Number of bolometers with good NEP measurements noisegoodbol : int Number of bolometers with good NOISE measurements Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_CALCNOISE for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/calcnoise", "calcnoise", in_, out, **kwargs)
[docs]def calcqu(in_, outq, outu, **kwargs): """ Calculate Q and U images from a set of time-series data files. Runs the command: $SMURF_DIR/calcqu . Arguments --------- `in_` : str,filename Input NDF data structure outq : str,filename Output Q NDFs outu : str,filename Output U NDFs Keyword Arguments ----------------- arcerror : float Max spatial shift in one time-slice block (arc-secs) [dyn.] config : str Configuration parameters [!] fix : bool Fix triggering issue? [FALSE] flatmeth : str Flatfield calculation method [POLYNOMIAL] flatorder : int Order of polynomial to use for flatfield fitting [1] flatsnr : float Signal-to-noise threshold for responsivity data [3.0] flatusenext : bool Should we compare with following flatfield? [!] harmonic : int The half-wave plate harmonic to use [4] lsqfit : bool Use least-squares method? [FALSE] maxsize : int Max no. of time slices in one block (0=no limit) [0] minsize : int Min no. of time slices in one block [200] north : str System to use as the reference direction ["TRACKING"] outf : str,filename Output fitted data NDFs [!] outfilesi : str New text file holding list of output I NDFs [!] outfilesq : str New text file holding list of output Q NDFs [!] outfilesu : str New text file holding list of output U NDFs [!] outi : str,filename Output I NDFs [!] resist : str Heater resistance information [$STARLINK_DIR/share/smurf/resist.cfg] respmask : bool Mask bolometers with bad responsivity? [TRUE] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_CALCQU for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/calcqu", "calcqu", in_, outq, outu, **kwargs)
[docs]def calcresp(in_, out, **kwargs): """ Calculate bolometer responsivity from stored flatfield solution. Runs the command: $SMURF_DIR/calcresp . Arguments --------- `in_` : str,filename Input files containing flatfield parameters out : str,filename Responsivity images Keyword Arguments ----------------- resist : str Heater resistance information [$STARLINK_DIR/share/smurf/resist.cfg] Returns ------- ngood : List[int] Number of good responsivities in each file Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_CALCRESP for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/calcresp", "calcresp", in_, out, **kwargs)
[docs]def checkcoords(in_, **kwargs): """ Check for discrepancies between AZEL and TRACKING coordinates. Runs the command: $SMURF_DIR/checkcoords . Arguments --------- `in_` : str,filename Input timeseries Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_CHECKCOORDS for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/checkcoords", "checkcoords", in_, **kwargs)
[docs]def configmeld(*args, **kwargs): """ Compare two MAKEMAP configs using a visual file comparison tool. Runs the command: $SMURF_DIR/configmeld.py . Keyword Arguments ----------------- config1 : The first configuration. This can be a normal config such as is supplied for the CONFIG parameter of MAKEMAP, or an NDF created by MAKEMAP. config2 : The first configuration. This can be a normal config such as is supplied for the CONFIG parameter of MAKEMAP, or an NDF created by MAKEMAP. If a value is supplied for PARAM, then CONFIG2 defaults to null (!). defaults : If TRUE, then each supplied configuration (CONFIG1 and CONFIG2) is extended to include default values are any MAKEMAP parameters that it does not specify. These defaults are read from file "$SMURF_DIR/smurf_makemap.def". [TRUE] param : If supplied, then the value used for the specified parameter is displayed on standard output, and no visual comparison is displayed. Separate values are displayed for CONFIG1 and (if supplied) CONFIG2. [!] tool : Gives the name of the file comparison tool to use. The named command should be available on the current PATH. It should take the names of two files to compare as command line arguments. If null (!) is supplied, the first available tool in the following list is used: - meld: www.meldmerge.org - opendiff: developer.apple.com - diffmerge: www.sourcegear.com/diffmerge - kdiff3: kdiff3.sourceforge.net - tkdiff: sourceforge.net/projects/tkdiff - diffuse: diffuse.sourceforge.net [!] waveband : This parameter is not used if either CONFIG1 or CONFIG2 is an NDF created by MAKEMAP. It should be one of "450" or "850". It specifies which value should be displayed for configuration parameters that have separate values for 450 and 850 um. If either CONFIG1 or CONFIG2 is an NDF created by MAKEMAP, then the wavebands to use are determined from the headers in the NDFs. Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_CONFIGMELD for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/configmeld.py", "configmeld", *args, **kwargs)
[docs]def copyflat(ref, in_, **kwargs): """ Copy the flatfield information from a reference file Runs the command: $SMURF_DIR/copyflat . Arguments --------- ref : str,filename Input file containing flatfield parameters to copy `in_` : str,filename Files to receive the updated flatfield information Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_COPYFLAT for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/copyflat", "copyflat", ref, in_, **kwargs)
[docs]def dreamsolve(in_, out, **kwargs): """ Solve DREAM observations and generate 2-D images. Runs the command: $SMURF_DIR/dreamsolve . Arguments --------- `in_` : str,filename Input data file out : str,filename Output data file Keyword Arguments ----------------- flatmeth : str Flatfield calculation method [POLYNOMIAL] flatorder : int Order of polynomial to use for flatfield fitting [1] flatsnr : float Signal-to-noise threshold for responsivity data [3.0] flatusenext : bool Should we compare with following flatfield? [!] resist : str Heater resistance information [^$STARLINK_DIR/share/smurf/resist.cfg] respmask : bool Mask bolometers with bad responsivity? [TRUE] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_DREAMSOLVE for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/dreamsolve", "dreamsolve", in_, out, **kwargs)
[docs]def dreamweights(ndf, out, config, **kwargs): """ Generate DREAM weights matrix. Runs the command: $SMURF_DIR/dreamweights . Arguments --------- ndf : str,filename Input raw data file out : str,filename Output weights file config : str DREAM reconstruction parameters [current value] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_DREAMWEIGHTS for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/dreamweights", "dreamweights", ndf, out, config, **kwargs)
[docs]def dsutils(in_, **kwargs): """ A collection of utilities for estimating focal plane distortion. Runs the command: $SMURF_DIR/dsutils . Arguments --------- `in_` : str,filename Input time series cube Keyword Arguments ----------------- bmap : str File in which to put focal plane pixel to sky mapping [!] border : int Width of border to exclude form each time slice (in pixels) [4] colname : str Name of a columne to write to an output NDF [!] colndf : str,filename Output NDF for values read from COLNAME column forward : bool Produce code for forward transformation? [TRUE] fpixsize : float Pixel size in focal plane units (mm) [1.0] fxhi : float Upper focal plane X limit, in mm [50] fxlo : float Lower focal plane X limit, in mm [-50] fxoff : float Focal plane X value at ref point, in mm [!] fyhi : float Upper focal plane Y limit, in mm [50] fylo : float Lower focal plane Y limit, in mm [-50] fyoff : float Focal plane Y value at ref point, in mm [!] incat : str Name of input catalogue text file [!] infitx : str,filename NDF containing polynomial fit for X distortion [!] infity : str,filename NDF containing polynomial fit for Y distortion [!] itime : int Index of time slice to dump to an output NDF [!] lowfactor : float Factor for lowest usable data sum [0.5] niter : int Number of sigma clips [3] outang : str,filename Output NDF holding focal-plane distortion angles outcat : str Name of output catalogue text file outcode : str Name of output C source file outdx : str,filename Output NDF holding focal-plane X offsets outdy : str,filename Output NDF holding focal-plane Y offsets outfx : str,filename Output NDF holding focal-plane X coords [!] outfy : str,filename Output NDF holding focal-plane Y coords [!] outmag : str,filename Output NDF holding focal-plane distortion magnitudes [!] outslice : str,filename Output NDF holding time slice data radius : float Radius of test circle (in bolometers) [!] subarray : str SCUBA-2 sub-array name [s8d] xbol : int X GRID index of test bolometer [!] ybol : int Y GRID index of test bolometer [!] zbox : int Smoothing box for timeslice data (in slices) [!] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_DSUTILS for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/dsutils", "dsutils", in_, **kwargs)
[docs]def extinction(in_, out, **kwargs): """ Extinction correct SCUBA-2 data. Runs the command: $SMURF_DIR/extinction . Arguments --------- `in_` : str,filename Input NDF data structure out : str,filename Output NDF data structure Keyword Arguments ----------------- tausrc : str Source of opacity data [AUTO] method : str Method to use for airmass calculation [ADAPTIVE] bbm : str,filename Bad bolometer masks [!] csotau : float Zenith optical depth at 225 GHz filtertau : float Zenith optical depth for current filter flatmeth : str Flatfield calculation method [POLYNOMIAL] flatorder : int Order of polynomial to use for flatfield fitting [1] flatsnr : float Signal-to-noise threshold for responsivity data [3.0] flatusenext : bool Should we compare with following flatfield? [!] hasskyrem : bool Has sky removal been applied? [FALSE] outfiles : str Text file in which to put the output NDF names [!] resist : str Heater resistance information [$STARLINK_DIR/share/smurf/resist.cfg] respmask : bool Mask bolometers with bad responsivity? [TRUE] taurel : str Group containing tau relationships [!] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_EXTINCTION for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/extinction", "extinction", in_, out, **kwargs)
[docs]def findslices(in_, xpos, ypos, **kwargs): """ Find time slices that are centred close to a given sky position. Runs the command: $SMURF_DIR/findslices . Arguments --------- `in_` : str,filename NDFs containing time-series data xpos : str X position at search centre ypos : str Y position at search centre Keyword Arguments ----------------- radius : float Radius of search circle in arc-sec [300] frame : str,filename NDF defining coordinate frame [!] closest : bool Display only closest time slices? [TRUE] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FINDSLICES for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/findslices", "findslices", in_, xpos, ypos, **kwargs)
[docs]def fit1d(in_, out, rms, **kwargs): """ Fit 1-D profiles to a data cube Runs the command: $SMURF_DIR/fit1d . Arguments --------- `in_` : str,filename NDF with profiles to be fitted out : str,filename NDF for fitted profiles rms : float RMS in cube [data units] Keyword Arguments ----------------- config : str Config file with fit parameters [!] userval : str File with user values for parameters [!] pardir : str Directory with component parameter files [!] parndf : str Input NDF with component parameter files [!] parcomp : str Component parameter files files [!] outfiles : str Text file in which to put the output NDF names [!] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FIT1D for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fit1d", "fit1d", in_, out, rms, **kwargs)
[docs]def fitsmerge(in_, ndf, **kwargs): """ Merge FITS headers. Runs the command: $SMURF_DIR/fitsmerge . Arguments --------- `in_` : str,filename Files containing input FITS headers ndf : str,filename File to receive merged FITS headers Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FITSMERGE for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fitsmerge", "fitsmerge", in_, ndf, **kwargs)
[docs]def fixsteps(in_, out, **kwargs): """ Fix DC steps in a supplied SCUBA-2 time series NDF. Runs the command: $SMURF_DIR/fixsteps . Arguments --------- `in_` : str,filename Input timeseries out : str,filename Cleaned timeseries Keyword Arguments ----------------- config : str Cleaning parameters [!] `continue_` : bool Continue to report further changes? [YES] dcfitbox : int Number of samples in fitting box [dyn.] dclimcorr : int Threshold for correction of correlated steps [dyn.] dcmaxsteps : int Max. no. of steps before bolo is flagged as bad [dyn.] dcsmooth : int Width of median filter used to smooth data [dyn.] dcthresh : float Threshold signal to noise ratio to detect and flag steps [dyn.] first : int Index of first changed step to report [1] meanshift : bool Use a mean-shift filter before fixing steps? [FALSE] newsteps : str Name of output text file holding new step descriptions [!] oldsteps : str Name of input text file holding old step descriptions [!] outfiles : str Text file in which to put the output NDF names [!] sizetol : float Minimum significant relative error in step height [0.05] Returns ------- changed : bool Were and significant changes found? nfixed : int Number of fixed steps nrejected : int Number of rejected bolometers Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FIXSTEPS for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fixsteps", "fixsteps", in_, out, **kwargs)
[docs]def flatfield(in_, out, **kwargs): """ Flatfield SCUBA-2 data Runs the command: $SMURF_DIR/flatfield . Arguments --------- `in_` : str,filename Input timeseries out : str,filename Flatfielded timeseries Keyword Arguments ----------------- bbm : str,filename Bad bolometer masks [!] flatmeth : str Flatfield calculation method [POLYNOMIAL] flatorder : int Order of polynomial to use for flatfield fitting [1] flatsnr : float Signal-to-noise threshold for responsivity data [3.0] flatusenext : bool Should we compare with following flatfield? [!] outfiles : str Text file in which to put the output NDF names [!] resist : str Heater resistance information [$STARLINK_DIR/share/smurf/resist.cfg] respmask : bool Mask bolometers with bad responsivity? [TRUE] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FLATFIELD for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/flatfield", "flatfield", in_, out, **kwargs)
[docs]def fts2deglitch(in_, out, **kwargs): """ Removes the glitches from the source. Runs the command: $SMURF_DIR/fts2deglitch . Arguments --------- `in_` : str,filename Input data files out : str,filename Output data files Keyword Arguments ----------------- ccsize : int Core cluster size [20] deglitchmode : int Deglitching mode: 1=CORE, 2=TAIL and 0=ALL [0] dshalflength : int Double-sided interferogrm half-length [500] tcsigma : float Tail cutoff standard deviation as percentage [0.80] tcsigmamul : float Tail cutoff standard deviation multiplier [4] tcsize : int Tail cluster size [60] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FTS2DEGLITCH for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fts2deglitch", "fts2deglitch", in_, out, **kwargs)
[docs]def fts2flatfield(in_, out, **kwargs): """ Corrects for the pixel-to-pixel variation in spectral responsivity, Runs the command: $SMURF_DIR/fts2flatfield . Arguments --------- `in_` : str,filename Input data files out : str,filename Output data files Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FTS2FLATFIELD for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fts2flatfield", "fts2flatfield", in_, out, **kwargs)
[docs]def fts2freqcorr(in_, out, theta, **kwargs): """ Off-Axis frequency correction. Runs the command: $SMURF_DIR/fts2freqcorr . Arguments --------- `in_` : str,filename Input data files out : str,filename Output data files theta : str,filename Theta file storing the off-axis angles Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FTS2FREQCORR for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fts2freqcorr", "fts2freqcorr", in_, out, theta, **kwargs)
[docs]def fts2gaia(*args, **kwargs): """ Display in-band FTS-2 spectrum in gaia Runs the command: $SMURF_DIR/fts2gaia.py . Keyword Arguments ----------------- `in_` : The NDF FTS-2 spectrum file to be displayed. Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FTS2GAIA for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fts2gaia.py", "fts2gaia", *args, **kwargs)
[docs]def fts2init(in_, out, zpd, **kwargs): """ Prepares the input to be processed by the FTS2 Data Reduction tasks Runs the command: $SMURF_DIR/fts2init . Arguments --------- `in_` : str,filename Input data files out : str,filename Output data files zpd : str,filename ZPD calibration file Keyword Arguments ----------------- centre : float Moving mirror position at centre of travel (mm) [225.0] fnyquist : float Override the default Nyquist frequency [0] rtsdelay : float RTS delay (ms) [0.0] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FTS2INIT for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fts2init", "fts2init", in_, out, zpd, **kwargs)
[docs]def fts2maskmap(in_, out, ftsport, **kwargs): """ Mask time series data for a SCUBA-2 map with FTS-2 in the beam. Runs the command: $SMURF_DIR/fts2maskmap . Arguments --------- `in_` : str,filename Input time series cubes out : str,filename Output time series cubes ftsport : str FTS-2 port: tracking or image [TRACKING] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FTS2MASKMAP for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fts2maskmap", "fts2maskmap", in_, out, ftsport, **kwargs)
[docs]def fts2opcorr(in_, out, **kwargs): """ Compansates for the effect of the FTS-2 optics on image distortion and Runs the command: $SMURF_DIR/fts2opcorr . Arguments --------- `in_` : str,filename Input data files out : str,filename Output data files Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FTS2OPCORR for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fts2opcorr", "fts2opcorr", in_, out, **kwargs)
[docs]def fts2phasecorr(in_, out, **kwargs): """ Given a 3D data cube of single-sided interferograms, applies phase Runs the command: $SMURF_DIR/fts2phasecorr . Arguments --------- `in_` : str,filename Input data files out : str,filename Output data files Keyword Arguments ----------------- apodization : int Apodization method [0] degree : int Fitting polynomial degree [1] dshalflength : int Double-sided interferogram half-length [512] pcfhalflength : int Phase correction function half-length [128] wnlbound : float The lower bound of the wavenumber range [0] wnubound : float The upper bound of the wavenumber range [0] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FTS2PHASECORR for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fts2phasecorr", "fts2phasecorr", in_, out, **kwargs)
[docs]def fts2phasecorrds(in_, out, **kwargs): """ Given a 3D data cube of double-sided interferograms, applies phase Runs the command: $SMURF_DIR/fts2phasecorrds . Arguments --------- `in_` : str,filename Input data files out : str,filename Output data files Keyword Arguments ----------------- degree : int Fitting polynomial degree [1] wnlbound : float The lower bound of the wavenumber range [0] wnubound : float The upper bound of the wavenumber range [0] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FTS2PHASECORRDS for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fts2phasecorrds", "fts2phasecorrds", in_, out, **kwargs)
[docs]def fts2portimbal(in_, out, **kwargs): """ Corrects for atmospheric transmission across the spectral dimension. Runs the command: $SMURF_DIR/fts2portimbal . Arguments --------- `in_` : str,filename Input data files out : str,filename Output data files Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FTS2PORTIMBAL for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fts2portimbal", "fts2portimbal", in_, out, **kwargs)
[docs]def fts2removebse(in_, out, bse, **kwargs): """ Removes the Beam splitter Self Emission (BSE) from the source. Runs the command: $SMURF_DIR/fts2removebse . Arguments --------- `in_` : str,filename Input data files out : str,filename Output data files bse : str,filename Beamsplitter self emission file Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FTS2REMOVEBSE for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fts2removebse", "fts2removebse", in_, out, bse, **kwargs)
[docs]def fts2spectrum(in_, out, sfp, **kwargs): """ Computes the spectrum of the interferograms. Runs the command: $SMURF_DIR/fts2spectrum . Arguments --------- `in_` : str,filename Input data files out : str,filename Output data files sfp : str,filename SFP calibration file [!] Keyword Arguments ----------------- resolution : float Spectral Resolution: [0.0] wnsfpfirst : float Spectral Filter Profile Wave Number range starting from [0.0] wnsfplast : float Spectral Filter Profile Wave Number range ending with [0.0] zeropad : int Zero padding [1] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FTS2SPECTRUM for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fts2spectrum", "fts2spectrum", in_, out, sfp, **kwargs)
[docs]def fts2split(in_, out, **kwargs): """ Convert multi scan NDFs for use in FTS-2 data reduction pipeline Runs the command: $SMURF_DIR/fts2split . Arguments --------- `in_` : str,filename Input data files out : str,filename Output data files Keyword Arguments ----------------- bandpass : float Distance to extract on either side of centre (mm) [0.0] outfiles : str Text file in which to put the output NDF names [!] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FTS2SPLIT for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fts2split", "fts2split", in_, out, **kwargs)
[docs]def fts2transcorr(in_, out, tau, **kwargs): """ Corrects for atmospheric transmission across the spectral dimension. Runs the command: $SMURF_DIR/fts2transcorr . Arguments --------- `in_` : str,filename Input data files out : str,filename Output data files tau : str,filename Atmospheric transmission calibration file Keyword Arguments ----------------- debug : bool If debug, does NOT include dry component! [FALSE] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_FTS2TRANSCORR for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/fts2transcorr", "fts2transcorr", in_, out, tau, **kwargs)
[docs]def gsd2acsis(in_, directory, **kwargs): """ Convert a GSD format DAS data file to an ACSIS format NDF. Runs the command: $SMURF_DIR/gsd2acsis . Arguments --------- `in_` : str Input DAS or AOSC GSD File directory : str Output Directory Returns ------- obsnum : int Observation Number Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_GSD2ACSIS for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/gsd2acsis", "gsd2acsis", in_, directory, **kwargs)
[docs]def gsdshow(in_, **kwargs): """ Display the contents of headers and arrays for GSD files. Runs the command: $SMURF_DIR/gsdshow . Arguments --------- `in_` : str Input DAS or AOSC GSD File Keyword Arguments ----------------- descriptions : bool Show descriptions? [FALSE] showdata : bool Print out data array? [FALSE] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_GSDSHOW for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/gsdshow", "gsdshow", in_, **kwargs)
[docs]def impaztec(in_, out, **kwargs): """ Import AzTEC NetCDF files and produce SCUBA-2 ICD-compliant files Runs the command: $SMURF_DIR/impaztec . Arguments --------- `in_` : str Input AzTEC NETCDF File out : str Output NDF file Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_IMPAZTEC for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/impaztec", "impaztec", in_, out, **kwargs)
[docs]def jsadicer(in_, **kwargs): """ Dice an image or cube into JSA tiles Runs the command: $SMURF_DIR/jsadicer . Arguments --------- `in_` : str,filename Input map or cube Keyword Arguments ----------------- instrument : str JCMT instrument [dyn.] outfiles : str Text file in which to put the output NDF names [!] proj : str JSA projection ["HPX"] trim : int How to trim the output NDFs [2] Returns ------- jsatilelist : List[int] ntile : int out : str Basename for output NDFs Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_JSADICER for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/jsadicer", "jsadicer", in_, **kwargs)
[docs]def jsajoin(*args, **kwargs): """ Create a single tangent-plane NDF from a set of JSA tiles. Runs the command: $SMURF_DIR/jsajoin.py . Keyword Arguments ----------------- centre1 : The formatted RA or Galactic longitude at the centre of a circle that defines the required extent of the output NDF. See also CENTRE2 and RADIUS. The coordinate system is specified by parameter SYSTEM. It is only accessed if a null (!) value is supplied for parameter REGION. If a null value is supplied for both CENTRE1 and REGION, the output NDF will encompass all the data specified by parameter TILES. [!] centre2 : The formatted Dec or Galactic latitude at the centre of a circle that defines the required extent of the output NDF. See also CENTRE1 and RADIUS. The coordinate system is specified by parameter SYSTEM. It is only accessed if a null (!) value is supplied for parameter REGION and a non-null value is supplied for parameter CENTRE1. instrument : Selects the tiling scheme to be used. The following instrument names are recognised (unambiguous abbreviations may be supplied): "SCUBA-2(450)", "SCUBA-2(850)", "ACSIS", "DAS". If the first input NDF contains JCMT data, the default value for this parameter is determined from the FITS headers in the input NDF. Otherwise, there is no default and an explicit value must be supplied. out : The output NDF. pixsize : The pixel size to use for the output NDF, in arc-seconds. Not used if an NDF is supplied for parameter REGION. If a null (!) value is supplied, a default pixel size is used equal to the geometric mean of the pixel dimensions in the middle tile specified by parameter TILES. [!] radius : The radius of the circle that defines the required extent of the output NDF, in arc-minutes. See also CENTRE1 and CENTRE2. It is only accessed if a null (!) value is supplied for parameter REGION and a non-null value is supplied for parameter CENTRE1. region : Specifies the required extent of the output NDF. It can be either a text file holding an AST Region description, or an NDF. If it is an NDF, it also defines the WCS and pixel grid of the output NDF. If a null (!) value is supplied, the region is specified using parameter CENTRE1, CENTRE2 and RADIUS. [!] retain : Should the temporary directory containing the intermediate files created by this script be retained? If not, it will be deleted before the script exits. If retained, a message will be displayed at the end specifying the path to the directory. [FALSE] system : The celestial coordinate system used by the CENTRE1 and CENTRE2 parameters. It can be either "ICRS" or "Galactic". The output NDF inherits this same system as its current WCS Frame. ["ICRS"] tiles : A group of NDFs each of which corresponds to a JSA tile. They should all relate to a single instrument. Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_JSAJOIN for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/jsajoin.py", "jsajoin", *args, **kwargs)
[docs]def jsapaster(in_, out, **kwargs): """ Paste several JSA tiles into a single mosaic. Runs the command: $SMURF_DIR/jsapaster . Arguments --------- `in_` : str,filename Input JSA tiles out : str,filename Output mosaic Keyword Arguments ----------------- instrument : str JCMT instrument [dyn.] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_JSAPASTER for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/jsapaster", "jsapaster", in_, out, **kwargs)
[docs]def jsasplit(*args, **kwargs): """ Split a single NDF up into a set of JSA tiles. Runs the command: $SMURF_DIR/jsasplit.py . Keyword Arguments ----------------- glevel : Controls the level of information to write to a text log file. Allowed values are as for "ILEVEL". The log file to create is specified via parameter "LOGFILE". ["ATASK"] ilevel : Controls the level of information displayed on the screen by the script. It can take any of the following values (note, these values are purposefully different to the SUN/104 values to avoid confusion in their effects): - "NONE": No screen output is created - "CRITICAL": Only critical messages are displayed such as warnings. - "PROGRESS": Extra messages indicating script progress are also displayed. - "ATASK": Extra messages are also displayed describing each atask invocation. Lines starting with ">>>" indicate the command name and parameter values, and subsequent lines hold the screen output generated by the command. - "DEBUG": Extra messages are also displayed containing unspecified debugging information. In addition scatter plots showing how each Q and U image compares to the mean Q and U image are displayed at this ILEVEL. In adition, the glevel value can be changed by assigning a new integer value (one of starutil.NONE, starutil.CRITICAL, starutil.PROGRESS, starutil.ATASK or starutil.DEBUG) to the module variable starutil.glevel. ["PROGRESS"] `in_` : The input NDF. instrument : Selects the tiling scheme to be used. The following instrument names are recognised (unambiguous abbreviations may be supplied): "SCUBA-2(450)", "SCUBA-2(850)", "ACSIS", "DAS". If the input NDF contains JCMT data, the default value for this parameter is determined from the FITS headers in the input NDF. Otherwise, there is no default and an explicit value must be supplied. logfile : The name of the log file to create if GLEVEL is not NONE. The default is "<command>.log", where <command> is the name of the executing script (minus any trailing ".py" suffix), and will be created in the current directory. Any file with the same name is over-written. msg_filter : Controls the default level of information reported by Starlink atasks invoked within the executing script. This default can be over-ridden by including a value for the msg_filter parameter within the command string passed to the "invoke" function. The accepted values are the list defined in SUN/104 ("None", "Quiet", "Normal", "Verbose", etc). ["Normal"] out : The basename for the output NDFs. Each output NDF will have a name formed by appending the integer tile index to the supplied basename, preceeded by and underscore. A null (!) value causes the name of the input NDF to be used. retain : Should the temporary directory containing the intermediate files created by this script be retained? If not, it will be deleted before the script exits. If retained, a message will be displayed at the end specifying the path to the directory. [FALSE] trim : A zero or negative value results in each output NDF covering the full area of the corresponding JSAtile. A value of one results in each output NDF being cropped to the bounds of the supplied NDF. A value of two or more results in each output NDF being cropped to remove any blank borders. [2] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_JSASPLIT for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/jsasplit.py", "jsasplit", *args, **kwargs)
[docs]def jsatileinfo(itile, **kwargs): """ Return information about a specified sky tile. Runs the command: $SMURF_DIR/jsatileinfo . Arguments --------- itile : int Zero-based tile index Keyword Arguments ----------------- instrument : str JCMT instrument [dyn.] create : bool Create tile NDF if it does not already exist? [FALSE] region : str File to receive an AST Region for the tile [!] header : str File to receive a FITS header for the tile [!] allsky : str,filename Output NDF containing all-sky tile indices [!] local : bool Put the reference point at the centre of the tile? [FALSE] proj : str JSA projection ["HPX"] target : str The target Region or NDF [!] Returns ------- deccen : float exists : bool lbnd : List[int] maxtile : int racen : float size : float tilendf : str tlbnd : List[int] tubnd : List[int] ubnd : List[int] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_JSATILEINFO for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/jsatileinfo", "jsatileinfo", itile, **kwargs)
[docs]def jsatilelist(in_, **kwargs): """ List the sky tiles that overlap a given set of data files or an Runs the command: $SMURF_DIR/jsatilelist . Arguments --------- `in_` : str,filename Input Region or NDF Keyword Arguments ----------------- instrument : str JCMT instrument [dyn.] vertex_dec : List[float] ICRS Dec at vertices (deg.s) vertex_ra : List[float] ICRS RA at vertices (deg.s) Returns ------- proj : str tiles : List[int] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_JSATILELIST for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/jsatilelist", "jsatilelist", in_, **kwargs)
[docs]def jsatilemoc(*args, **kwargs): """ Create an image MOC based on a JSA tile. Runs the command: $SMURF_DIR/jsatilemoc.py . Keyword Arguments ----------------- `in_` : An NDF (or FITS) file containing a JSA tile. It must have a TILENUM header indicating the JSA tile number accompanied by a comment including the HEALPix Nside value. The JSA tile must not have been trimmed. It could either be created with the trimming options disabled, or be untrimmed using the UNTRIM_JSA_TILES PICARD recipe. maxorder : The maximum HEALPix order to be included in the MOC. [29] out : The output MOC FITS file name. Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_JSATILEMOC for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/jsatilemoc.py", "jsatilemoc", *args, **kwargs)
[docs]def makecube(in_, out, **kwargs): """ Regrid ACSIS spectra into a data cube. Runs the command: $SMURF_DIR/makecube . Arguments --------- `in_` : str,filename Input NDF data structure out : str,filename Output NDF data structure Keyword Arguments ----------------- pixsize : List[float] Output pixel size(s) for spatial part of map (arcsec) [dyn.] system : str Celestial coord system for output cube [TRACKING] alignsys : bool Align data in the output spatial co-ordinate system? [FALSE] autogrid : bool Determine projection parameters automatically? [FALSE] badmask : str Scheme for determining the output bad bolometer mask ["OR"] catepoch : float Output catalogue epoch catframe : str Output catalogue coordinate Frame [!] crota : float Position angle of second pixel axis in output (degs) [dyn.] detectors : str Names of detectors to be included [!] extracols : str JCMTState items to include in output catalogue [!] genvar : str Method for calculating output variances ["Tsys"] inweight : bool Weight input spectra when combining them? [TRUE] jsatiles : bool Create the cube as a set of JSA tiles? [FALSE] lbnd : List[int] Lower pixel index bounds for output spatial axes [dyn.] outcat : str Output positions list [!] outfiles : str Text file in which to put the output NDF names [!] params : List[float] Auxiliary rebinning parameters polbinsize : float Angular size of analyser angle bins (degs) [!] polbinzero : float Angle at centre of first polarisation bin (degs) [0] poserrfatal : bool Report error if RECEPPOS and FPLANEX/Y disagree? [FALSE] poserrmax : float Max error between RECEPPOS and FPLANEX/Y (arcsec) [3.0] ref : str,filename Reference NDF [!] reflat : str Celestial latitude at output reference point [dyn.] reflon : str Celestial longitude at output reference point [dyn.] refpix1 : float X pixel coord at output reference point [!] refpix2 : float Y pixel coord at output reference point [!] sparse : bool Create a sparse output array? [dyn.] specbounds : str Low and high bounds for output spectral axis [dyn.] specunion : bool Use union of input spectral ranges as default for SPECBOUNDS? [FALSE] spread : str Pixel spreading method ["Nearest"] tileborder : int Width of tile overlap in pixels [0] tiledims : List[int] Output tile dimensions in pixels [!] trim : bool Trim the output cube to excluded unused detectors? [TRUE] trimtiles : bool Trim the output tiles? [FALSE] ubnd : List[int] Upper pixel index bounds for output spatial axes [dyn.] usedetpos : bool Read detector positions from the input NDF? [TRUE] weights : bool Save pixel weights in the output NDF? [FALSE] Returns ------- fbl : List[float] fbr : List[float] flbnd : List[float] ftl : List[float] ftr : List[float] fubnd : List[float] jsatilelist : List[int] lbound : List[int] npolbin : int ntile : int pixref : List[float] ubound : List[int] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_MAKECUBE for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/makecube", "makecube", in_, out, **kwargs)
[docs]def makemap(in_, out, **kwargs): """ Make a map from SCUBA-2 data Runs the command: $SMURF_DIR/makemap . Arguments --------- `in_` : str,filename Input NDF data structure out : str,filename Output NDF data structure Keyword Arguments ----------------- pixsize : List[float] Output pixel size(s) for the map (arcsec) [dyn.] system : str Celestial coord system for output cube [TRACKING] abortsoon : bool Abort as soon as convergence seems unlikely? [FALSE] alignsys : bool Align data in the output spatial co-ordinate system? [FALSE] bbm : str,filename Bad bolometer masks [!] config : str Map-maker tuning parameters [current value] crota : float Position angle of second pixel axis in output (degs) [dyn.] flatmeth : str Flatfield calculation method [POLYNOMIAL] flatorder : int Order of polynomial to use for flatfield fitting [1] flatsnr : float Signal-to-noise threshold for responsivity data [3.0] flatusenext : bool Should we compare with following flatfield? [!] ftsport : str FTS-2 port: tracking, image or null [!] intoption : int What to do now (1-3) [3] ipref : str Total intensity map for IP calculation [!] itermaps : str The file to receive any itermaps that are requested [!] jsatiles : bool Create the map as a set of JSA tiles? [FALSE] lbnd : List[int] Lower pixel index bounds for output spatial axes [dyn.] mask2 : str,filename Second mask NDF [!] mask3 : str,filename Third mask NDF [!] maxmem : int Maximum memory available for map-making in Mb [dyn.] method : str Map-making method [ITERATE] outfiles : str Text file in which to put the output NDF names [!] params : List[float] Auxiliary rebinning parameters pointing : str Text file containing pointing corrections [!] ref : str,filename Reference NDF [!] reflat : str Celestial latitude at output reference point [dyn.] reflon : str Celestial longitude at output reference point [dyn.] refpix1 : float X pixel coord at output reference point [!] refpix2 : float Y pixel coord at output reference point [!] resist : str Heater resistance information [$STARLINK_DIR/share/smurf/resist.cfg] respmask : bool Mask bolometers with bad responsivity? [TRUE] spread : str Pixel spreading method ["Nearest"] tileborder : int Width of tile overlap in pixels [0] tiledims : List[int] Output tile dimensions in pixels [!] trim : bool Trim bad border from output image? [FALSE] trimtiles : bool Trim the output tiles? [FALSE] ubnd : List[int] Upper pixel index bounds for output spatial axes [dyn.] Returns ------- abortedat : int chunkchange : List[float] fbl : List[float] fbr : List[float] flbnd : List[float] ftl : List[float] ftr : List[float] fubnd : List[float] jsatilelist : List[int] lbound : List[int] nboloeff : float ncontchunk : int nmcnvg : int nminsmp : int ntile : int pixref : float rate_limited : bool Was MAPTOL_RATE limit hit? tausrc : str ubound : List[int] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_MAKEMAP for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/makemap", "makemap", in_, out, **kwargs)
[docs]def nanten2acsis(in_, directory, **kwargs): """ Convert NANTEN2 FITS format data files to an ACSIS format NDF. Runs the command: $SMURF_DIR/nanten2acsis . Arguments --------- `in_` : str Input NANTEN2 FITS Files directory : str Output Directory Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_NANTEN2ACSIS for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/nanten2acsis", "nanten2acsis", in_, directory, **kwargs)
[docs]def pol2check(in_, **kwargs): """ Check if specified NDFs probably hold POL-2 data. Runs the command: $SMURF_DIR/pol2check . Arguments --------- `in_` : str,filename Input NDFs Keyword Arguments ----------------- junkfile : str File in which to put non-POL2 NDF paths [!] mapfile : str File in which to put POL-2 map NDF paths [!] mapinfo : str File in which to put Stokes map NDF information [!] missing : str File in which to put missing raw sub-scans [!] multiobject : bool Allow data for multiple objects? [FALSE] rawfile : str File in which to put raw POL2 time-series NDF paths [!] rawinfo : str File in which to put raw data time-series NDF information [!] stokesfile : str File in which to put Stokes POL2 time-series NDF paths [!] stokesinfo : str File in which to put Stokes time-series NDF information [!] Returns ------- junkfound : bool mapfound : bool rawfound : bool stokesfound : bool Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_POL2CHECK for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/pol2check", "pol2check", in_, **kwargs)
[docs]def pol2ip(*args, **kwargs): """ Create an Instrumental Polarisation (IP) model from a set of POL2 Runs the command: $SMURF_DIR/pol2ip.py . Keyword Arguments ----------------- diam : The diameter of the circle (in arc-seconds), centred on the source, over which the mean Q, U and I values are found. If zero, or a negative value, is supplied, the fit is based on the weighted mean values within the source, where the spatial weiging function is a fitted beam shape determined using kappa:beamfit. In this case, a text file called "beamfit.asc" is created in the current directory. This is a table containg columns of the geometric properties of the polarised intensity beam in each observation. The header for this file contains the parameters of quadratic fits to these properties, which are used within pol2scan. [40] ilevel : Controls the level of information displayed on the screen by the script. It can take any of the following values (note, these values are purposefully different to the SUN/104 values to avoid confusion in their effects): - "NONE": No screen output is created - "CRITICAL": Only critical messages are displayed such as warnings. - "PROGRESS": Extra messages indicating script progress are also displayed. - "ATASK": Extra messages are also displayed describing each atask invocation. Lines starting with ">>>" indicate the command name and parameter values, and subsequent lines hold the screen output generated by the command. - "DEBUG": Extra messages are also displayed containing unspecified debugging information. In addition scatter plots showing how each Q and U image compares to the mean Q and U image are displayed at this ILEVEL. In adition, the glevel value can be changed by assigning a new integer value (one of starutil.NONE, starutil.CRITICAL, starutil.PROGRESS, starutil.ATASK or starutil.DEBUG) to the module variable starutil.glevel. ["PROGRESS"] iref : A 2D NDF holding a map of total intensity (in pW) for the object covered by the observations in OBSLIST. It is assumed that the object is centred at the reference point in the map. The supplied map is resampled to to give it the pixel size specified by parameter PIXSIZE. If a null value(!) is supplied, the total intensity is determined from the POL2 data itself. logfile : The name of the log file to create if GLEVEL is not NONE. The default is "<command>.log", where <command> is the name of the executing script (minus any trailing ".py" suffix), and will be created in the current directory. Any file with the same name is over-written. The script can change the logfile if necessary by assign the new log file path to the module variable "starutil.logfile". Any old log file will be closed befopre the new one is opened. mapdir : Path to a directory containing any pre-existing Q/U/I maps. Each UT date should have a separate subdirectory within "mapdir", and each observation should have a separate subdirectory within its <UT> date subdirectory. Any new Q/U/I maps created by this script are placed in this directory. If null (!) is supplied, the root directory containing the Q/U maps is placed within the temporary directory used to store all other intermediate files. [!] msg_filter : Controls the default level of information reported by Starlink atasks invoked within the executing script. This default can be over-ridden by including a value for the msg_filter parameter within the command string passed to the "invoke" function. The accepted values are the list defined in SUN/104 ("None", "Quiet", "Normal", "Verbose", etc). ["Normal"] obslist : The path to a text file listing the POL2 observations to use. Each line should contain a string of the form "<ut>/<obs>", where <ut> is the 8 digit UT date (e.g. "20151009") and <obs> is the 5 digit observation number (e.g. "00034"). Blank lines and lines starting with "#" are ignored. The raw data for all observations is expected to reside in a directory given by environment variable "SC2", within subdirectories with paths of the form: $SC2/[s4a|s8a]/20150918/00056/ etc. The choice of "s8" or "s4" is made on the basis of parameter WAVEBAND. pixsize : Pixel dimensions in the Q and U maps, in arcsec. The default is 4 arc-sec for 850 um data and 2 arc-sec for 450 um data. qudir : Path to a directory containing any pre-existing Q/U/I time streams. Each UT date should have a separate subdirectory within "qudir", and each observation should have a separate subdirectory within its <UT> date subdirectory. Any new Q/U/I time streams created by this script are placed in this directory. If null (!) is supplied, the root directory containing the Q/U time streams is placed within the temporary directory used to store all other intermediate files. [!] restart : If a value is assigned to this parameter, it should be the path to a directory containing the intermediate files created by a previous run of POL2IP (it is necessry to run POL2IP with RETAIN=YES otherwise the directory is deleted after POL2IP terminates). If supplied, any files which can be re-used from the supplied directory are re-used, thus speeding things up. The path to the intermediate files can be found by examining the log file created by the previous run. [!] retain : Should the temporary directory containing the intermediate files created by this script be retained? If not, it will be deleted before the script exits. If retained, a message will be displayed at the end specifying the path to the directory. [FALSE] table : The path to a new text file to create in which to place a table holding columns of elevation, Q, U, Qfit and Ufit (and various other useful things), in TOPCAT ASCII format. [!] tablein : The path to an existing text file containing a table created by a previous run of this script, using the TABLE parameter. If supplied, none of the other parameters are accessed, and a fit is performed to the values in the supplied table. [!] waveband : Indicates the waveband - "450" or "850". Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_POL2IP for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/pol2ip.py", "pol2ip", *args, **kwargs)
[docs]def pol2map(*args, **kwargs): """ Create Q, U and I maps from a group of POL-2 "spin&scan" data files. Runs the command: $SMURF_DIR/pol2map.py . Keyword Arguments ----------------- binsize : The bin size in the output vector catalogue, in arcsec. The value supplied for parameter PIXSIZE is used as the default for BINSIZE. An error is reported if BINSIZE is smaller than PIXSIZE. cat : The output FITS vector catalogue. No catalogue is created if null (!) is supplied. The Q, U and PI values in this catalogue will be in units of pW or mJy/beam, as selected using parameter JY . The bin size is specified by parameter BINSIZE. [!] config : Extra parameter values to include in the MAKEMAP configuration used to create both the I maps and the Q/U maps. In general, it is important that the I, Q and U maps are all created using the same configuration so that they can be compared directly. However, if it is necessary to use a different configuration for I and Q/U maps, the differences may be specified using the ADAM parameters "ICONFIG" and "QUCONFIG". The ADAM parameter "CONFIG" specifies the configuration parameters that are always used, whether an I map or a Q/U map is being created. In all cases the configuration parameters specified by "CONFIG" are applied first, followed by the configuration parameters specified by "ICONFIG" (if creating an I map) or "QUCONFIG" (if creating a Q or U map). Thus values supplied in "ICONFIG" or "QUCONFIG" over-ride values for the same parameters specified in "CONFIG". The configurations specified by CONFIG, ICONFIG and QUCONFIG are applied on top of the following set of default parameters: --- ^$STARLINK_DIR/share/smurf/.dimmconfig_pol2.lis numiter = -200 modelorder=(com,gai,pca,ext,flt,ast,noi) maptol = 0.05 maptol_mask = <undef> maptol_mean = 0 maptol_box = 60 maptol_hits = 1 ast.mapspike_freeze = 5 pca.pcathresh = -150 pca.zero_niter = 0.5 com.zero_niter = 0.5 flt.zero_niter = 0.5 com.freeze_flags = 30 --- Additional parameters are also set, depending on the value of parameter MASK. If MASK is set to "AUTO", the following parameters are added to the above default config: --- ast.skip = 10 ast.zero_snr = 3 ast.zero_snrlo = 2 ast.zero_freeze = 0.2 pca.pcathresh = -50 pca.zero_snr = 5 pca.zero_snrlo = 3 pca.zero_freeze = -1 com.zero_snr = 5 com.zero_snrlo = 3 com.zero_freeze = -1 flt.zero_snr = 5 flt.zero_snrlo = 3 flt.zero_freeze = -1 --- If MASK is set to "CIRCLE", the following parameters are added to the above default config: --- ast.zero_circle = 0.0083 (degrees, i.e. 30 arc-seconds) pca.zero_circle = 0.0038 com.zero_circle = 0.0083 flt.zero_circle = 0.0083 --- The default value for pca.pcathresh indicated above will be changed if it is too high to allow convergence of the I maps within the number of iterations allowed by numiter (this change only occurs if parameter SKYLOOP is FALSE). If MASK is set to the name of an NDF, this script creates fixed masks from the NDF, and the following parameters are added to the above default config: --- ast.zero_mask = ref pca.zero_mask = mask2 com.zero_mask = mask2 flt.zero_mask = mask2 --- The above "ref" mask consists of clumps of pixel with SNR greater than 3, extended down to an SNR level of 2. The "mask2" mask consists of clumps of pixel with SNR greater than 5, extended down to an SNR level of 3. However, the above SNR levels are raised if necessary to ensure that the source occupies no more than 20% of the pixels within the "ref" mask, and 10% of the pixels within the "mask2" mask. The same configuration is used for all three Stokes parameters - I, Q and U with the exception that "com.noflag=1" is added to the configuration when creating maps for Q and U. If a configuration is supplied using parameter CONFIG, values supplied for any of the above parameters will over-write the values specified above. In addition, the following mandatory values are always appended to the end of the used configuration: --- flagslow = 0.01 downsampscale = 0 noi.usevar=1 --- If null (!) or "def" is supplied, the above set of default configuration parameters are used without change. ["def"] debias : TRUE if a correction for statistical bias is to be made to percentage polarization and polarized intensity in the output vector catalogue specified by parameter CAT. [FALSE] fcf : The FCF value that is used to convert I, Q and U values from pW to Jy/Beam. If a null (!) value is supplied a default value is used that depends on the waveband in use - 725.0 for 850 um and 962.0 for 450 um. [!] glevel : Controls the level of information to write to a text log file. Allowed values are as for "ILEVEL". The log file to create is specified via parameter "LOGFILE. In adition, the glevel value can be changed by assigning a new integer value (one of starutil.NONE, starutil.CRITICAL, starutil.PROGRESS, starutil.ATASK or starutil.DEBUG) to the module variable starutil.glevel. ["ATASK"] iconfig : Extra parameter values to include in the MAKEMAP configuration used to create I maps. The values specified by "ICONFIG" are applied after those specified by "CONFIG". [!] ilevel : Controls the level of information displayed on the screen by the script. It can take any of the following values (note, these values are purposefully different to the SUN/104 values to avoid confusion in their effects): - "NONE": No screen output is created - "CRITICAL": Only critical messages are displayed such as warnings. - "PROGRESS": Extra messages indicating script progress are also displayed. - "ATASK": Extra messages are also displayed describing each atask invocation. Lines starting with ">>>" indicate the command name and parameter values, and subsequent lines hold the screen output generated by the command. - "DEBUG": Extra messages are also displayed containing unspecified debugging information. In adition, the glevel value can be changed by assigning a new integer value (one of starutil.NONE, starutil.CRITICAL, starutil.PROGRESS, starutil.ATASK or starutil.DEBUG) to the module variable starutil.glevel. ["PROGRESS"] `in_` : A group of input files. Each specified file must be one of the following types: - a raw POL-2 data file. Any supplied raw POL-2 data files will be converted into time-series Q,U and I files using SMURF:CALCQU and placed in the directory specified by parameter QUDIR. These will then be converted into maps using SMURF:MAKEMAP, and placed in the directory specified by parameter MAPDIR. - a time-series file holding Stokes Q, U or I values. Any supplied time-series files will be converted into individual maps (one for each file) using SMURF:MAKEMAP, and placed in the directory specified by parameter MAPDIR. These maps are created only for the required Stokes parameters - as indicated by parameters IOUT, QOUT and UOUT. - a two-dimensional map holding Stokes Q, U or I values. Any maps must be in units of pW. The final output I map is created by coadding any supplied I maps with the I maps created by this script. These coadded maps are created only for the required Stokes parameters - as indiciated by parameters IOUT, QOUT and UOUT. Any combination of the above types can be supplied. Note, if parameter REUSE is TRUE, then any required output files that already exist in the directory specified by parameter MAPDIR are re-used rather than being re-created from the corresponding input data. iout : The output NDF in which to return the total intensity (I) map including all supplied observations. This will be in units of pW. Supply null (!) if the I map is not to be retained on exit. In this case, the I map will only be created if it is needed to create the output vector catalogue (see parameter CAT) and will be deleted on exit. ipcor : If TRUE, then IP correction is used when creating Q and U maps, based on the values in the total intensity map specified by parameter IPREF. If FALSE, then no IP correction is performed. The default is TRUE if any Q or U output maps are being created, and FALSE otherwise. ipref : The total intensity map to be used for IP correction. Only accessed if parameter IPCOR is set TRUE. If null (!) is supplied for IPREF, the map supplied for parameter REF is used. The map must be in units of pW. If the same value is supplied for both IOUT and IPREF, the output I map will be used for IP correction. [!] jy : If TRUE, the I, Q and U values in the output catalogue will be in units of mJy/beam. Otherwise they will be in units of pW. Note, the Q, U and I maps are always in units of pW. The same FCF value is used to convert all three Stokes parameters from pW to mJy/beam, derived from the value supplied for parameter FCF. [TRUE] logfile : The name of the log file to create if GLEVEL is not NONE. The default is "<command>.log", where <command> is the name of the executing script (minus any trailing ".py" suffix), and will be created in the current directory. Any file with the same name is over-written. The script can change the logfile if necessary by assign the new log file path to the module variable "starutil.logfile". Any old log file will be closed befopre the new one is opened. mapdir : The name of a directory in which to put the Q, U an I maps made from each individual observation supplied via "IN", before coadding them. If null is supplied, the new maps are placed in the same temporary directory as all the other intermediate files and so will be deleted when the script exists (unless parameter RETAIN is set TRUE). Note, these maps are always in units of pW. Each one will contain FITS headers specifying the pointing corrections needed to align the map with the reference map. [!] mapvar : Determines how the variance information in the final I, Q and U coadded maps (parameters IOUT, QOUT and UOUT) are derived. If MAPVAR is FALSE, the variances in the coadded maps are calculated by propagating the variance information from the individual observation maps. These variances are determined by makemap and are based on the spread of bolometer I, Q or U values that fall in each pixel of the individual observation map. If MAPVAR is TRUE, the variances in the coadded maps are determined from the spread of input values (i.e. the pixel values from the individual observation maps) that fall in each pixel of the coadd. The two methods produce similar variance estimates in the background regions, but MAPDIR=TRUE usually creates much higher on-source errors than MAPDIR=FALSE. Only use MAPDIR=TRUE if you have enough input observations to make the variance between the individual observation maps statistically meaningful. [FALSE] mask : Specifies the type of masking to be used within makemap (the same type of masking is used to create all three maps - I, Q and U): - "AUTO": makemap uses automatically generated masks based on the SNR map at the end of each iteration. The SNR levels used are specified by the "xxx.ZERO_SNR" and "xxx.ZERO_SNRLO" configuration parameters (see parameter CONFIG). - "CIRCLE": makemap uses a fixed circular mask of radius 60 arc-seconds centred on the expected source position. - Any other value is assumed to be a group of one or two NDFs that specify the "external" AST and PCA masks to be used. The way in which these NDFs are used depends on the value of parameter MASKTYPE. These NDFs must be aligned in pixel coordinates with the reference map (parameter REF). ["AUTO"] maskout1 : If a non-null value is supplied for MASKOUT, it specifies the NDF in which to store the AST mask created from the NDF specified by parameter MASK. Only used if an NDF is supplied for parameter MASK. [!] maskout2 : If a non-null value is supplied for MASKOUT, it specifies the NDF in which to store the PCA mask created from the NDF specified by parameter MASK. Only used if an NDF is supplied for parameter MASK. [!] masktype : Specifies the way in which NDFs supplied for parameter MASK are to be used. This parameter can be set to either of the following values: - "Signal": A single NDF should be supplied for parameter MASK holding the astronomical signal level at each pixel within the astronomical field being mapped. It can be in any units, but must have a Variance component. The AST and PCA masks are created from this map by finding all clumps of contiguous pixels above a fixed SNR limit, and then extending these clumps down to a lower SNR limit. For the AST model, the upper and lower SNR limits are of 3.0 and 2.0. For the PCA mask, the limits are 5.0 and 3.0. The AST and PCA masks created in this way can be saved using parameters MASKOUT1 and MASKOUT2. - "Mask": A pair of NDFs should be supplied for parameter MASK, each holding a mask in which background pixels have bad values and source pixels have good values. The first supplied NDF is used directly as the AST mask, and the second is used as the PCA mask. ["Signal"] msg_filter : Controls the default level of information reported by Starlink atasks invoked within the executing script. This default can be over-ridden by including a value for the msg_filter parameter within the command string passed to the "invoke" function. The accepted values are the list defined in SUN/104 ("None", "Quiet", "Normal", "Verbose", etc). ["Normal"] multiobject : Indicates if it is acceptable for the list of input files to include data for multiple objects. If FALSE, an error is reported if data for more than one object is specified by parameter IN. Otherwise, no error is reported if multiple objects are found. [FALSE] newmaps : The name of a text file to create, in which to put the paths of all the new maps written to the directory specified by parameter MAPDIR (one per line). If a null (!) value is supplied no file is created. [!] normalise : If TRUE, scale corrections for individual observations found in any pre-existing auto-masked maps (e.g. made on a previous run of this script) are applied when creating new maps. If False, no scale corrections are applied. Scale correction factors are created and stored at the same time as the pointing corrections. The correction factor for a single observation is found by comparing the data values in the map made from the single observation with those in the mean of the maps made from all observation. The factor found in this way is stored in the FITS extension of the map made from the observation (header "CHUNKFAC"). [FALSE] north : Specifies the celestial coordinate system to use as the reference direction in any newly created Q and U time series files. For instance if NORTH="AZEL", then they use the elevation axis as the reference direction, and if "ICRS" is supplied, they use the ICRS Declination axis. If "TRACKING" is supplied, they use north in the tracking system - what ever that may be. ["TRACKING"] obsweight : This parameter affects how maps from separate observations are weighted when they are combined together to form a coadd. If it is FALSE, each pixel in each map is weighted simply using the reciprocal of the Variance value stored in the map. If it is TRUE, an extra factor is included in the pixel weights that is constant for all pixels in a map but varies from observation to observation. In other words, each observation is assigned a weight, which is used to factor the pixel weights derived from the Variance values. The purpose of this per-observation weight is to down-weight observations that are very different to the other observations and which would therefore contribute to a high Variance if parameter MAPVAR is set TRUE. These weights are proportional to 1/(RMS*RMS), where "RMS" is the RMS residual between an individual observation map and the coadd of all observation maps, after they have been aligned spatially to take account of any pointing error in the individual observation. [FALSE] pixsize : Pixel dimensions in the output I, Q and U maps, in arcsec. The default is 4 arc-sec for both 450 and 850 um data. The bin size for the output catalogue can be specified separately - see parameter BINSIZE and CAT. [4] qout : The output NDF in which to return the Q map including all supplied observations. This will be in units of pW. Supply null (!) if no Q map is required. quconfig : Extra parameter values to include in the MAKEMAP configuration used to create Q and U maps. The values specified by "QUCONFIG" are applied after those specified by "CONFIG". [!] qudir : The name of a directory in which to put the Q, U and I time series generated by SMURF:CALCQU, prior to generating maps from them. If null (!) is supplied, they are placed in the same temporary directory as all the other intermediate files and so will be deleted when the script exists (unless parameter RETAIN is set TRUE). [!] ref : An optional map defining the pixel grid for the output maps, and which is used to determine pointing corrections. If null (!) is supplied, then the map (if any) specified by parameter MASK is used. See also parameter REFFCF. [!] reffcf : The FCF that should be used to convert the supplied REF map to pW. This parameter is only used if the supplied REF map is not already in units of pW. The default is the FCF value stored in the FITS extension of the map, or the standard FCF for the band concerned (450 or 840) if there is no FCF value in the FITS header. Specify a new value on the pol2map command line if the default value described above is inappropriate. retain : Should the temporary directory containing the intermediate files created by this script be retained? If not, it will be deleted before the script exits. If retained, a message will be displayed at the end specifying the path to the directory. [FALSE] reuse : If TRUE, then any output maps or time-treams that already exist (for instance, created by a previous run of this script) are re-used rather than being re-created from the corresponding input files. If FALSE, any previously created output maps or time-streams are ignored and new ones are created from the corresponding input files. [TRUE] skyloop : Should the skyloop script be used in place of makemap to create the maps from the I, Q and U time-series data? Note, when using skyloop it is not possible to add in new observations to an existing collection of I, Q and U maps - all observations must be processed together. Therefore the value supplied for parameter REUSE will be ignored and a value of FALSE assumed if the MAPDIR directory is missing maps for any of the supplied observations. [FALSE] uout : The output NDF in which to return the U map including all supplied observations. This will be in units of pW. Supply null (!) if no U map is required. Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_POL2MAP for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/pol2map.py", "pol2map", *args, **kwargs)
[docs]def pol2scan(*args, **kwargs): """ Create Q and U maps from a set of POL-2 "spin&scan" data Runs the command: $SMURF_DIR/pol2scan.py . Keyword Arguments ----------------- align : If TRUE, and if a non-null value is supplied for parameter REF, then corrections to the telescope pointing are determined and applied when creating the Q and U maps for each observation. To determine this pointing correction for an observation, a total intensity map is created from the raw POL2 data for the observation using the supplied reference map (see parameter REF) to specify the pixel grid. Due to pointing errors, this total intensity map may not be aligned accurately with the reference map (errors of up to 8 arc-seconds have been seen). The positional shift required to minimise the residuals between the shifted total intensity map and the reference map is found, and used to correct the pointing when creating the Q and U map. Note, this option slows down the operation of pol2scan as it requires an extra invocation of smurf:makemap for each observation, to create the total intensity maps (which is not required if ALIGN is FALSE). [TRUE] cat : The output FITS vector catalogue. No catalogue is created if null (!) is supplied. [!] config : The MAKEMAP configuration parameter values to use. If a null value (!) or "def" is supplied, the following defaults will be used: --- ast.zero_snr=3 ast.zero_snrlo=2 maptol=0.05 modelorder=(pca,ext,ast,noi) noisecliphigh=3 numiter=-20 pca.pcathresh=4 spikebox=10 spikethresh=5 --- If a configuration is supplied, it is used in place of the above default configurations. In either case, the following values are always appended to the end of the used config (whether external or defaulted): --- flagslow = 0.01 downsampscale = 0 noi.usevar=1 --- debias : TRUE if a correction for statistical bias is to be made to percentage polarization and polarized intensity in the output vector catalogue specified by parameter CAT and the polarised intensity map specified by parameter PI. [FALSE] glevel : Controls the level of information to write to a text log file. Allowed values are as for "ILEVEL". The log file to create is specified via parameter "LOGFILE. In adition, the glevel value can be changed by assigning a new integer value (one of starutil.NONE, starutil.CRITICAL, starutil.PROGRESS, starutil.ATASK or starutil.DEBUG) to the module variable starutil.glevel. ["ATASK"] ilevel : Controls the level of information displayed on the screen by the script. It can take any of the following values (note, these values are purposefully different to the SUN/104 values to avoid confusion in their effects): - "NONE": No screen output is created - "CRITICAL": Only critical messages are displayed such as warnings. - "PROGRESS": Extra messages indicating script progress are also displayed. - "ATASK": Extra messages are also displayed describing each atask invocation. Lines starting with ">>>" indicate the command name and parameter values, and subsequent lines hold the screen output generated by the command. - "DEBUG": Extra messages are also displayed containing unspecified debugging information. In adition, the glevel value can be changed by assigning a new integer value (one of starutil.NONE, starutil.CRITICAL, starutil.PROGRESS, starutil.ATASK or starutil.DEBUG) to the module variable starutil.glevel. ["PROGRESS"] `in_` : A group of input files. Each specified file must be one of the following types: - a raw POL-2 data file - a time-series file holding Stokes Q, U or I values - a two-dimensional map holding Stokes Q or U values (Q and U maps must be in units of pW). Any combination of the above types can be supplied. ipbeamfix : Should the supplied total intensity reference image (parameter IPREF) be modified so that its beam shape matches the expected IP beam shape at the elevation of each supplied POL2 observation, before doing IP correction? This is currently an experimental feature. [FALSE] ipfcf : The FCF that should be used to convert the supplied IP REF map to pW. This parameter is only used if the supplied IPREF map is not already in units of pW, and if the FCF is not stored in the FITS extension of the map. The suggested default is the standard FCF for the band concerned (450 or 840). Just press return at the prompt to use this default, or enter a new value if the suggested value is not the FCF that was actually used to create the map. ipref : A 2D NDF holding a map of total intensity within the sky area covered by the input POL2 data, in units of pW, mJy/beam, Jy/beam, mJy/arcsec**2, Jy/arcsec**2 ("^" may be used in place of "**"). If supplied, the returned Q and U maps will be corrected for instrumental polarisation, based on the total intensity values in IPREF. The supplied IPREF map need not be pre-aligned with the output Q and U maps - it will be resampled as necessary using a transformation derived from its WCS information. The total intensity values in this map are also used to calculate the percentage polarisation values stored in the output vector catalogue specified by parameter CAT. [!] jy : If TRUE, the output catalogue, and the output maps specified by parameters "Q", "U" and "PI", will be in units of Jy/beam. Otherwise they will be in units of pW (in this case, the I values in the output catalogue will be scaled to take account of the different FCFs for POL-2 and non-POL-2 observations). Note, the Q and U maps made from individual observations (see parameter MAPDIR) are always in units of pW. [True] logfile : The name of the log file to create if GLEVEL is not NONE. The default is "<command>.log", where <command> is the name of the executing script (minus any trailing ".py" suffix), and will be created in the current directory. Any file with the same name is over-written. The script can change the logfile if necessary by assign the new log file path to the module variable "starutil.logfile". Any old log file will be closed befopre the new one is opened. mapdir : The name of a directory in which to put the Q and U maps made from each individual observation supplied via "IN", before coadding them (the QMAP and UMAP parameters specify the final coadded Q and U maps). If null is supplied, they are placed in the same temporary directory as all the other intermediate files and so will be deleted when the scrip exists (unless parameter RETAIN is set TRUE). Note, these maps are always in units of pW. [!] msg_filter : Controls the default level of information reported by Starlink atasks invoked within the executing script. This default can be over-ridden by including a value for the msg_filter parameter within the command string passed to the "invoke" function. The accepted values are the list defined in SUN/104 ("None", "Quiet", "Normal", "Verbose", etc). ["Normal"] north : Specifies the celestial coordinate system to use as the reference direction in any newly created Q and U time series files. For instance if NORTH="AZEL", then they use the elevation axis as the reference direction, and if "ICRS" is supplied, they use the ICRS Declination axis. If "TRACKING" is supplied, they use north in the tracking system - what ever that may be. ["TRACKING"] obstable : The path of a new text file to create, to which will be written statistics describined the Q and U maps for each individual observation present in the list of files specified by parameter IN. No file is created if null (!) is supplied. The values are written in the form of a TOPCAT "ascii" table, with one row for each observation. The columns are: - UT: UT date of observation - OBS: Observation number - SUBSCAN: The first subscan included in the map - WVM: The mean of the starting and ending WVM tau values - NEFD_Q: The measured NEFD in the Q map (mJy.sec^(0.5)) - NEFD_U: The measured NEFD in the U map (mJy.sec^(0.5)) - NEFD_EXP: The expected NEFD based on WVM and elevation (mJy.sec^(0.5)) - TIME: The elapsed time of the data included in the maps (s) - SIZE_Q: The total area of the source regions in the Q map (square arc-mins) - SIZE_U: The total area of the source regions in the U map (square arc-mins) - RMS_Q: The RMS Q value within the source regions (pW) - RMS_U: The RMS U value within the source regions (pW) - NBOLO_Q: Number of bolometers contributing to Q map - NBOLO_U: Number of bolometers contributing to U map - DX: Pointing correction in azimuth (arc-sec) - DY: Pointing correction in elevation (arc-sec) The last two columns (DX and DY) are only created if parameter ALIGN is TRUE. [!] pi : An output NDF in which to return the polarised intensity map. No polarised intensity map will be created if null (!) is supplied. [!] pixsize : Pixel dimensions in the output Q and U maps, in arcsec. The default is 4 arc-sec for 850 um data and 2 arc-sec for 450 um data. q : The output NDF in which to return the total Q intensity map including all supplied observations. qudir : The name of a directory in which to put the Q, U and I time series generated by SMURF:CALCQU. If null (!) is supplied, they are placed in the same temporary direcory as all the other intermediate files. [!] ref : An optional map defining the pixel grid for the output maps. If no value is specified for REF on the command line, it defaults to the value supplied for parameter IPREF. See also parameter ALIGN. retain : Should the temporary directory containing the intermediate files created by this script be retained? If not, it will be deleted before the script exits. If retained, a message will be displayed at the end specifying the path to the directory. [FALSE] u : The output NDF in which to return the total U intensity map including all supplied observations. Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_POL2SCAN for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/pol2scan.py", "pol2scan", *args, **kwargs)
[docs]def pol2stack(*args, **kwargs): """ Combine multiple Q, U and I images and create a vector catalogue Runs the command: $SMURF_DIR/pol2stack.py . Keyword Arguments ----------------- cat : The output FITS vector catalogue. debias : TRUE if a correction for statistical bias is to be made to percentage polarization and polarized intensity. [FALSE] glevel : Controls the level of information to write to a text log file. Allowed values are as for "ILEVEL". The log file to create is specified via parameter "LOGFILE. In adition, the glevel value can be changed by assigning a new integer value (one of starutil.NONE, starutil.CRITICAL, starutil.PROGRESS, starutil.ATASK or starutil.DEBUG) to the module variable starutil.glevel. ["ATASK"] ilevel : Controls the level of information displayed on the screen by the script. It can take any of the following values (note, these values are purposefully different to the SUN/104 values to avoid confusion in their effects): - "NONE": No screen output is created - "CRITICAL": Only critical messages are displayed such as warnings. - "PROGRESS": Extra messages indicating script progress are also displayed. - "ATASK": Extra messages are also displayed describing each atask invocation. Lines starting with ">>>" indicate the command name and parameter values, and subsequent lines hold the screen output generated by the command. - "DEBUG": Extra messages are also displayed containing unspecified debugging information. In addition scatter plots showing how each Q and U image compares to the mean Q and U image are displayed at this ILEVEL. In adition, the glevel value can be changed by assigning a new integer value (one of starutil.NONE, starutil.CRITICAL, starutil.PROGRESS, starutil.ATASK or starutil.DEBUG) to the module variable starutil.glevel. ["PROGRESS"] `in_` : A group of container files, each containing three 2D NDFs in components Q, U and I, as created using the QUI parameter of the pol2cat script. Parameters INQ, INU and INI are used if a null (!) value is supplied for IN. [!] ini : A group of input I maps in units of pW. Only used if a null value is supplied for parameter IN. inq : A group of input Q maps in unts of pW. Only used if a null value is supplied for parameter IN. inu : A group of input U maps in units of pW. Only used if a null value is supplied for parameter IN. jy : If TRUE, the output catalogue, and the output Q, U, PI and I maps will be in units of Jy/beam. Otherwise they will be in units of pW (in this case, the I values will be scaled to take account of any difference in FCFs for POL-2 and non-POL-2 observations). [True] logfile : The name of the log file to create if GLEVEL is not NONE. The default is "<command>.log", where <command> is the name of the executing script (minus any trailing ".py" suffix), and will be created in the current directory. Any file with the same name is over-written. The script can change the logfile if necessary by assign the new log file path to the module variable "starutil.logfile". Any old log file will be closed befopre the new one is opened. msg_filter : Controls the default level of information reported by Starlink atasks invoked within the executing script. This default can be over-ridden by including a value for the msg_filter parameter within the command string passed to the "invoke" function. The accepted values are the list defined in SUN/104 ("None", "Quiet", "Normal", "Verbose", etc). ["Normal"] pi : The output NDF in which to return the polarised intensity map. No polarised intensity map will be created if null (!) is supplied. If a value is supplied for parameter IREF, then PI defaults to null. Otherwise, the user is prompted for a value if none was supplied on the command line. qui : If a value is supplied for QUI, the total Q, U and I images that go into the final polarisation vector catalogue will be saved to disk as a set of three 2D NDFs. The three NDFs are stored in a single container file, with path given by QUI. So for instance if QUI is set to "stokes.sdf", the Q, U and I images can be accessed as "stokes.q", "stokes.u" and "stokes.i". [!] retain : Should the temporary directory containing the intermediate files created by this script be retained? If not, it will be deleted before the script exits. If retained, a message will be displayed at the end specifying the path to the directory. [FALSE] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_POL2STACK for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/pol2stack.py", "pol2stack", *args, **kwargs)
[docs]def qucovar(qres, ures, qlut, ulut, ref, out, **kwargs): """ Find co-variance of Q and U from a POL2 observation. Runs the command: $SMURF_DIR/qucovar . Arguments --------- qres : str,filename Input Q residuals time-stream NDF ures : str,filename Input U residuals time-stream NDF qlut : str,filename Input Q LUT time-stream NDF ulut : str,filename Input U LUT time-stream NDF ref : str,filename Input reference map out : str,filename Output Q/U co-variance map Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_QUCOVAR for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/qucovar", "qucovar", qres, ures, qlut, ulut, ref, out, **kwargs)
[docs]def rawfixmeta(in_, out, **kwargs): """ Fix metadata associated with a raw data file. Runs the command: $SMURF_DIR/rawfixmeta . Arguments --------- `in_` : str,filename Input timeseries out : str,filename Uncompressed timeseries Returns ------- steptime : float Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_RAWFIXMETA for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/rawfixmeta", "rawfixmeta", in_, out, **kwargs)
[docs]def rawpress(in_, out, **kwargs): """ Compress raw data Runs the command: $SMURF_DIR/rawpress . Arguments --------- `in_` : str,filename Input timeseries out : str,filename Compressed timeseries Keyword Arguments ----------------- method : str Compression method [DELTA] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_RAWPRESS for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/rawpress", "rawpress", in_, out, **kwargs)
[docs]def rawrecreatewcs(ndf, **kwargs): """ Fix broken raw ACSIS files by enabling the spectral WCS to be reconstructed Runs the command: $SMURF_DIR/rawrecreatewcs . Arguments --------- ndf : str,filename Input ACSIS timeseries Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_RAWRECREATEWCS for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/rawrecreatewcs", "rawrecreatewcs", ndf, **kwargs)
[docs]def rawrewrtsc2wcs(ndf, **kwargs): """ Fix broken WCS in raw SCUBA-2 file by re-writing it Runs the command: $SMURF_DIR/rawrewrtsc2wcs . Arguments --------- ndf : str,filename Input SCUBA-2 timeseries to be fixed Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_RAWREWRTSC2WCS for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/rawrewrtsc2wcs", "rawrewrtsc2wcs", ndf, **kwargs)
[docs]def rawunpress(in_, out, **kwargs): """ Uncompress raw data Runs the command: $SMURF_DIR/rawunpress . Arguments --------- `in_` : str,filename Input timeseries out : str,filename Uncompressed timeseries Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_RAWUNPRESS for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/rawunpress", "rawunpress", in_, out, **kwargs)
[docs]def remsky(in_, out, method, **kwargs): """ Remove sky background from SCUBA-2 data Runs the command: $SMURF_DIR/remsky . Arguments --------- `in_` : str,filename Input timeseries out : str,filename Sky-subtracted timeseries method : str Sky removal method Keyword Arguments ----------------- group : bool Group related files? [FALSE] bbm : str,filename Bad bolometer masks [!] fit : str Remove mean, slope or plane? flatmeth : str Flatfield calculation method [POLYNOMIAL] flatorder : int Order of polynomial to use for flatfield fitting [1] flatsnr : float Signal-to-noise threshold for responsivity data [3.0] flatusenext : bool Should we compare with following flatfield? [!] outfiles : str Text file in which to put the output NDF names [!] resist : str Heater resistance information [$STARLINK_DIR/share/smurf/resist.cfg] respmask : bool Mask bolometers with bad responsivity? [TRUE] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_REMSKY for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/remsky", "remsky", in_, out, method, **kwargs)
[docs]def sc2clean(in_, out, **kwargs): """ Clean SCUBA-2 time-series data. Runs the command: $SMURF_DIR/sc2clean . Arguments --------- `in_` : str,filename Input timeseries out : str,filename Cleaned timeseries Keyword Arguments ----------------- bbm : str,filename Bad bolometer masks [!] com : bool Write common-mode to NDF if calculated? [!] config : str Cleaning parameters [current value] flat : bool If set ensure data are flatfielded [TRUE] flatmeth : str Flatfield calculation method [POLYNOMIAL] flatorder : int Order of polynomial to use for flatfield fitting [1] flatsnr : float Signal-to-noise threshold for responsivity data [3.0] flatusenext : bool Should we compare with following flatfield? [!] gai : bool Write common-mode gain to NDF if calculated? [!] maxlen : float Maximum concatenated length in seconds [!] outfiles : str Text file in which to put the output NDF names [!] padend : int Number of samples to pad at start [!] padstart : int Number of samples to pad at end [!] resist : str Heater resistance information [$STARLINK_DIR/share/smurf/resist.cfg] respmask : bool Mask bolometers with bad responsivity? [TRUE] usedarks : bool If set mask data using darks [TRUE] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_SC2CLEAN for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/sc2clean", "sc2clean", in_, out, **kwargs)
[docs]def sc2concat(in_, **kwargs): """ Concatenate files into a larger file. Runs the command: $SMURF_DIR/sc2concat . Arguments --------- `in_` : str,filename Input NDF data structure Keyword Arguments ----------------- out : str,filename Output NDF data structure [./\*_con] flat : bool If set ensure data are flatfielded [TRUE] flatmeth : str Flatfield calculation method [POLYNOMIAL] flatorder : int Order of polynomial to use for flatfield fitting [1] flatsnr : float Signal-to-noise threshold for responsivity data [3.0] flatusenext : bool Should we compare with following flatfield? [!] maxlen : float Maximum concatenated length in seconds [!] outbase : str Base-name for output NDF data structures [!] outfiles : str Text file in which to put the output NDF names [!] padend : int Number of samples to pad at start [!] padstart : int Number of samples to pad at end [!] resist : str Heater resistance information [$STARLINK_DIR/share/smurf/resist.cfg] respmask : bool Mask bolometers with bad responsivity? [TRUE] usedarks : bool If set mask data using darks [TRUE] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_SC2CONCAT for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/sc2concat", "sc2concat", in_, **kwargs)
[docs]def sc2expandmodel(in_, **kwargs): """ Expand a DIMM model component into a full time-series data cube Runs the command: $SMURF_DIR/sc2expandmodel . Arguments --------- `in_` : str,filename Input NDF data structure Keyword Arguments ----------------- out : str,filename Output NDF data structure [./\*_con] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_SC2EXPANDMODEL for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/sc2expandmodel", "sc2expandmodel", in_, **kwargs)
[docs]def sc2fft(in_, out, **kwargs): """ Fourier Transform SCUBA-2 time-series data Runs the command: $SMURF_DIR/sc2fft . Arguments --------- `in_` : str,filename Input NDF data structure out : str,filename Output NDF data structure Keyword Arguments ----------------- avpspec : bool Calculate average power spectrum of good detectors? [FALSE] avpspecthresh : float N-sigma threshold for defining good detectors for average power spectrum [5] bbm : str,filename Bad bolometer masks [!] flat : bool If set ensure data are flatfielded [TRUE] flatmeth : str Flatfield calculation method [POLYNOMIAL] flatorder : int Order of polynomial to use for flatfield fitting [1] flatsnr : float Signal-to-noise threshold for responsivity data [3.0] flatusenext : bool Should we compare with following flatfield? [!] inverse : bool Perform inverse transformation if set [FALSE] outfiles : str Text file in which to put the output NDF names [!] polar : bool Use polar instead of cartesian representation of FFT? [FALSE] power : bool Calculate power spectrum (in polar coordinates)? [FALSE] resist : str Heater resistance information [$STARLINK_DIR/share/smurf/resist.cfg] respmask : bool Mask bolometers with bad responsivity? [TRUE] weightavpspec : bool Weight bolos in avpspec as 1/noise^2? [TRUE] zerobad : bool Set bad values to 0 before calculating FFT? [TRUE] Returns ------- ngood : int Number of good bolometers in average power spectrum Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_SC2FFT for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/sc2fft", "sc2fft", in_, out, **kwargs)
[docs]def sc2filtermap(in_, out, **kwargs): """ Filter a 2-d map Runs the command: $SMURF_DIR/sc2filtermap . Arguments --------- `in_` : str,filename Input NDF data structure out : str,filename Output NDF data structure Keyword Arguments ----------------- filt_edgehigh : float High-pass filter frequency (1/arcsec)? [0] filt_edgelow : float Low-pass filter frequency (1/arcsec)? [0] outfilter : str,filename Output NDF container for filter [!] whiten : bool Whiten the map power spectrum? [FALSE] whiterefmap : str,filename Reference map for whitening filter [FALSE] zerobad : bool Set bad values to 0 before calculating FFT? [TRUE] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_SC2FILTERMAP for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/sc2filtermap", "sc2filtermap", in_, out, **kwargs)
[docs]def sc2mapfft(in_, out, **kwargs): """ Fourier Transform 2D maps Runs the command: $SMURF_DIR/sc2mapfft . Arguments --------- `in_` : str,filename Input NDF data structure out : str,filename Output NDF data structure Keyword Arguments ----------------- azavpspec : bool Calculate azimuthally averaged angular power spectrum? [FALSE] inverse : bool Perform inverse transformation if set [FALSE] polar : bool Use polar instead of cartesian representation of FFT? [FALSE] power : bool Calculate power spectrum (in polar coordinates)? [FALSE] zerobad : bool Set bad values to 0 before calculating FFT? [TRUE] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_SC2MAPFFT for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/sc2mapfft", "sc2mapfft", in_, out, **kwargs)
[docs]def sc2pca(in_, outamp, outcomp, **kwargs): """ Use principal component analysis to identify correlated SCUBA-2 signals Runs the command: $SMURF_DIR/sc2pca . Arguments --------- `in_` : str,filename Input timeseries outamp : str,filename Amplitude files of the principal component outcomp : str,filename Principal component files Keyword Arguments ----------------- bbm : str,filename Bad bolometer masks [!] flat : bool If set ensure data are flatfielded [TRUE] flatmeth : str Flatfield calculation method [POLYNOMIAL] flatorder : int Order of polynomial to use for flatfield fitting [1] flatsnr : float Signal-to-noise threshold for responsivity data [3.0] flatusenext : bool Should we compare with following flatfield? [!] outampfiles : str Text file in which to put the output amplitude NDF names [!] outcompfiles : str Text file in which to put the output component NDF names [!] resist : str Heater resistance information [$STARLINK_DIR/share/smurf/resist.cfg] respmask : bool Mask bolometers with bad responsivity? [TRUE] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_SC2PCA for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/sc2pca", "sc2pca", in_, outamp, outcomp, **kwargs)
[docs]def sc2sim(obspar, simpar, **kwargs): """ SCUBA-2 Simulator Runs the command: $SMURF_DIR/sc2sim . Arguments --------- obspar : str Observation parameters simpar : str Simulation parameters Keyword Arguments ----------------- seed : int [!] maxwrite : int Number of samples to write in output file [12000] overwrite : bool Overwrite existing files? [TRUE] simstats : bool Report simulation statistics only? [FALSE] simtype : str Simulation type (FULL or WEIGHTS) badbol : str ARD Description File for Bad Bolometer mask [!] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_SC2SIM for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/sc2sim", "sc2sim", obspar, simpar, **kwargs)
[docs]def sc2threadtest(*args, **kwargs): """ Task for testing speeds of different threading schemes Runs the command: $SMURF_DIR/sc2threadtest . Keyword Arguments ----------------- nchunks : int Number of time chunks [2] nsub : int Number of subarrays [4] nthread : int Number of threads to use [2] tsteps : int Number of time samples in simulated data chunk [6000] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_SC2THREADTEST for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/sc2threadtest", "sc2threadtest", *args, **kwargs)
[docs]def skyloop(*args, **kwargs): """ Create a map using the "inside-out" algorithm. Runs the command: $SMURF_DIR/skyloop.py . Keyword Arguments ----------------- chunkwgt : Controls the weight used for each chunk. If False, then the weights are determined by the value of the CHUNKWGT FITS header in each input time-stream data file (unit weight is used for any data file that has no CHUNKWGT FITS header). If True, the weight for each chunk is based on the normalised map change for each chunk calculated on the previous iteration - the weight for a chunk is the ratio of the mean of all the chunk map changes to the chunk's own map change. Weights above 1.0 are limited to 1.0. [False] config : The MAKEMAP configuration parameter values to use. Additions will be made as follows: - First iteration: --- numiter=1 noi.export=1 exportNDF=(lut,ext,res,qua) noexportsetbad=1 exportclean=1 ast.zero_notlast = 0 flt.zero_notlast = 0 com.zero_notlast = 0 pca.zero_notlast = 0 itermap=0 shortmap=0 bolomap=0 flagmap=<undef> sampcube=0 diag.append=0 --- - Subsequent iterations: --- numiter=1 noi.import=1 exportNDF=(res,qua) doclean=0 importsky=ref importlut=1 ext.import=1 ast.zero_notlast = 0 flt.zero_notlast = 0 com.zero_notlast = 0 pca.zero_notlast = 0 flt.notfirst = 0 pca.notfirst = 0 pln.notfirst = 0 smo.notfirst = 0 itermap=0 shortmap=0 bolomap=0 flagmap=<undef> sampcube=0 diag.append=1 downsampscale=0 downsampfreq=0 fakemap=<undef> --- - Last iteration: --- numiter=1 noi.import=1 doclean=0 importsky=ref importlut=1 ext.import=1 ast.zero_notlast = 1 flt.zero_notlast = 1 com.zero_notlast = 1 pca.zero_notlast = 1 flt.notfirst = 0 pca.notfirst = 0 pln.notfirst = 0 smo.notfirst = 0 itermap=0 shortmap=0 bolomap=0 flagmap=<undef> sampcube=0 diag.append=1 downsampscale=0 downsampfreq=0 fakemap=<undef> --- extra : A string holding any extra command line options to be passed to MAKEMAP (all invocations). [!] glevel : Controls the level of information to write to a text log file. Allowed values are as for "ILEVEL". The log file to create is specified via parameter "LOGFILE. ["ATASK"] ilevel : Controls the level of information displayed on the screen by the script. It can take any of the following values (note, these values are purposefully different to the SUN/104 values to avoid confusion in their effects): - "NONE": No screen output is created - "CRITICAL": Only critical messages are displayed such as warnings. - "PROGRESS": Extra messages indicating script progress are also displayed. - "ATASK": Extra messages are also displayed describing each atask invocation. Lines starting with ">>>" indicate the command name and parameter values, and subsequent lines hold the screen output generated by the command. - "DEBUG": Extra messages are also displayed containing unspecified debugging information. ["PROGRESS"] `in_` : The group of time series NDFs to include in the output map. ipref : An existing NDF that is to be used to define the correction to be made for instrumental polarisation (IP). It is only accessed if the input data contains POL2 Q or U time-series values, as created by SMURF:CALCQU. No IP correction is made if a null (!) value is supplied. If a non-null value is supplied, it should be an NDF that holds the total intensity (in pW) within the area of sky covered by the output map. The supplied NDF need not be pre-aligned with the output map - the WCS information in the NDF will be used to aligned them. For each Q or U value in the input time-streams, the corresponding total intensity (I) value is found by sampling the supplied IPREF map at the sky position of the Q/U value. This I value is multipled by a factor that depends on elevation and focal plane position, to get the IP correction. These Q and U corrections are rotated so that they use the same reference direction as the input Q/U data, corrected for extinction, and are then subtracted from the input Q or U value before going on to make a map from the corrected values. [!] itermap : A 3D NDF to create holding the maps from all iterations. [!] logfile : The name of the log file to create if GLEVEL is not NONE. The default is "<command>.log", where <command> is the name of the executing script (minus any trailing ".py" suffix), and will be created in the current directory. Any file with the same name is over-written. mask2 : An existing NDF that can be used to specify a second external mask for use with either the AST, PCA, FLT or COM model. See configuration parameters AST.ZERO_MASK, PCA.ZERO_MASK, FLT.ZERO_MASK and COM.ZERO_MASK. Note, it is assumed that this image is aligned in pixel coordinate with the output map. [!] mask3 : An existing NDF that can be used to specify a third external mask for use with either the AST, PCA, FLT or COM model. See configuration parameters AST.ZERO_MASK, PCA.ZERO_MASK, FLT.ZERO_MASK and COM.ZERO_MASK. Note, it is assumed that this image is aligned in pixel coordinate with the output map. [!] msg_filter : Controls the default level of information reported by Starlink atasks invoked within the executing script. The accepted values are the list defined in SUN/104 ("None", "Quiet", "Normal", "Verbose", etc). ["Normal"] niter : The number of iterations to perform. A positive value specifies a fixed number of iterations to perform. A negative value indicates that iterations should continue until the normalized change in the map between iterations is less than the value of the "maptol" parameter in the configuration supplied by parameter CONFIG (a maptol value of 0.05 is used if CONFIG does not specify maptol). If a value of zero is supplied for NITER, the value used will be read from the "numiter" parameter in the configuration. [0] obsdir : The name of a directory in which to put maps made from the individual observations. These are generated on the final iteration. If null is supplied, individual observation maps will not be created. Each map is stored in a file with name <UT>_<OBS>.sdf. If a single observation is split into multiple chunks, the first chunk will use the above naming scheme but the second and subsequent chunks will have names of the form <UT>_<OBS>_<CHUNK>.sdf. [!] out : The NDF holding the output map. pixsize : Pixel dimensions in the output image, in arcsec. The same value will be used for both axes. The default depends on the wavelength of the input data. ref : An existing NDF that is to be used to define the output grid. If supplied, the output grid will be aligned with the supplied reference NDF. The reference can be either 2D or 3D and the spatial frame will be extracted. If a null (!) value is supplied then the output grid is determined by parameters REFLON, REFLAT, etc. In addition, this NDF can be used to mask the AST, PCA, FLT or COM model. See configuration parameters AST.ZERO_MASK, PCA.ZERO_MASK, FLT.ZERO_MASK and COM.ZERO_MASK. On the second and subsequent invocations of MAKEMAP, any supplied REF image is replaced by the map created by the previous invocation of MAKEMAP. [!] restart : If a value is assigned to this parameter, it should be the path to a directory containing the intermediate files created by a previous run of SKYLOOP. If supplied, execution of skyloop will restart from the point where the previous run finished. This is useful for continuing runs that have been interupted accidentally. The path to the intermediate files can be found by examining the log file created by the previous run. [!] retain : Should the temporary directory containing the intermediate files created by this script be retained? If not, it will be deleted before the script exits. If retained, a message will be displayed at the end specifying the path to the directory. [FALSE] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_SKYLOOP for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/skyloop.py", "skyloop", *args, **kwargs)
[docs]def skynoise(obspar, simpar, **kwargs): """ Generate a simulated sky background with spatial noise. Runs the command: $SMURF_DIR/skynoise . Arguments --------- obspar : str Observation file simpar : str Simulation file Keyword Arguments ----------------- seed : int [!] exponent : float Power-Law Exponent [1.8] filename : str [atm] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_SKYNOISE for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/skynoise", "skynoise", obspar, simpar, **kwargs)
[docs]def smurfcopy(in_, out, slice, **kwargs): """ Copy a 2d image out of a time series file. Runs the command: $SMURF_DIR/smurfcopy . Arguments --------- `in_` : str,filename Input timeseries out : str,filename Output filename slice : int Index of time slice to extract (0 for last) Keyword Arguments ----------------- ftsport : str FTS-2 port: tracking, image or null [!] outfiles : str Text file in which to put the output NDF names [!] pointing : str Text file containing pointing corrections [!] resist : str Heater resistance information [^$STARLINK_DIR/share/smurf/resist.cfg] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_SMURFCOPY for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/smurfcopy", "smurfcopy", in_, out, slice, **kwargs)
[docs]def smurfhelp(*args, **kwargs): """ Gives help about SMURF. Runs the command: $SMURF_DIR/smurfhelp . Keyword Arguments ----------------- topic : str Help topic [" "] subtopic : str Help subtopic [" "] subsubtopic : str Help subsubtopic [" "] subsubsubtopic : str Help subsubsubtopic [" "] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_SMURFHELP for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/smurfhelp", "smurfhelp", *args, **kwargs)
[docs]def stackframes(in_, out, sort, sortby, **kwargs): """ Stack 2d processed frames into time series cube Runs the command: $SMURF_DIR/stackframes . Arguments --------- `in_` : str,filename Input processed 2d frames out : str,filename Stacked frames sort : bool [TRUE] sortby : str Sort key [MJD] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_STACKFRAMES for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/stackframes", "stackframes", in_, out, sort, sortby, **kwargs)
[docs]def starecalc(in_, out, **kwargs): """ Calculate image for SCUBA-2 STARE observations Runs the command: $SMURF_DIR/starecalc . Arguments --------- `in_` : str,filename Input data file(s) out : str,filename Output data file(s) Keyword Arguments ----------------- bbm : str,filename Bad bolometer masks [!] naver : int Number of samples to average together to produce an image [!] outfiles : str Text file in which to put the output NDF names [!] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_STARECALC for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/starecalc", "starecalc", in_, out, **kwargs)
[docs]def supercam2acsis(in_, directory, **kwargs): """ Convert a Supercam SDFITS format data file to an ACSIS format NDF. Runs the command: $SMURF_DIR/supercam2acsis . Arguments --------- `in_` : str Input SuperCam SDFITS File directory : str Output Directory Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_SUPERCAM2ACSIS for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/supercam2acsis", "supercam2acsis", in_, directory, **kwargs)
[docs]def timesort(in_, out, **kwargs): """ Re-order the time slices in a raw ACSIS data cube into increasing time. Runs the command: $SMURF_DIR/timesort . Arguments --------- `in_` : str,filename Input NDF data structure out : str,filename Output NDF data structure Keyword Arguments ----------------- detectors : str Names of detectors to be included [!] detpurge : bool Remove dead detectors? [FALSE] genvar : bool [FALSE] limittype : str Type of limit specified by LIMITSIZE ["FILESIZE"] merge : bool Merge input NDFs? [dyn.] outfiles : str Text file in which to put the output NDF names [!] sizelimit : int Size limit for each output NDF [!] specbnd : str How to choose pixel bounds on output spectral axis ["FIRST"] Returns ------- nout : int Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_TIMESORT for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/timesort", "timesort", in_, out, **kwargs)
[docs]def unmakecube(in_, ref, out, **kwargs): """ Produce simulated time series data from a regrided ACSIS data cube. Runs the command: $SMURF_DIR/unmakecube . Arguments --------- `in_` : str,filename Input sky cubes ref : str,filename Template time series cubes out : str,filename Output time series cubes Keyword Arguments ----------------- detectors : str Names of detectors to be included [!] interp : str Pixel interpolation method [current value] params : List[float] Auxiliary interpolation parameters usedetpos : bool Read detector positions from the input NDF? [TRUE] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_UNMAKECUBE for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/unmakecube", "unmakecube", in_, ref, out, **kwargs)
[docs]def unmakemap(in_, ref, out, **kwargs): """ Produce simulated time series data from a SCUBA-2 map. Runs the command: $SMURF_DIR/unmakemap . Arguments --------- `in_` : str,filename Input sky map ref : str,filename Template time series cubes out : str,filename Output time series cubes Keyword Arguments ----------------- alignsys : bool Align data in the spatial co-ordinate system of the map? [FALSE] amp16 : float Amplitude of 16 Hz signal as a fraction of I [0.0] amp2 : float Amplitude of 2 Hz signal as a fraction of I [0.0] amp4 : float Amplitude of 4 Hz signal as a fraction of I [0.0] angrot : float Angle from focal plane X to fixed analyser (degs) [90.0] com : str,filename Common-mode time-series NDFs [!] comval : List[float] Constant comon-mode value for all time slices (pW) [!] gai : str,filename 2-dimensional GAI model NDFs [!] harmonic : int The half-wave plate harmonic to use [4] instq : str,filename Instrumental Q value for each boloemeter instu : str,filename Instrumental U value for each boloemeter interp : str Pixel interpolation method [current value] ipform : str Instrumental polarisation model to use ["PL3"] jkdata : str Johnstone/Kennedy IP model data ['$STARLINK_DIR/share/smurf/ipdata.sdf'] paoff : float Angle from fixed analyser to POL_ANG=0 (degs) [18.65] params : List[float] Auxiliary interpolation parameters pasign : bool POL_ANG in sense of rotation from focal plane X to Y? [FALSE] perror : float Sigma of random pointing errors to add, in arc-seconds [0.0] phase16 : float Phase of 16 Hz signal in degrees [0.0] phase2 : float Phase of 2 Hz signal in degrees [0.0] phase4 : float Phase of 4 Hz signal in degrees [0.0] pldata : List[float] Parameter values for PL1 PL2 or PL3 IP model [2.624E-3,4.216E-2,-2.410E-2,-3.400E-2] pointing : str Text file containing pointing corrections [!] qin : str,filename Input map of sky Q values [!] sigma : float Stndard deviation of Gaussian noise to add [0.0] uin : str,filename Input map of sky U values [!] useaxis : str The sky map WCS axes to use [!] Notes ----- See http://www.starlink.ac.uk/cgi-bin/htxserver/sun258.htx/sun258.html?xref_UNMAKEMAP for full documentation of this command in the latest Starlink release """ return wrapper.starcomm("$SMURF_DIR/unmakemap", "unmakemap", in_, ref, out, **kwargs)