Querying ALMA archive for M83 pointings and plotting them on a 2MASS image

In [2]:
from astroquery.alma import Alma
from astroquery.skyview import SkyView
import string
from astropy import units as u
import pylab as pl
import aplpy

Retrieve M83 2MASS K-band image:

In [3]:
m83_images = SkyView.get_images(position='M83', survey=['2MASS-K'], pixels=1500)
WARNING: AstropyDeprecationWarning: Since 0.4, config parameter 'astropy.utils.data.REMOTE_TIMEOUT' is deprecated. Use 'astropy.utils.data.conf.remote_timeout' instead. [astropy.config.configuration]
WARNING:astropy:AstropyDeprecationWarning: Since 0.4, config parameter 'astropy.utils.data.REMOTE_TIMEOUT' is deprecated. Use 'astropy.utils.data.conf.remote_timeout' instead.
FITS files must be read as binaries; error is likely.

Retrieve ALMA archive information including private data and non-science fields:

In [4]:
m83 = Alma.query_object('M83', public=False, science=False)
In [5]:
m83
Out[5]:
<Table masked=True length=2720>
Project codeSource nameRADecBandFrequency resolutionIntegrationRelease dateFrequency supportVelocity resolutionPol productsObservation datePI namePWVMember ous idAsdm uidProject titleProject typeScan intent
degdegkHzsGHzm / smm
string128string2048float64float64int32float64float64objectstring21600float64string512objectstring2048float32string256string256string2048string128string2048
2011.0.00772.SM83204.24697661723459-29.8541732148263393488.2812540.0349999999999972013-09-28[100.63..101.57GHz,488.28kHz, XX YY] U [102.43..103.37GHz,488.28kHz, XX YY] U [112.74..113.68GHz,488.28kHz, XX YY] U [114.45..115.38GHz,488.28kHz, XX YY]1354.7258237091098XX YY2012-03-27 07:12:59Hirota, Akihiko1.3226013uid://A002/X3216af/X31uid://A002/X3b3400/X90fGiant Molecular Cloud Survey Toward bar and arm of the nearby Galaxy M83STARGET
2011.0.00772.SM83204.24697661723459-29.8541732148263393488.2812540.0349999999999972013-09-28[100.63..101.57GHz,488.28kHz, XX YY] U [102.43..103.37GHz,488.28kHz, XX YY] U [112.74..113.68GHz,488.28kHz, XX YY] U [114.45..115.38GHz,488.28kHz, XX YY]1354.7258237091098XX YY2012-03-27 08:41:25Hirota, Akihiko1.2252344uid://A002/X3216af/X31uid://A002/X3b3400/Xaf3Giant Molecular Cloud Survey Toward bar and arm of the nearby Galaxy M83STARGET
2011.0.00772.SM83204.24697661723459-29.8541732148263393488.2812540.1730000000000022013-09-28[100.63..101.57GHz,488.28kHz, XX YY] U [102.43..103.37GHz,488.28kHz, XX YY] U [112.74..113.68GHz,488.28kHz, XX YY] U [114.45..115.38GHz,488.28kHz, XX YY]1354.7258237091098XX YY2012-05-07 02:48:00Hirota, Akihiko1.8213283uid://A002/X3216af/X31uid://A002/X3fbe56/X607Giant Molecular Cloud Survey Toward bar and arm of the nearby Galaxy M83STARGET
2011.0.00772.SM83204.24848880184393-29.8648656720870143488.2812546.7310000000000022013-09-28[100.63..101.57GHz,488.28kHz, XX YY] U [102.43..103.37GHz,488.28kHz, XX YY] U [112.74..113.68GHz,488.28kHz, XX YY] U [114.45..115.38GHz,488.28kHz, XX YY]1354.7258237091098XX YY2012-03-27 07:12:59Hirota, Akihiko1.3226013uid://A002/X3216af/X31uid://A002/X3b3400/X90fGiant Molecular Cloud Survey Toward bar and arm of the nearby Galaxy M83STARGET
2011.0.00772.SM83204.24848880184393-29.8648656720870143488.2812546.752013-09-28[100.63..101.57GHz,488.28kHz, XX YY] U [102.43..103.37GHz,488.28kHz, XX YY] U [112.74..113.68GHz,488.28kHz, XX YY] U [114.45..115.38GHz,488.28kHz, XX YY]1354.7258237091098XX YY2012-03-27 08:41:25Hirota, Akihiko1.2252344uid://A002/X3216af/X31uid://A002/X3b3400/Xaf3Giant Molecular Cloud Survey Toward bar and arm of the nearby Galaxy M83STARGET
2011.0.00772.SM83204.24848880184393-29.8648656720870143488.2812546.9099999999999972013-09-28[100.63..101.57GHz,488.28kHz, XX YY] U [102.43..103.37GHz,488.28kHz, XX YY] U [112.74..113.68GHz,488.28kHz, XX YY] U [114.45..115.38GHz,488.28kHz, XX YY]1354.7258237091098XX YY2012-05-07 02:48:00Hirota, Akihiko1.8213283uid://A002/X3216af/X31uid://A002/X3fbe56/X607Giant Molecular Cloud Survey Toward bar and arm of the nearby Galaxy M83STARGET
2011.0.00772.SM83204.24977987250298-29.8484484297088353488.2812540.0309999999999992013-09-28[100.63..101.57GHz,488.28kHz, XX YY] U [102.43..103.37GHz,488.28kHz, XX YY] U [112.74..113.68GHz,488.28kHz, XX YY] U [114.45..115.38GHz,488.28kHz, XX YY]1354.7258237091098XX YY2012-03-27 07:12:59Hirota, Akihiko1.3226013uid://A002/X3216af/X31uid://A002/X3b3400/X90fGiant Molecular Cloud Survey Toward bar and arm of the nearby Galaxy M83STARGET
2011.0.00772.SM83204.24977987250298-29.8484484297088353488.2812540.0360000000000012013-09-28[100.63..101.57GHz,488.28kHz, XX YY] U [102.43..103.37GHz,488.28kHz, XX YY] U [112.74..113.68GHz,488.28kHz, XX YY] U [114.45..115.38GHz,488.28kHz, XX YY]1354.7258237091098XX YY2012-03-27 08:41:25Hirota, Akihiko1.2252344uid://A002/X3216af/X31uid://A002/X3b3400/Xaf3Giant Molecular Cloud Survey Toward bar and arm of the nearby Galaxy M83STARGET
2011.0.00772.SM83204.24977987250298-29.8484484297088353488.2812540.1790000000000022013-09-28[100.63..101.57GHz,488.28kHz, XX YY] U [102.43..103.37GHz,488.28kHz, XX YY] U [112.74..113.68GHz,488.28kHz, XX YY] U [114.45..115.38GHz,488.28kHz, XX YY]1354.7258237091098XX YY2012-05-07 02:48:00Hirota, Akihiko1.8213283uid://A002/X3216af/X31uid://A002/X3fbe56/X607Giant Molecular Cloud Survey Toward bar and arm of the nearby Galaxy M83STARGET
.........................................................
2012.1.00762.Sm83204.29994502155807-29.8644623459100453976.562510.129[99.86..101.85GHz,976.56kHz, XX YY] U [101.74..103.73GHz,976.56kHz, XX YY] U [112.09..114.08GHz,976.56kHz, XX YY] U [114.59..115.59GHz,488.28kHz, XX YY]2611.7724487100772XX YY2013-12-04 09:35:37Hirota, Akihiko--uid://A002/X5a9a13/X68buid://A002/X74fea5/X10d0Extended GMC survey in the nearby galaxy M83STARGET
2012.1.00762.Sm83204.29994774826423-29.8644478976906173976.562510.151999999999999[99.86..101.85GHz,976.56kHz, XX YY] U [101.74..103.73GHz,976.56kHz, XX YY] U [112.09..114.08GHz,976.56kHz, XX YY] U [114.59..115.59GHz,488.28kHz, XX YY]2611.7823942972855XX YY2013-12-01 09:19:08Hirota, Akihiko0.54483771uid://A002/X5a9a13/X68buid://A002/X74d4df/X4b9Extended GMC survey in the nearby galaxy M83STARGET WVR
2012.1.00762.Sm83204.2999565036323-29.876776393460353976.562510.117000000000001[99.86..101.85GHz,976.56kHz, XX YY] U [101.74..103.73GHz,976.56kHz, XX YY] U [112.09..114.08GHz,976.56kHz, XX YY] U [114.59..115.59GHz,488.28kHz, XX YY]2611.7343188001446XX YY2013-12-17 08:47:59Hirota, Akihiko--uid://A002/X5a9a13/X68buid://A002/X75f169/X1348Extended GMC survey in the nearby galaxy M83STARGET
2012.1.00762.Sm83204.30003398242312-29.8337537787793683976.562510.117000000000001[99.86..101.85GHz,976.56kHz, XX YY] U [101.74..103.73GHz,976.56kHz, XX YY] U [112.09..114.08GHz,976.56kHz, XX YY] U [114.59..115.59GHz,488.28kHz, XX YY]2611.7352830617078XX YY2013-12-17 10:44:34Hirota, Akihiko--uid://A002/X5a9a13/X68buid://A002/X75f169/X15f6Extended GMC survey in the nearby galaxy M83STARGET
2012.1.00762.Sm83204.30007748596259-29.8582833773929693976.562510.119[99.86..101.85GHz,976.56kHz, XX YY] U [101.74..103.73GHz,976.56kHz, XX YY] U [112.09..114.08GHz,976.56kHz, XX YY] U [114.59..115.59GHz,488.28kHz, XX YY]2611.7789019763472XX YY2013-12-02 08:41:32Hirota, Akihiko--uid://A002/X5a9a13/X68buid://A002/X74deb6/X1304Extended GMC survey in the nearby galaxy M83STARGET
2012.1.00762.Sm83204.31232521341892-29.8152795828858643976.562510.128[99.86..101.85GHz,976.56kHz, XX YY] U [101.74..103.73GHz,976.56kHz, XX YY] U [112.09..114.08GHz,976.56kHz, XX YY] U [114.59..115.59GHz,488.28kHz, XX YY]2611.7352830617078XX YY2013-12-17 10:44:34Hirota, Akihiko--uid://A002/X5a9a13/X68buid://A002/X75f169/X15f6Extended GMC survey in the nearby galaxy M83STARGET
2012.1.00762.Sm83204.31233028180358-29.8275832883760863976.562510.118[99.86..101.85GHz,976.56kHz, XX YY] U [101.74..103.73GHz,976.56kHz, XX YY] U [112.09..114.08GHz,976.56kHz, XX YY] U [114.59..115.59GHz,488.28kHz, XX YY]2611.7732219137765XX YY2013-12-04 11:19:47Hirota, Akihiko--uid://A002/X5a9a13/X68buid://A002/X74fea5/X1558Extended GMC survey in the nearby galaxy M83STARGET
2012.1.00762.Sm83204.31236333974948-29.8398469021759143976.562510.129[99.86..101.85GHz,976.56kHz, XX YY] U [101.74..103.73GHz,976.56kHz, XX YY] U [112.09..114.08GHz,976.56kHz, XX YY] U [114.59..115.59GHz,488.28kHz, XX YY]2611.7724487100772XX YY2013-12-04 09:35:37Hirota, Akihiko--uid://A002/X5a9a13/X68buid://A002/X74fea5/X10d0Extended GMC survey in the nearby galaxy M83STARGET
2012.1.00762.Sm83204.31237002788583-29.8521436865078583976.562510.151999999999999[99.86..101.85GHz,976.56kHz, XX YY] U [101.74..103.73GHz,976.56kHz, XX YY] U [112.09..114.08GHz,976.56kHz, XX YY] U [114.59..115.59GHz,488.28kHz, XX YY]2611.7823942972855XX YY2013-12-01 09:19:08Hirota, Akihiko0.54483771uid://A002/X5a9a13/X68buid://A002/X74d4df/X4b9Extended GMC survey in the nearby galaxy M83STARGET WVR
2012.1.00762.Sm83204.31237891503417-29.8644723255743293976.562510.117000000000001[99.86..101.85GHz,976.56kHz, XX YY] U [101.74..103.73GHz,976.56kHz, XX YY] U [112.09..114.08GHz,976.56kHz, XX YY] U [114.59..115.59GHz,488.28kHz, XX YY]2611.7343188001446XX YY2013-12-17 08:47:59Hirota, Akihiko--uid://A002/X5a9a13/X68buid://A002/X75f169/X1348Extended GMC survey in the nearby galaxy M83STARGET

Parse components of the ALMA data. Specifically, find the frequency support - the frequency range covered - and convert that into a central frequency for beam radius estimation.

In [6]:
def parse_frequency_support(frequency_support_str):
    supports = frequency_support_str.split("U")
    freq_ranges = [(float(sup.strip('[] ').split("..")[0]),
                    float(sup.strip('[] ').split("..")[1].split(',')[0].strip(string.letters)))
                   *u.Unit(sup.strip('[] ').split("..")[1].split(',')[0].strip(string.punctuation+string.digits))
                   for sup in supports]
    return u.Quantity(freq_ranges)

def approximate_primary_beam_sizes(frequency_support_str):
    freq_ranges = parse_frequency_support(frequency_support_str)
    beam_sizes = [(1.22*fr.mean().to(u.m, u.spectral())/(12*u.m)).to(u.arcsec,
                                                                     u.dimensionless_angles())
                  for fr in freq_ranges]
    return u.Quantity(beam_sizes)
In [7]:
primary_beam_radii = [approximate_primary_beam_sizes(row['Frequency support']) for row in m83]

Compute primary beam parameters for the public and private components of the data for plotting below.

In [8]:
print "The bands used include: ",np.unique(m83['Band'])
The bands used include:  Band
----
   3
   6
In [9]:
private_circle_parameters = [(row['RA'],row['Dec'],np.mean(rad).to(u.deg).value)
                             for row,rad in zip(m83, primary_beam_radii)
                             if row['Release date']!='' and row['Band']==3]
public_circle_parameters = [(row['RA'],row['Dec'],np.mean(rad).to(u.deg).value)
                             for row,rad in zip(m83, primary_beam_radii)
                             if row['Release date']=='' and row['Band']==3]
unique_private_circle_parameters = np.array(list(set(private_circle_parameters)))
unique_public_circle_parameters = np.array(list(set(public_circle_parameters)))

print "BAND 3"
print "PUBLIC:  Number of rows: {0}.  Unique pointings: {1}".format(len(m83), len(unique_public_circle_parameters))
print "PRIVATE: Number of rows: {0}.  Unique pointings: {1}".format(len(m83), len(unique_private_circle_parameters))

private_circle_parameters_band6 = [(row['RA'],row['Dec'],np.mean(rad).to(u.deg).value)
                             for row,rad in zip(m83, primary_beam_radii)
                             if row['Release date']!='' and row['Band']==6]
public_circle_parameters_band6 = [(row['RA'],row['Dec'],np.mean(rad).to(u.deg).value)
                             for row,rad in zip(m83, primary_beam_radii)
                             if row['Release date']=='' and row['Band']==6]
BAND 3
PUBLIC:  Number of rows: 2720.  Unique pointings: 551
PRIVATE: Number of rows: 2720.  Unique pointings: 650

Show all of the private observation pointings that have been acquired

In [10]:
fig = aplpy.FITSFigure(m83_images[0])
fig.show_grayscale(stretch='arcsinh')
fig.show_circles(unique_private_circle_parameters[:,0],
                 unique_private_circle_parameters[:,1],
                 unique_private_circle_parameters[:,2],
                 color='r', alpha=0.2)
/Users/adam/repos/aplpy/aplpy/labels.py:432: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  if self.coord == x or self.axis.apl_tick_positions_world[ipos] > 0:
INFO:astropy:Auto-setting vmin to  5.516e+02
INFO:astropy:Auto-setting vmax to  5.790e+02
INFO: Auto-setting vmin to  5.516e+02 [aplpy.core]
INFO: Auto-setting vmax to  5.790e+02 [aplpy.core]

In principle, all of the pointings shown below should be downloadable from the archive:

In [11]:
fig = aplpy.FITSFigure(m83_images[0])
fig.show_grayscale(stretch='arcsinh')
fig.show_circles(unique_public_circle_parameters[:,0],
                 unique_public_circle_parameters[:,1],
                 unique_public_circle_parameters[:,2],
                 color='b', alpha=0.2)
INFO:astropy:Auto-setting vmin to  5.516e+02
INFO:astropy:Auto-setting vmax to  5.790e+02
INFO: Auto-setting vmin to  5.516e+02 [aplpy.core]
INFO: Auto-setting vmax to  5.790e+02 [aplpy.core]