Shell finder code. 1.01 The code is designed to look for best spherical expanding shell candidates in HI data-cubes. The present version is optimised and tested for the following range of parameters: - Original data - CGPS (Canadian Galactic Plane Survey) mosaics. - Original subcube size - 222 x 222 x 41*n pixels, where n=1,2,3. - The original subcube should be rebinned to the size 111 x 111 x 41 pixels. - The shell-generating object (e.g. massive star) is located at the center of the subcube (spatially, and in velocity). - The shell-generating object is required to be always within the shell boundaries (spatially and in velocity). - Range of possible shell radii - 2...26 rebinned pixels (for CGPS corresponds to 1.2 ... 15.6 arcmin). - Range of possible expansion velocities - 2...9 rebinned pixels (for CGPS corresponds to 3.3*n ... 15*n km/s). List of files in the package: Shell_finder/Linux/sf3 > sf3 code compiled for linux (x86) Shell_finder/Linux/integral > integral code compiled for linux (x86) Shell_finder/Makefile > makefile for the code compilation Shell_finder/README.Shell_finder > this file Shell_finder/SunOS/sf3 > sf3 code compiled for SunOS Shell_finder/SunOS/integral > integral code compiled for SunOS Shell_finder/dat/bg2.tab > table of upper limit of lg(rho) for fake shells detection (obtained emprirically from quiescent fields in CGPS data) Shell_finder/dat/model.fits > model template of 1/8 of spherical expanding shell (used in sf3.f) Shell_finder/dat.mon > Super Mongo script Shell_finder/lib/libfitsio_linux.a > FITSIO library for linux (x86) Shell_finder/lib/libfitsio_sun.a > FITSIO library for SunOS Shell_finder/rebin > shell script for FITS files rebinning Shell_finder/sf3.run > shell script to run sf3 code Shell_finder/src/integral2.f > Fortran program for FITS files rebinning Shell_finder/src/sf3.f > Fortran program for calculation of cross- correlations between different models and the data Required software: - Super Mongo (sm). (Attention! Due to a bug in sm, it might not work properly under Linux x86.) Optional software: - Fortran 77 compiler (can be g77) - in case you need to recompile the package. - Find.field package - to find an appropriate CGPS mosaic, and to cut a sub-cube. (Can be found on http://www.astro.umontreal.ca/~syam/software.html). - Package KARMA (especially program kview) - to visualize FITS data-cubes. (http://www.atnf.CSIRO.AU/karma). To compile: cd Shell_finder make Shell search consists from the following steps: 1) We should find the appropriate CGPS mosaic, and to cut a subcube centered at the point of interest (e.g. massive star), - both spatially and in velocity. Original pixel size should be 222 x 222 x 41*n (l x b x V), where n=1,2,3. n>3 have not been tested, and would require to change the parameter NZmax in the file integral2.f to 41*n_max value, and then - to recompile the code with "make" command. The package Find.field can be used at this step. 2) The original subcube should be rebinned to obtain the standard size 111 x 111 x 41 pixels. Use the following command: rebin original_subcube.fits rebinned_subcube.fits 2 n Here n is required velocity rebinning factor (1,2, or 3). 3) The most time consuming step is running the Shell Finder code itself. For the standard case the time required is ~1.5 hours on 500 MHz PC. Type: sf3.run rebinned_subcube.fits There are only 2 parameters in the script sf3.run which you can change: - Perform background subtraction? (default - true) - Dump? (default - false). The first parameter specifies the way the background is subtracted from the subcube before calculating cross-correlation coefficients between models and the data: when it's false, then no subtraction is performed; when it's true, then the background is subtracted as a linear function of two spatial coordinates within a circle with the center at the center of the subcube and the radius equal to twice maximum possible shell radius (~112 pix.) - separately for each velocity channel. When the parameter is true, an auxiliary file BS.fits is produced - which is the original datacube with background subtracted (pixels which have not been used for shell search are assigned "blank" value). The second parameter will be used later on - when the best shell candidate is found. The main output of the shell finder is file with the same name, as the input fits file, but with the extension ".dat". It contains all information required for the following analysis. It is wise to keep all .dat files produced - because it takes time to obtain them, and because they are universal, and do not depend on any assumptions about "structural" and instrumental noise in the data. 4) Search for best shell candidate in *.dat file using Super Mongo script dat.mon. There are a few parameters in the header of the dat.mon file which can be changed (using any text editor): - Name of the dat file. - Distance to the shell (pc). - Left boundary of lg(Nt). (Ntl) - Right boundary of lg(Nt). (Ntr) The total range of lg(Nt) is 1.5 ... 4.8. (Here Nt is the total number of non-zero 3D pixels in the model shell). The dat.mon script finds the best shell candidate with the size in the range Ntl...Ntr. These two parameters are useful when we are interested in other shell candidates (second-to-best, third-to-best ...). To run the script: - Start Super Mongo (sm). - Change parameters in the header of the dat.mon file. - Type "inp_new dat.mon". It will produce the detection plot (shell significance versus shell size), and parameters of the best shell candidate in the given range of lg(Nt). Red points located above blue horisontal line correspond to significant shell detections. One shell usually produces a broad peak of red points. Sometimes a double shell plot is produced (usually for very small, and big shells). In this case you can choose the particular shell by specifing the range of log(Nt) in the header of dat.mon corresponding to this shell. The script also creates auxiliary file with the extension .ann. The file is an annotation file for KARMA visualization package with location and size of the best shell candidates. 5) To make 3D visialization of the best shell candidate found with the use of KARMA package you should: - Run script sf3_best.shell.run (produced by sm script dat.mon). - At the end of the run the following files will be created: mod00.fits, and BS.fits (only if "Perform background subtraction?"=true). Now you can visualize the shell candidate using kview program in the following way: a) Load BS.fits (or rebinned_subcube.fits) as first data set. b) Load mod00.fits as second data set. c) Load *.ann annotation file (option in "Overlays" menu). d) Start "View" window ( by pressing the "View" button). e) Set "Display mode" to "Set 1 -> image, set 2 -> contour". f) Type %50 into "Contour Levels" window. g) Press "Apply Levels" button. h) Press "Movie" button; in Movie window you can scroll through velocity channels. CAUTION!!! Shell mass and other mass-related parameters ("Quiscent ISM number density" and "Required mechanical luminosity of the wind") produced by the dat.mon script are very unreliable and in most cases are smaller than the real ones by the factor of ~2-10. The reason is that real shells are never perfectly spherical. This doesn't affect much shell finding procedure (because the correlation coefficient values have only relative meaning - they are compared to correlation coefficients from quiscent fields.), whereas fitting the best spherical shell to the real data can miss most of the emission (because real shells can be thicker, and have deviations from spherical symmetry). Parameters listed after "Wind blown shell model:" correspond to wind blown shell model of Weaver et al. 1977. For shells produced by other means (e.g. SNe) these parameters should be ignored. EXAMPLE As an example I included one subcube from CGPS data - b.fits (around a B1V star HD18352). It was already rebinned with the spatial rebinning factor 4, and velocity rebinning factor 2. At the end the dat.mon script should produce the following output (for distance=568pc): Absolute maximum of r for log(N)=0...5: log(N)=3.895698786; r=1.48211813 Pixel coordinates of the shell center, and its relative distance from the star: x=46, y=58, v=25; de=1.0272367 Radius and expansion velocity of the shell: Rad=14.05737591 pix., Vel=5.5 pix. Celestial coordinates of the shell center: l0=137.9324799 dgr.; b0=2.197500229 dgr. Shell brightness and contrast: B=7363.836426 K; C=0.1866553873 Radius and expansion velocity in physical units: R=2.787146568 pc; V=9.069032669 km/s Shell mass (very uncertain, lower limit): M=8.858757019 M_Sun <<<<< Wind blown shell model: >>>>> Quiscent ISM number density (very uncertain, lower limit): n0=3.111313105 cm^(-3) Age of the shell: t=0.180215776 Myr Required mechanical luminosity of the wind (very uncertain, lower limit): L=6539.439453 (10^30 erg/s) The results for this star are shown in the Fig. 3 of Mashchenko & St-Louis (2000; astro-ph/0010140). ------------------------------------------------------------------------------------ HISTORY 1.01: 17 September 2001. The sf3.f program version is 3.29. Changes to dat.mon script - now it produces sf3_best.shell.run script for the best shell 3D visualization, shows location of the best found shell as dashed vertical line. New "debug" variable was added - useful for debugging the code with artificial (e.g. - noise free) data. 1.00: Released 1 June 2001. (Original release of the package). The sf3.f program version is 3.28. ------------------------------------------------------------------------------------ Any questions and comments please send to Sergey Mashchenko (syam@astro.umontreal.ca). The code can be found on my home page (http://www.astro.umontreal.ca/~syam/software.html).