Home
User`s guide
Contents
1. 31 8 Troubleshooting 33 9 Acknowledgements 33 ii iii 1 What is SWarp SWarp is a program that resamples and co adds together FITS images using any arbitrary astrometric projection de ned in the WCS standard1 The main features of SWarp are FITS format including multi extensions in input and output Full handling of weight maps in input and output Ability to work with very large images up to 500 Mpixels on 32 bit machines and 106 Tpixels with 64 bits thanks to customized virtual memory mapping and bu ering Works with arrays in up to 9 dimensions including or not two spherical coordinates Selectable high order interpolation method up to 8 tap lters in any dimension Compatible with WCS and TNX IRAF astrometric descriptions Support for equatorial galactic and equatorial coordinate systems Astrometric and photometric parameters are read from FITS headers or external ASCII les Built in background subtraction Built in noise level measurement for automatic weighting Automatic centering and sizing functions of the output eld Multi threaded code with load balancing to take advantage of multiple processors 2 Skeptical Sam s questions Skeptical Sam doesn t have time to test software extensively but is always keen on asking agressive questions to the author to
2. 10 5 5 2 Output frames 11 5 5 3 Bi cubic spline interpolation 15 5 6 Resampling 15 5 6 1 Image data 16 5 6 2 Oversampling 18 5 6 3 Noise stability issues 18 5 6 4 Weight maps 21 5 7 Background subtraction 21 5 8 Scaling the ux 24 5 9 Combining resampled images 25 5 9 1 Various types of image combination 25 5 9 2 Weighted coaddition 27 5 9 3 Image bu ering and memory constraints 29 i 6 Two step co addition and resampling 29 7 Examples 29 7 1 Example 1 30 7 2 Example 2
3. 4 1 The Con guration le Each time SWarp is run it looks for a con guration le If no con guration le is speci ed in the command line it is assumed to be called default swarp and to reside in the current directory If no con guration le is found SWarp will use its own internal default con guration 4 1 1 Creating a con guration le SWarp can generate an ASCII dump of its internal default con guration using the d option By redirecting the standard output of SWarp to a le one creates a con guration le that can easily be modi ed afterward swarp d gt default swarp 4 1 2 Format of the con guration le The format is ASCII There must be only one parameter set per line following the form Con g parameter Value s Extra spaces or linefeeds are ignored Comments must begin with a and end with a linefeed Values can be of di erent types strings can be enclosed between double quotes oats integers keywords or boolean Y y or N n Some parameters accept zero or several values which must then be separated by commas Integers can be given as decimals in octal form preceded by digit O or in hexadecimal preceded by 0x The hexadecimal format is particularly convenient for writing multiplexed bit values such as binary masks Environment variables written as HOME or HOME are expanded 4 1 3 Con guration parameter list Here is a list of all the
4. External weight maps Input Warped images headers Frame buffer Frame buffer Frame buffer Frame buffer Background subtraction Resampling Image Co addition Figure 1 Global Layout of SWarp 8 Weight map Input image weight map Resampled image Resampled Flux scaling Variance scaling engine Interpolation alpha delta gt x y out Frame buffer Frame buffer x y in gt alpha delta Figure 2 Layout of the image mapping section default path for VMEM DIRECTORY is tmp which on many systems is on a partition simply not large enough to handle the typical quantities of data to process An alternative is to use the current directory at the expense of disk thrashing De projecting and co adding simultaneously all input images would frequently imply many les open at the same time and large amounts of virtual memory SWarp takes a more sequential approach each input image is mapped in a tightly tting rectangular subsection of the output frame All subsections are written to disk in the RESAMPLE DIRECTORY as swarp xxx ts FITS les and read back later during the co addition phase to be stacked together Individual subsection les are automatically removed after processing or abortion It is possible to disable the deletion by setting the DELETE TMPFILES con guration parameter to N the default is Y This can be useful for diagnostic purposes Note that although SWarp
5. 16 Figure 6 Comparison between resampling methods From top to bottom nearest neighbour bilinear Lanczos2 Lanczos3 Lanczos4 From left to right Interpolation function pro le Mod ulation Transfer Function result from shifting an image by half a pixel in both direction and result for a 5 zoom rotation by 20 degrees 17 Figure 7 Example of moir e pattern on the background noise generated by bilinearly resampling an image containing white noise at a pixel scale slightly di erent from 1 5 6 2 Oversampling Unfortunately the procedure described above generates aliasing when zooming out su ciently an image by resampling it at a lower resolution Moreover the intensity of the resampled background white noise stays constant instead of being proportional to the zooming factor see Fig 10 This is because the algorithm essentially decimates the data instead of binning them within the output pixel footprint a similar e ect applies in the panning windows of astronomical visualization tools for instance This problem can be approximately solved by dilating appropriately the interpolation kernel or by pre ltering the input image like textures in 3D hardware A more exact and more e cient solution is to oversample the output pixel grid Fig 10 in order to obtain a density of samples per unit area or hypervolume at least equal to that of the input image Oversampling is controlled by the OVERSAMPLING con g
6. ux10 This is why equal area projections should be prefered to other projections whenever possible Immediately following resampling the intensity of each image is scaled according to the con gu ration parameters The ux scaling parameter pi is the product of two factors a photometric factor and an astrometric one Currently the photometric part must be speci ed by the user for instance in a pipeline it is generally produced by the photometric calibration process 10Warning this ux correction can be extremely inaccurate 10 error or even more for sources that are undersampled on the output image 24 The photometric factor can be set directly using the con guration parameter FSCALE DEFAULT there must be one value per input image separated by a coma It can also be read from the FITS header The FSCALE KEYWORD con guration parameter tells SWarp what FITS keyword to look for in each input image The default is FLXSCALE If the FSCALE KEYWORD is not found in the image header then the FSCALE DEFAULT value is taken instead FSCALE DEFAULT is defaulted to 1 for all images The astrometric part of the ux scaling factor corrects for the di erence in pixel size be tween the input and output images The FSCALASTRO TYPE con guration parameter controls the behaviour of this astrometric ux scaling In the current version the default behaviour FSCALASTRO TYPE FIXED is to apply a constant c
7. Take the minimum of pixel scales at the center of input frames MAX Take the maximum of pixel scales at the center of input frames MANUAL User de ned pixel scale at image center with the PIXEL SCALE key word FIT Compute the pixel scale in order to have the full output eld tting the user de ned IMAGE SIZE 5 PROJECTION ERR 0 001 oats n nima Maximum position error in pixels al lowed for the bicubic spline interpo lation of the astrometric reprojection Use 0 for no interpolation PROJECTION TYPE TAN string Projection system used in output in standard WCS notation see Table 1 RESAMPLE Y boolean If true resampling is performed on the input images RESAMPLE DIR string Path of the directory where resampled images are written RESAMPLE SUFFIX resamp fits string lename extension given to resampled images produced by SWarp RESAMPLING TYPE LANCZOS3 keywords n ndim Resampling method NEAREST Take the nearest neighbour BILINEAR Bi linear interpolation LANCZOS2 Lanczos 2 4 tap lter LANCZOS3 Lanczos 3 6 tap lter LANCZOS4 Lanczos 4 8 tap lter SUBTRACT BACK Y booleans n nima If true input images are background subtracted prior to resampling VMEM DIR tmp string Path of the directory where virtual memory and other temporary les are written VMEM MAX 2048 integer Maximum amount of megabytes al lowed for virtual mem
8. les It is therefore more appropriate to weight pixels according to the intensity of the local background noise which is far smoother qiwij 1 p2 i 2 ij 25 This has also the advantage that one can use normalized at elds as wij s without prior knowledge of the CCD gain in the case where instrumental noise is negligeable For faint objects this weighting scheme is as e cient as that of 24 and is only suboptimum for the objects with very high surface brightness when the qi s vary a lot from exposure to exposure But as these objects are easily detected on individual exposures the most accurate photometry is still possible by combining the N measurements 11Both uxes and weights may have gone through resampling but for the sake of clarity we shall from now drop the from 5 6 27 In practice SWarp can read several types of weight maps although they are all internally converted to variance for processing The input weight map format must be speci ed with the WEIGHT TYPE keyword WEIGHT TYPE NONE is for no input weight map the default MAP RMS for indicating that the data contain the absolute standard deviation of pixel values MAP VARIANCE for weight map data stored as relative variances and MAP WEIGHT for relative weights Relative variances or weights are scaled internally using local variance measurements made directly on the input images When producing composite elds larger than the
9. 1 i 31 Sadly in many bands the presence of clouds does not decrease the sky brightness as much as source brightness and doesn t act at all like a decrease in global sensitivity or exposure time Coadded regions of a survey that are taken under non photometric conditions experience uctuating gains But this e ect is generally small taking the quite unfavourable case of qi p 2 i constant background noise with pi s varying by a factor of 4 between two exposures and weights varying from 0 5 to 1 makes Gj to vary by 20 at most This should not cause signi cant di culties in any pro le tting routine Therefore 31 still remains a very good approximation in the general case and the coadded gains provided by this method are still more stable than what unweighted co addition o ers This does not prevent regions with lower coverage in which N is smaller having lower gains To avoid large gain drops in the gaps of CCD mosaic images it is recommended for the observations to use large random dithering patterns consisting of at least 4 5 exposures per covered sky area 28 5 9 3 Image bu ering and memory constraints In order to maximize the e ciency of the image combination process SWarp version 2 0 and above allocates a signi cant amount of memory to bu er input and output data This amount of memory can be set by the user with the COMBINE BUFSIZE con guration parameter The default value
10. SWarp ltering is 6This feature is currently limited to 2D images 15 naturally implemented by oversampling the destination grid Because SWarp uses reverse mapping interpolation is made on the input images 5 6 1 Image data At each position x the dot product between a local kernel k x and neighbouring pixel values f yields a local interpolated value f x k x f 1 The kernel is derived locally from an interpolation function h ki x h x xi 2 The RESAMPLING TYPE con guration parameter allows the user to choose among several sym metric compact interpolation functions NEAREST a square box response function with width 1 pixel Applying this function produces nearest neighbour interpolation also known as sample and hold The kernel extends over a single input pixel BILINEAR a pyramidal response function with Full Width at Half Maximum 1 pixel This results in a bilinear interpolation The kernel extends over 2ndim pixels LANCZOS2 a d sinc xd sinc 2 xd response function with 2 lt xd 2 Lanczos2 window The kernel extends over 4ndim pixels LANCZOS3 a d sinc xd sinc 3 xd response function with 3 lt xd 3 Lanczos3 window The kernel extends over 6ndim pixels LANCZOS4 a d sinc xd sinc 4 xd response function with 4 lt xd 4 Lanczos4 window The kernel extends over 8ndim pixels As demonstrat
11. advised to use large BACK SIZEs in SWarp Of course if the mesh size is too large it will not be able to reproduce all the variations of the background a good compromise has to be found by the user Typically for reasonably sampled images a size of 128 the default to 512 pixels should work well The nal background map is a natural bicubic spline interpolation between the meshes of the grid Before interpolating a median lter can be applied to suppress possible local overestima tions due to bright stars or artifacts BACK FILTERSIZE sets the size in background meshes of the median lter 1 means no ltering applied to the background grid Usually a size of 3 meshes the default is su cient but it may be necessary to use larger dimensions especially to compensate in part for small background mesh sizes or in the case of large artifacts in the images Median ltering also helps reducing possible ringing e ects of the bicubic spline around bright features In some speci c cases it might be desirable to median lter only background meshes whose original values exceed some threshold above the ltered value This di erential threshold is set by the BACK FILTERTHRESH parameter in ADUs The default is 0 By default the computed background map is automatically subtracted from the input image But there are some situations where it is more appropriate to subtract a constant from the image e g images where the backg
12. does not use much memory the amount of temporary disk space needed during processing can be quite large In addition to the output image and weight map one should provide disk space for the individual projected images and their weight maps In the case of mappings done at unit scale this involves storing more than twice the amount of input pixels as temporary data 9 5 3 Propagating FITS keywords During the re gridding and co addition processes involved in SWarp the FITS keywords present in the input image headers are not automatically copied to the output image headers many of them become irrelevant Nevertheless for data management purposes it is often useful to propagate some selected FITS keywords such as FILTER EXPTIME or TELESCOP for instance and their values from the input image headers to the resampled and coadded image headers To this aim a COPY KEYWORDS con guration parameter is provided It accepts a list of FITS keywords that shall be copied in the headers of all the images created by SWarp by default only the OBJECT keyword and its content are copied But because the coadded image can result from the combination of many input les only the keyword found in the rst image header from the input le list is propagated up to the nal coadded image It is important to note that SWarp does not check the content of the list of COPY KEYWORDS therefore one should be cautious not to propagate FITS keywords like NAXIS1 B
13. each image if the GAIN KEYWORD keyword is not found in the FITS header 0 means in nite GAIN KEYWORD GAIN string FITS keyword that should contain the gain in input images HEADER ONLY Y boolean If true SWarp does not do anything but create the FITS header in the combined image This header can later be duplicated as head les to provide on several machines HEADER SUFFIX head string Extension of the external ASCII headers that shall be seeked to over ride internal FITS parameters IMAGEOUT NAME coadd fits string Name of the output image le IMAGE SIZE integers n ndim Dimensions of the output image in PIXELSCALE TYPE MANUAL or FIT mode MEM MAX 128 integer Maximum amount of megabytes al lowed for silicon memory storage NTHREADS 1 or 2 MP integer Number of threads processes to run simultaneously during the resampling phase SWarp must have been com piled with the threads option enabled for this parameter to take e ect OVERSAMPLING 0 integers n ndim Amount of oversampling in each di mension 0 means automatic PIXEL SCALE oats n ndim Step between pixels in each dimension in PIXELSCALE TYPE MANUAL mode For angular coordinates it must be expressed in arcseconds PIXELSCALE TYPE MEDIAN keywords n ndim The way SWarp sets the output pixel size MEDIAN Take the median of pixel scales at the center of input frames MIN
14. input images the latter must be background subtracted prior to coaddition to avoid generating discontinuites in the output image Thus one can write the output coadded ux as fj i qiwijpi fij i qiwij pl flj l 26 and the resulting variance as 2 j i k2 i w2 ijp2 i 2 ij i qiwij 2 27 Using 23 an equivalent local gain Gj in the coadded image can be computed Gjwj fj 2 j i qiwijpi fij i k2 i w2 ijp2 i 2 ij i qiwij 28 where wj is the composite weight map of the coadded image From our de nition of weights wj is inversely proportional to 2 j and must be 1 if all input weights are at 1 hence it is easy to show that wj i qiwij i qi 29 Substituting 29 in 28 and using 22 and 23 one gets Gj i qiwij i k2 i wijpig 1 i i qi 30 Unfortunately as can be seen this coadded gain will vary with position in the general case Nevertheless some approximations can be made to simplify this expression First of all in most cases gi will be almost constant from one input image to another Second if exposures are taken under photometric conditions with constant sky brightness and negligible instrumental noise one should have qi p 1 i removing the dependence with input weights and therefore position in the coadded image In that very case the resulting gain is simply G g i p
15. nd out if a program could t his needs S Sam What s the point in releasing another image co addition software We already had the Drizzle and MSCRED IRAF packages for instance Author Co addition is most certainly the most critical step in reducing modern CCD mosaic data Although several powerful packages are already available they did not meet all the requirements we have at the TERAPIX data center here in Paris S Sam SWarp doesn t perform the astrometric calibration does it Author No it doesn t The astrometric calibration software of the TERAPIX pipeline will be released in future versions of the software In the meanwhile any polynomial description will do you may use IRAF for instance S Sam I am the kind of guy who does high precision astrometry and photometry My sources are detectable on raw frames Resampling you know would just wreck the signal so I prefer to combine measurements from individual images than to co add pixels Author It is true that resampling distorts slightly both signal and noise However if done properly and if the data are not undersampled Full Width at Half Maximum gt 2 5 pixels 1see http www cv nrao edu fits documents wcs wcs html 1 the degradation is generally very small For instance resampling a single ground based image atmospheric seeing of FWHM 3 pixels and conversion factor 2e ADU twice with SWarp and comparing uxes and positions measured using PSF
16. robust co additions even with strongly non Gaussian noise distributions However it is suboptimal for Gaussian noise the resulting variance is increased by 60 compared to what is obtained with an average As with all non linear combinations one should check that input images have approximately the same Point Spread Function if point sources are to be co added MIN The output is the minimum of all pixel values with non zero weights F min pifi 16 The variance of F is too noise distribution dependent to allow some estimation hence we set W 1 if n 0 0 0 otherwise 17 MAX The output is the maximum of all pixel values with non zero weights F min pifi 18 The variance of F is too noise distribution dependent to allow some estimation hence we set W 1 if n 0 0 0 otherwise 19 Maxima and minima can be useful for identifying defects or rare events in a set of data WEIGHTED The output is a weighted average of input values F i wipifi i wi 20 The output weight is just the sum of input weights W i wi 21 This combination should be the most appropriate for detecting and measuring faint sources on properly weighted homogeneous images Because it is a linear processing new data can be added later if needed 26 5 9 2 Weighted coaddition Weight maps provide a convenient way to store the standard ux error assigned to each pix
17. ELSCALE_TYPE MANUAL The full sky area will exceed the fraction that contains the fields PIXEL_SCALE 1800 0 in arcsec Half a degree per pixel at image center on both axes IMAGE_SIZE 800 400 360 0 5 720 180 0 5 360 plus a margin Resampling RESAMPLING_TYPE BILINEAR For illustration purposes no need for a sophisticated interpolation OVERSAMPLING 4 A small oversampling only to have pretty antialiased field limits INTERPOLATE N 12http skyview gsfc nasa gov 30 GAIN_KEYWORD GAIN GAIN_DEFAULT 0 0 Background subtraction SUBTRACT_BACK N No background subtraction BACK_TYPE AUTO BACK_DEFAULT 0 0 BACK_SIZE 128 BACK_FILTERSIZE 3 Virtual memory management VMEM_DIR VMEM_MAX 2047 MEM_MAX 128 128 MB should be enough to avoid swapping Miscellaneous DELETE_TMPFILES Y Delete temporary resampled FITS files VERBOSE_TYPE NORMAL In this application coverage maps can be generated using the output weight map instead of the image itself 7 2 Example 2 In this example one has a set of CCD images taken with a standard dithering strategy input fits and the related set of weight maps input w fits However the unusual thing is that for s
18. ITPIX that may interfere with the interpretation of the output data 5 4 Parallel processing Versions 1 32 of SWarp can be compiled with multi threading enabled2 Multi threading allows CPU intensive tasks in SWarp to be run in parallel on Symetric Multi Processing SMP or Hyper Threaded HT machines By default SWarp MP uses 2 computing threads which should lead to a 1 85 speed up in resampling compared to the mono threaded version on an SMP machine The number of computing threads used can be set with the NTHREADS con gura tion parameter Best performance is generally achieved with NTHREADS equal to the number of processors in the machine3 Figure 3 shows the improvement in SWarp pixel throughput as a function of NTHREADS on a 4 processor machine Departure from a linear scaling with the number of threads are mostly due to I O limitations and parts of code that are not multithreaded 5 5 Astrometry The astrometric engine at the heart of SWarp is based on M Calabretta s WCSlib library4 to which we added the handling of polynomial distorsion parameters FITS keywords PV xx xx as proposed in the latest WCS documents5 We included IRAF s TNX astrometric projection too for inputs only although it is not part of the WCS standard All celestial coordinate computations are performed in the equatorial system Galactic or ecliptic coordinates are supported in input and output 5 5 1 Input frames De projectio
19. SWarp v2 15 User s guide E BERTIN Institut d Astrophysique amp Observatoire de Paris December 10 2004 Contents 1 What is SWarp 1 2 Skeptical Sam s questions 1 3 Installing the software 2 3 1 Software and hardware requirements 2 3 2 Obtaining SWarp 2 3 3 Installation 2 4 Using SWarp 3 4 1 The Con guration le 3 4 1 1 Creating a con guration le 3 4 1 2 Format of the con guration le 3 4 1 3 Con guration parameter list 3 5 How SWarp works 7 5 1 Overview of the software 7 5 2 Image mapping and memory constraints 7 5 3 Propagating FITS keywords 10 5 4 Parallel processing 10 5 5 Astrometry 10 5 5 1 Input frames
20. YPE MANUAL mode Can be given in oating point notation in hh mm ss for right ascension longitude or dd mm ss for declination latitude COMBINE Y boolean If true resampled images will be com bined COMBINE BUFSIZE 64 integer Amount of bu er memory in MB used for the co addition process COMBINE TYPE MEDIAN keyword The way SWarp combines resampled images MEDIAN Take the median of pixel values AVERAGE Take the average MIN Take the minimum MAX Take the maximum WEIGHTED Take the weighted average CHI2 Take the weighted quadratic sum COPY KEYWORDS OBJECT strings n 1024 Coma separated list of FITS keywords that will be propagated from the input FITS headers to the coadded and re sampled image headers DELETE TMPFILES Y boolean If true resampled temporary image les are deleted if COMBINE is set to Y FSCALASTRO TYPE FIXED keyword The way SWarp computes the astro metric part of the ux scaling NONE Ignore the e ects of re projection FIXED Apply a xed correction based on the ratio of pixel scales 4 FSCALE DEFAULT 1 0 oats n nima Default uxscale to adopt for each im age if the FSCALE KEYWORD keyword is not found in the FITS header FSCALE KEYWORD FLXSCALE string FITS keyword that should contain the ux scale in input images GAIN DEFAULT 0 0 oats n nima Default gain conversion factor in e ADU to adopt for
21. YWORD GAIN GAIN_DEFAULT 0 0 Background subtraction SUBTRACT_BACK Y Needed for co adding dithered fields BACK_TYPE AUTO BACK_DEFAULT 0 0 BACK_SIZE 128 BACK_FILTERSIZE 3 Virtual memory management VMEM_DIR VMEM_MAX 2047 MEM_MAX 128 128 MB should be enough to avoid swapping Miscellaneous DELETE_TMPFILES Y Delete temporary resampled FITS files VERBOSE_TYPE NORMAL To implement the unusual output features required one must write a coadd head ASCII le that contains a custom anisotropic scaling matrix A coadd head for pixels 0 2 large that tilts the image by 30 degrees and applies a 16 9 anamorphosis to the data would be CD1_1 6 4150E 5 CD1_2 2 0833E 5 CD2_1 3 7037E 5 CD2_2 3 6084E 5 END 32 8 Troubleshooting My window terminal crashes during a long SWarp run Unexpected crashes of XTerm windows have been reported This seems to be caused by the large number of ANSI control sequences that SWarp sends to the terminal You may either set the SWarp con guration keyword VERBOSE TYPE to QUIET or FULL and or redirect the output to a le SWarp crashes with error messages like gt Error pthread create failed The multithreaded version of SWarp requires a fairly large stack that may exceed
22. al in both dimensions to avoid anamorphosis 12 Table 1 Valid PROJECTION TYPEs in SWarp Zenithal projections AZP Zenithal perspective TAN Distorted tangential STG Stereographic SIN Slant orthographic ARC Zenithal equidistant ZPN Zenithal polynomial ZEA Zenithal equal area AIR Airy Cylindrical projections CYP Cylindrical perspective CEA Cylindrical equal area CAR Plate carr ee MER Mercator Conic projections COP Conic perspective COE Conic equal area COD Conic equidistant COO Conic orthomorphic Pseudoconic and polyconic projections BON Bonne s equal area PCO Polyconic Pseudocylindrical projections GLS Global sinusoidal Sanson Flamsteed PAR Parabolic MOL Mollweide AIT Hammer Aito Quad cube projections TSC Tangential spherical cube CSC COBE quadrilateralized spherical cube QSC Quadrilateralized spherical cube 13 AZP TAN STG SIN ARC ZPN ZEA AIR CYP CEA CAR MER COP COE COD COO BON PCO Figure 4 Graphic illustration of projections available in the WCS library see text 14 GLS PAR MOL AIT TSC CSC QSC Figure 5 Graphic illustration of projections available in the WCS library continued from Fig 4 The PIXEL SCALE parameters are active in PIXELSCALE TYPE MANUAL mode only and must be used to specify the actual pixel step for each dimension in world units Note that in the case of angular coordinates PIXEL SCALE values are read in arcseconds n
23. e i e constant ux per solid angle The ux measured on the at elded image is therefore Ff S q x f x f0q x x d2x S f x f0 x d2x 8 where is the local sky area sustained by a pixel area 1 in pixel units and f0 the scaling factor of the at eld which we will set to 1 for the sake of simplicity As can be seen at elding does not make the image at in terms of sensitivity it introduces a dependency with astrometrical distorsion With most cameras the e ect is generally small 1 millimag The resampling operations described in 5 6 are designed to conserve surface brightness per pixel hence the ux recorded on the warped image with new physical coordinates x is now Ffw S f x x d2x S f x x x i xj d2x S f x x i j d2x 9 represents the local angular sky coordinate vector We have made use of the fact that if pixel size is small compared to the rate of change of plate scale which is almost always true x is equal to the Jacobian of the de projection i xj Now if an equal area projection is selected for the output image x i j is constant and we have the nice relation Ffw F This means that swarping properly at elded data using an equal area output projection produces an image with a perfectly at response to the incoming
24. ed in Fig 6 the Lanczos4 interpolation function provides the best resampling for correctly sampled data In theory one could use an even larger kernel to get a closer to perfect resampling However in practice large kernels with a sharply limited bandpass carry more problems than advantages Artifacts image borders or undersampled data generate extended ripples Gibbs phenomenon These ripples are obvious on the saturation trail and the cosmic ray impact of the Lanczos interpolations in Fig 6 In addition the computational cost becomes prohibitive with multi dimensional data Nearest neighbour interpolation provides a good conservation of the noise spectrum at scales close to unity unfortunately it generates a terrible aliasing when zooming in and can distort a lot object shapes at places Its usage should therefore be restricted to images such as ag or weight maps Bilinear interpolation is fast and doesn t generate negative artifacts However it creates a lot of smoothing by correlating the values of neighbour pixels On images with white noise this may lead to obvious moir e e ects Fig 7 Nevertheless bilinear interpolation can be useful for processing undersampled data In general Lanczos3 resampling represents the best compromise As can be seen in Fig 8 it brings a substantial bene t over bilinear interpolation in preserving the signal while creating relatively modest artifacts around image discontinuities
25. eight pixel will yield a clump of about 64 pixels in the resampled image This is another illustration of the disadvantages in using large interpolation kernels 5 7 Background subtraction The ux at each pixel is a function of the sum of a background signal and light coming from the objects of interest At most wavelengths the strongest contribution to the background is of instrumental atmospheric ecliptic origin and is therefore prone to changes between exposures If not subtracted the compositing of all these exposures will often produce an ugly patchwork created by all the di erent individual backgrounds A solution to this problem is to apply background subtraction prior to resampling and co adding the data Large scale gradients of instrumental origin are commonly found on astronomical images hence subtracting a constant from each frame will generally yield poor results as shown in Fig 11 It is therefore necessary to subtract a smooth background map which contains the low spatial frequency noise components of the data including any o set Subtracting a background map may alter or destroy the signal of scienti c interest thus some caution is needed in choosing parameters for this procedure Background subtraction is activated by setting the SUBTRACT BACK con guration parameter to Y which is the default Setting it to N will disable subtraction but background estimation will still take place it is needed by other SWar
26. el For each input image 1 i N entering image combination one can de ne the following parameters in an arbitrarily small pixel j The local uncalibrated ux fij fij fij where fij is the ux contributed by the sky background and fij that contributed by celestial sources the local uncalibrated variance of the ux 2 ij 2 ij 2 ij where 2 ij is the ux variance contributed by the background noise and 2 ij that contributed by the photon statistics of celestial sources the local normalized weight11 wij the electronic gain of the CCD gi in e ADU de ned at wij 1 the relative ux scaling factor pi deduced from the photometric solution to calibrate the images pi fij pl flj i j l 22 and the relative weight scaling factor qi derived from the comparison of the background noise level with the normalized weight input images will be weighted with qiwi fi 2 i wi and gi are related through giwij fij 2 ij 23 Now to optimally co add calibrated images one could weight them using qiwij 1 p2 i 2 ij 24 However such weight maps exhibit strong variations on small scales in the presence of celestial objects 2 ij increases a lot on bright pixels The modulating e ect of weighting combined with variations of the PSF and sampling errors would lead to signi cant distorsions of stellar pro
27. esampled projected into subsections of the output frame and saved as FITS les Projected weight maps are created too even if no weight maps were given in input 4 A combined output image is created using the information stored in the projected weight maps It consists of a composite of the resampled sub sections A composite output weight map is also written in the process The global layout of SWarp is presented in Fig 1 Let us now describe each of the important steps 5 2 Image mapping and memory constraints How does SWarp projects input images into the output frame space There are two ways of applying a geometric transformation to an image see Wolberg 1992 The most intuitive is called forward mapping It consists in scanning the input image pixel per pixel line by line Each pixel is simply thrown to the position it is supposed to occupy in the output grid Although this technique can be used for geometric resampling or drizzling Fruchter amp Hook 1997 it is totally cumbersome with high order interpolation techniques Inverse mapping is far more e cient in this case In this procedure the output frame is scanned pixel per pixel and line by line Using the inverse projection each output pixel center is associated a position in the input frame at which the image is interpolated This technique has been implemented in SWarp Fig 2 it possesses several advantages The output image is acc
28. esampled at an earlier stage RESAMPLE should be set to N in that case SWarp will skip all the background subtraction and resampling stage and jump directly to the combine process Prior to version 2 0 this feature only worked with input resampled images produced by SWarp because of some speci c information needed in the FITS header Since version 2 0 any FITS image can be used However when RESAMPLE is set to N SWarp combines input images with the implicit assumption that they all share the same CRVAL and CDELT WCS parameters images are placed in the nal frame according to their CRPIX and NAXIS Setting both RESAMPLE and COMBINE to N will not produce any output le but can be useful to check the content of input data or to adjust output astrometric parameters By default RESAMPLE and COMBINE are both set to Y It may sometimes be useful to create only the header of what will become the combined image for instance for generating an output head le that will de ne the output projection system Such a head le can then be copied to several machines that will resample input images to a common projection for later co addition This can be done by setting the HEADER ONLY con guration parameter to Y processing will stop before resampling like in the case where RESAMPLE and COMBINE are set to N but this time the header of the output image will be written to disk 7 Examples In the following examples of use of SWar
29. essed sequentially and thus can be arbitrarily large Also only positions corresponding to pixels or sub pixels within the output frame have to be mapped The most potentially critical part is the pseudo random access in the input image In most cases it will be an individual imaging array like an individual CCD and will therefore t in memory For much larger input images however we rely on the e ciency of virtual memory mapping SWarp s virtual memory engine works in the following way each input image stored as a single precision 4 byte array is loaded in physical memory if the required amount of megabytes doesn t exceed MEM MAX If it does a temporary le called vmxxxxx xxxxx tmp is written in the directory speci ed by VMEM DIRECTORY The program exits with an error message if this le would exceed VMEM MAX Megabytes The 3 memory parameters are mostly hardware dependent It is advised to set MEM MAX to 50 100 of the actual amount of memory present in your machine If disk space is not the limiting factor VMEM MAX should be set to a higher value 2048 on a 32 bit machine or even more on a 64 bit machine The choice of the VMEM DIRECTORY is critical First this write enabled directory must be large enough to contain each input image in oating point format Second it is strongly recommended to have the data on a fast disk Note that the 7 Input frames Warped weight maps weight map Composite Co added image
30. for COMBINE BUFSIZE is 64 Megabytes If your machine is a bit short of memory you should decrease this value Conversely if you need to combine a large number of overlapping images you might want to set COMBINE BUFSIZE to a substantial fraction of the memory available on your machine to avoid disk thrashing 6 Two step co addition and resampling All the operations described so far can be done in one single run of SWarp This generally su cient for small projects which usually involve observations conducted over a short period of time However for large sky surveys that can extend over years this implies waiting for the data to accumulate after passing through the reduction pipeline In this case SWarp would only be started once all the elds that cover a given sky area are available Much of SWarp processing time is spent in resampling the data therefore for projects that extend over a long period of time it would be more e cient to resample the images as they come out of the reduction pipeline The remaining of the work co addition could be done at a later date To solve this problem versions 1 32 of SWarp allow the internal processing pipeline to be split in two image resampling and image combining If the COMBINE con guration parameter is set to N SWarp stops right after having background subtracted and resampled the input images The DELETE TMPFILES option is then automatically deactivated To combine images r
31. is W 1 13 The result of the combination is a so called 2 image Although it does not respond linearly to the input signals it can be used for detecting sources As shown by Szalay et 25 al 1999 the 2 image is indeed the optimum combination to achieve panchromatic detection on a set of images taken at di erent wavelengths provided the data sets are background noise limited and that the noise is uncorrelated between frames This assumes further that the Point Spread Function PSF has been homogenized in all channels 2 images are most often used in deep panchromatic surveys requiring photometric redshift analyses The double image mode of SExtractor allows one to detect on the 2 image while making the photometric measurements on each of the single band images MEDIAN The output is the median of all scaled pixel values with non zero weights F median fi 14 Assuming Gaussian noise distribution we obtain the following approximation to the com posite weight see e g Kendall amp Stuart 1977 W 2 i wi n 0 2 n 0 2 1 if n 0 is even 2 i wi n 0 2 n 0 2 otherwise 15 This approximation can become inaccurate if wj varies by large proportions a factor of 3 or more from frame to frame The median is convenient for combining data polluted by unidenti ed glitches or noise spikes It generally provides safe
32. is strongly advised to install the RPM packages if you are running Linux on a machine with ix86 architecture and RPM support as they contain a strongly optimized version of the code The MP multi processor version can take advantage of multiple processors in an SMP or even hyperthreaded con guration by running several threads at the same time 3 3 Installation To install you must rst uncompress and unarchive the archive gzip dc swarp x x tar gz tar xvf A new directory called swarp x x should now appear at the current position on your disk You should then just enter the directory and follow the instructions in the le called INSTALL The software is also available as a precompiled RPM for Linux systems with an x86 architecture The multithreaded version with the mp su x in the lename shall be installed preferably on machines with multiple processors to take advantage of parallel processing The simplest way to install an RPM package is to log as root and use the following command rpm U swarp x x dist arch rpm 2 4 Using SWarp SWarp is run from the shell with the following syntax swarp Input image1 Input image2 c con guration le Parameter1 Value1 Parameter2 Value2 The part enclosed within brackets is optional Any Parameter Value statement in the command line overrides the corresponding de nition in the con guration le or any default value see below
33. larger elds the pure tangential projection is inappropriate and one is faced with the usual problems confronted by cartographers It would be outside the scope of this document to discuss the merits of each projection For detailed information about the di erent projection systems the user should refer to the latest WCS document Let us just mention that equal area projections those that conserve relative areas are often to be preferred for mapping large sky surveys because they naturally conserve surface brightness and or allow summing pixel values to measure uxes The following are equal area projections ZEA CEA COE BON GLS PAR MOL AIT QSC AIT Aito is one of the most popular projections for all sky maps Note that some of the projections CYP CEA COD COE COO COP and BON require additional PV xx xx parameters These parameters can easily be included in a xxxx head header le with the same pre x as the output coadded image which is coadd ts by default see the example at the end of this document Centering of the output frame is controlled by the CENTER TYPE parameter There are three centering modes ALL the eld is centered in a way that all input images t into the output frame This is the default MOST the eld is centered on the zone of maximum overlap between input images MANUAL manual centering with the CENTER parameter A di erent centering mode can be used in each dime
34. n parameters of input images are extracted from their respective FITS headers These are the usual CTYPEx CRVALx CRPIXx CDELTx and or CD xx xx WCS parameters Exter nal header les can also be provided by the user for every input xxxx ts image SWarp looks for a xxxx head header le and loads it if present A head su x is the default it can be changed 2To check if your SWarp executable is multi threaded run it without any argument Multi threading is enabled if the displayed version number is followed by MP 3The actual number of threads started by SWarp is always larger than NTHREADS but no more than NTHREADS threads are active simultaneously 4Available at http www cv nrao edu fits src wcs 5http www cv nrao edu fits documents wcs wcs html 10 Figure 3 Pixel throughput of SWarp 2 0 resampling Lanczos3 as a function of the NTHREADS con guration parameter on an SMP machine with 4 Opteron 242 1 6GHz processors Perfect linear scaling is indicated by the dashed line for reference using the HEADER SUFFIX con guration parameter External headers may either be real FITS header cards no carriage return or ASCII les containing lines in FITS like format with the nal line starting with END Multiple extensions must be separated by an END line External headers need not contain all the FITS keywords normally required The key words present in external header
35. nsion for instance in 2D images with coordinates CENTER TYPE ALL MOST will apply the ALL mode in and the MOST mode in If a single mode is speci ed it is applied to all available dimensions The CENTER parameters are active in CENTER TYPE MANUAL mode only and must be used to spec ify the actual center of the output eld in world units In the case of angular coordinates both the oating point in degrees and sexagedecimal formats are accepted right ascension longitude may be written as hh mm ss ss and declination latitude as dd mm ss ss The pixel scale which is the step between pixels at the center of the output frame can be computed automatically in each dimension by SWarp There are ve modes speci ed by the PIXELSCALE TYPE con guration parameter MEDIAN the default the median value of all pixel scales at the center of input frames is taken as the output pixel scale MIN the smallest of all pixel scales at the center of input frames is taken MAX the largest of all pixel scales at the center of input frames is taken MANUAL manual scaling with the PIXEL SCALE con guration parameter FIT Pixel scales are automatically computed to have the projected data tting the output frame dimensions speci ed with the IMAGE SIZE con guration parameter When right ascension longitude and declination latitude are both present pixel scales computed by SWarp are made equ
36. ome reason the output has to be tilted by 30 degrees with respect to the local north south axis and the pixels must have an aspect ratio of 16 9 First one starts with a fairly standard con guration le Output IMAGEOUT_NAME coadd fits Output filename WEIGHTOUT_NAME coadd weight fits Output weight map filename Input Weights WEIGHT_TYPE MAP_WEIGHT all or for each weight map WEIGHT_SUFFIX w fits Suffix to use for weight maps WEIGHT_IMAGE Weightmap filename if suffix not used all or for each weight map Co addition COMBINE_TYPE WEIGHTED weight maps are provided 31 Astrometry CELESTIAL_TYPE NATIVE Standard stuff PROJECTION_TYPE TAN A tangent projection will do CENTER_TYPE ALL We want all the data to fit in CENTER 00 00 00 0 00 00 00 0 Not used in CENTER_TYPE ALL mode PIXELSCALE_TYPE MEDIAN Will be overriden by coadd head PIXEL_SCALE 0 0 Not used in MEDIAN mode IMAGE_SIZE 0 Automatic sizing Resampling RESAMPLING_TYPE LANCZOS3 High quality resampling OVERSAMPLING 0 Auto oversampling 1 in that case INTERPOLATE N GAIN_KE
37. or extensive testing and suggestions and Henry Joy McCracken TERAPIX IAP for help with the manual and additional testing References 1 Anscombe F J 1948 Biometrika 15 246 2 Bertin E 1999 SExtractor 2 1 User s manual IAP 3 Da Costa G S 1992 in Astronomical CCD Observing and Reduction Techniques ed How ell S B ASP Conf Series 4 Fruchter A Hook R N 1997 SPIE 3164 120 5 Infante L 1987 A amp A 183 177 6 Jarvis J J Tyson J A 1981 AJ 86 476 33 7 Kendall M Stuart K 1977 The Advanced Theory of Statistics Vol 1 Charles Gri n amp Co London 8 Starck J L Murtagh F Bijaoui A 1998 Image Processing and Data Analysis Cambridge University Press 9 Szalay A S Connolly A J Szokoly G P 1999 AJ 117 68 10 Wolberg G 1992 Digital Image Warping IEEE Computer Society Press 34
38. orrection factor to account for possible mis matches in pixel size Hence ux is conserved only with equal area projections Astrometric ux scaling can also be deactivated by using the FSCALASTRO TYPE NONE option Future versions of SWarp may include variable pixel scale correction for non equal area projections 5 9 Combining resampled images This is the last part of the processing Now at each pixel position of the output image SWarp has to combine data values coming from all the resampled image each one coming with a rough estimate of its variance from the resampled weight map Many combinations are therefore possible 5 9 1 Various types of image combination The user can choose between the following options as arguments to the COMBINE TYPE con gu ration parameter AVERAGE The output is simply an unweighted average of all pixel values with non zero weights F i pifi n 0 10 where pi is the ux scaling factor see 5 8 and the composite weight is W n2 0 i 1 qiwi 11 where the wi are proportional to the inverse of the scaled variance 1 p2 i 2 Needless to say that this combination is not optimum in terms of S N unless all input images have identical Gaussian noise CHI2 The output is the square root of the reduced 2 of all pixel values with non zero weights F i wif2 i n 0 12 By construction the composite weight the absolute one
39. ory storage WEIGHT IMAGE strings n nima List of input weight maps WEIGHTOUT NAME coadd fits string File name of the output weight map WEIGHT THRESH oats n nima Threshold below or above which input weights are equivalent to zero in nite variance i e a bad pixel WEIGHT TYPE NONE keywords n nima Type of input weight maps NONE no weighting MAP WEIGHT relative weights i e inverse vari ance MAP VARIANCE relative variance MAP RMS absolute standard deviation WRITE FILEINFO N boolean If true extended information about input les is written in the header of the output FITS image VERBOSE TYPE NORMAL keyword How much SWarp comments its op erations QUIET run silently NORMAL display warnings and limited info concerning the work in progress FULL display more complete information 6 5 How SWarp works 5 1 Overview of the software What SWarp does is basically to read a set of input FITS images resample and combine them and nally save the resultant FITS image to disk The work can be decomposed in several steps 1 Input image headers are read and checked for content If con gured in fully automatic mode SWarp will set the characteristics of the output frame based on this information 2 Input images and their weight maps if available are read one by one Background maps are built and subtracted from the images if required 3 Images are r
40. ot degrees The dimensions of the output frame in number of pixels per axis are set using the IMAGE SIZE con guration parameter A value of 0 for any axis results in an automatic dimensioning of this axis but obviously this is not possible in PIXELSCALE TYPE FIT mode Note that the current automatic centering and scaling routines can get confused rather easily with some very wide eld projections In particular it is recommended to turn o automatic settings when making all sky projections 5 5 3 Bi cubic spline interpolation The trigonometric calculations involved in SWarp re projections have a major impact on pro cessing speed To accelerate the resampling phase versions 2 06 of SWarp implement a bi cubic spline interpolation6 of the astrometric mapping between the input and the output frames Interpolation is used by default for large images with a maximum allowed positional error of 10 3 pixel as measured in the output frame This error tolerance can be changed independently for each input image with the PROJECTION ERR con guration parameter A PROJECTION ERR of 0 turns interpolation o Interpolation is also automatically deactivated for smaller images or inappropriate mappings like all sky projections or projection with singularities 5 6 Resampling The action of projecting a grid of pixels on another grid is called resampling Ideal image resampling involves both ltering and interpolation between pixels In
41. p are given together with commented con guration les 29 7 1 Example 1 Let us assume one wants to produce a full sky Aito representation in galactic coordinates of a series of observed elds stored in fits 2D les with WCS info for illustration purposes The les might be dummy ones supplemented with hand made headers or obtained from virtual telescopes such as SkyView12 or real ones In all cases an additional full sky map is useful to delimit the full sky one may for instance download a 360 degrees Aito projection of COBE DIRBE data from SkyView The syntax is swarp fits A possible default swarp con guration le is Output IMAGEOUT_NAME coadd fits WEIGHTOUT_NAME coadd weight fits Input Weights WEIGHT_TYPE MAP_WEIGHT Not used here WEIGHT_SUFFIX weight fits WEIGHT_IMAGE Co addition COMBINE_TYPE AVERAGE This coaddition is for illustration only the weight map will contain a sum of field footprints Astrometry CELESTIAL_TYPE GALACTIC Coordinate system forced to galactic PROJECTION_TYPE AIT Code for Aitoff CENTER_TYPE MANUAL Imposed to alpha delta 0 0 CENTER 00 00 00 0 00 00 00 0 PIX
42. p tasks and the processing time will stay approximately the same Background estimation uses SExtractor s algorithm and is controllable with the same keywords8 The following is largely copied from SExtractor documentation Bertin 1999 7It is possible to stabilize the noise variance using a non linear dynamic scale transform Anscombe 1948 see also Stark et al 1998 The transformed signal is still bandpass limited but unfortunately resampling and transforming it back biases signi cantly the data 8In SWarp All background con guration keywords accept a list of values one value for each input frame 21 Figure 11 Example of residual gradients in a co addition after a constant has been subtracted from input images To construct the background map SWarp makes a rst pass through the pixel data computing an estimator for the local background in each mesh of a grid that covers the whole frame The background estimator is a combination of clipping and mode estimation similar to the one employed in Stetson s DAOPHOT program see e g Da Costa 1992 Brie y the local background histogram is clipped iteratively until convergence at 3 around its median if is changed by less than 20 during that process we consider that the eld is not crowded and we simply take the mean of the clipped histogram as a value for the background otherwise we estimate the mode with Mode 2 5 Median 1 5 Mean 4 This expres
43. parameters known to SWarp Please refer to next section for a detailed description of their meaning New parameters in version 2 0 of the software are indicated with a Parameter default type Description BACK DEFAULT 0 0 oats n nima Default background value to be sub tracted in BACK TYPE MANUAL mode BACK FILTERSIZE integers n nima Size in background meshes of the background ltering mask 3 BACK FILTTHRESH integers n nima Di erence threshold in ADUs for the background ltering BACK SIZE integers n nima Size in pixels of a background mesh BACK TYPE AUTO keywords n nima What background is subtracted from the images AUTO the internal interpolated background map MANUAL a user supplied constant value pro vided in BACK DEFAULT CELESTIAL TYPE NATIVE keyword Celestial coordinate system in output NATIVE Same as rst input le PIXEL No de projection faster EQUATORIAL Equatorial coordinates GALACTIC Galactic l b coordinates ECLIPTIC Ecliptic coordinates CENTER TYPE ALL keywords n ndim The way SWarp centers the output frame ALL Center on the region that contains all input elds MOST Center on the region with most over lap between input elds MANUAL Manual centering using the CENTER parameter CENTER 0 0 strings n ndim Position of the center in CENTER T
44. rinsic photon 18 Figure 8 E ects of the resampling on position top and ux bottom measurements Left bilinear interpolation right Lanczos3 interpolation In both cases a simulated deep sky image with 0 7 seeing containing stars and white background noise was rotated by 20 degrees and then rotated back to match the original image Fluxes were measured in a xed 2 aperture The dispersions seen here re ect the di erences between measurements on the original and resampled images These dispersions are much smaller than what one would observe by comparing the measurements on the resampled images with the theoretical noise free positions or uxes of the simulation Note however the signi cant magnitude o set and ux dispersion in the bilinear case consequences of the stronger smoothing induced by bilinear interpolation 19 Figure 9 Oversampling in SWarp The input grid is shown as small grey squares whereas the output grid resampled image is represented by the large tilted ones Left Without oversam pling only one interpolation dark spot of the input image is done at the center of each output pixel Right with oversampling several interpolated samples are obtained on a regular subgrid and then binned in each output pixel Here a 3 3 oversampling is su cient Figure 10 The e ect of oversampling in SWarp A deep real image with a 0 2 pixel scale and 0 8 seeing FWHM is resampled at 1 resol
45. round noise distribution is strongly skewed The BACK TYPE con guration parameter set by default to AUTO can be switched to MANUAL to allow for the value speci ed by the BACK DEFAULT parameter to be subtracted from the input image The default value is 0 As said before the background estimation procedure is used not only for background subtraction 23 but also for other tasks in SWarp such as weight calibration Thus even if SUBTRACT BACK is set to N or BACK TYPE is in MANUAL mode reasonable values for other background parameters must be given to ensure proper working of the software Note that the present version of background subtraction doesn t work on non 2D images 5 8 Scaling the ux How are uxes modi ed by image warping Let us assume F is the integrated ux in units of e for simpli cation of a source of nite extent S that would be recorded on a perfect detector array In the continuous limit we de ne F S f x d2x 6 where f x is the pixel value at physical position x on the detector In real life pixel values are a ected by a variable e ciency q yielding a measured raw ux Fr S q x f x d2x 7 Digital images are generally divided by a at eld and even a super at prior to SWarping The assumption behind at elding is that the light received from the sky or the dome and recorded to form the at eld has uniform radianc
46. s are only there to override their counterparts in the original image headers or add new ones 5 5 2 Output frames The celestial pair of components of the output coordinate system is speci ed with the CELESTIAL TYPE con guration parameter and can be selected among NATIVE PIXEL EQUATORIAL GALACTIC and ECLIPTIC In NATIVE mode the output celestial coordinate system is taken from that of the rst le of the input list This is the default The PIXEL option forces SWarp to ignore all the ce lestial aspects projection de projection sky coordinates of both input and output images It provides a major speed up to the warping engine by bypassing all the trigonometric operations normally involved in the other modes It is useful for quickly combining mosaic images whenever astrometric information is not needed In PIXEL mode degrees are interpreted as dimensionless Cartesian coordinates The output celestial projection is set by the PROJECTION TYPE con guration parameter The list of all presently supported projections is shown in Table 1 and illustrated in Fig 4 and 5 using a gridded map of the Earth Now what projection is the best With small elds lt 10 degrees in their maximum di 11 mension the choice is not critical as long as the projection center lies within the frame For compatibility reasons it is advised to stay with the traditional gnomonic TAN for tangential projection in such cases With
47. sion is di erent from the usual approximation Mode 3 Median 2 Mean 5 e g Kendall and Stuart 1977 but was found to be more accurate with our clipped distri butions from the simulations we made Fig 12 shows that the expression of the mode above is considerably less a ected9 by crowding than a simple clipped mean like the one used in FOCAS Jarvis and Tyson 1981 or by Infante 1987 but is 30 noisier For this reason we revert to the mean in non crowded elds 9Obviously in some very unfavorable cases like small meshes falling on bright stars it leads to totally inaccurate results 22 10 5 0 5 10 0 5 10 15 20 25 30 Clipped Mode ADU Clipped Mean ADU Figure 12 Simulations of 32 32 pixels background meshes polluted by random Gaussian pro les The true background lies at 0 ADU While being slightly noisier the clipped Mode gives a more robust estimate than a clipped Mean in crowded regions The choice of the mesh size in pixels BACK SIZE is critical If it is too small the background estimation is a ected by the presence of objects and random noise But more important is the fact that part of the ux of extended objects can be absorbed in the background map The e ect may be almost unnoticeable on individual input images where the signal to noise ratio is low and have measurable photometric consequences on the deep coadded image It is therefore
48. the maximum value allowed by your shell Use the shell command limit to increase the stacksize parameter if required you might need the root privileges to change this if it is a hard limit SWarp crashes with error messages like gt Error Not enough memory for although I have properly set the MEM MAX VMEM MAX parameters The maximum value allowed by your shell for memory use might be set too low Use the shell command limit to increase the datasize memoryuse and vmemoryuse parameters if required you might need the root privileges to change this if it is a hard limit SWarp crashes with error messages like gt Error cannot open for reading during the co addition phase although it had no problem accessing the same les for resampling The maximum number of open les allowed by your shell might be set too low Use the shell command limit to increase the descriptors and openfiles parameters if required you might need the root privileges to change this if it is a hard limit 9 Acknowledgements Many thanks go to Mark Calabretta ATNF CSIO Epping for his great astrometric library Nicolas Devillard ESO Garching for introducing me to memory mapping techniques Mireille Dantel Fort Laurent Domisse Fr ed eric Magnard Yannick Mellier TERAPIX IAP Mario Radovich OAC Naples Roeland Rengeling Sterrewacht Leiden Roy Williams CACR Cal Tech and Dafydd Wyn Evans IoA Cambridge f
49. tting one gets for bright stars rms di erences of less than 5 10 4 mag and 10 3 pixel between the original and the twice resampled images This is already much better than what photon noise allows for Hence apart from situations of strongly non stationary noise or undersampled data the consequences of resampling are expected to be negligible 3 Installing the software 3 1 Software and hardware requirements SWarp has been developed on Unix machines Compaq Tru 64 and GNU Linux and should compile on any POSIX compliant system The software is run in ANSI text mode from a shell A window system is therefore unnecessary with present versions Memory requirements are fairly modest in most cases as they do not depend on the size of the output images 100MB is su cient when co adding images even mosaics involving current CCD chips 2k 4 5k More memory may be helpful for co adding bigger maps Although the built in virtual memory feature will almost always allow one to work with any image size the performance hit caused by le swapping may be important in some cases 3 2 Obtaining SWarp The easiest way to obtain SWarp is to download it from an internet site The current o cial anonymous FTP site is ftp ftp iap fr pub from users bertin swarp There can be found the latest versions of the program as standard tar gz Unix source archives including the documentation and Linux binaries as RPM packages For production it
50. uration parameter If OVERSAMPLING is set to 1 no oversampling is applied An OVERSAMPLING of 2 oversamples the data by 2ndim samples per pixel and so on Oversampling can be di erent in each dimension OVERSAMPLING 2 3 will oversample each pixel in a 2 3 grid for instance An OVERSAMPLING of 0 the default lets SWarp select automatically the most appropriate oversampling factor in each dimension by comparing pixel scales at the reference point Although it works fairly well in many cases situations where the pixel scale varies a lot over the image like in all sky projections are not yet properly handled and manual setting should then be prefered Note that oversampling considerably slows down the processing OVERSAMPLING values should therefore be selected with some caution 5 6 3 Noise stability issues So far we have ignored the in uence of noise variations in the resampling process In theory the interpolation schemes described above apply only if the noise is stationary in the wide sense over the extent of the interpolation kernel Artifacts aside this can be considered as true for the background noise since the weight maps are reasonably stable at the interpolation scale However the photon noise associated with the sources themselves may vary strongly over the scale of the PSF FWHM As most astronomical images are barely oversampled the hypothesis of noise stationarity breaks down on bright point sources for which int
51. ution Left no oversampling Right with 5 5 oversampling Note the lower noise level and higher depth in the right image 20 noises dominates7 In the most severe cases resampled noise peaks may generate distorsions in the resampled pro les Low background noise simulations were conducted in order to evaluate the amplitude of these distorsions on correctly sampled data PSF FWHM 3 pixels The e ect is small although not totally negligible on sources with intermediate intensity On pro le tting measurements for instance photometry can be a ected at the level of a few millimag rms The degradation of astrometric precision was found not to exceed a few millipixels rms On typical background noise limited images the e ects are even smaller 5 6 4 Weight maps The processing of the weight maps see 5 9 2 follows that of the data images except that one is dealing now with variances instead of uxes The resampled weight at position x may be written as w x 1 i k2 i x wi 3 Therefore when an input weight within the range of the interpolation function is zero the interpolated weight is also zero The general consequence is that the borders of interpolated images are trimmed by half the range of the interpolation function Similarly small holes in a provided weight map are dilated by the interpolation function footprint For example once interpolated with a Lanczos4 kernel a single isolated zero w
Download Pdf Manuals
Related Search
Related Contents
Active Thermal Management System 1 manual de utilização ASUS B85-PLUS J7928 User's Manual Copyright © All rights reserved.
Failed to retrieve file