create.par.file: Create Parameter File

View source: R/create.par.file.R

create.par.fileR Documentation

Create Parameter File

Description

Generate the parameter file for use in the measure.fluxes procedure. All Parameter file values can be sent to the procedure, or the default file can be generated by simply invoking the routine with no parameters specified.

Usage

   create.par.file(filename='Lambdar_default.par',
       RootDirectory = "./", WorkingDirectory = "./",
       OutputDirectory = "./", Catalogue = "catalogue.csv",
       DataMap = "image.fits", BeamArea_SqAS = 0, PSFConvolve
       = 0, PSFWeighted = 1, PSFMap = "NONE", Gauss_FWHM_AS = 0, 
       PSFLabel='SEEING', PSFLabelType='FWHM.ARCSEC',SimGauss_AS=0, 
       RemoveContam = 0, CheckContam = 0,
       nNearestCheck = 10, NoContamImageFile =
       "NoContamResidualImage.fits", CatIDColumnLabel =
       "CATAID", RAColumnLabel = "RAdeg", DecColumnLabel =
       "DECdeg", ThetaColumnLabel = "rotN2E",
       SemiMajColumnLabel = "radmajasec", SemiMinColumnLabel
       = "radminasec", ContamColumnLabel = "CONTAM",
       FluxWgtColumnLabel = "FLUXWEIGHT", ErrorMap = "NONE",
       MaskMap = "NONE", WeightMap = "NONE", WeightMapZP = 0,
       Saturation = Inf, SaturationLabel = "SATUR", GainLabel =
       "GAIN", DataExtn = 0, ErrorExtn = 0, MaskExtn = 0,
       WeightExtn = 0, ApertureType = 1, EFactor = 1, FluxCorr = 1,
       CropImage = 0, CropFitsName = "croppedimage",
       CropImRA0 = -999, CropImDec0 = -999, CropImRad = 0.5,
       Confusion_units = 0, nProcessors = 1, AngularOffset = 0,
       MapUnitsPerBeam = 0, ResampleAper = 0, ResamplingRes = 3,
       ResamplingIters = 2, PSFConfidence = 1, ApStampWidth =
       1.05, SourceMaskOnly = 0, WriteSourceMask = 0,
       WriteAAMask = 0, AllApersFile =
       "AllApertures_Mask.fits", WriteFAMask = 0,
       ConvApersFile = "AllConvolvedApertures_Mask.fits",
       WriteDFAMask = 0, DeblConvApersFile =
       "AllDeblConvolvedApertures_Mask.fits", WriteResidMap =
       0, ResidImageFile = "ResidualImage.fits", WriteTable =
       1, TableName = "LAMBDAR_Results", ShowTime = 0,
       Interactive = 0, UseMaskLim = 0.2, Diagnostic = 0,
       Verbose = 0, PlotSample = 0, PlotAll = 0, Magnitudes =
       1, MagZPLabel = "MagZP", ABVegaFlux = 1, MagZeroPoint
       = 8.9, BlankCor = 0, nBlanks = 10, RanCor = 0, nRandoms
       = 10, DoSkyEst = 0, GetSkyRMS = 0, SkyEstIters = 5,
       SkyEstProbCut = 3, SkyCorrelNoise = 1, SkyDefault =
       "median", SourceMaskFile = "SourceMask.fits",
       TransmissionMap = 0, GetDeblFrac = 0,
       SourceMaskConfLim = 0.95, MinApRad = 0, MemorySafe =
       0, ApertureConfLimit = 0.9, IterateFluxes = 0,
       nIterations = 2, FluxWgtType = "scale",
       UsePixelFluxWgts = 0, LogFile = "LAMBDAR_Log.txt")

Arguments

filename

string; Filename to use for outputting Lambdar Parameter File

RootDirectory

string; Path to Root Directory for program execution. Default is ‘./’; i.e. the current R working directory

WorkingDirectory

string; Path of Working Directory, relative to the Root Directory, for program execution.

Catalogue

string; Catalogue Filename and Path from Root. Accepted formats are ‘.csv’, ‘.fits’, ‘.Rdata’

PSFMap

string; PSF Filename and Path from Root (use ‘NONE’ if not wanted)

DataMap

string; Image Filename and Path from Root

ErrorMap

string; Error Map Filename and Path from Root (use ‘NONE’ if not wanted)

MaskMap

string; Mask Filename and Path from Root (use ‘NONE’ if not wanted)

WeightMap

string; Weightmap Filename and Path from Root (used if generating a mask from weightmap - use ‘NONE’ if not wanted)

CatIDColumnLabel

string; Label for ‘Catalogue ID’ Column in input catalogue

RAColumnLabel

string; Label for ‘Right Ascension’ Column in input catalogue

DecColumnLabel

string; Label for ‘Declination’ Column in input catalogue

ThetaColumnLabel

string; Label for ‘Aperture Angle’ Column in input catalogue (column may not be needed)

SemiMinColumnLabel

string; Label for ‘SemiMinor Axis’ Column in input catalogue (column may not be needed)

SemiMajColumnLabel

string; Label for ‘SemiMajor Axis’ Column in input catalogue (column may not be needed)

ContamColumnLabel

string; Label for ‘Contaminant Flag’ Column in input catalogue (column may not be needed)

FluxWgtColumnLabel

string; Label for ‘Flux Weights’ Column in input catalogue (column may not be needed)

FluxWgtType

string; What form do the flux.weights take? magnitudes ‘mag’, Fluxes ‘flux’, or scales ‘scale’.

MapUnitsPerBeam

boolean 0/1; Is the Image Flux measured in Unitsperbeam (as opposed to UnitsPerPixel)? [1/0]

Confusion_units

float; Confusion Correction in Units

Saturation

float; image saturation in ADU

SaturationLabel

string; saturation fits keyword

GainLabel

string; gain fits keyword. Used to determine gain if no weightmap or error.map is provided

Gauss_FWHM_AS

float; Gaussian FWHM of Seeing in ArcSec (used if generating a PSF)

PSFLabel

string; what is the header keyword for the PSF size (used if generating a PSF and Gauss_FWHM_AS is negative)

PSFLabelType

string; is the PSF size in the header specified a FWHM [FWHM] or StDev [SD], and is it in units of arcsec [ARCSEC] or Pixels [PIX].

SimGauss_AS

float; FWHM of Gaussian used when performing Gaussianisation of the input image. Used when generating a Simulated Image, to accurately reproduce the background correlations.

BeamArea_SqAS

float; Beam area in Square Arcsec (used if MapUnitsPerBeam=1)

FluxCorr

float; Flux Correction Factor (multiplicative)

EFactor

float; Error Map Scale Factor (multiplicative)

DataExtn

integer; Fits header extension of Data in Image File

ErrorExtn

integer; Fits header extension of Data in Errormap File (used if reading error.map from file)

MaskExtn

integer; Fits header extension of Data in Maskmap File (used if reading mask from file)

WeightExtn

integer; Fits header extension of Data in Weightmap File (used if generating mask from weightmap)

WeightMapZP

float; Zero Point of the Weight Map. i.e. the value that corresponds to ‘No Data’ (used if generating mask)

CropImage

boolean 0/1; Do we want to crop the input image to a particular subsection? [1/0]

CropImRA0

float; RA that crop will centre around (deg; -999 will focus crop around the centre of the input image)

CropImDec0

float; Dec that crop will centre around (deg; -999 will focus crop around the centre of the input image)

CropImRad

float; Radius of crop (deg; NA will default to 1deg radius)

CropFitsName

string; Name of the output cropped images (without ‘.fits’ extension)

RemoveContam

boolean 0/1; Remove Contaminants (Catalogue must contain contaminant flag column) from the image? [1/0]

CheckContam

boolean 0/1; Check for relevant Contaminants? Contaminants deemed not needed (not overlapping science targets) will not be measured. [1/0]

nNearestCheck

integer; number of nearest neighbours to check when discarding contaminant

MinApRad

flaot; Minimum Aperture Radius

PSFConvolve

boolean 0/1; Convolve the Aperture with a PSF? [1/0]

PSFWeighted

boolean 0/1; Use PSF Weighted Apertures [1] or convert all apertures to boxcar prior to measurement [0]?

ApertureConfLimit

float; when not using PSF Weighted Apertures, this is the integral point at which the boxcar boundary occurs

AngularOffset

boolean 0/1; 0 if the catalogue is in N90E0 angular coords, 1 if it is in N0E90 coords [0/1]

ApertureType

integer; What type of aperture do we want? Force point sources [0], BoxCar Apertures [1], Gaussian Apertures [2], or Segmentation Apertures [3]?

ResampleAper

boolean 0/1; Smooth Apertures by resampling? (Improves aperture surface integral accuracy) [1/0]

ResamplingRes

integer; Rate of Upscaling in Resolution during Aperture Resampling (final res is ResamplingRes^[nIters] higher)

ResamplingIters

integer; Number of iterations to perform in resampling

UseMaskLim

float in {0,1}; fraction of aperture stamp that must be within the mask. If less, aperture is discarded.

Verbose

boolean 0/1; Verbose Output? [1/0]

ShowTime

boolean 0/1; Display execution times & total elapsed time during run? [1/0]

PlotSample

boolean 0/1; Plot a random sample of the Apertures to file, during various procedures, for Inspection? [1/0]

PlotAll

integer 0/1/2; Plot all of the Apertures to file, during various procedures, for Inspection? [1] Or if removing contaminants (RemoveContam parameter), just plot the non-contaminant sources? [2]

Diagnostic

boolean 0/1; Diagnostic Output of Variable Values During Computation - Helpful in Understanding Code & debugging [1/0]

Interactive

boolean 0/1; Interactive Mode - Allows user access to entire parameter-space after final calculations [1/0]

Magnitudes

boolean 0/1; Output Flux magnitudes? [1/0]

ABVegaFlux

float; Flux of Vega in this band (used for calculation of AB magnitudes)

MagZeroPoint

float; Magnitude of the Image Zero Point. If -999, ZP will be read from FITS header

MagZPLabel

string; Label used for the Zero Point Keyword in the FITS header, if reading from FITS

DoSkyEst

boolean 0/1; Perform a subtraction of the local background for each aperture? [1/0]

SkyEstIters

integer; Number of iterative clips performed during sky estimation

SkyEstProbCut

float; Probability limit (specified as a sigma value) used in iterative clipping of sky-pixels during sky estimation

SkyDefault

character/float; The default value to use if sky estimation fails; can be a value (numeric), ‘mean’, or ‘median’

SkyCorrelNoise

float; Multiplicative factor describing the amount of correlated noise in the data.map

GetSkyRMS

boolean 0/1; Perform an estimation of the local sky background, without doing subtraction

RanCor

boolean 0/1; Perform a randoms measurement for each aperture? [1/0]

nRandoms

integer; number of randoms to measure, per aperture.

BlankCor

boolean 0/1; Perform a randoms measurement for each aperture? [1/0]

nBlanks

integer; number of Blanks to attempt to measure, per aperture. Actual number successfully measured is output by blanks function

UsePixelFluxWgts

boolean 0/1; Do we want to weight initialise deblends by object central pixel fluxes? [0/1]

IterateFluxes

boolean 0/1; Perform an iteration of the flux measurements, to create improve photometric accuracy (generally, not always)

nIterations

integer; Number of iterations we would like to perform when refining fluxes

GetDeblFrac

boolean 0/1; Do we just want to return the deblend solutions? No flux measurement will be output [0/1]

OutputDirectory

string; Output directory Name and Path

LogFile

string; Filename for Log

SourceMaskOnly

boolean 0/1; Only Output Source Mask image to file, and stop (without calculating fluxes)? (Overrules all other Flags) [1/0]

TransmissionMap

boolean 0/1; Do we want to output a transmission map rather than a sourcemask? [1/0]

WriteTable

boolean 0/1; Output Results Table? [1/0]

TableName

string; Filename for Results Table

WriteAAMask

boolean 0/1; Write the All Apertures Mask image to file? [1/0]

AllApersFile

string; Filename for All Apertures Mask

WriteSourceMask

boolean 0/1; Write the Source Mask image to file? [1/0]

SourceMaskConfLim

float in {0,1}; Confidence Limit used when making sourcemask of convolved apertures

SourceMaskFile

string; Filename for Source Mask

WriteDFAMask

boolean 0/1; Write the Convolved Apertures Mask image to file? [1/0]

DeblConvApersFile

string; Filename for All Convolved Apertures Mask

WriteFAMask

boolean 0/1; Write the Convolved Apertures Mask image to file? [1/0]

ConvApersFile

string; Filename for All Convolved Apertures Mask

WriteResidMap

boolean 0/1; Write the Residual Image Map to file? [1/0]

ResidImageFile

string; Filename for Residual Image

NoContamImageFile

string; Filename for Contaminant Subtracted Residual Image

nProcessors

integer; Number of Processors Available for Use in Computations

MemorySafe

boolean 0/1; do we want to check that memory usage will be less than system limits? [0/1]

ApStampWidth

float in {1,Inf}; Width of the Aperture stamps in multiples of aperture major axis; Can be changed *with caution* if memory issues arise.

PSFConfidence

float in {0,1}; Confidence level to which the PSF is generated, or to which aperture stamps are padded if reading PSF from File

Details

This function reads the various inputs from the LAMBDAR parameter file. Generally, if a particular parameter isn't found during parameter file read then the program will warn the user in the log file, and will continue on using the default values for that parameter. In this way a user that wishes to use all default values, and specify only one or two parameters explicitly, can provide a simply file containing only those parameters that they wish to modify. Exceptions to this rule are those parameters that are considered vital to the correct running of the program. These are: > The Root Path (can be simply set to "./") > The Working Directory Path (can be simply set to "./") > The Input Image File > The Input Catalogue

Details of what is expected in the input catalogue are given in the open.catalogue manual page

Value

NULL; Procedure outputs the parameter file to ‘LAMBDAR_default.par’

Author(s)

Angus H Wright ICRAR angus.wright@icrar.org

References

Wright et al. 2015 (in prep)

See Also

measure.fluxes

Examples


#Load LAMBDAR
library(LAMBDAR)
#To output the default parameter file to 'Lambdar_default.par', simply call:
create.par.file()

#To specify the output file as 'Lambdar_Custom.par':
create.par.file(file="Lambdar_Custom.par")

#Finally, all parameters can be set as they are output:
create.par.file(file="Lambdar_Custom.par", Catalogue="MyCat.csv",
DataMap="SampleImage.fits",nProcessors=10)


AngusWright/LAMBDAR documentation built on May 12, 2022, 1:49 a.m.