In [1]:
from IPython.display import HTML

HTML('''<script>
code_show=true; 
function code_toggle() {
 if (code_show){
 $('div.input').hide();
 } else {
 $('div.input').show();
 }
 code_show = !code_show
} 
$( document ).ready(code_toggle);
</script>
<form action="javascript:code_toggle()"><input type="submit" value="Click here to toggle on/off the raw code."></form>''')


Out[1]:

Building a MOC from a CDS/Vizier catalog

After a couple of conversations I had during the week of the 2nd ASTERICS VO school I've got two small TODO's hanging on my list, this is an answer to both. First one (to François) is an observation about CDS/Vizier LaMassa 2016 catalog's metadata; the second one (to Markus) is about MOC catalogs format. I will not get into the details -- since the respective discussion had already being done --, it is sufficient to say that:

  1. some of Lamassa's null value are not properly read when using Astropy;
  2. what I understand about a MOC catalog.

The data to be used is provided by Vizier, the LaMassa et al, 2016, ApJ, 817, 172, in particular the ReadMe and chandra.dat files. Software to handle the catalog will be Astropy and Thomas Boch's mocpy and Healpy.

TOC:


In [2]:
baseurl = 'ftp://cdsarc.u-strasbg.fr/pub/cats/J/ApJ/817/172/'
readme_file = 'ReadMe'
chandra_file = 'chandra.dat'

import astropy
print "astropy version:",astropy.__version__

import mocpy
print "mocpy version:",mocpy.__version__

import healpy
print "healpy version:",healpy.__version__


astropy version: 1.2.1
mocpy version: 0.3.5
healpy version: 1.10.1

Download ReadMe and chandra.dat files and save them inside ./data/ dir


In [3]:
def download(path,filename,outdir):
    from urllib2 import urlopen
    url = path+filename
    f = urlopen(url)
    data = f.read()
    with open(outdir+filename, "wb") as fp:
        fp.write(data)

In [4]:
import os
if not os.path.isdir('data'):
    os.mkdir('data')
download(baseurl,readme_file,outdir='data/')
download(baseurl,chandra_file,outdir='data/')
!ls 'data/'


MOC_chandra.fits  ReadMe            chandra.dat
MOC_on_Aladin.png ReadMe_fix

Dealing with null values from Vizier metadata

The goal here, as said before, is to show the "bug" in Vizier ReadMe (description) file when dealing with null values not properly formatted.

We start by opening the chandra table and noticing the values -999 not being properly handled by Astropy as null values.


In [5]:
from astropy.table import Table
chandra = Table.read('data/chandra.dat',readme='data/ReadMe',format='ascii.cds')

In [6]:
chandra # Notice the '-999' values


Out[6]:
<Table masked=True length=1146>
MSIDObsIDRAdegDEdege_PosDistNNInAO10InAO13RemLogNSFSoftB_FSoftb_FSoftCtSoftFHardB_FHardb_FHardCtHardFFullB_FFullb_FFullCtFulllogLSoftlogLHardlogLFullRejSSDSSRASdegDESdegRelSrSCoaddSumage_umaggmage_gmagrmage_rmagimage_imagzmage_zmagSpecIDClasszspr_zspWISERAWdegDEWdege_RAWdege_DEWdegRelWrWW1mage_W1magW1SNRW2mage_W2magW2SNRW3mage_W3magW3SNRW4mage_W4magW4SNRExtWRejWUKIDSSRAUdegDEUdegRelUrUYmage_YmagJmage_JmagHmage_HmagKmage_KmagRejUVHSRAVdegDEVdegRelVrVJVmage_JVmagHVmage_HVmagKVmage_KVmagRejVGALEXRAGdegDEGdege_NUVPose_FUVPosRelGrGNUVe_NUVFUVe_FUVFIRSTRAFdegDEFdegrFF1.4GHze_F1.4GHzRAHdegDEHdegrHF250e_F250F350e_F350F500e_F500XMMAO10CPXMMAO13CPCPCoord
degdegarcsecarcsecct1e-17 W / m21e-17 W / m21e-17 W / m2ct1e-17 W / m21e-17 W / m21e-17 W / m2ct1e-17 W / m21e-17 W / m21e-17 W / m2ct[10-7W][10-7W][10-7W]degdegarcsecmagmagmagmagmagmagmagmagmagmagdegdegarcsecarcsecarcsecmagmagmagmagmagmagmagmagdegdegarcsecmagmagmagmagmagmagmagmagdegdegarcsecmagmagmagmagmagmagdegdegarcsecarcsecarcsecmagmagmagmagdegdegarcsecmJymJydegdegarcsecmJymJymJymJymJymJy
int64int64float64float64float64float64str9str9str3float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64str3str19float64float64float64float64str3float64float64float64float64float64float64float64float64float64float64str19str6float64int64str19float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64str3str3str12float64float64float64float64float64float64float64float64float64float64float64float64str2str12float64float64float64float64float64float64float64float64float64float64str1str19float64float64float64float64float64float64float64float64float64float64str22float64float64float64float64float64float64float64float64float64float64float64float64float64float64str5str4int64
15288775029.212-0.768.958.1nonono0.01.810.019.760.02.470.09.133.914.83.0229.610.00.044.96no123766378313646081029.212-0.7590.932.6no19.10.0219.120.0119.060.0118.750.0118.760.03453806688202418176QSO1.7970J015650.83-004532.729.21-0.760.090.10.8152.5115.750.0425.714.410.0522.511.610.25.49.330.542.0nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0--377933166465148668329.212-0.7590.530.590.93.3920.550.0421.320.07---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15292775029.32-0.8850.7169.1nonoyes0.00.370.06.340.03.40.018.852.112.541.6824.690.00.043.14no123765706954932233729.321-0.8851.00.32no21.580.1421.110.0420.480.0419.180.0219.650.09788134919485286400QSO0.4220---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0nono43383778926729.32-0.8850.9970.3119.030.0818.430.0817.620.0716.630.05no47246910790429.32-0.8850.9980.2618.320.0317.580.0316.890.04-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15293775029.356-0.8541.0169.1nonono1.251.481.0129.425.756.784.8238.195.926.675.1867.32-999.0-999.0-999.0no123765706954938822729.356-0.8540.990.93no25.480.9422.170.1221.130.0720.40.0619.930.14-----999.0--J015725.41-005114.729.36-0.850.070.070.9971.0515.030.0333.813.910.0426.911.090.128.88.180.224.9nono43383779730029.356-0.8540.9930.9819.320.118.630.0917.660.0716.660.05no47246910719729.356-0.8540.9940.9618.780.0517.740.0416.80.04-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15295775029.274-0.8751.3171.4nonono0.01.610.013.790.02.70.05.573.74.632.8719.53-999.0-999.0-999.0no123765706954932256829.274-0.8750.990.38no21.690.1321.770.0621.090.0520.820.0521.080.23-----999.0--J015705.71-005228.729.27-0.870.180.180.99460.5416.490.0617.215.810.147.512.61-999.00.29.34-999.0-1.6nono43383778924629.274-0.8750.9830.3820.270.2519.030.1418.280.1318.070.17no47246910765829.274-0.8750.9890.4819.230.0718.490.0717.750.09-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15296775029.305-0.9881.8376.1nonono2.532.92.1751.220.02.790.014.096.066.855.2765.8743.260.043.64no123765706954932258629.305-0.9881.01.4no20.490.1120.010.0319.10.0218.710.0218.40.06789333661701924864GALAXY0.4410J015713.28-005916.829.31-0.990.080.080.99231.4715.220.0332.914.390.0522.311.060.110.68.840.442.5nono43383778950729.305-0.9880.9831.3118.880.0718.150.0617.320.0616.470.04no47246911027029.305-0.9880.9851.2518.190.0317.340.0316.60.03-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15297775029.221-0.7732.658.1nonono4.585.193.9866.890.04.10.016.5511.1112.429.8183.3643.870.044.26no123766378313646089429.222-0.7730.990.94no19.760.0319.420.0119.530.0119.360.0219.340.054060009444665652224QSO0.6150J015653.16-004623.429.22-0.770.070.070.991.0715.00.0333.314.210.0424.711.980.293.88.58-999.01.8nono43383719740429.221-0.7730.9720.9218.520.0518.230.0617.360.0516.480.04no47246910520329.222-0.7730.9740.9418.120.0317.310.0316.520.03--377933166465148652729.221-0.7730.490.510.990.3319.560.0220.340.04---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15303410029.210.8860.683.2nonoyes3.874.333.3360.139.0610.757.5536.3114.1215.6112.6496.0844.8745.2445.43yes123766378528394456329.210.8861.00.06no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0453847919888459776QSO1.6530J015650.28+005308.929.210.890.070.070.99930.4714.880.0334.813.990.0426.911.270.147.68.010.185.9nono43382714236029.210.8860.9980.0617.680.0316.930.0216.010.0215.840.03no47244714429729.2090.8860.9980.0716.830.0115.980.0115.840.02--378489079524019764229.2090.8860.50.691.00.7620.470.0322.910.15---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15304410029.2220.9050.783.2nonono3.253.742.850.070.03.00.08.438.769.937.5859.08-999.0-999.0-999.0yes123766378528394489229.2220.9051.00.11no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0--J015653.36+005417.729.220.90.20.210.99730.3516.630.0814.315.520.128.712.38-999.00.98.86-999.00.4nono43382714230629.2220.9050.9950.1720.040.23-999.0-999.0-999.0-999.018.290.23no47244714388829.2220.9050.9970.0619.310.118.260.0917.950.15--378489079524019783429.2220.9050.711.30.990.4222.460.1423.540.23---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15306410029.140.9641.9363.0nonono3.163.662.6643.470.04.290.011.259.0410.347.7555.0243.690.044.15no123766378528387909929.140.9641.01.24no20.270.0520.020.0219.980.0219.660.0219.430.071210446352912246784QSO0.6050J015633.56+005749.129.140.960.080.080.99211.3415.150.0332.614.550.0616.812.540.472.39.120.52.2nono43382644655929.140.9640.9811.1318.660.0518.190.0617.390.0616.650.05no47244714279829.140.9640.9831.3118.450.0517.660.0516.880.06--378489079524019878429.140.9640.540.561.01.0520.170.0320.870.05---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
...........................................................................................................................................................................................................................................................................................................................................................................
1849734938349.5850.5250.825.5nonono3.223.393.05368.730.00.10.01.556.546.896.19376.04-999.0-999.0-999.0yes1237663277923172569349.5850.5251.00.33no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0--J231820.35+003129.9349.580.520.030.030.99940.08-999.0-999.0-999.07.960.0254.57.960.0251.38.380.363.0nono433828032783349.5850.5240.9751.9111.240.010.140.011.330.010.490.0no472447374193349.5850.5251.00.212.190.012.80.011.290.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849754938349.5040.79422.4322.5nonono0.790.910.6780.010.02.120.046.092.663.052.27126.7-999.0-999.0-999.0no---999.0-999.0-999.0-999.0no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849764938349.8160.76737.5174.3nonono1.071.270.8863.940.02.650.047.323.534.023.05111.46-999.0-999.0-999.0no---999.0-999.0-999.0-999.0no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849784938349.70.5841.044.9nonono0.951.050.86108.161.321.541.1143.872.742.972.51152.85-999.0-999.0-999.0no1237663277923238284349.70.5840.991.02no22.270.1922.030.0721.830.0821.40.0921.340.29-----999.0--J231848.06+003501.0349.70.580.270.280.99480.6616.90.1110.015.720.138.112.22-999.00.98.26-999.01.8nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849794938349.7560.7168.863.8nonono0.380.490.2826.110.01.230.024.431.391.671.1250.17-999.0-999.0-999.0no---999.0-999.0-999.0-999.0no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849804938349.6410.5143.147.4nonono0.00.140.012.030.00.720.018.660.530.650.430.28-999.0-999.0-999.0no---999.0-999.0-999.0-999.0no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0--J231833.91+003051.1349.640.510.360.380.9391.8417.050.138.116.110.25.411.9-999.01.08.43-999.00.6nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849834938349.6970.5961.344.9nonono0.290.360.2427.370.00.760.015.970.941.10.7943.59-999.0-999.0-999.0no1237663277923238560349.6970.5960.990.46no22.690.2622.860.1421.950.0921.990.1521.680.38-----999.0--J231847.37+003544.6349.70.60.250.260.99160.7216.660.0912.116.190.195.712.3-999.00.78.57-999.00.2nono433828033029349.6970.5960.9860.57-999.0-999.0-999.0-999.0-999.0-999.017.770.16no472447372493349.6970.5960.9880.4919.680.1319.10.218.310.17-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849844938349.6020.6020.867.0nonono0.00.170.017.240.00.320.08.210.420.510.3425.56-999.0-999.0-999.0no---999.0-999.0-999.0-999.0no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0--J231824.70+003605.1349.60.60.490.530.97471.817.250.176.516.47-999.02.012.19-999.00.98.9-999.0-0.1nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849854938349.6530.611.144.2nonono0.00.140.012.820.00.30.06.650.340.430.2619.5-999.0-999.0-999.0no--349.6530.610.980.43yes24.750.2523.970.0723.580.0723.670.11-999.0-999.0-----999.0--J231836.63+003634.0349.650.610.210.220.94912.6516.410.0814.315.810.157.312.27-999.00.49.02-999.0-0.2nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----1
1960767867352.9910.4634.046.1nonono2.02.31.761.370.02.530.022.515.35.974.6484.7643.560.043.98no1237663277924680755352.9920.4630.941.76no24.71.1423.270.3221.330.0820.020.0519.330.094742471093791945728GALAXY0.6440J233157.95+002748.7352.990.460.10.110.97141.7115.290.0426.115.10.0813.412.570.512.18.73-999.0-0.7nono433828908457352.9910.4630.8831.719.160.0718.360.0717.450.0716.520.05no472450116796352.9920.4630.8371.7718.310.0617.450.0616.690.05-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0FIRST J233157.9+002748352.9920.4641.938.60.11-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0

We can see records in columns logLSoft, logLHard, logLFull, for example, showing the values -999.0. Although we already suspect, we go to ReadMe and double-check it to see what is there about Null values. For those three example columns we see ?=-999, which is the right --although truncated/integer-- value. For some reason, Astropy is not handling it as it should.

To fix this, we have sync the number of significat digits of the null values with the (declared) format. For instance, those columns have a Format=F7.2 and so should the null values be declared as ?=-999.00.

Changing such signatures for those columns (logLSoft, logLHard and logLFull) and saving them to file ReadMe_fix give us the following:


In [7]:
from astropy.table import Table
chandra = Table.read('data/chandra.dat',readme='data/ReadMe_fix',format='ascii.cds')
chandra


Out[7]:
<Table masked=True length=1146>
MSIDObsIDRAdegDEdege_PosDistNNInAO10InAO13RemLogNSFSoftB_FSoftb_FSoftCtSoftFHardB_FHardb_FHardCtHardFFullB_FFullb_FFullCtFulllogLSoftlogLHardlogLFullRejSSDSSRASdegDESdegRelSrSCoaddSumage_umaggmage_gmagrmage_rmagimage_imagzmage_zmagSpecIDClasszspr_zspWISERAWdegDEWdege_RAWdege_DEWdegRelWrWW1mage_W1magW1SNRW2mage_W2magW2SNRW3mage_W3magW3SNRW4mage_W4magW4SNRExtWRejWUKIDSSRAUdegDEUdegRelUrUYmage_YmagJmage_JmagHmage_HmagKmage_KmagRejUVHSRAVdegDEVdegRelVrVJVmage_JVmagHVmage_HVmagKVmage_KVmagRejVGALEXRAGdegDEGdege_NUVPose_FUVPosRelGrGNUVe_NUVFUVe_FUVFIRSTRAFdegDEFdegrFF1.4GHze_F1.4GHzRAHdegDEHdegrHF250e_F250F350e_F350F500e_F500XMMAO10CPXMMAO13CPCPCoord
degdegarcsecarcsecct1e-17 W / m21e-17 W / m21e-17 W / m2ct1e-17 W / m21e-17 W / m21e-17 W / m2ct1e-17 W / m21e-17 W / m21e-17 W / m2ct[10-7W][10-7W][10-7W]degdegarcsecmagmagmagmagmagmagmagmagmagmagdegdegarcsecarcsecarcsecmagmagmagmagmagmagmagmagdegdegarcsecmagmagmagmagmagmagmagmagdegdegarcsecmagmagmagmagmagmagdegdegarcsecarcsecarcsecmagmagmagmagdegdegarcsecmJymJydegdegarcsecmJymJymJymJymJymJy
int64int64float64float64float64float64str9str9str3float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64str3str19float64float64float64float64str3float64float64float64float64float64float64float64float64float64float64str19str6float64int64str19float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64str3str3str12float64float64float64float64float64float64float64float64float64float64float64float64str2str12float64float64float64float64float64float64float64float64float64float64str1str19float64float64float64float64float64float64float64float64float64float64str22float64float64float64float64float64float64float64float64float64float64float64float64float64float64str5str4int64
15288775029.212-0.768.958.1nonono0.01.810.019.760.02.470.09.133.914.83.0229.610.00.044.96no123766378313646081029.212-0.7590.932.6no19.10.0219.120.0119.060.0118.750.0118.760.03453806688202418176QSO1.7970J015650.83-004532.729.21-0.760.090.10.8152.5115.750.0425.714.410.0522.511.610.25.49.330.542.0nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0--377933166465148668329.212-0.7590.530.590.93.3920.550.0421.320.07---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15292775029.32-0.8850.7169.1nonoyes0.00.370.06.340.03.40.018.852.112.541.6824.690.00.043.14no123765706954932233729.321-0.8851.00.32no21.580.1421.110.0420.480.0419.180.0219.650.09788134919485286400QSO0.4220---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0nono43383778926729.32-0.8850.9970.3119.030.0818.430.0817.620.0716.630.05no47246910790429.32-0.8850.9980.2618.320.0317.580.0316.890.04-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15293775029.356-0.8541.0169.1nonono1.251.481.0129.425.756.784.8238.195.926.675.1867.32------no123765706954938822729.356-0.8540.990.93no25.480.9422.170.1221.130.0720.40.0619.930.14-----999.0--J015725.41-005114.729.36-0.850.070.070.9971.0515.030.0333.813.910.0426.911.090.128.88.180.224.9nono43383779730029.356-0.8540.9930.9819.320.118.630.0917.660.0716.660.05no47246910719729.356-0.8540.9940.9618.780.0517.740.0416.80.04-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15295775029.274-0.8751.3171.4nonono0.01.610.013.790.02.70.05.573.74.632.8719.53------no123765706954932256829.274-0.8750.990.38no21.690.1321.770.0621.090.0520.820.0521.080.23-----999.0--J015705.71-005228.729.27-0.870.180.180.99460.5416.490.0617.215.810.147.512.61-999.00.29.34-999.0-1.6nono43383778924629.274-0.8750.9830.3820.270.2519.030.1418.280.1318.070.17no47246910765829.274-0.8750.9890.4819.230.0718.490.0717.750.09-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15296775029.305-0.9881.8376.1nonono2.532.92.1751.220.02.790.014.096.066.855.2765.8743.260.043.64no123765706954932258629.305-0.9881.01.4no20.490.1120.010.0319.10.0218.710.0218.40.06789333661701924864GALAXY0.4410J015713.28-005916.829.31-0.990.080.080.99231.4715.220.0332.914.390.0522.311.060.110.68.840.442.5nono43383778950729.305-0.9880.9831.3118.880.0718.150.0617.320.0616.470.04no47246911027029.305-0.9880.9851.2518.190.0317.340.0316.60.03-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15297775029.221-0.7732.658.1nonono4.585.193.9866.890.04.10.016.5511.1112.429.8183.3643.870.044.26no123766378313646089429.222-0.7730.990.94no19.760.0319.420.0119.530.0119.360.0219.340.054060009444665652224QSO0.6150J015653.16-004623.429.22-0.770.070.070.991.0715.00.0333.314.210.0424.711.980.293.88.58-999.01.8nono43383719740429.221-0.7730.9720.9218.520.0518.230.0617.360.0516.480.04no47246910520329.222-0.7730.9740.9418.120.0317.310.0316.520.03--377933166465148652729.221-0.7730.490.510.990.3319.560.0220.340.04---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15303410029.210.8860.683.2nonoyes3.874.333.3360.139.0610.757.5536.3114.1215.6112.6496.0844.8745.2445.43yes123766378528394456329.210.8861.00.06no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0453847919888459776QSO1.6530J015650.28+005308.929.210.890.070.070.99930.4714.880.0334.813.990.0426.911.270.147.68.010.185.9nono43382714236029.210.8860.9980.0617.680.0316.930.0216.010.0215.840.03no47244714429729.2090.8860.9980.0716.830.0115.980.0115.840.02--378489079524019764229.2090.8860.50.691.00.7620.470.0322.910.15---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15304410029.2220.9050.783.2nonono3.253.742.850.070.03.00.08.438.769.937.5859.08------yes123766378528394489229.2220.9051.00.11no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0--J015653.36+005417.729.220.90.20.210.99730.3516.630.0814.315.520.128.712.38-999.00.98.86-999.00.4nono43382714230629.2220.9050.9950.1720.040.23-999.0-999.0-999.0-999.018.290.23no47244714388829.2220.9050.9970.0619.310.118.260.0917.950.15--378489079524019783429.2220.9050.711.30.990.4222.460.1423.540.23---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
15306410029.140.9641.9363.0nonono3.163.662.6643.470.04.290.011.259.0410.347.7555.0243.690.044.15no123766378528387909929.140.9641.01.24no20.270.0520.020.0219.980.0219.660.0219.430.071210446352912246784QSO0.6050J015633.56+005749.129.140.960.080.080.99211.3415.150.0332.614.550.0616.812.540.472.39.120.52.2nono43382644655929.140.9640.9811.1318.660.0518.190.0617.390.0616.650.05no47244714279829.140.9640.9831.3118.450.0517.660.0516.880.06--378489079524019878429.140.9640.540.561.01.0520.170.0320.870.05---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
...........................................................................................................................................................................................................................................................................................................................................................................
1849734938349.5850.5250.825.5nonono3.223.393.05368.730.00.10.01.556.546.896.19376.04------yes1237663277923172569349.5850.5251.00.33no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0--J231820.35+003129.9349.580.520.030.030.99940.08-999.0-999.0-999.07.960.0254.57.960.0251.38.380.363.0nono433828032783349.5850.5240.9751.9111.240.010.140.011.330.010.490.0no472447374193349.5850.5251.00.212.190.012.80.011.290.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849754938349.5040.79422.4322.5nonono0.790.910.6780.010.02.120.046.092.663.052.27126.7------no---999.0-999.0-999.0-999.0no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849764938349.8160.76737.5174.3nonono1.071.270.8863.940.02.650.047.323.534.023.05111.46------no---999.0-999.0-999.0-999.0no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849784938349.70.5841.044.9nonono0.951.050.86108.161.321.541.1143.872.742.972.51152.85------no1237663277923238284349.70.5840.991.02no22.270.1922.030.0721.830.0821.40.0921.340.29-----999.0--J231848.06+003501.0349.70.580.270.280.99480.6616.90.1110.015.720.138.112.22-999.00.98.26-999.01.8nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849794938349.7560.7168.863.8nonono0.380.490.2826.110.01.230.024.431.391.671.1250.17------no---999.0-999.0-999.0-999.0no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849804938349.6410.5143.147.4nonono0.00.140.012.030.00.720.018.660.530.650.430.28------no---999.0-999.0-999.0-999.0no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0--J231833.91+003051.1349.640.510.360.380.9391.8417.050.138.116.110.25.411.9-999.01.08.43-999.00.6nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849834938349.6970.5961.344.9nonono0.290.360.2427.370.00.760.015.970.941.10.7943.59------no1237663277923238560349.6970.5960.990.46no22.690.2622.860.1421.950.0921.990.1521.680.38-----999.0--J231847.37+003544.6349.70.60.250.260.99160.7216.660.0912.116.190.195.712.3-999.00.78.57-999.00.2nono433828033029349.6970.5960.9860.57-999.0-999.0-999.0-999.0-999.0-999.017.770.16no472447372493349.6970.5960.9880.4919.680.1319.10.218.310.17-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849844938349.6020.6020.867.0nonono0.00.170.017.240.00.320.08.210.420.510.3425.56------no---999.0-999.0-999.0-999.0no-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0--J231824.70+003605.1349.60.60.490.530.97471.817.250.176.516.47-999.02.012.19-999.00.98.9-999.0-0.1nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0
1849854938349.6530.611.144.2nonono0.00.140.012.820.00.30.06.650.340.430.2619.5------no--349.6530.610.980.43yes24.750.2523.970.0723.580.0723.670.11-999.0-999.0-----999.0--J231836.63+003634.0349.650.610.210.220.94912.6516.410.0814.315.810.157.312.27-999.00.49.02-999.0-0.2nono---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0no---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0---999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----1
1960767867352.9910.4634.046.1nonono2.02.31.761.370.02.530.022.515.35.974.6484.7643.560.043.98no1237663277924680755352.9920.4630.941.76no24.71.1423.270.3221.330.0820.020.0519.330.094742471093791945728GALAXY0.6440J233157.95+002748.7352.990.460.10.110.97141.7115.290.0426.115.10.0813.412.570.512.18.73-999.0-0.7nono433828908457352.9910.4630.8831.719.160.0718.360.0717.450.0716.520.05no472450116796352.9920.4630.8371.7718.310.0617.450.0616.690.05-----999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0FIRST J233157.9+002748352.9920.4641.938.60.11-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0-999.0----0

That's it. After declaring the null values with all the significant numbers following the Format, such values are properly handled.

Generating a MOC catalog

Now we go through a MOC catalog creation. There is no problem here, just to answer Markus what I understand what a MOC is: a list of (unique) element numbers. The section 2.3.1 NUNIQ packing of the IVOA MOC document version-1 explains how the conversion between the two kinds of elements representation.

The lines below will use the catalog we just have in hands, chandra, to build the MOC. First, I will compute Healpix level/nside values based on the mean positional error of the catalog and then the MOC elements are computed from (RA,Dec) using HealPy. MOCPy is used at the end to plot the MOC elements; Also Aladin is used to have a better view of the elements. Files can be download from data/ directory.


In [8]:
# A function to find out which healpix level corresponds a given (typical) size of coverage
def size2level(size):
    """
    Returns nearest Healpix level corresponding to a given diamond size
    
    The 'nearest' Healpix level is here to be the nearest greater level, 
    right before the first level smaller than 'size'.
    """
    # units
    from astropy import units as u

    # Structure to map healpix' levels to their angular sizes
    #
    healpix_levels = {
        0  : 58.63 * u.deg,
        1  : 29.32 * u.deg, 
        2  : 14.66 * u.deg, 
        3  : 7.329 * u.deg, 
        4  : 3.665 * u.deg, 
        5  : 1.832 * u.deg, 
        6  : 54.97 * u.arcmin, 
        7  : 27.48 * u.arcmin, 
        8  : 13.74 * u.arcmin, 
        9  : 6.871 * u.arcmin, 
        10 : 3.435 * u.arcmin, 
        11 : 1.718 * u.arcmin, 
        12 : 51.53 * u.arcsec, 
        13 : 25.77 * u.arcsec, 
        14 : 12.88 * u.arcsec, 
        15 : 6.442 * u.arcsec,
        16 : 3.221 * u.arcsec,
        17 : 1.61 * u.arcsec,
        18 : 805.2 * u.milliarcsecond,
        19 : 402.6 * u.milliarcsecond,
        20 : 201.3 * u.milliarcsecond,
        21 : 100.6 * u.milliarcsecond,
        22 : 50.32 * u.milliarcsecond,
        23 : 25.16 * u.milliarcsecond,
        24 : 12.58 * u.milliarcsecond,
        25 : 6.291 * u.milliarcsecond,
        26 : 3.145 * u.milliarcsecond,
        27 : 1.573 * u.milliarcsecond,
        28 : 786.3 * u.microarcsecond,
        29 : 393.2 * u.microarcsecond
    }
    
    assert size.unit
    ko = None
    for k,v in healpix_levels.iteritems():
        if v < 2 * size:  # extrapolating the error by one order of magnitude
            break
        ko = k
    return ko

import numpy as np
from astropy import units as u

median_positional_error = np.median(chandra['e_Pos']) * u.arcsec
level = size2level(median_positional_error)
nside = 2**level

print "Typical (median) position error: \n{}".format(median_positional_error)
print "\nCorrespondig healpix level: {} \n\t and nsize value: {}".format(level,nside)


Typical (median) position error: 
1.8 arcsec

Correspondig healpix level: 15 
	 and nsize value: 32768

In [9]:
def healpix_radec2pix(nside, ra, dec, nest=True):
    """
    convert ra,dec to healpix elements
    """
    def radec2thetaphi(ra,dec):
        """
        convert equatorial ra, dec in degrees
        to polar theta, phi in radians
        """
        def ra2phi(ra):
            import math
            return math.radians(ra)

        def dec2theta(dec):
            import math
            return math.pi/2 - math.radians(dec)

        _phi = ra2phi(ra)
        _theta = dec2theta(dec)
        return _theta,_phi
    
    import healpy

    _theta,_phi = radec2thetaphi(ra, dec)
    return healpy.ang2pix(nside, _theta, _phi, nest=nest)

In [10]:
radec = zip(chandra['RAdeg'],chandra['DEdeg'])
hpix = [ healpix_radec2pix(nside,ra,dec) for ra,dec in radec ]

Here it is, the MOC catalog (the list of elements to be more precise):


In [11]:
hpix


Out[11]:
[4670494905,
 4670400279,
 4670403331,
 4670401645,
 4670392473,
 4670494759,
 4671384085,
 4671384357,
 4676978911,
 4671330533,
 4671331180,
 4989484038,
 4990210203,
 4990222218,
 4990210849,
 4990304600,
 4990212145,
 4990308017,
 4990309939,
 4989505731,
 4990308766,
 4989505904,
 4990314223,
 4990314200,
 4990315270,
 4990307128,
 4990219767,
 4990314273,
 4990313014,
 4989508090,
 4989591218,
 4989503515,
 4989602649,
 4989601755,
 4989603613,
 4989588848,
 4989600491,
 4989602599,
 4743815115,
 4743778943,
 4743778930,
 4743831719,
 4743798150,
 4743832559,
 4743796413,
 4743797180,
 4743807680,
 4743825454,
 4743807643,
 4743786078,
 4743807439,
 4743785967,
 4743786377,
 4743808188,
 4743810193,
 4743773411,
 4743810402,
 4743810473,
 4743812227,
 4743813175,
 4743810913,
 4743813811,
 4743771941,
 4743773703,
 4743773481,
 4743782977,
 4743773921,
 4743773667,
 4743773951,
 4743783386,
 4743784850,
 4743796117,
 4743785221,
 4743796519,
 4743798075,
 4743795509,
 4743786281,
 4743815215,
 4743815381,
 4743811894,
 4743813312,
 4743771084,
 4743783288,
 4743772739,
 4743771707,
 4743771476,
 4743782713,
 4743797825,
 4743784037,
 4743784393,
 4743819316,
 4743814117,
 4743784932,
 4743770756,
 4743770936,
 4743797652,
 4743814857,
 4743784931,
 4743819737,
 4743788987,
 4743804810,
 4743790528,
 4743769404,
 4743785207,
 4743777876,
 4743812436,
 4743814099,
 4743814921,
 4743798770,
 4743856202,
 4743785565,
 4738694782,
 4739044917,
 4738681892,
 4738680688,
 4738682453,
 4738682606,
 4738682761,
 4738688190,
 4737980386,
 4921113766,
 4921515761,
 4921199321,
 4921149166,
 4921156057,
 4921148972,
 4735832517,
 4735731554,
 4735729982,
 4735729911,
 4735708847,
 4735730147,
 4735739377,
 4735832111,
 4735661937,
 4735741925,
 4735741279,
 4735744032,
 4735742858,
 4735744222,
 4735829332,
 4658148736,
 4658114371,
 4658117184,
 4658113750,
 4658137378,
 4658117346,
 4658139170,
 4658139192,
 4658117454,
 4658117455,
 4658139286,
 4658117591,
 4658139771,
 4658111574,
 4658140788,
 4658140977,
 4658110836,
 4658110939,
 4658112153,
 4658111970,
 4658111997,
 4658112381,
 4658113844,
 4658113764,
 4658140753,
 4658141691,
 4658142633,
 4658105993,
 4658105968,
 4658105715,
 4658114601,
 4658114793,
 4658147603,
 4658148580,
 4658111823,
 4658142134,
 4658114323,
 4658137297,
 4658105887,
 4658109301,
 4658136352,
 4656708194,
 4658159744,
 4658117271,
 4658113856,
 4658141900,
 4658142780,
 4658103619,
 4658141614,
 4721546600,
 4721542348,
 4721194619,
 4721544527,
 4721545064,
 4721557715,
 4721549142,
 4721560598,
 4721554097,
 4721555040,
 4721542527,
 4721566100,
 4721544081,
 4721566770,
 4721542177,
 4721207166,
 4721209534,
 4721545694,
 4721546141,
 4721545190,
 4721545202,
 4724898376,
 4724898695,
 4725019750,
 4724895580,
 4724932077,
 4724899320,
 4724923143,
 4724893927,
 4724923621,
 4724928903,
 4724917927,
 4724917873,
 4724918054,
 4724936351,
 4724935730,
 4725115109,
 4725032799,
 4724944188,
 4725032493,
 4741298253,
 4741298794,
 4741299880,
 4741296575,
 4725226291,
 4725247082,
 4725255804,
 4725249897,
 4725208383,
 4725246899,
 4725255872,
 4725255801,
 4725177650,
 4716477092,
 4716488309,
 4717890873,
 4716489131,
 4717884691,
 4717896751,
 4927156831,
 4927156827,
 4927159403,
 4927160151,
 4927153377,
 4927156368,
 4927158859,
 4927180819,
 4927159119,
 4927144983,
 4927144982,
 4927155469,
 4927150896,
 4927054455,
 4927145633,
 4927156405,
 4927151099,
 4927157445,
 4927147362,
 4927155695,
 4927203384,
 4927157646,
 4927057605,
 4719448817,
 4719093701,
 4719451520,
 6090674122,
 6090685943,
 6090728364,
 6090728875,
 6090730555,
 6090726127,
 6077357433,
 6077375302,
 6077401387,
 6077400963,
 6077407319,
 6077402637,
 6077390175,
 6077411662,
 4563328692,
 4563335287,
 4563334710,
 4563333476,
 4921252903,
 4563087630,
 4563108631,
 4563090238,
 4563112109,
 4563110774,
 4563077403,
 4563090595,
 4563111255,
 4563112683,
 4563078187,
 4563114169,
 4563089419,
 4563124978,
 4563088158,
 4563088965,
 4563039493,
 4563077764,
 4563110051,
 4995953359,
 4995941920,
 4992792449,
 4992785519,
 4992782979,
 4995591040,
 4720659098,
 4720581596,
 4720610995,
 4720579527,
 4720663213,
 4720590679,
 4720572401,
 4720577655,
 4720634528,
 4720634476,
 4720634613,
 4720658181,
 4720634734,
 6068253755,
 6068256687,
 6068280339,
 6068251867,
 6068274760,
 6068259378,
 6068247309,
 6068639168,
 5100810473,
 5100811832,
 5100812323,
 5100449639,
 5100799570,
 5100447381,
 5100801744,
 5100801850,
 5100804280,
 5100807470,
 5100452036,
 5100799333,
 5100575621,
 5100593946,
 5100572737,
 5100393975,
 4651184031,
 4651206778,
 4651212198,
 4651182222,
 4651218030,
 4651182649,
 4651363166,
 4651173257,
 4651204676,
 4651205454,
 4651205460,
 4651171313,
 6077185753,
 6077251685,
 6077225466,
 6077226149,
 6077225196,
 6077233506,
 9663531377,
 9663526676,
 9663526750,
 9663532580,
 9663537406,
 9663538319,
 9663528904,
 9663516041,
 9663517121,
 9663517925,
 9663495715,
 9663529153,
 9663529077,
 9663520457,
 9663526096,
 9663526076,
 9663496180,
 9663526286,
 9663526370,
 9663526380,
 9663537849,
 9663538103,
 9663539672,
 9663494021,
 9663495505,
 9663519088,
 9663495655,
 9663518334,
 9663537964,
 9663628714,
 9663490898,
 9663627333,
 9663486734,
 9663518513,
 9663489708,
 9663487015,
 9663494450,
 9663519800,
 9663629487,
 9663487905,
 9663538231,
 9663521086,
 9663522823,
 9663513129,
 9663628726,
 9663486469,
 9663513424,
 9663494000,
 9663630864,
 9663521261,
 9663519703,
 9663531995,
 9663493843,
 9663629057,
 9663513461,
 4654226245,
 4654507352,
 4654507486,
 4654501751,
 4654331695,
 4660946158,
 4660947235,
 4660926234,
 4660932252,
 4655324715,
 4655318488,
 4660927572,
 4660927794,
 4660937376,
 4660938954,
 4675198728,
 4675169008,
 4675198779,
 4675191758,
 4675203487,
 4675206529,
 4675206470,
 4675469930,
 4675197465,
 4675203605,
 4675197153,
 4667992551,
 4667993445,
 4667939502,
 4667946708,
 4667971061,
 4737426089,
 4737456722,
 4737416793,
 4737450413,
 4737413608,
 4737414582,
 4737428611,
 4737451171,
 4737416429,
 4737453285,
 4737404910,
 4737425976,
 4737405560,
 4737453822,
 4737406486,
 4737416879,
 4737438736,
 4737417016,
 4737438835,
 4737439160,
 4737439175,
 4945498788,
 4945405424,
 4945494078,
 4945407130,
 4945395301,
 4945543176,
 4945358363,
 4945358817,
 4945360612,
 4945397875,
 4945499315,
 4945391333,
 4945499711,
 4945361398,
 4945359063,
 4945398220,
 4945398762,
 4945404411,
 4945404240,
 4925994285,
 4719386334,
 4719393808,
 4719393561,
 4719383108,
 4719384100,
 4719389724,
 4719386028,
 4719380418,
 4719403540,
 4719379838,
 4719382547,
 4719393631,
 4719392741,
 4719381829,
 4719405732,
 4719390396,
 4719028987,
 4719383224,
 4719029106,
 4719213919,
 4719418451,
 4719378518,
 4718851370,
 4718851677,
 4719381979,
 4719412852,
 4719027365,
 4719427755,
 4719428118,
 4719415820,
 4719027413,
 4719026386,
 4719236429,
 4719029712,
 4719385168,
 4719385293,
 4719390838,
 4719391369,
 4719391095,
 4630168122,
 4630127689,
 4630121969,
 4630135359,
 4630141475,
 4630170550,
 4630132731,
 4630033802,
 4630045316,
 4630032240,
 4630122203,
 4630127734,
 4630123496,
 4630127945,
 4630120016,
 4630124982,
 4630128453,
 4630130797,
 4630125497,
 4630131596,
 4630131819,
 4630131816,
 4630032070,
 4630120012,
 4630119574,
 4630120155,
 4630125218,
 4630035096,
 4630130955,
 4630131235,
 4630126379,
 4630121548,
 4630131775,
 4630131537,
 4630132388,
 4630156356,
 4630120332,
 4630118991,
 4630135539,
 4630139523,
 4630120377,
 4630145655,
 4630036185,
 4630034933,
 4630034351,
 4630123805,
 4630122029,
 4630135389,
 4630167830,
 4630121724,
 4630122616,
 4630046737,
 4630123326,
 4630044686,
 4630144285,
 4653840872,
 4654189447,
 4654190744,
 4654195164,
 4653835962,
 4653837578,
 4653837542,
 4653837807,
 4653837818,
 4654189124,
 4653840807,
 4653836067,
 4653838899,
 4654183515,
 4654198001,
 4654190753,
 4654184036,
 4654377611,
 4653834881,
 4654197592,
 4654201336,
 4654202567,
 4654196459,
 4654224695,
 4654400058,
 4653835442,
 4654202753,
 4654196780,
 4653828702,
 4654201898,
 4654400843,
 4653837786,
 4654184285,
 4654378233,
 4654176248,
 4653835828,
 4654400237,
 4654177938,
 4654185487,
 4654187612,
 4654187874,
 4653840984,
 4653840872,
 4928330481,
 4928344060,
 4928349442,
 4928349841,
 4928352731,
 4928349518,
 4928358870,
 4928359022,
 4928361010,
 4928360312,
 4928363100,
 4928336679,
 4676876644,
 4676897583,
 4676861435,
 4676868669,
 4676868747,
 4676873751,
 4676865809,
 4676859296,
 4676869279,
 4676873759,
 4677051009,
 4676868052,
 4676865976,
 4676866009,
 4676895594,
 4671234360,
 4671251424,
 4671216181,
 4671228833,
 4671222099,
 4671228139,
 4671222042,
 4671248841,
 4671249981,
 4671217582,
 4671223493,
 5006335256,
 5006307319,
 5006321764,
 5006307579,
 5006335498,
 5006323091,
 5006228452,
 5006320177,
 5006320106,
 5006313920,
 6079687054,
 6079687725,
 6079833420,
 6079788480,
 6079788768,
 6079793442,
 4651817797,
 4651844056,
 4651775933,
 4651829793,
 4651817889,
 4651849882,
 4651844074,
 4651827959,
 4651811882,
 4651829451,
 4651850635,
 4651819042,
 4651835474,
 4651850265,
 4651856052,
 4651850427,
 4651813770,
 4651817289,
 4651855121,
 4651823108,
 4651823510,
 4651818766,
 4651824959,
 4651819302,
 4651815509,
 4651817257,
 4658976016,
 4658879748,
 4658924703,
 4658855115,
 4658952380,
 4658950950,
 4658951053,
 4658935008,
 4658952214,
 4658952263,
 4658927354,
 4658946508,
 4657689226,
 4657685333,
 4657686263,
 4657693860,
 4657693926,
 4657682033,
 4657704027,
 4657698508,
 4657744003,
 4657667104,
 4657746840,
 4658898160,
 4658907571,
 4658895878,
 4658894553,
 4658896007,
 4658901116,
 4658892612,
 4657686587,
 4657493309,
 4657505025,
 4657499506,
 4657508266,
 4657508332,
 4657683632,
 4657502642,
 4657560534,
 4657662568,
 4657560478,
 4657647710,
 4657673903,
 4657666291,
 4657665966,
 4657575902,
 4657575897,
 4657625112,
 4657621674,
 4657571320,
 4659085713,
 4658909792,
 4659093096,
 4658914419,
 4658918923,
 4659088249,
 4659086165,
 4658918953,
 4658943777,
 4721147860,
 4721194994,
 4721207906,
 4721192514,
 4721193559,
 4721191952,
 4721205994,
 4721196454,
 4721188284,
 4721158580,
 4721181496,
 4721181835,
 4721181498,
 4721145286,
 4721185319,
 4721138803,
 4721189219,
 4721185488,
 4721187177,
 4721181654,
 4721188187,
 4721183326,
 4721189540,
 4721183499,
 4721163046,
 4721158999,
 4721198315,
 4721183681,
 4721198628,
 4721184067,
 4721187363,
 4654510968,
 4653815801,
 4653834644,
 4653837940,
 4659083055,
 4659076916,
 4742091501,
 4742090223,
 4742272375,
 4741907472,
 4741914166,
 4742064986,
 4742065128,
 4741884957,
 4742065677,
 4741914257,
 4742455881,
 4742451105,
 4742093028,
 4742100929,
 4741919791,
 4741914574,
 4741910573,
 4741918931,
 4741919618,
 4742087971,
 4741921656,
 4726138631,
 4725960539,
 4726040667,
 4726128728,
 4726084613,
 4726084628,
 4726084762,
 4926080977,
 4925992908,
 4926080221,
 4925997343,
 4925976232,
 4925954975,
 4925962064,
 4925985680,
 4925997120,
 4925999285,
 4925998732,
 4925997796,
 4926000410,
 4926000274,
 4925959195,
 4926003893,
 4926006771,
 4925973378,
 4925992982,
 4925984173,
 4925997328,
 4925958116,
 4925997927,
 4925998803,
 4925955088,
 4925999678,
 4926006418,
 4925953784,
 4925610412,
 4925653289,
 4925609966,
 4925656043,
 4925609295,
 4925653074,
 4927287546,
 4927287276,
 4927265543,
 4927265273,
 4927286580,
 4925585786,
 4925583329,
 4925567981,
 4925568890,
 4925987146,
 4925954246,
 4925973330,
 4925973330,
 4925997219,
 4925954660,
 4925957081,
 4925963161,
 4925951701,
 4927281270,
 4927287355,
 4927326660,
 4927327107,
 4925917783,
 4925924293,
 4925859087,
 4925856775,
 4925857956,
 4925594876,
 4925949197,
 4925597205,
 4925597158,
 4925597494,
 4925600275,
 4925882233,
 4925931655,
 4925928968,
 4925918354,
 4925918607,
 4925927967,
 4925928055,
 4925929823,
 4925916064,
 4925863141,
 4925843732,
 4925867336,
 4925832984,
 4926558033,
 4926551999,
 4925159978,
 4927259557,
 4926567532,
 4926568099,
 4925894129,
 4925793119,
 4925885162,
 4925892604,
 4925891344,
 4925795813,
 4925958777,
 4925982303,
 4925947942,
 4925806277,
 4925981131,
 4925780636,
 4925782983,
 4927274267,
 4927303774,
 4927285988,
 4927308628,
 4927305537,
 4926600636,
 4927297944,
 4927304711,
 4927269199,
 4925809927,
 4925883905,
 4925811443,
 4925800628,
 4925802871,
 4925778638,
 4925811160,
 4925963647,
 4925975057,
 4925970838,
 4925611686,
 4925965330,
 4925904257,
 4925904668,
 4925909648,
 4925905549,
 4925912102,
 4925932725,
 4989509614,
 4990304319,
 4990220704,
 4990216397,
 4989516399,
 4990306517,
 4990209227,
 4990214727,
 4990207556,
 4989506164,
 4989514040,
 4989604082,
 4989604792,
 4990308811,
 4989516947,
 4990216830,
 4989509322,
 4990214260,
 4989517181,
 4990214899,
 4989517665,
 4989517659,
 4989508987,
 4989508778,
 4990208706,
 4990215160,
 4989605372,
 4989605366,
 4990216144,
 4990217870,
 4989509280,
 4990217215,
 4989507341,
 ...]

The plot made by MOCPy:


In [12]:
moc = mocpy.MOC()
moc.add_pix_list(level,hpix)
moc.plot()
moc.write('data/MOC_chandra.fits')


0.0 180.0 -180.0 180.0
The interval between parallels is 30 deg -0.00'.
The interval between meridians is 30 deg -0.00'.

And here after importing it to Aladin:


In [13]:
from IPython.display import HTML
HTML('''
<figure>
  <img src="data/MOC_on_Aladin.png" alt="MOC printed on Aladin">
  <figcaption>Figure 1: MOC printed on Aladin</figcaption>
</figure>
''')


Out[13]:
Figure 1: MOC printed on Aladin

In [ ]: