cd ../pipeline/
/Users/dorislee/Desktop/GSoC2014/rc3-sdss/pipeline
from sdss import SDSS
from rc3 import RC3
WARNING: AstropyDeprecationWarning: ConfigurationItem has been deprecated in astropy 0.4. Use ConfigItem objects as members of ConfigNamespace subclasses instead. See ConfigNamespace for an example. [astropy.config.configuration] WARNING:astropy:AstropyDeprecationWarning: ConfigurationItem has been deprecated in astropy 0.4. Use ConfigItem objects as members of ConfigNamespace subclasses instead. See ConfigNamespace for an example.
This information was obtained from rc3_ra_dec_pgc.txt which contains relvant information extracted from the original RC3 Catalog. We are interested in mosaicking NGC0309, the alternate PGC naming is PGC3377, as shown in this NED search.
14.1779166667 -9.91416666667 0.0527046277749 3377
Creating an RC3 object for PGC3377
pgc3377 = RC3(14.1779166667,-9.91416666667,0.0527046277749,3377)
Create a Survey object for SDSS which can be used in the mosaicking process
sdss = SDSS()
Upon initializing the SDSS object, a corresponding data server is also generated.
sdss.data_server
<skyserver.SkyServer at 0x1146df6d0>
Since SDSS's "best band" (bandpass with the highest transmission) is red, we first generate a r band mosaic for source_info to work on. Margin denotes how large the size of the image should be. We use a margin of 3*radius in our first attempt. When choosing a margin, generally 2 ~ 4 times the radius is ideal. The chosen can not be so big that the object of interest shows up as a tiny speck in the image because source extractor may Treated as background or have trouble with estimating its radius. on the other hand margin can not be too small such that the images completely filled by the galaxy, SExtractor will have a trouble estimating the background which results in the non-detection.
sdss.best_band
'r'
radius = 0.0527046277749
rfits = pgc3377.mosaic_band('r',14.1779166667,-9.91416666667,3*radius,radius,3377,sdss)
rfits = 'SDSS_r_3377.fits'
If you are running this on a MacOSX machine, change the line in rc3.py :
os.system("sextractor {} {}".format(survey.sextractor_params, file))
to :
os.system("sex {} {}".format(survey.sextractor_params, file))
update = pgc3377.source_info(rfits,sdss)
1th iteration ------------------source_info---------------------- Source info for SDSS_r_3377.fits [['PGC 3377', '14.177758', '-9.913872']] ra,dec of catalog sources rc3_data: [[3377, 14.177758, -9.913872]] Radius: [317.44684594432499, 5.6568542494923806, 4.9497474683058327, 3.2015621187164243, 2.1213203435596424, 1.8027756377319946, 1.5811388300841898, 2.8284271247461903, 1.8027756377319946, 78.638413005350003, 55.326304774492215, 1.5811388300841898, 1.1180339887498949, 2.5, 2.8284271247461903, 3.2015621187164243, 1.1180339887498949, 2.5, 1.8027756377319946, 2.1213203435596424, 3.5355339059327378, 1.8027756377319946, 5.7008771254956896, 7.1063352017759476, 2.8284271247461903, 2.1213203435596424, 2.1213203435596424, 1.4142135623730951, 2.5, 1.1180339887498949, 3.2015621187164243, 1.4142135623730951, 3.2015621187164243, 3.2015621187164243, 2.5, 2.8284271247461903, 2.1213203435596424, 1.8027756377319946, 1.4142135623730951, 2.5, 2.8284271247461903, 2.5, 2.1213203435596424, 8.7464278422679502, 1.8027756377319946, 2.9154759474226504, 2.1213203435596424, 3.2015621187164243, 2.9154759474226504, 2.8284271247461903, 2.5, 2.8284271247461903, 1.4142135623730951, 4.9497474683058327, 2.5, 3.905124837953327, 2.5, 3.5355339059327378, 3.905124837953327, 2.1213203435596424, 2.2360679774997898, 1.8027756377319946, 12.103718436910205, 2.8284271247461903, 2.8284271247461903, 3.2015621187164243, 1.4142135623730951, 1.1180339887498949, 1.4142135623730951, 1.1180339887498949, 1.8027756377319946, 2.8284271247461903, 2.1213203435596424, 1.8027756377319946, 2.8284271247461903, 29.698484809834994, 2.1213203435596424, 1.8027756377319946, 2.1213203435596424, 3.2015621187164243, 1.1180339887498949, 2.1213203435596424, 4.3011626335213133, 2.5, 4.4721359549995796, 1.4142135623730951, 3.905124837953327, 2.1213203435596424, 5.315072906367325, 1.5811388300841898, 1.1180339887498949, 2.6925824035672519, 3.5355339059327378, 7.1063352017759476, 1.8027756377319946, 1.1180339887498949, 10.606601717798213, 12.747548783981962, 2.8284271247461903, 4.2426406871192848, 1.8027756377319946, 3.2015621187164243, 1.4142135623730951, 3.6055512754639891, 2.1213203435596424, 2.8284271247461903, 3.5355339059327378, 7.3824115301167001, 2.1213203435596424, 11.101801655587259, 2.5, 2.5, 3.905124837953327, 3.905124837953327, 4.2426406871192848, 2.9154759474226504, 1.8027756377319946, 6.7268120235368549, 2.8284271247461903, 2.1213203435596424, 3.905124837953327, 1.8027756377319946, 1.4142135623730951, 5.8309518948453007, 1.4142135623730951, 9.013878188659973, 4.4721359549995796, 2.5, 2.1213203435596424, 3.2015621187164243, 2.5, 1.4142135623730951, 2.1213203435596424, 4.3011626335213133, 1.4142135623730951, 6.946221994724902, 2.5, 16.507574019219177, 2.9154759474226504, 6.103277807866851, 1.4142135623730951, 2.1213203435596424, 3.2015621187164243, 2.8284271247461903, 1.8027756377319946, 6.0207972893961479, 10.259142264341596, 2.8284271247461903, 2.5, 1.4142135623730951, 1.4142135623730951, 4.6097722286464435, 6.0207972893961479, 5.0, 1.4142135623730951, 2.5, 2.5, 1.4142135623730951, 29.068883707497267, 3.905124837953327, 1.4142135623730951, 8.2764726786234242, 3.2015621187164243, 1.8027756377319946, 2.8284271247461903, 2.2360679774997898, 3.2015621187164243, 2.1213203435596424, 2.1213203435596424, 1.4142135623730951, 1.4142135623730951, 4.3011626335213133, 3.6055512754639891, 3.5355339059327378, 1.8027756377319946, 1.4142135623730951, 2.1213203435596424, 2.1213203435596424, 1.8027756377319946, 2.1213203435596424, 3.2015621187164243, 2.8284271247461903, 2.5, 2.1213203435596424, 1.8027756377319946, 1.1180339887498949, 3.905124837953327, 4.2426406871192848, 2.1213203435596424, 6.3639610306789276, 4.4721359549995796, 2.8284271247461903, 2.1213203435596424, 2.1213203435596424, 1.4142135623730951, 1.8027756377319946, 5.1478150704935004, 1.1180339887498949, 1.8027756377319946, 1.4142135623730951, 3.5355339059327378, 3.6055512754639891, 2.1213203435596424, 6.0415229867972862, 1.1180339887498949, 5.315072906367325, 2.8284271247461903, 1.1180339887498949, 2.1213203435596424, 2.5, 1.1180339887498949, 2.1213203435596424, 2.1213203435596424, 1.4142135623730951, 5.6568542494923806, 1.8027756377319946, 1.1180339887498949, 4.6097722286464435, 1.4142135623730951, 2.5, 1.1180339887498949, 1.8027756377319946, 1.8027756377319946, 1.8027756377319946, 4.9497474683058327, 1.1180339887498949] Source is Obvious Biggest Galaxy with radius 317.446845944 pixels! new_ra and new_dec: 14.1785651 , -9.9140282 Radii: 317.446845944 pixel Radii: 0.0349053444551 degrees rc3: 14.1779166667 , updated: 14.1785651 rc3: -9.91416666667 , updated: -9.9140282 rc3: 0.0527046277749 , updated: 0.0349053444551 Mosaic_all on 3377 ------------------mosaic_all_bands---------------------- Working on 3377 ------------------mosaic_band---------------------- Now mosaic_band on 3377 ('14.1785651', '-9.9140282', 0.1581138833247) Data contain unclean images ------------------mosaic_band---------------------- Now mosaic_band on 3377 ('14.1785651', '-9.9140282', 0.1581138833247) ------------------mosaic_band---------------------- Now mosaic_band on 3377 ('14.1785651', '-9.9140282', 0.1581138833247) ------------------mosaic_band---------------------- Now mosaic_band on 3377 ('14.1785651', '-9.9140282', 0.1581138833247) ------------------mosaic_band---------------------- Now mosaic_band on 3377 ('14.1785651', '-9.9140282', 0.1581138833247) Completed Mosaic
source_info not only mosaics all bands but also returns a list [new_ra,new_dec,margin,radii,pgc] of updated astrometry.
update
[14.1785651, -9.9140282, 0.1581138833247, 0.034905344455103668, 3377]
cd 3377
/Users/dorislee/Desktop/GSoC2014/rc3-sdss/pipeline/3377
from IPython.core.display import Image
import os
os.system("gm convert SDSS_3377_BEST.tiff SDSS_3377_BEST.jpg") #for ipynb display purpose only
Image(filename="SDSS_3377_BEST.jpg")
os.system("gm convert SDSS_3377_LOW.tiff SDSS_3377_LOW.jpg") #for ipynb display purpose only
Image(filename="SDSS_3377_LOW.jpg")
If the color image generated by the default value doesn't look good, you can modify the stiff parameter for each image and rerun the mosaicing procedure on the updated values.
sdss.stiff_param_best
' -MAX_TYPE QUANTILE -MAX_LEVEL 0.99 -COLOUR_SAT 5 -MIN_TYPE QUANTILE -MIN_LEVEL 1 -GAMMA_FAC 0.8'
sdss.stiff_param_best = "-MAX_TYPE QUANTILE -MAX_LEVEL 0.997 -COLOUR_SAT 5 -MIN_TYPE QUANTILE -MIN_LEVEL 0.8 -GAMMA_FAC 0.6"
sdss.stiff_param_low = "-MAX_TYPE QUANTILE -MAX_LEVEL 0.9997 -COLOUR_SAT 2 -MIN_TYPE QUANTILE -MIN_LEVEL 0.3 -GAMMA_FAC 1.3"
pgc3377.mosaic_all_bands(update[0],update[1],update[2],update[3],update[4],sdss)
------------------mosaic_all_bands---------------------- Working on 3377 ------------------mosaic_band---------------------- Now mosaic_band on 3377 (14.1785651, -9.9140282, 0.1581138833247) Data contain unclean images ------------------mosaic_band---------------------- Now mosaic_band on 3377 (14.1785651, -9.9140282, 0.1581138833247) ------------------mosaic_band---------------------- Now mosaic_band on 3377 (14.1785651, -9.9140282, 0.1581138833247) ------------------mosaic_band---------------------- Now mosaic_band on 3377 (14.1785651, -9.9140282, 0.1581138833247) ------------------mosaic_band---------------------- Now mosaic_band on 3377 (14.1785651, -9.9140282, 0.1581138833247) Completed Mosaic
cd 3377/
/Users/dorislee/Desktop/GSoC2014/rc3-sdss/pipeline/3377/3377
os.system("gm convert SDSS_3377_BEST.tiff SDSS_3377_BEST.jpg") #for ipynb display purpose only
Image(filename="SDSS_3377_BEST.jpg")
os.system("gm convert SDSS_3377_LOW.tiff SDSS_3377_LOW.jpg") #for ipynb display purpose only
Image(filename="SDSS_3377_LOW.jpg")