{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# DMU0: IAC SDSS S82 extraction\n", "\n", "The original extraction was missing objects below RA=0. In this notebook we combine the individual catalogues that were downloaded from ftp.iac.es and also available from http://www.iac.es/proyecto/stripe82/pages/data.php into one full catalogue to be used here and uploaded to CDS." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This notebook was run with herschelhelp_internal version: \n", "017bb1e (Mon Jun 18 14:58:59 2018 +0100)\n", "This notebook was executed on: \n", "2018-09-21 18:05:43.317551\n" ] } ], "source": [ "from herschelhelp_internal import git_version\n", "print(\"This notebook was run with herschelhelp_internal version: \\n{}\".format(git_version()))\n", "import datetime\n", "print(\"This notebook was executed on: \\n{}\".format(datetime.datetime.now()))" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", "#%config InlineBackend.figure_format = 'svg'\n", "\n", "import matplotlib.pyplot as plt\n", "plt.rc('figure', figsize=(10, 6))\n", "\n", "import os\n", "import time\n", "\n", "from astropy import units as u\n", "from astropy.coordinates import SkyCoord\n", "from astropy.table import Column, Table, vstack, join\n", "import numpy as np\n", "from pymoc import MOC\n", "\n", "import glob" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## I - Get list of files\n", "Merge stars and galaxies into one table" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['./data/tiles/f0295_ps.cat',\n", " './data/tiles/f0312_gal.cat',\n", " './data/tiles/f0914_ps.cat',\n", " './data/tiles/f2012_ps.cat',\n", " './data/tiles/f1101_gal.cat',\n", " './data/tiles/f1464_ps.cat',\n", " './data/tiles/f1243_ps.cat',\n", " './data/tiles/f1633_gal.cat',\n", " './data/tiles/f2121_gal.cat',\n", " './data/tiles/f1714_gal.cat']" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "file_list = glob.glob('./data/tiles/*.cat')\n", "file_list[:10]" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "\n", "test_gal = Table.read('./data/tiles/f0011_gal.cat', format='ascii')\n", "test_star = Table.read('./data/tiles/f0011_ps.cat', format='ascii')" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "Table length=10\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
col1col2col3col4col5col6col7col8col9col10col11col12col13col14col15col16col17col18col19col20col21col22col23col24col25col26col27col28col29col30col31col32col33col34col35col36col37col38col39col40col41col42col43col44col45col46col47col48col49col50col51col52col53col54col55col56col57col58col59col60col61col62col63col64col65col66col67col68col69col70col71col72col73col74col75
float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64int64
310.089107-1.235528222.746223.149724.37523.318122.838322.8580.35980.76280.32020.22610.26540.39034.34820.677120.732922.415621.520.842120.72550.0290.04180.03940.02810.0250.02975.36419.142519.139520.700319.824519.283919.15040.01090.0140.01640.01140.010.01094.65518.525118.507820.017819.180318.676918.5310.010.01290.01370.00980.0090.00994.51418.202618.23319.629218.798518.317318.210.02190.03030.02650.01930.01850.02174.2323.55.285.1923.678-51.251.4120.2923
310.4277744-1.24087821.812721.734723.79822.515821.865721.82460.13730.16440.2090.12230.11670.15544.8221.194921.189822.887721.790321.224421.17570.03860.04850.05220.03380.03280.04224.44820.112720.109421.667420.65420.156320.10620.02040.02510.02750.01840.01790.02234.20719.74919.751321.234820.26219.7919.74780.02310.02940.0270.01890.01970.02574.07219.649419.780820.991220.066719.654619.69370.0620.08980.05880.04360.05010.07243.7163.935.283.6723.002-13.121.2230.1820
310.3773283-1.242188721.158120.652223.265622.216521.461321.06630.08330.09070.14640.09880.08470.08246.56620.596420.745622.270121.307820.764120.58130.02460.04540.03590.02460.02310.02574.79420.195520.252821.862920.905620.345220.19070.02220.03890.03070.02130.02030.02354.819.828619.792321.558920.594420.046519.79640.02530.04250.03280.02340.02380.02645.06119.64519.854421.512720.52519.884119.60680.06320.1360.08250.060.05940.06585.5683.526.64.2573.63265.661.1720.1473
310.3473479-1.243651520.949620.867623.174522.069721.391521.11490.07640.08860.13830.08950.08030.08567.43619.544619.523321.345720.372519.817519.6270.01240.01410.0220.01450.01250.01295.39118.54118.524720.104519.237218.766818.60240.00730.00820.01210.00830.00730.00754.71517.997517.963919.469418.656918.2218.06070.00680.00770.01030.00730.00670.0074.51717.651617.643919.080618.262617.847417.70410.01420.01670.01980.01420.01330.01454.2673.54.627.2782.653-43.492.7430.6350
310.2980108-1.245064721.60721.445522.585421.844321.639221.65380.16610.2710.09720.07720.09710.13392.89920.172820.029321.489720.741120.479420.32170.02370.03660.02370.01790.01930.02173.89419.509919.408920.750720.11319.827119.66460.01730.02780.01680.01340.01430.0163.93919.12119.188620.460919.824219.433919.23950.01910.03660.01730.01420.0150.01684.58918.986719.463620.357619.708119.260619.12280.0510.14670.03970.0340.03670.04474.6933.687.266.3864.705-45.821.3570.2633
310.1278317-1.245376623.310623.247125.344123.681723.043422.74210.25960.35160.67950.29820.31140.34614.26223.33123.573424.21423.434723.754824.60250.12590.22560.13050.11570.28150.90352.70422.598822.536423.322122.657422.575522.88360.08460.11490.07910.07530.12590.24392.45822.09822.066422.751822.133722.07422.48580.08680.12290.07440.07510.13130.28212.34422.178821.854322.430622.081921.986924.65710.28780.31930.16650.21820.38246.58981.7373.55.281.9331.63227.021.1850.1560
310.3637914-1.247228722.982122.857724.608823.505923.00722.83430.24690.35470.3830.26310.3070.38223.96722.22522.505423.405222.515922.262722.51850.06080.12030.07240.05570.07490.13383.33621.081321.100621.934621.285621.069621.09070.03070.04650.03210.02750.03570.05032.71520.160720.159620.92520.356820.153420.20780.02230.0330.02240.020.02590.03742.53519.761519.799420.427619.886119.779419.86180.04550.07130.04110.03790.05450.08232.3153.55.942.7551.888-23.771.4590.3150
310.2891375-1.247245623.225823.172824.255123.38922.974423.4820.45810.56860.29190.23980.29620.68062.9622.073422.147123.357422.465622.123822.13050.07870.10750.07070.05450.06750.09643.52120.792120.68622.06921.206520.836520.73390.03430.03930.0350.02630.02990.03763.62719.982219.87321.253920.407920.031619.930.02670.03060.02710.02070.02340.02943.64619.410519.352520.875220.043419.56419.38640.0490.05890.05450.04290.04630.05554.3544.55.942.9932.62240.651.1420.1243
310.2111772-1.247239723.666923.651324.928723.981723.216724.05390.3780.54470.4850.38250.36111.12453.52723.137223.081924.04823.219223.071123.43870.11530.15890.11540.09720.15320.31242.74822.237322.248123.244122.379222.229622.67410.06680.09590.07440.05990.0920.19952.92222.337922.333723.10822.44922.443622.52660.11390.16720.09690.09650.17960.28672.53622.841722.017523.604622.479422.273622.08980.55290.39360.43160.30030.48260.6072.5573.55.282.7221.393-50.811.9540.4880
310.464261-1.247662723.878524.340724.454823.579223.579725.12670.48091.14030.33490.27420.49712.99882.23623.348923.636524.329523.562423.399623.4390.14190.28360.13950.12520.19860.30262.8922.736122.985923.789722.932422.758522.91930.10750.20790.11170.09350.1470.25063.02422.200722.046223.107122.33422.148622.2830.11050.15020.0990.090.14240.2382.7621.765621.885622.955822.218521.704621.99590.22880.4010.25350.24380.29390.56783.5543.665.942.5061.53876.121.630.3860
" ], "text/plain": [ "\n", " col1 col2 col3 col4 col5 ... col72 col73 col74 col75\n", " float64 float64 float64 float64 float64 ... float64 float64 float64 int64\n", "----------- ---------- ------- ------- ------- ... ------- ------- ------- -----\n", " 310.089107 -1.2355282 22.7462 23.1497 24.375 ... -51.25 1.412 0.292 3\n", "310.4277744 -1.240878 21.8127 21.7347 23.798 ... -13.12 1.223 0.182 0\n", "310.3773283 -1.2421887 21.1581 20.6522 23.2656 ... 65.66 1.172 0.147 3\n", "310.3473479 -1.2436515 20.9496 20.8676 23.1745 ... -43.49 2.743 0.635 0\n", "310.2980108 -1.2450647 21.607 21.4455 22.5854 ... -45.82 1.357 0.263 3\n", "310.1278317 -1.2453766 23.3106 23.2471 25.3441 ... 27.02 1.185 0.156 0\n", "310.3637914 -1.2472287 22.9821 22.8577 24.6088 ... -23.77 1.459 0.315 0\n", "310.2891375 -1.2472456 23.2258 23.1728 24.2551 ... 40.65 1.142 0.124 3\n", "310.2111772 -1.2472397 23.6669 23.6513 24.9287 ... -50.81 1.954 0.488 0\n", " 310.464261 -1.2476627 23.8785 24.3407 24.4548 ... 76.12 1.63 0.386 0" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "test_gal[:10]" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "Table length=10\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
col1col2col3col4col5col6col7col8col9col10col11col12col13col14col15col16col17col18col19col20col21col22col23col24col25col26col27col28col29col30col31col32col33col34col35col36col37col38col39col40col41col42col43col44col45col46col47col48col49col50col51col52col53col54col55col56col57col58col59col60col61col62col63col64col65col66col67col68col69col70col71col72col73col74col75
float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64int64
310.0406973-1.238838418.841618.841619.530518.974518.827418.79640.0160.0160.02090.01640.01610.01712.37616.887116.887117.464616.987916.87816.85730.00270.00270.00350.00280.00270.00272.14516.133516.133516.625316.22616.123916.1010.00190.00190.00240.0020.00190.00191.96415.837215.837216.273415.923715.827915.80380.00190.00190.00230.00190.00190.00191.85315.670315.670316.132515.761515.660815.64010.0040.0040.00480.00410.0040.00421.9193.53.52.5742.50954.911.0260.0252
310.4340371-1.240861516.095416.095416.822916.23416.096416.07260.00430.00430.0060.00460.00430.00432.45514.685514.685515.295714.798614.686214.66610.0010.0010.00130.0010.0010.0012.22314.237814.237814.741614.336714.238814.21740.00080.00080.0010.00080.00080.00082.00214.0614.0614.501414.152414.060914.03680.00080.00080.0010.00090.00080.00081.8813.956913.956914.421514.052113.957813.93510.00180.00180.00220.00190.00180.00181.9313.53.53.0022.7953.861.0760.0713
310.1488541-1.240722320.327320.313921.101520.507620.301820.29670.03580.03690.04440.03540.03770.04572.53717.602217.592118.150417.69417.586517.56710.00380.00380.00480.00390.00380.00392.08616.255916.245416.712216.335516.239816.21840.0020.0020.00250.00210.0020.0021.89815.716815.705916.137315.794815.715.67810.00180.00180.00210.00180.00180.00181.82615.406215.394115.858415.489415.38815.36820.00350.00350.00430.00360.00350.00361.9033.53.962.362.331-8.281.0130.0123
310.468454-1.240856517.279617.279618.031717.430217.284717.26390.00750.00750.01040.00790.00750.00762.47315.768415.768416.396515.886515.771915.75330.00160.00160.00210.00170.00160.00162.24115.221115.221115.705415.321215.225215.20590.00120.00120.00150.00130.00120.00121.94115.053215.053215.483515.148415.057215.03590.00130.00130.00160.00140.00130.00131.83414.981914.981915.459415.086414.985214.96560.00290.00290.00350.0030.00290.00291.9433.53.53.6742.59860.381.4140.2932
310.3837857-1.241339917.256917.256917.951817.391117.249417.22810.00740.00740.010.00780.00740.00752.40215.92215.92216.508416.029615.915815.8960.00170.00170.00220.00180.00170.00172.20915.446215.446215.893315.531615.440115.41980.00140.00140.00170.00140.00140.00141.88515.278515.278515.673415.361315.271915.2490.00150.00150.00170.00150.00150.00151.76215.235515.235515.690715.328615.228215.20690.00330.00330.00390.00340.00330.00331.9333.53.52.6452.591-78.171.0210.022
310.4004031-1.241651720.229720.229720.922820.360120.180820.1860.03390.03390.04080.03290.03520.04262.38817.651217.651218.198917.745217.633417.61510.00390.00390.00490.0040.00390.0042.12916.573216.573217.000916.650416.556616.53790.00230.00230.00280.00240.00230.00241.84316.228616.228616.622816.305816.211916.19230.00230.00230.00270.00230.00230.00241.76316.017816.017816.484416.108115.999115.98060.00470.00470.00570.00480.00480.0051.9443.53.52.3362.27526.01.0270.0260
310.3007964-1.242690817.491717.491718.192117.629517.48817.46530.00830.00830.01120.00870.00830.00842.38515.728215.728216.30515.833715.724815.70650.00160.00160.0020.00160.00160.00162.13315.12215.12215.570615.209815.118615.09980.00120.00120.00150.00120.00120.00121.86214.911514.911515.344415.00714.907714.8870.00120.00120.00150.00130.00120.00121.82814.833214.833215.339214.946514.829314.80950.00270.00270.00340.00280.00270.00271.9933.53.52.8622.57176.141.1130.1022
310.0110293-1.243343717.979217.979218.675418.131517.989917.97990.01080.01080.0140.0110.01060.0112.40616.460616.460617.060616.586916.476516.45720.00220.00220.00290.00230.00220.00222.21515.855215.855216.378315.977315.873815.85020.00170.00170.00210.00180.00170.00172.03315.573615.573616.026615.694915.597315.56630.00170.00170.0020.00180.00170.00171.8615.471115.471115.959815.593715.490815.46680.00380.00380.00450.00380.00370.00381.9653.53.54.1453.596-82.41.1530.1332
310.3679257-1.243176419.695619.695620.397519.843719.664819.64230.02520.02520.03160.02520.02580.02942.40417.176117.176117.74517.27417.162217.14490.00310.00310.0040.00320.00310.00312.14816.003216.003216.457516.084515.990315.97140.00180.00180.00220.00190.00180.00181.89215.54615.54615.947515.621415.533215.51470.00160.00160.0020.00170.00160.00171.78215.294615.294615.746615.378815.280715.26250.00330.00330.00410.00340.00340.00341.9163.53.52.4422.366-88.251.0320.0310
310.383409-1.244786419.640819.640820.454719.874619.628419.5450.0250.0250.03240.02550.02510.02742.63517.013417.013417.602317.124617.008816.97920.00290.00290.00370.0030.00290.00292.15815.695515.695516.157515.786415.691915.66770.00160.00160.00190.00160.00160.00161.9115.150715.150715.563215.236915.14715.12150.00140.00140.00160.00140.00140.00141.82414.857114.857115.321514.952514.853314.83230.00270.00270.00330.00280.00270.00281.9283.53.52.812.65326.71.0590.0562
" ], "text/plain": [ "\n", " col1 col2 col3 col4 col5 ... col72 col73 col74 col75\n", " float64 float64 float64 float64 float64 ... float64 float64 float64 int64\n", "----------- ---------- ------- ------- ------- ... ------- ------- ------- -----\n", "310.0406973 -1.2388384 18.8416 18.8416 19.5305 ... 54.91 1.026 0.025 2\n", "310.4340371 -1.2408615 16.0954 16.0954 16.8229 ... 53.86 1.076 0.071 3\n", "310.1488541 -1.2407223 20.3273 20.3139 21.1015 ... -8.28 1.013 0.012 3\n", " 310.468454 -1.2408565 17.2796 17.2796 18.0317 ... 60.38 1.414 0.293 2\n", "310.3837857 -1.2413399 17.2569 17.2569 17.9518 ... -78.17 1.021 0.02 2\n", "310.4004031 -1.2416517 20.2297 20.2297 20.9228 ... 26.0 1.027 0.026 0\n", "310.3007964 -1.2426908 17.4917 17.4917 18.1921 ... 76.14 1.113 0.102 2\n", "310.0110293 -1.2433437 17.9792 17.9792 18.6754 ... -82.4 1.153 0.133 2\n", "310.3679257 -1.2431764 19.6956 19.6956 20.3975 ... -88.25 1.032 0.031 0\n", " 310.383409 -1.2447864 19.6408 19.6408 20.4547 ... 26.7 1.059 0.056 2" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "test_star[:10]" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "columns = {\n", "\n", " 1: 'ALPHA_J2000' ,#Right ascension of barycenter (J2000) [deg]\n", " 2: 'DELTA_J2000' ,#Declination of barycenter (J2000) [deg]\n", " 3: 'MAG_AUTO_u' ,#Sloan u | Kron-like elliptical aperture magnitude [mag]\n", " 4: 'MAG_PETRO_u' ,#Sloan u | Petrosian-like elliptical aperture magnitude [mag]\n", " 5: 'MAG_APER_1_u' ,#Sloan u | 5 pixel fixed aperture magnitude [mag]\n", " 6: 'MAG_APER_2_u' ,#Sloan u | 10 pixel fixed aperture magnitude [mag]\n", " 7: 'MAG_APER_3_u' ,#Sloan u | 20 pixel fixed aperture magnitude [mag]\n", " 8: 'MAG_APER_4_u' ,#Sloan u | 30 pixel fixed aperture magnitude [mag]\n", " 9: 'MAGERR_AUTO_u' ,#Sloan u | RMS error for AUTO magnitude [mag]\n", " 10: 'MAGERR_PETRO_u' ,#Sloan u | RMS error for PETROsian magnitude [mag]\n", " 11: 'MAGERR_APER_1_u' ,#Sloan u | RMS error for MAG_APER (1) [mag]\n", " 12: 'MAGERR_APER_2_u' ,#Sloan u | RMS error for MAG_APER (2) [mag]\n", " 13: 'MAGERR_APER_3_u' ,#Sloan u | RMS error for MAG_APER (3) [mag]\n", " 14: 'MAGERR_APER_4_u' ,#Sloan u | RMS error for MAG_APER (4) [mag]\n", " 15: 'FLUX_RADIUS_u' ,#Sloan u | Fraction-of-light radii (0.5 of total) [pixel] \n", " 16: 'MAG_AUTO_g' ,#Sloan g | Kron-like elliptical aperture magnitude [mag] \n", " 17: 'MAG_PETRO_g' ,#Sloan g | Petrosian-like elliptical aperture magnitude [mag] \n", " 18: 'MAG_APER_1_g' ,#Sloan g | 5 pixel fixed aperture magnitude [mag] \n", " 19: 'MAG_APER_2_g' ,#Sloan g | 10 pixel fixed aperture magnitude [mag] \n", " 20: 'MAG_APER_3_g' ,#Sloan g | 20 pixel fixed aperture magnitude [mag] \n", " 21: 'MAG_APER_4_g' ,#Sloan g | 30 pixel fixed aperture magnitude [mag] \n", " 22: 'MAGERR_AUTO_g' ,#Sloan g | RMS error for AUTO magnitude [mag] \n", " 23: 'MAGERR_PETRO_g' ,#Sloan g | RMS error for PETROsian magnitude [mag] \n", " 24: 'MAGERR_APER_1_g' ,#Sloan g | RMS error for MAG_APER (1) [mag] \n", " 25: 'MAGERR_APER_2_g' ,#Sloan g | RMS error for MAG_APER (2) [mag] \n", " 26: 'MAGERR_APER_3_g' ,#Sloan g | RMS error for MAG_APER (3) [mag] \n", " 27: 'MAGERR_APER_4_g' ,#Sloan g | RMS error for MAG_APER (4) [mag] \n", " 28: 'FLUX_RADIUS_g' ,#Sloan g | Fraction-of-light radii (0.5 of total) [pixel] \n", " 29: 'MAG_AUTO_r' ,#Sloan r | Kron-like elliptical aperture magnitude [mag] \n", " 30: 'MAG_PETRO_r' ,#Sloan r | Petrosian-like elliptical aperture magnitude [mag] \n", " 31: 'MAG_APER_1_r' ,#Sloan r | 5 pixel fixed aperture magnitude [mag] \n", " 32: 'MAG_APER_2_r' ,#Sloan r | 10 pixel fixed aperture magnitude [mag] \n", " 33: 'MAG_APER_3_r' ,#Sloan r | 20 pixel fixed aperture magnitude [mag] \n", " 34: 'MAG_APER_4_r' ,#Sloan r | 30 pixel fixed aperture magnitude [mag] \n", " 35: 'MAGERR_AUTO_r' ,#Sloan r | RMS error for AUTO magnitude [mag] \n", " 36: 'MAGERR_PETRO_r' ,#Sloan r | RMS error for PETROsian magnitude [mag] \n", " 37: 'MAGERR_APER_1_r' ,#Sloan r | RMS error for MAG_APER (1) [mag] \n", " 38: 'MAGERR_APER_2_r' ,#Sloan r | RMS error for MAG_APER (2) [mag] \n", " 39: 'MAGERR_APER_3_r' ,#Sloan r | RMS error for MAG_APER (3) [mag] \n", " 40: 'MAGERR_APER_4_r' ,#Sloan r | RMS error for MAG_APER (4) [mag] \n", " 41: 'FLUX_RADIUS_r' ,#Sloan r | Fraction-of-light radii (0.5 of total) [pixel]\n", " 42: 'MAG_AUTO_i' ,#Sloan i | Kron-like elliptical aperture magnitude [mag] \n", " 43: 'MAG_PETRO_i' ,#Sloan i | Petrosian-like elliptical aperture magnitude [mag] \n", " 44: 'MAG_APER_1_i' ,#Sloan i | 5 pixel fixed aperture magnitude [mag] \n", " 45: 'MAG_APER_2_i' ,#Sloan i | 10 pixel fixed aperture magnitude [mag] \n", " 46: 'MAG_APER_3_i' ,#Sloan i | 20 pixel fixed aperture magnitude [mag] \n", " 47: 'MAG_APER_4_i' ,#Sloan i | 30 pixel fixed aperture magnitude [mag] \n", " 48: 'MAGERR_AUTO_i' ,#Sloan i | RMS error for AUTO magnitude [mag] \n", " 49: 'MAGERR_PETRO_i' ,#Sloan i | RMS error for PETROsian magnitude [mag] \n", " 50: 'MAGERR_APER_1_i' ,#Sloan i | RMS error for MAG_APER (1) [mag] \n", " 51: 'MAGERR_APER_2_i' ,#Sloan i | RMS error for MAG_APER (2) [mag] \n", " 52: 'MAGERR_APER_3_i' ,#Sloan i | RMS error for MAG_APER (3) [mag] \n", " 53: 'MAGERR_APER_4_i' ,#Sloan i | RMS error for MAG_APER (4) [mag] \n", " 54: 'FLUX_RADIUS_i' ,#Sloan i | Fraction-of-light radii (0.5 of total) [pixel]\n", " 55: 'MAG_AUTO_z' ,#Sloan z | Kron-like elliptical aperture magnitude [mag] \n", " 56: 'MAG_PETRO_z' ,#Sloan z | Petrosian-like elliptical aperture magnitude [mag] \n", " 57: 'MAG_APER_1_z' ,#Sloan z | 5 pixel fixed aperture magnitude [mag] \n", " 58: 'MAG_APER_2_z' ,#Sloan z | 10 pixel fixed aperture magnitude [mag] \n", " 59: 'MAG_APER_3_z' ,#Sloan z | 20 pixel fixed aperture magnitude [mag] \n", " 60: 'MAG_APER_4_z' ,#Sloan z | 30 pixel fixed aperture magnitude [mag] \n", " 61: 'MAGERR_AUTO_z' ,#Sloan z | RMS error for AUTO magnitude [mag] \n", " 62: 'MAGERR_PETRO_z' ,#Sloan z | RMS error for PETROsian magnitude [mag] \n", " 63: 'MAGERR_APER_1_z' ,#Sloan z | RMS error for MAG_APER (1) [mag] \n", " 64: 'MAGERR_APER_2_z' ,#Sloan z | RMS error for MAG_APER (2) [mag] \n", " 65: 'MAGERR_APER_3_z' ,#Sloan z | RMS error for MAG_APER (3) [mag] \n", " 66: 'MAGERR_APER_4_z' ,#Sloan z | RMS error for MAG_APER (4) [mag] \n", " 67: 'FLUX_RADIUS_z' ,#Sloan z | Fraction-of-light radii (0.5 of total) [pixel]\n", " 68: 'KRON_RADIUS' ,#Kron aperture in units of A_IMAGE \n", " 69: 'PETRO_RADIUS' ,#Petrosian aperture in units of A_IMAGE \n", " 70: 'A_IMAGE' ,#Profile RMS along major axis [pixel] \n", " 71: 'B_IMAGE' ,#Profile RMS along minor axis [pixel] \n", " 72: 'THETA_IMAGE' ,#Position angle (CCW/x) [deg] \n", " 73: 'ELONGATION' ,#A_IMAGE/B_IMAGE\n", " 74: 'ELLIPTICITY' ,#1 - B_IMAGE/A_IMAGE \n", " 75: 'FLAGS' ,#Extraction flags \n", " \n", "}\n", "\n", "def fix_headers(cat):\n", " for col in columns:\n", " cat['col{}'.format(col)].name = columns[col]\n", " if columns[col].startswith('MAG'):\n", " cat[columns[col]].unit = u.mag\n", " if columns[col].startswith('FLUX_RADIUS_'):\n", " cat[columns[col]].unit = u.pix\n", " cat['A_IMAGE'].unit = u.pix\n", " cat['B_IMAGE'].unit = u.pix\n", " cat['THETA_IMAGE'].unit = u.deg\n", " cat['ALPHA_J2000'].unit = u.deg\n", " cat['DELTA_J2000'].unit = u.deg\n", " return cat" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Bad file: ./data/tiles/f0141_gal.cat\n", "Bad file: ./data/tiles/f1805_gal.cat\n", "Bad file: ./data/tiles/f0141_ps.cat\n", "Bad file: ./data/tiles/f1641_gal.cat\n", "Bad file: ./data/tiles/f1805_ps.cat\n", "Bad file: ./data/tiles/f1641_ps.cat\n" ] } ], "source": [ "full_cat = Table()\n", "for cat_name in file_list:\n", " try:\n", " cat = Table.read(cat_name, format='ascii')\n", " except: \n", " print('Bad file: ' + cat_name)\n", " continue\n", " fix_headers(cat)\n", " \n", " cat.add_column(Column(data=np.zeros(len(cat)), name='sdss_stellarity', dtype='int32'))\n", " if 'ps.cat' in cat_name:\n", " cat['sdss_stellarity'] = 1\n", " \n", " full_cat = vstack([full_cat, cat])\n", " \n", " " ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "15368824" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(full_cat)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "full_cat.add_column(Column(data=np.arange(len(full_cat)), name='sdss_iac_id', dtype='int32'))" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "Table masked=True length=15368824\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
ALPHA_J2000DELTA_J2000MAG_AUTO_uMAG_PETRO_uMAG_APER_1_uMAG_APER_2_uMAG_APER_3_uMAG_APER_4_uMAGERR_AUTO_uMAGERR_PETRO_uMAGERR_APER_1_uMAGERR_APER_2_uMAGERR_APER_3_uMAGERR_APER_4_uFLUX_RADIUS_uMAG_AUTO_gMAG_PETRO_gMAG_APER_1_gMAG_APER_2_gMAG_APER_3_gMAG_APER_4_gMAGERR_AUTO_gMAGERR_PETRO_gMAGERR_APER_1_gMAGERR_APER_2_gMAGERR_APER_3_gMAGERR_APER_4_gFLUX_RADIUS_gMAG_AUTO_rMAG_PETRO_rMAG_APER_1_rMAG_APER_2_rMAG_APER_3_rMAG_APER_4_rMAGERR_AUTO_rMAGERR_PETRO_rMAGERR_APER_1_rMAGERR_APER_2_rMAGERR_APER_3_rMAGERR_APER_4_rFLUX_RADIUS_rMAG_AUTO_iMAG_PETRO_iMAG_APER_1_iMAG_APER_2_iMAG_APER_3_iMAG_APER_4_iMAGERR_AUTO_iMAGERR_PETRO_iMAGERR_APER_1_iMAGERR_APER_2_iMAGERR_APER_3_iMAGERR_APER_4_iFLUX_RADIUS_iMAG_AUTO_zMAG_PETRO_zMAG_APER_1_zMAG_APER_2_zMAG_APER_3_zMAG_APER_4_zMAGERR_AUTO_zMAGERR_PETRO_zMAGERR_APER_1_zMAGERR_APER_2_zMAGERR_APER_3_zMAGERR_APER_4_zFLUX_RADIUS_zKRON_RADIUSPETRO_RADIUSA_IMAGEB_IMAGETHETA_IMAGEELONGATIONELLIPTICITYFLAGSsdss_stellaritysdss_iac_id
degdegmagmagmagmagmagmagmagmagmagmagmagmagpixmagmagmagmagmagmagmagmagmagmagmagmagpixmagmagmagmagmagmagmagmagmagmagmagmagpixmagmagmagmagmagmagmagmagmagmagmagmagpixmagmagmagmagmagmagmagmagmagmagmagmagpixpixpixdeg
float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64int64int32int32
324.40233530.757420719.361219.361219.870619.462919.370819.33110.02120.02120.02390.02040.02170.02422.04417.409817.409817.886417.500117.408117.38250.00330.00330.0040.00340.00330.00331.97216.678816.678817.108516.764316.676616.6490.00240.00240.00290.00250.00240.00251.86816.428316.428316.807116.512516.426216.39640.00260.00260.0030.00260.00260.00261.75116.319316.319316.720516.412716.318216.2830.00530.00530.00610.00540.00540.00571.7873.53.53.3582.134-31.711.5740.365010
324.36068580.756864419.214919.209119.698519.285319.197119.20260.01870.0190.02210.01870.01960.02221.96917.8117.797918.27417.873517.785417.77290.00390.00390.00480.0040.00390.0041.94317.239217.227417.643517.297917.213917.19980.00320.00320.00380.00320.00320.00331.8317.011516.998517.355217.067316.98616.97430.00340.00340.00390.00340.00340.00361.68216.90916.897517.260716.966916.884316.87210.0070.00710.00780.0070.00720.0081.6923.53.962.1111.9868.191.0630.059011
324.48375620.756362221.538121.550122.046721.638621.505621.55820.07650.08270.0710.06770.08950.12722.06218.903718.892419.369818.973518.882218.86650.00670.00670.0080.00680.00680.00711.94917.452617.441917.87317.516417.429817.41270.00350.00350.00420.00360.00350.00361.84816.626516.616116.99516.686216.603516.5870.00280.00280.00330.00290.00280.00291.71216.182916.171316.565416.248916.159916.14220.00490.00490.00570.0050.00490.00521.743.53.962.1792.04829.141.0640.06212
324.10396020.755737699.026.337826.392328.431299.099.099.03.60461.749922.031299.099.09.50124.350924.307324.899824.41825.573826.1310.1870.20390.17790.20391.09272.72082.17323.515123.543623.86823.563124.017999.00.13730.15960.11160.14750.419599.01.88623.494323.508123.586723.545599.099.00.20450.23670.12890.22199.099.01.51522.658222.977723.095322.674722.759424.98550.31560.48120.26050.3310.69368.00632.0570.03.961.5841.23380.511.2840.221013
324.18564910.754421121.483421.456321.958421.515721.46621.65210.07150.07450.06760.06240.08620.13692.00719.128519.117819.610319.200319.100519.09450.00740.00750.0090.00750.00760.00811.99418.179318.168718.598118.242418.152218.14170.0050.0050.00580.0050.00510.00541.87817.854217.842718.216917.913717.82617.81190.00510.00510.00580.00510.00530.00571.74217.673717.66218.04317.730117.640517.62090.01040.01060.01140.01020.01110.01291.7413.53.962.0761.953.251.0650.061214
324.35658060.754193519.434719.427819.912619.499119.413819.41880.02080.02120.02440.02070.02210.02551.98318.530418.51818.988818.591318.501418.48730.00560.00560.00670.00570.00560.00581.95318.206818.194118.605918.260618.17918.16740.0050.00510.00590.00510.00520.00551.82918.064118.049118.401218.114618.036818.02510.00560.00570.00630.00560.00590.00651.68418.009217.994118.353218.060217.990217.98450.01250.01280.01320.01210.01390.01681.7013.53.962.0881.873-12.61.1150.103015
324.42519380.753241220.06720.037120.576320.136620.031720.00850.0290.03050.03350.02860.03170.03752.0519.819319.783920.333119.888319.777819.7590.01050.01070.01260.01050.01090.01222.04219.80119.779320.278619.864819.773919.77410.01150.01230.0130.01130.01280.01561.96619.854719.844520.302919.911419.849219.85050.01530.01710.01590.01450.01830.02391.89619.984419.985120.435720.037819.99219.99640.04460.05390.0390.03930.05950.08431.8913.54.622.0541.78924.711.1480.129016
324.08749680.752671221.328821.313221.803421.400921.249521.14450.06020.0630.06210.05790.07250.08891.94920.347520.331220.812320.404220.307720.28650.01370.01380.01590.01360.01490.01731.93719.952719.940520.363220.001919.914219.90480.01240.01270.01350.01210.0140.01721.8419.773519.755620.130119.822619.729219.70710.01430.01480.01450.01380.01690.02151.71119.78919.75920.078519.814619.708419.64050.03680.03870.03180.03350.04670.06111.6413.53.961.8541.745-30.851.0620.059017
324.1287040.752471426.029826.512724.771125.726625.461799.02.35715.1490.43431.8192.805799.00.69124.416324.554425.106524.448924.70723.84250.19760.30170.20640.20580.48550.32742.41223.861724.060624.415623.979624.253623.59180.18090.29530.16630.20320.49640.40312.08923.720323.782623.840823.832624.14923.40420.24870.36410.15560.27870.72090.54371.57522.857124.192523.213223.209923.693322.00020.37131.73850.27990.51621.57140.49811.944.656.61.2530.8982.141.3960.284018
.......................................................................................................................................................................................................................................
50.48268451.190206523.848622.987124.924524.252122.919723.03730.40890.27070.44110.43370.250.40093.14323.52923.374424.765723.877423.366123.44280.11220.13410.14630.11590.13030.20143.45823.389223.384224.238523.7823.404423.33720.14740.20630.13380.15510.20530.28512.65423.835424.5524.545123.789724.395999.00.33420.92160.24770.23530.781499.02.38422.625822.019124.967823.34422.136322.45240.37610.31261.16130.52060.3390.67364.7825.497.921.4471.16115.331.2470.1983015368814
50.42427261.161452799.099.027.717699.099.099.099.099.05.058899.099.099.0-28.02524.599824.83524.882224.709324.83926.57410.20550.40460.16250.23480.49423.58961.68723.489223.339923.879723.446723.622124.04170.11890.16490.10350.11940.25660.55521.98822.780322.886623.216322.790823.04323.41860.09730.16810.08820.1020.23440.4882.01222.387622.035522.799422.280522.264323.05310.21770.25820.18450.20720.38531.17472.040.00.01.5871.1673.271.360.2640015368815
50.43433041.188946525.160525.170626.198225.242425.2999.01.04961.94461.26091.01862.069899.04.18123.81824.079724.527523.820424.042324.03080.12060.2560.12430.11170.23720.34362.43523.319923.029224.056423.41923.021122.85790.11490.15470.11590.11420.14710.18582.47423.307324.065623.932423.327723.92124.33330.17030.60860.15020.15750.50931.10932.30122.924922.489323.649322.932322.677221.48910.39490.48560.3640.3590.55010.27792.3223.56.61.691.49420.711.1310.1160015368816
50.29309191.19167928.674899.027.498499.099.099.029.293299.04.133899.099.099.01.9724.25824.161724.835824.262224.409125.2690.18680.23230.15550.15980.33141.07112.11524.394123.923624.67324.242723.968325.11890.31330.28470.18660.22910.34061.44711.71323.50123.599424.289423.742823.551424.02180.21790.32870.20020.22510.36250.82852.56722.697122.669923.787123.111622.877123.49630.34770.47150.40520.41770.65631.72363.5254.710.01.5551.101-74.171.4120.2920015368817
50.39206131.186213125.639825.076925.220926.030924.390625.06221.31071.32030.5742.14790.95052.59892.04725.543599.025.337925.924699.099.00.424899.00.2310.682999.099.01.24924.247624.55724.645324.292624.887799.00.20680.4460.18650.24510.809299.01.89623.248623.469823.644123.26524.043527.45560.12870.25040.1190.14750.562919.33761.85222.83723.578823.141723.0525.211599.00.29480.95130.24370.40695.738899.01.8243.55.941.3721.13519.441.2090.1730015368818
50.48235521.15868924.514324.023124.804324.436223.883523.1930.49070.5070.40320.51160.58610.46261.80824.191324.005824.599824.213324.106624.2310.13620.17690.130.15220.25060.4112.05223.612123.553123.851723.650823.618125.02660.12210.18060.10020.13960.25061.33811.74823.37123.724823.530723.397523.643999.00.14830.32340.11070.1690.397999.01.70622.438922.685723.057322.517624.433599.00.21230.42520.22470.25372.786999.02.2963.55.941.41.12710.831.2420.1950015368819
50.41020251.200039726.122924.691125.417625.596224.637799.03.06331.34590.66771.43621.176299.00.77824.461824.513325.12924.479424.787324.13550.24370.40220.19560.19350.47240.3872.3823.121523.278423.993723.269123.130923.03910.11480.20450.11240.10290.16510.22242.71822.754222.650423.462222.811322.70822.7790.12540.17860.10580.10370.17310.27082.43222.538321.968223.525622.892922.031721.59660.33730.32220.33450.35390.31350.31153.2644.036.61.851.468-4.791.260.2070015368820
50.34258691.190348999.025.122325.388325.400627.331325.093399.02.34840.63351.175813.49622.572-4.27423.638223.780524.328123.692523.649323.86570.15840.2380.10650.09930.16410.28742.39621.851521.727622.842322.190621.82521.70780.05230.06040.05040.04420.05240.06573.00421.09920.994221.968621.323521.113120.94030.04160.04860.03820.03290.04310.05132.74320.615120.325621.4920.899520.581520.220.08620.08770.07080.06680.08590.08882.7680.06.62.1841.871-8.011.1670.1430015368821
50.43366471.155766426.21325.797327.83926.599599.099.02.28792.93335.45323.483299.099.04.78124.768624.904625.398224.982625.09425.32440.22770.4560.23580.290.60641.11472.14824.438127.173424.854924.571226.503799.00.25715.72150.21740.30823.481399.02.06823.189723.891823.857623.285223.876499.00.13260.44240.14140.15260.489999.02.33823.290625.112623.658123.726223.595199.00.46124.53950.36490.72831.270199.01.5553.56.61.7121.06237.851.6130.380015368822
50.35351741.184107424.275823.536725.990724.587323.866523.45760.88430.75361.0640.58250.57840.58973.23722.030721.981423.526322.735722.061922.00910.04650.06640.06510.05110.04590.05874.7820.527820.465421.744121.082720.552120.45850.02060.02750.0270.02170.02030.02413.97619.914619.908921.036520.430219.948619.88030.01830.02560.02280.01880.01810.0223.62219.453219.431420.55719.959919.484719.36480.03680.05380.04060.03520.03620.0443.5433.55.943.832.378-1.881.6110.3793015368823
" ], "text/plain": [ "\n", "ALPHA_J2000 DELTA_J2000 MAG_AUTO_u ... FLAGS sdss_stellarity sdss_iac_id\n", " deg deg mag ... \n", " float64 float64 float64 ... int64 int32 int32 \n", "----------- ----------- ---------- ... ----- --------------- -----------\n", "324.4023353 0.7574207 19.3612 ... 0 1 0\n", "324.3606858 0.7568644 19.2149 ... 0 1 1\n", "324.4837562 0.7563622 21.5381 ... 2 1 2\n", "324.1039602 0.7557376 99.0 ... 0 1 3\n", "324.1856491 0.7544211 21.4834 ... 2 1 4\n", "324.3565806 0.7541935 19.4347 ... 0 1 5\n", "324.4251938 0.7532412 20.067 ... 0 1 6\n", "324.0874968 0.7526712 21.3288 ... 0 1 7\n", " 324.128704 0.7524714 26.0298 ... 0 1 8\n", " ... ... ... ... ... ... ...\n", " 50.4826845 1.1902065 23.8486 ... 3 0 15368814\n", " 50.4242726 1.1614527 99.0 ... 0 0 15368815\n", " 50.4343304 1.1889465 25.1605 ... 0 0 15368816\n", " 50.2930919 1.191679 28.6748 ... 0 0 15368817\n", " 50.3920613 1.1862131 25.6398 ... 0 0 15368818\n", " 50.4823552 1.158689 24.5143 ... 0 0 15368819\n", " 50.4102025 1.2000397 26.1229 ... 0 0 15368820\n", " 50.3425869 1.1903489 99.0 ... 0 0 15368821\n", " 50.4336647 1.1557664 26.213 ... 0 0 15368822\n", " 50.3535174 1.1841074 24.2758 ... 3 0 15368823" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "full_cat[full_cat.colnames]" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "cols = full_cat.colnames\n", "\n", "cols.insert(0, cols.pop(cols.index('sdss_iac_id')))\n" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "full_cat[cols].write('./data/IAC-SDSS_Herschel-Stripe-82_full.fits', overwrite=True)" ] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python (herschelhelp_internal)", "language": "python", "name": "helpint" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.5" } }, "nbformat": 4, "nbformat_minor": 2 }