Skip to content

Catalogue Crossmatch

Matching catalogues to the VAST Pilot Survey

This notebook gives an example of how to use vast-tools in a notebook environment to perform a crossmatch between a catalogue and the VAST Pilot Survey.

Note The settings and filters applied in this notebook, while sensible, are somewhat generic - always consider your science goals on what filters you want to make!

It is highly recommended that results from the VAST Pipeline are used and this is what will be primarily covered in this example. It is possible to run a search just using vast-tools but the results are nowhere near as rich as the pipeline - this is covered at the of this document.

The VAST Pipeline

The pipeline hosted on the Nimbus server will contain the pipeline run for the full pilot survey. For a complete demo of what can be done with the vast-tools Pipeline class see the vast-pipeline-example.ipynb example notebook.

The Imports

Below are the imports required for this example. The main imports required from vast-tools are the Pipeline and VASTMOCS objects. The Query object is for the vast-tools query option that is shown at the end of this notebook. Astropy objects are also imported as they are critical to perfoming the crossmatch.

from vasttools.moc import VASTMOCS
from vasttools.pipeline import Pipeline
from vasttools.query import Query
from mocpy import World2ScreenMPL
import matplotlib.pyplot as plt
from astropy import units as u
from astropy.coordinates import Angle, SkyCoord

%matplotlib inline

Catalogue selection

For this example we will be using the ATNF Pulsar Catalogue (Manchester+, 2005) catalogue, which has the Vizier ID of B/psr.

Note: Of course your catalogue doesn't have to come from Vizier. If you have a csv or FITS file then simply load this data into a DataFrame, create a SkyCoord object and you'll be good to go.

To start our search, the first question we want to answer is:

What sources from the catalogue are in the VAST Pilot Survey footprint?

This can be efficiently answered by using the query_vizier_vast_pilot() method in VASTMOCS.

First we initialise the VASTMOCS object:

mocs = VASTMOCS()

We then use the query vizier method to obtain all the sources from the PSRCAT catalogue which are contained within the footprint. It will likely take a bit of time to complete.

psrcat_vast_sources = mocs.query_vizier_vast_pilot('B/psr', max_rows=200000)
psrcat_vast_sources
Table length=347
_RAJ2000_DEJ2000PSRJr_PSRJRAJ2000DEJ2000Plxe_Plxr_PlxP0e_P0r_P0DMe_DMr_DMS400e_S400r_S400DistDistDMr_DistDMAgeEdot
degdegmasmassspc.cm**-3pc.cm**-3mJymJykpckpcyr1e-07W
float64float64objectstr7str11str11float32float32str7float64float32str7float64float32str7float32float64str6float32float32str4float64float64
8.5909506-5.5768389J0034-0534bhl+9400 34 21.83-05 34 36.6----0.001877181884582e-16aaa+10b13.7651704e-05aaa+10b17.005.0000tbms980.980.98tc935990000000.03e+34
8.5369597-7.3648358J0034-0721lvw69a00 34 08.87-07 21 53.40.9300.080cbv+090.942950994559802e-12hlk+0410.9220000.006srb+1552.0012.0000lylg951.030.63tc9336600000.02e+31
11.3570417-70.7019722J0045-7042mfl+0600 45 25.69-70 42 07.1----0.632335800020006e-11mfl+0670.0000003.0mfl+06----59.702.43tc934020000.04e+32
11.3965000-73.3175000J0045-7319mmh+9100 45 35.16-73 19 03.0----0.926275904970003e-11kbm+96105.4000000.7kjb+941.00--mmh+9159.702.55tc933290000.02e+32
14.4333333-72.0219444J0057-7201ckm+0100 57 44.00-72 01 19.0----0.738062442600002e-10ckm+0127.0000005.0ckm+01----2.492.49tc93117000000.01e+31
15.1792917-72.1926667J0100-7211lfmp0201 00 43.03-72 11 33.6----8.020392000000009e-06mgr+05--------59.70--6760.01e+33
17.8698750-71.5296667J0111-7131mfl+0601 11 28.77-71 31 46.8----0.688541511640005e-11mfl+0676.0000003.0mfl+06----59.702.46tc931540000.09e+32
18.2962083-72.3422778J0113-7220ckm+0101 13 11.09-72 20 32.2----0.325883016130001e-11ckm+01125.4900000.03ckm+01----59.702.51tc931060000.06e+33
22.8687917-73.1692611J0131-7310mfl+0601 31 28.51-73 10 09.3----0.348124045581007e-12mfl+06205.2000000.7mfl+06----59.702.55tc933130000.02e+33
.....................................................................
326.4602561-7.8384656J2145-0750bhl+9421 45 50.46-07 50 18.51.8400.170rhc+150.016052423918094e-16rhc+158.997610--rhc+15100.0030.0000tbms980.530.50tc938540000000.03e+32
328.7558333-56.6991667J2155-5641mlt+7821 55 01.40-56 41 57.0----1.373654387000002e-09nmc8114.0000009.0nmc812.10--tml930.860.86tc935150000.06e+31
335.5248714-1.6210344J2222-0137blr+1322 22 05.97-01 37 15.73.7420.016dbl+130.032817859053073e-15kbd+143.2842000.0006kbd+14----0.270.17tc938870000000.07e+31
339.2160458-55.4635647J2236-5527bbb+1322 36 51.85-55 27 48.8----0.006907549392923e-15bbb+1320.0000000.5bbb+13----2.032.03tc9311400000000.01e+33
340.4250772-52.6100628J2241-5236kjr+1122 41 42.02-52 36 36.2----0.002186699771551e-15kjr+1111.4108503e-05kjr+11----0.680.68tc935220000000.02e+34
342.1121000-1.0300278J2248-0101mld+9622 48 26.90-01 01 48.1----0.477233119123003e-12hlk+0429.0500000.03hlk+0411.00--mld+962.282.28tc9311500000.02e+32
344.2349583-10.4095472J2256-1024hrm+1122 56 56.39-10 24 34.4----0.00229000000000--hrm+1113.800000--hrm+117.00--hrm+110.910.91tc93----
351.3137500-5.5108333J2325-0530kkl+1523 25 15.30-05 30 39.0----0.868735115025008e-12kkl+1514.9660000.007kkl+15----1.071.07tc9313400000.06e+31
354.9114167-5.5514778J2339-0533rbs+1423 39 38.74-05 33 05.3----0.002884226741552e-16pc15--------1.10--3240000000.02e+34
356.7102250-6.1665278J2346-0609mld+9623 46 50.45-06 09 59.5----1.181463382967005e-12hlk+0422.5040000.02hlk+0411.00--mld+961.961.96tc9313700000.03e+31

We see that 347 sources are within the VAST Pilot Survey footprint.

Tip: The table returned above is an astropy.table. This can be converted to pandas by using psrcat_vast_sources = psrcat_vast_sources.to_pandas().

These can be plotted along with the VAST Pilot Survey footprint using the MOC. See the vast-mocs-example notebook for more on using MOCS and the Wordl2ScreenMPL method.

from astropy.visualization.wcsaxes.frame import EllipticalFrame

fig = plt.figure(figsize=(16,8))

# Load the Epoch 1 MOC file to use
epoch1_moc = mocs.load_pilot_epoch_moc('1')

# 
with World2ScreenMPL(
    fig,
    fov=320 * u.deg,
    center=SkyCoord(0, 0, unit='deg', frame='icrs'),
    coordsys="icrs",
    rotation=Angle(0, u.degree),
) as wcs:
    ax = fig.add_subplot(111, projection=wcs, frame_class=EllipticalFrame)
    ax.set_title("PSRCAT Catalogue Sources in the VAST Pilot Survey")
    ax.grid(color="black", linestyle="dotted")
    epoch1_moc.fill(ax=ax, wcs=wcs, alpha=0.5, fill=True, linewidth=0, color="#00bb00")
    epoch1_moc.border(ax=ax, wcs=wcs, alpha=0.5, color="black")
    ax.scatter(
        psrcat_vast_sources['_RAJ2000'], 
        psrcat_vast_sources['_DEJ2000'], 
        transform=ax.get_transform('world'),
        zorder=10,
        s=3
    )
No description has been provided for this image

Loading the VAST Pipeline Data

Now the results of the VAST Pipeline need to be loaded. This example will not give full details of the Pipeline class, but please refer to the vast-pipeline-example.ipynb example notebook for a full example and description.

We'll be using the full VAST Pilot Survey pipeline containing epochs 0–13 (a test version called tiles_corrected).

# below I suppress DeprecationWarnings due to ipykernel bug and an astropy warning due to FITS header warnings.
import warnings
from astropy.utils.exceptions import AstropyWarning
warnings.simplefilter('ignore', category=AstropyWarning)
warnings.filterwarnings("ignore", category=DeprecationWarning)
# define pipeline object
pipe = Pipeline()
# load the run
pipe_run = pipe.load_run('tiles_corrected')
/home/ddobie/vast-tools/vasttools/pipeline.py:2701: UserWarning: Measurements have been loaded with vaex.
  warnings.warn("Measurements have been loaded with vaex.")
/home/ddobie/user-conda-envs/vast-tools-dev/lib/python3.9/asyncio/base_events.py:686: ResourceWarning: unclosed event loop <_UnixSelectorEventLoop running=False closed=False debug=False>
  _warn(f"unclosed event loop {self!r}", ResourceWarning, source=self)

We now have access to the unique sources found by the pipeline:

pipe_run.sources.head()
wavg_ra wavg_dec avg_compactness min_snr max_snr wavg_uncertainty_ew wavg_uncertainty_ns avg_flux_int avg_flux_peak max_flux_peak ... n_neighbour_dist vs_abs_significant_max_peak m_abs_significant_max_peak vs_abs_significant_max_int m_abs_significant_max_int n_measurements n_selavy n_forced n_siblings n_relations
id
3154268 256.680374 -31.633248 1.283746 7.023084 9.908238 0.000131 0.000131 10.155522 8.054022 9.744 ... 0.004406 0.0 0.0 0.0 0.0 8 7 1 1 0
3154269 256.768092 -32.291573 1.323703 7.360183 12.238208 0.000131 0.000131 13.821750 10.513000 16.082 ... 0.018514 0.0 0.0 0.0 0.0 8 8 0 0 0
3154270 256.877497 -32.994510 1.652192 4.206989 5.507463 0.000111 0.000111 2.737171 2.125296 4.428 ... 0.000899 0.0 0.0 0.0 0.0 8 2 6 1 1
3154271 256.994382 -34.269667 1.078640 5.091991 5.091991 0.000104 0.000104 2.715779 2.669529 4.705 ... 0.031288 0.0 0.0 0.0 0.0 8 1 7 0 0
3154272 257.064242 -30.605582 1.265750 13.853442 34.843492 0.000104 0.000104 24.911125 19.716750 21.150 ... 0.005057 0.0 0.0 0.0 0.0 8 8 0 1 0

5 rows × 31 columns

Performing the Crossmatch

The crossmatch can be performed using the astropy match_to_catalog_sky function. The first step is to create the sky coord objects for each catalogue. First the PSRCAT catalog which was already obtained above:

# Unfortunately we cannot use guess_from_table for the Vizier results, so we construct manually
psrcat_skycoord = SkyCoord(psrcat_vast_sources['_RAJ2000'], psrcat_vast_sources['_DEJ2000'], unit=(u.deg, u.deg))
psrcat_names = psrcat_vast_sources['PSRJ'].tolist()

and then by default the pipeline run object has the default sources saved as a sky coord object as pipe_run.sources_skycoord:

pipe_run.sources_skycoord
<SkyCoord (ICRS): (ra, dec) in deg
    [(256.68037425, -31.63324799), (256.76809184, -32.29157276),
     (256.87749704, -32.99451047), ..., ( 25.085549  , -70.881779  ),
     ( 23.102247  , -71.605088  ), ( 27.338584  , -72.877979  )]>

Now the crossmatching can be performed. See https://docs.astropy.org/en/stable/coordinates/matchsep.html#astropy-coordinates-matching for details on the astropy functions and outputs.

idx, d2d, d3d = psrcat_skycoord.match_to_catalog_sky(pipe_run.sources_skycoord)
radius_limit = 15 * u.arcsec
(d2d &lt;= radius_limit).sum()
155

From above we can see that 155 PSRCAT objects have a match to the pipeline sources. If you wish you could merge the results together:

# Convert PSRCAT to pandas first
psrcat_vast_sources_pd = psrcat_vast_sources.to_pandas()
# Create a d2d mask
d2d_mask = d2d &lt;= radius_limit
# Select the crossmatches less than 15 arcsec
psrcat_crossmatch_result_15asec = psrcat_vast_sources_pd.loc[d2d_mask].copy()
# Append the id and distance of the VAST crossmatch to the PSRCAT sources
psrcat_crossmatch_result_15asec['vast_xmatch_id'] = pipe_run.sources.iloc[idx[d2d_mask]].index.values
psrcat_crossmatch_result_15asec['vast_xmatch_d2d_asec'] = d2d[d2d_mask].arcsec
# Join the result
psrcat_crossmatch_result_15asec = psrcat_crossmatch_result_15asec.merge(pipe_run.sources, how='left', left_on='vast_xmatch_id', right_index=True, suffixes=("_psrcat", "_vast"))
psrcat_crossmatch_result_15asec
_RAJ2000 _DEJ2000 PSRJ r_PSRJ RAJ2000 DEJ2000 Plx e_Plx r_Plx P0 ... n_neighbour_dist vs_abs_significant_max_peak m_abs_significant_max_peak vs_abs_significant_max_int m_abs_significant_max_int n_measurements n_selavy n_forced n_siblings n_relations
0 8.590951 -5.576839 J0034-0534 bhl+94 00 34 21.83 -05 34 36.6 NaN NaN 0.001877 ... 0.080955 0.000000 0.000000 0.000000 0.000000 8 1 7 0 0
1 8.536960 -7.364836 J0034-0721 lvw69a 00 34 08.87 -07 21 53.4 0.930 0.080 cbv+09 0.942951 ... 0.021437 5.805117 3.025243 6.048914 2.953605 9 8 1 0 0
7 18.296208 -72.342278 J0113-7220 ckm+01 01 13 11.09 -72 20 32.2 NaN NaN 0.325883 ... 0.079727 0.000000 0.000000 0.000000 0.000000 8 1 7 0 0
9 23.385250 -69.958244 J0133-6957 lml+98 01 33 32.46 -69 57 29.7 NaN NaN 0.463474 ... 0.017206 4.959570 2.487757 0.000000 0.000000 8 2 6 0 0
10 27.844587 -6.584111 J0151-0635 mlt+78 01 51 22.70 -06 35 02.8 NaN NaN 1.464665 ... 0.032805 39.548210 1.449293 23.080835 1.428997 9 9 0 0 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
339 335.524871 -1.621034 J2222-0137 blr+13 22 22 05.97 -01 37 15.7 3.742 0.016 dbl+13 0.032818 ... 0.079420 25.475731 1.977018 16.969950 1.975633 10 7 3 0 0
340 339.216046 -55.463565 J2236-5527 bbb+13 22 36 51.85 -55 27 48.8 NaN NaN 0.006908 ... 0.039932 8.804036 2.150520 5.441326 2.204556 8 2 6 0 0
341 340.425077 -52.610063 J2241-5236 kjr+11 22 41 42.02 -52 36 36.2 NaN NaN 0.002187 ... 0.000413 26.074964 1.706249 19.425390 1.726953 8 5 3 0 1
342 342.112100 -1.030028 J2248-0101 mld+96 22 48 26.90 -01 01 48.1 NaN NaN 0.477233 ... 0.047085 0.000000 0.000000 0.000000 0.000000 10 6 4 0 0
346 356.710225 -6.166528 J2346-0609 mld+96 23 46 50.45 -06 09 59.5 NaN NaN 1.181463 ... 0.030995 18.036826 1.386727 8.133751 1.162942 10 10 0 0 0

155 rows × 56 columns

With the crossmatches in hand you can now start to do any kind of analysis you wish to perform. For example we can perform a quick check to see if the pipeline has picked out any of these sources as having significant two-epoch variability:

psrcat_crossmatch_result_15asec[psrcat_crossmatch_result_15asec['m_abs_significant_max_peak'] &gt; 0.00]
_RAJ2000 _DEJ2000 PSRJ r_PSRJ RAJ2000 DEJ2000 Plx e_Plx r_Plx P0 ... n_neighbour_dist vs_abs_significant_max_peak m_abs_significant_max_peak vs_abs_significant_max_int m_abs_significant_max_int n_measurements n_selavy n_forced n_siblings n_relations
1 8.536960 -7.364836 J0034-0721 lvw69a 00 34 08.87 -07 21 53.4 0.930 0.080 cbv+09 0.942951 ... 0.021437 5.805117 3.025243 6.048914 2.953605 9 8 1 0 0
9 23.385250 -69.958244 J0133-6957 lml+98 01 33 32.46 -69 57 29.7 NaN NaN 0.463474 ... 0.017206 4.959570 2.487757 0.000000 0.000000 8 2 6 0 0
10 27.844587 -6.584111 J0151-0635 mlt+78 01 51 22.70 -06 35 02.8 NaN NaN 1.464665 ... 0.032805 39.548210 1.449293 23.080835 1.428997 9 9 0 0 0
11 43.984254 -53.072600 J0255-5304 lvw69b 02 55 56.22 -53 04 21.4 NaN NaN 0.447708 ... 0.061489 92.358038 1.877875 57.120201 1.815636 8 8 0 0 0
12 64.517500 -41.903000 J0418-4154 bcm+15 04 18 04.20 -41 54 10.8 NaN NaN 0.757119 ... 0.022815 4.944623 2.644577 4.750799 2.420084 10 5 5 0 0
14 69.316234 -47.252531 J0437-4715 jlh+93 04 37 15.90 -47 15 09.1 6.370 0.090 rhc+15 0.005757 ... 0.010246 459.760960 1.551950 268.189986 1.535510 14 14 0 0 0
17 73.948125 -69.859528 J0455-6951 mmh+91 04 55 47.55 -69 51 34.3 NaN NaN 0.320423 ... 0.025054 4.505564 4.957074 0.000000 0.000000 8 2 6 0 0
24 77.985417 -65.143472 J0511-6508 mfl+06 05 11 56.50 -65 08 36.5 NaN NaN 0.322062 ... 0.010071 5.456853 2.300719 0.000000 0.000000 12 1 11 0 0
30 81.503750 -66.076750 J0525-6607 mgi+79 05 26 00.90 -66 04 36.3 NaN NaN 8.047000 ... 0.000483 15.360738 6.497738 15.360738 6.497738 12 6 6 6 3
31 82.462167 -66.877278 J0529-6652 mhah83 05 29 50.92 -66 52 38.2 NaN NaN 0.975725 ... 0.007933 5.478094 1.384967 5.478094 1.384967 8 1 7 0 0
39 85.046675 -69.331714 J0540-6919 shh84 05 40 11.20 -69 19 54.2 NaN NaN 0.050499 ... 0.000202 306.361443 4.282022 189.523336 10.201650 8 7 1 7 2
44 90.193750 -57.948333 J0600-5756 mlt+78 06 00 46.50 -57 56 54.0 NaN NaN 2.261365 ... 0.012853 4.665924 12.948068 4.665924 12.948068 11 1 10 0 0
47 156.161161 -7.322047 J1024-0719 bjb+97 10 24 38.68 -07 19 19.4 0.500 0.300 rhc+15 0.005162 ... 0.000081 9.455741 231.281450 7.334509 39.923624 12 9 3 1 1
61 260.142154 -29.554500 J1720-2933 dls72 17 20 34.12 -29 33 16.2 NaN NaN 0.620448 ... 0.098047 9.949226 0.767920 6.414743 0.763346 8 8 0 0 0
63 260.512313 -32.129250 J1722-3207 dls72 17 22 02.95 -32 07 45.3 NaN NaN 0.477158 ... 0.006137 5.056400 0.216495 5.786829 0.294642 8 8 0 1 0
64 260.846607 -28.632547 J1723-2837 fsk+04 17 23 23.19 -28 37 57.2 NaN NaN 0.001856 ... 0.033884 7.153730 4.219884 4.890065 4.518603 10 1 9 0 0
71 261.879125 -27.650139 J1727-2739 hfs+04 17 27 30.99 -27 39 00.5 NaN NaN 1.293100 ... 0.003720 4.755661 0.903148 0.000000 0.000000 10 7 3 1 1
75 262.590276 -23.075331 J1730-2304 lnl+95 17 30 21.67 -23 04 31.2 1.500 0.300 rhc+15 0.008123 ... 0.006951 27.816377 0.899722 16.000686 0.890588 8 8 0 1 0
85 263.360125 -22.476944 J1733-2228 dls73 17 33 26.43 -22 28 37.0 NaN NaN 0.871683 ... 0.046341 34.757021 0.957204 18.265635 0.904423 8 8 0 0 0
111 264.851267 -31.520917 J1739-3131 cl86 17 39 24.30 -31 31 15.3 NaN NaN 0.529441 ... 0.000475 4.708996 0.341578 4.859213 0.650619 9 4 5 0 1
117 265.278625 -20.323333 J1741-2019 ebvb01 17 41 06.87 -20 19 24.0 NaN NaN 3.904506 ... 0.068183 7.690824 0.980997 5.049187 0.987144 9 9 0 0 0
125 265.902854 -31.839361 J1743-3150 jlm+92 17 43 36.68 -31 50 21.7 NaN NaN 2.414576 ... 0.060486 4.455535 0.394657 0.000000 0.000000 9 8 1 0 0
130 266.023675 -31.501111 J1744-3130 mhl+02 17 44 05.68 -31 30 04.0 NaN NaN 1.066061 ... 0.022567 4.493521 2.754936 0.000000 0.000000 7 1 6 0 0
135 266.484604 -30.673194 J1745-3040 kac+73 17 45 56.31 -30 40 23.5 NaN NaN 0.367429 ... 0.006712 27.994264 0.525955 18.031535 0.581324 7 7 0 1 0
143 266.845000 -28.154167 J1747-2809 crgl09 17 47 22.80 -28 09 15.0 NaN NaN 0.052153 ... 0.005247 12.769129 1.228181 14.634913 1.844325 10 4 6 4 4
144 266.816175 -29.966944 J1747-2958 cmgl02 17 47 15.88 -29 58 01.0 NaN NaN 0.098814 ... 0.003486 90.355303 1.028914 110.233555 1.733855 7 3 4 2 0
152 267.009396 -24.776917 J1748-2446A lmd+90 17 48 02.25 -24 46 36.9 NaN NaN 0.011563 ... 0.008658 20.127595 1.960417 15.166862 1.965977 8 2 6 0 0
202 268.244540 -28.110361 J1752-2806 tv68 17 52 58.69 -28 06 37.3 NaN NaN 0.562558 ... 0.005869 112.585249 0.815895 68.487201 0.825646 10 10 0 4 0
204 268.396546 -19.249444 J1753-1914 lfl+06 17 53 35.17 -19 14 58.0 NaN NaN 0.062955 ... 0.004599 6.780742 0.844056 0.000000 0.000000 9 9 0 2 2
218 268.924500 -27.429167 J1755-2725 mhl+02 17 55 41.88 -27 25 45.0 NaN NaN 0.261955 ... 0.063875 4.515877 5.314773 4.452447 4.616464 10 7 3 0 0
227 269.372234 -24.368722 J1757-2421 kom74 17 57 29.34 -24 22 07.4 NaN NaN 0.234101 ... 0.000027 4.918588 0.383124 0.000000 0.000000 10 10 0 1 1
241 269.850000 -24.033333 J1759-24 ncb+15 17 59 24.00 -24 02 00.0 NaN NaN 1.457739 ... 0.007064 4.703387 2.019895 4.703387 2.019895 9 2 7 2 0
252 270.250067 -24.857639 J1801-2451 mdt85 18 01 00.02 -24 51 27.5 NaN NaN 0.124924 ... 0.005920 6.392525 0.770605 0.000000 0.000000 9 5 4 5 0
253 270.445146 -29.344056 J1801-2920 jlm+92 18 01 46.83 -29 20 38.6 NaN NaN 1.081908 ... 0.072913 4.356985 0.390115 0.000000 0.000000 7 7 0 0 0
263 270.964211 -21.618709 J1803-2137 cl86 18 03 51.41 -21 37 07.4 NaN NaN 0.133667 ... 0.000138 5.018418 0.389613 5.437931 0.713022 9 9 0 0 1
265 270.882050 -27.201667 J1803-2712 jlm+92 18 03 31.69 -27 12 06.0 NaN NaN 0.334415 ... 0.000329 6.659983 0.904122 5.592387 1.014530 9 6 3 1 2
271 271.088047 -27.292000 J1804-2717 llb+96 18 04 21.13 -27 17 31.2 NaN NaN 0.009343 ... 0.026593 4.431900 9.141833 4.377761 9.068466 9 8 1 0 0
293 272.462862 -19.731092 J1809-1943 ims+04 18 09 51.09 -19 43 51.9 NaN NaN 5.540354 ... 0.000028 10.707772 31.097310 6.695243 10.872046 9 8 1 1 1
307 274.147508 -26.831389 J1816-2650 lvw69a 18 16 35.40 -26 49 53.0 NaN NaN 0.592885 ... 0.099965 6.489064 0.507230 8.023686 1.044030 9 9 0 0 0
327 301.432250 -0.339417 J2005-0020 mld+96 20 05 43.74 -00 20 21.9 NaN NaN 2.279661 ... 0.087325 9.967506 1.425750 7.509335 1.490407 10 6 4 0 0
328 301.568196 -8.117194 J2006-0807 mlt+78 20 06 16.37 -08 07 01.9 NaN NaN 0.580871 ... 0.049130 21.059837 0.717188 12.550027 0.723820 11 11 0 0 0
330 308.379625 0.706111 J2033+0042 bb10 20 33 31.11 +00 42 22.0 NaN NaN 5.013398 ... 0.024504 9.375689 1.285790 4.551096 1.294827 11 10 1 0 0
331 311.500654 -4.357222 J2046-0421 mlt+78 20 46 00.16 -04 21 26.0 NaN NaN 1.546938 ... 0.007206 5.865061 0.646703 4.801842 0.652493 10 10 0 1 0
332 312.781311 -8.460499 J2051-0827 sbl+96 20 51 07.51 -08 27 37.8 NaN NaN 0.004509 ... 0.059644 9.290051 1.608255 6.256718 1.603359 10 8 2 0 0
334 322.344862 -57.353948 J2129-5721 llb+96 21 29 22.77 -57 21 14.2 NaN NaN 0.003726 ... 0.012257 24.650627 1.549664 12.868040 1.461259 7 7 0 0 0
337 326.460256 -7.838466 J2145-0750 bhl+94 21 45 50.46 -07 50 18.5 1.840 0.170 rhc+15 0.016052 ... 0.029843 64.265409 1.592969 36.709866 1.577444 10 10 0 0 0
338 328.755833 -56.699167 J2155-5641 mlt+78 21 55 01.40 -56 41 57.0 NaN NaN 1.373654 ... 0.015180 11.460850 2.218627 7.549638 2.218899 8 1 7 0 0
339 335.524871 -1.621034 J2222-0137 blr+13 22 22 05.97 -01 37 15.7 3.742 0.016 dbl+13 0.032818 ... 0.079420 25.475731 1.977018 16.969950 1.975633 10 7 3 0 0
340 339.216046 -55.463565 J2236-5527 bbb+13 22 36 51.85 -55 27 48.8 NaN NaN 0.006908 ... 0.039932 8.804036 2.150520 5.441326 2.204556 8 2 6 0 0
341 340.425077 -52.610063 J2241-5236 kjr+11 22 41 42.02 -52 36 36.2 NaN NaN 0.002187 ... 0.000413 26.074964 1.706249 19.425390 1.726953 8 5 3 0 1
346 356.710225 -6.166528 J2346-0609 mld+96 23 46 50.45 -06 09 59.5 NaN NaN 1.181463 ... 0.030995 18.036826 1.386727 8.133751 1.162942 10 10 0 0 0

51 rows × 56 columns

And remember you can use the vast-toools source tools to view any source as in the other example notebooks:

# Get the first VAST source above from the table above
first_source_id = psrcat_crossmatch_result_15asec[psrcat_crossmatch_result_15asec['m_abs_significant_max_peak'] &gt; 0.00].iloc[0].vast_xmatch_id
first_source = pipe_run.get_source(first_source_id)
first_source.plot_lightcurve(min_points=1);
No description has been provided for this image
first_source.show_all_png_cutouts(columns=5, figsize=(12,5), size=Angle(2. * u.arcmin));
No description has been provided for this image

Filtering the Pipeline Sources (Optional)

The example above has used all the sources from the pipeline results, but these may need to be filtered further to improve results. For example Below is an example of how to filter the sources.

my_query_string = (
    "n_measurements &gt;= 3 "
    "&amp; n_selavy &gt;= 2 "
    "&amp; n_neighbour_dist &gt; 1./60. "
    "&amp; 0.8 &lt; avg_compactness &lt; 1.4 "
    "&amp; n_relations == 0 "
    "&amp; max_snr &gt; 7.0"
)

pipe_run_filtered_sources = pipe_run.sources.query(my_query_string)
pipe_run_filtered_sources
wavg_ra wavg_dec avg_compactness min_snr max_snr wavg_uncertainty_ew wavg_uncertainty_ns avg_flux_int avg_flux_peak max_flux_peak ... n_neighbour_dist vs_abs_significant_max_peak m_abs_significant_max_peak vs_abs_significant_max_int m_abs_significant_max_int n_measurements n_selavy n_forced n_siblings n_relations
id
3154269 256.768092 -32.291573 1.323703 7.360183 12.238208 0.000131 0.000131 13.821750 10.513000 16.082000 ... 0.018514 0.000000 0.000000 0.000000 0.000000 8 8 0 0 0
3154274 257.123241 -33.290413 1.043619 5.383128 7.515734 0.000131 0.000131 3.478531 3.365781 4.299000 ... 0.033579 0.000000 0.000000 0.000000 0.000000 8 6 2 0 0
3154275 257.150280 -34.244257 1.100210 27.437848 56.402649 0.000100 0.000100 36.091500 33.053375 42.584000 ... 0.055755 14.525015 0.415325 7.691956 0.356892 8 8 0 0 0
3154276 257.208633 -33.706400 1.137502 5.171521 8.311847 0.000130 0.000130 4.048633 3.648008 4.771000 ... 0.068295 0.000000 0.000000 0.000000 0.000000 8 6 2 0 0
3154280 257.385381 -29.637161 1.223584 4.914062 8.870000 0.000136 0.000136 4.392721 3.942971 10.097926 ... 0.090124 0.000000 0.000000 0.000000 0.000000 8 6 2 0 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
4187751 28.447701 -71.461967 1.170482 5.262097 7.271111 0.000120 0.000120 1.285112 1.173112 1.636000 ... 0.038168 0.000000 0.000000 0.000000 0.000000 8 4 4 0 0
4187753 27.868811 -73.366549 0.961813 6.240385 7.564972 0.000106 0.000106 1.126009 1.138259 1.913642 ... 0.075690 0.000000 0.000000 0.000000 0.000000 8 2 6 0 0
4187767 29.119577 -76.484675 1.304243 7.550373 26.512988 0.000108 0.000108 19.405860 15.354985 19.670880 ... 0.039074 0.000000 0.000000 0.000000 0.000000 8 7 1 0 0
4187768 12.644212 -69.259777 1.145142 12.137412 22.289985 0.000116 0.000116 17.166571 15.038286 19.649000 ... 0.053142 5.239442 0.475465 0.000000 0.000000 7 7 0 0 0
4187771 18.395954 -69.143241 1.011926 6.956522 17.792143 0.000111 0.000111 13.555196 13.376696 14.852000 ... 0.123835 0.000000 0.000000 0.000000 0.000000 8 7 1 0 0

160540 rows × 31 columns

You can either: * apply this to the crossmatch results above, or * substitute pipe_run_filtered_sources into the complete crossmatch process above in the place of my_run.sources (you need to create a new SkyCoord object first).

pipe_run_filtered_sources_skycoord = pipe_run.get_sources_skycoord(user_sources=pipe_run_filtered_sources)
pipe_run_filtered_sources_skycoord
<SkyCoord (ICRS): (ra, dec) in deg
    [(256.76809184, -32.29157276), (257.12324084, -33.29041257),
     (257.15028042, -34.2442568 ), ..., ( 29.11957731, -76.48467529),
     ( 12.64421225, -69.25977672), ( 18.39595379, -69.14324061)]>

Finding All Crossmatches Between Sources

The crossmatch above only finds the nearest neighbour to the sources in your catalogue. Astropy also offers the functionality to find all matches between objects within a defined radius. See https://docs.astropy.org/en/stable/coordinates/matchsep.html#searching-around-coordinates for full details. This is done by performing the below, using the 15 arcsec radius:

idx_vast, idx_psrcat, d2d, d3d = psrcat_skycoord.search_around_sky(pipe_run.sources_skycoord, 15 * u.arcsec)

A merged dataframe of this crossmatch can be made like that below. Note there are multiple matches to sources so this will generate duplicate sources within the dataframe.

# Create a subset dataframe of the PSRCAT sources with a match
psrcat_search_around_results_15asec = psrcat_vast_sources_pd.iloc[idx_psrcat].copy()
# Add the VAST d2d and match id columns
psrcat_search_around_results_15asec['vast_xmatch_d2d_asec'] = d2d.arcsec
psrcat_search_around_results_15asec['vast_xmatch_id'] = pipe_run.sources.iloc[idx_vast].index.values
# Perform the merge
psrcat_search_around_results_15asec = psrcat_search_around_results_15asec.merge(pipe_run.sources, how='left', left_on='vast_xmatch_id', right_index=True, suffixes=("_psrcat", "_vast"))
psrcat_search_around_results_15asec
_RAJ2000 _DEJ2000 PSRJ r_PSRJ RAJ2000 DEJ2000 Plx e_Plx r_Plx P0 ... n_neighbour_dist vs_abs_significant_max_peak m_abs_significant_max_peak vs_abs_significant_max_int m_abs_significant_max_int n_measurements n_selavy n_forced n_siblings n_relations
108 264.892825 -29.050972 J1739-2903 cl86 17 39 34.28 -29 03 03.5 NaN NaN 0.322882 ... 0.000238 0.000000 0.000000 0.000000 0.000000 10 8 2 0 2
197 267.685421 -35.052472 J1750-3503 mld+96 17 50 44.50 -35 03 08.9 NaN NaN 0.684014 ... 0.064277 0.000000 0.000000 0.000000 0.000000 7 4 3 0 0
196 267.697158 -31.962250 J1750-3157 jlm+92 17 50 47.32 -31 57 44.1 NaN NaN 0.910363 ... 0.076475 0.000000 0.000000 0.000000 0.000000 7 7 0 0 0
200 267.886354 -33.394333 J1751-3323 kbm+03 17 51 32.73 -33 23 39.6 NaN NaN 0.548227 ... 0.004772 0.000000 0.000000 0.000000 0.000000 7 7 0 1 0
284 271.785396 -27.250833 J1807-2715 mlt+78 18 07 08.49 -27 15 03.0 NaN NaN 0.827776 ... 0.005584 0.000000 0.000000 0.000000 0.000000 9 8 1 1 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
332 312.781311 -8.460499 J2051-0827 sbl+96 20 51 07.51 -08 27 37.8 NaN NaN 0.004509 ... 0.059644 9.290051 1.608255 6.256718 1.603359 10 8 2 0 0
11 43.984254 -53.072600 J0255-5304 lvw69b 02 55 56.22 -53 04 21.4 NaN NaN 0.447708 ... 0.061489 92.358038 1.877875 57.120201 1.815636 8 8 0 0 0
14 69.316234 -47.252531 J0437-4715 jlh+93 04 37 15.90 -47 15 09.1 6.37 0.09 rhc+15 0.005757 ... 0.010246 459.760960 1.551950 268.189986 1.535510 14 14 0 0 0
39 85.046675 -69.331714 J0540-6919 shh84 05 40 11.20 -69 19 54.2 NaN NaN 0.050499 ... 0.000400 202.051391 1.099582 142.782739 1.593554 8 6 2 5 2
12 64.517500 -41.903000 J0418-4154 bcm+15 04 18 04.20 -41 54 10.8 NaN NaN 0.757119 ... 0.022815 4.944623 2.644577 4.750799 2.420084 10 5 5 0 0

283 rows × 56 columns

This is the end of the example of performing a catalogue crossmatch using the VAST Pipeline. The information below this point is about using the vast-tools query method to find sources from the pilot survey if a pipeline run is not available. A pipeline run should be used whenever possible due to the superior quality of data it generates.

Find VAST Matches Using VAST Tools

If a pipeline run isn't available you can use VAST Tools to match to the VAST data instead.

Here the same PSRCAT dataframe that was created in the pipeline section above is used.

The first step is to construct a Query to see how many sources have matches to selavy components in the VAST Pilot Survey. In the Query definition below we use the matches_only argument. This means that only those sources that have an actual match are returned. For simplicity I only search epochs 1 through 4 to ensure that the query can complete in a reasonable time, but it is possible to search the entire survey. Note you must pre-create the output directory for the query if you intend to use it.

psrcat_query = Query(
    coords=psrcat_skycoord,
    source_names=psrcat_names,
    epochs='1,2,3,4',
    max_sep=1.5,
    crossmatch_radius=10.0,
    matches_only=True,
    no_rms=True,
    output_dir='psrcat-vast-crossmatching',
    use_tiles=False,
)
Removing 30 sources outside the requested survey footprint.

Note: we provide the argument use_tiles=False to use the COMBINED dataset, which was the default for the pilot survey. The default for the full survey is to use the post-processed tiles data - your query settings should only differ from the default with good reason!

And run find_sources - again a warning that this will take a little while to process.

psrcat_query.find_sources()
'J0034-0534' has no detections and 'matches only' has been selected. This source will not be in the results.
'J0457-6337' has no detections and 'matches only' has been selected. This source will not be in the results.
'J0514-4407' has no detections and 'matches only' has been selected. This source will not be in the results.
'J0532-6639' has no detections and 'matches only' has been selected. This source will not be in the results.
'J0957-06' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1023+0038' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1038+0032' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1312+0051' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1332-03' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1712-2715' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1723-2852' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1727-29' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1732-3131' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1733-2837' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1733-3030' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1734-2415' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1736-2819' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1736-2843' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1736-3511' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1737-3137' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1737-3320' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1738-3107' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1739-3023' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1739-3049' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1740-3327' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1741-2719' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1741-3016' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1741-34' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1744-1610' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1745-2229' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1745-2900' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1745-2912' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1746-27' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1746-2856' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1747-2958' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1748-2021C' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1750-2444' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1750-2536' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1750-28' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1751-2857' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1754-2422' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1754-30' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1754-3443' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1755-26' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1756-2225' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1756-2251' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1757-15' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1758-1931' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1758-2206' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1758-2540' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1800-2114' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1801-2451' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1801-3210' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1802-1745' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1803-1616' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1803-2149' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1803-3002B' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1803-3002C' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1804-2228' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1804-28' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1805-1504' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1805-2032' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1805-2037' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1805-2447' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1805-2948' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1808-1726' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1809-1850' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1809-1917' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1813-2113' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1824-2233' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1824-2328' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1824-2452A' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1824-2452B' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1824-2452D' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1824-2452E' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1824-2452F' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1824-2452G' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1824-2452H' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1824-2452J' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1824-2452K' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1824-2452L' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1824-2537' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1946-5403' has no detections and 'matches only' has been selected. This source will not be in the results.
'J2013-0649' has no detections and 'matches only' has been selected. This source will not be in the results.
'J2139+00' has no detections and 'matches only' has been selected. This source will not be in the results.
'J2325-0530' has no detections and 'matches only' has been selected. This source will not be in the results.
'J0420-5022' has no detections and 'matches only' has been selected. This source will not be in the results.
'J0502-6617' has no detections and 'matches only' has been selected. This source will not be in the results.
'J0514-4002A' has no detections and 'matches only' has been selected. This source will not be in the results.
'J0600-5756' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1046+0304' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1142+0119' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1327-0755' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1708-3506' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1715-3247' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1724-3149' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1724-3505' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1725-2852' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1726-31' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1727-2946' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1729-2117' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1730-2900' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1730-3353' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1730-34' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1731-3123' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1731-3322' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1732-3426' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1732-35' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1733-2533' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1733-3322' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1734-3058' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1734-3333' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1735-3258' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1736-2457' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1737-3102' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1738-2330' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1738-2647' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1738-2736' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1738-2955' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1740-2540' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1740-3052' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1741-2054' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1741-2945' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1743-2442' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1743-3153' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1744-2335' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1744-3130' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1745-2910' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1746-2849' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1746-2850' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1746-3239' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1747-2802' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1748-2021D' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1748-2446A' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1748-30' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1748-3009' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1749-2347' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1749-2629' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1750-2043' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1750-2438' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1750-3503' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1751-2516' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1752-2410' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1752-2821' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1753-2240' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1754-3510' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1755-1650' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1755-2025' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1755-25' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1755-2521' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1755-25211' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1755-2534' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1755-33' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1756-25' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1756-2619' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1757-2223' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1757-27' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1758-2630' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1758-2846' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1759-1736' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1759-1903' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1759-1956' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1759-2302' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1759-2307' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1759-24' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1759-2549' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1759-2922' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1800-2343' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1801-1855' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1801-2115' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1801-2154' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1801-3458' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1802-2426' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1802-3346' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1803-1857' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1803-1920' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1803-30' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1806-1618' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1806-1920' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1806-2125' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1807-2557' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1808-1517' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1808-2024' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1808-2701' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1809-2004' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1809-2109' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1811-2439' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1812-2102' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1812-2526' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1812-2748' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1813-2242' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1813-2621' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1817-2311' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1824-2452C' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1824-2452I' has no detections and 'matches only' has been selected. This source will not be in the results.
'J1947-4215' has no detections and 'matches only' has been selected. This source will not be in the results.
'J2129-04' has no detections and 'matches only' has been selected. This source will not be in the results.
'J2144-5237' has no detections and 'matches only' has been selected. This source will not be in the results.
'J2155-5641' has no detections and 'matches only' has been selected. This source will not be in the results.
'J2339-0533' has no detections and 'matches only' has been selected. This source will not be in the results.

We can check the results attribute to see how many sources return a match.

len(psrcat_query.results)
110

Using the results

110 sources have returned a match in the the first four epochs of the VAST survey.

We can create new skycoord and name objects ready for a new query:

matches_mask = [i in (psrcat_query.results) for i in psrcat_vast_sources['PSRJ']]
matched_names = psrcat_vast_sources['PSRJ'][matches_mask].tolist()
matched_skycoords = psrcat_skycoord[matches_mask]

Or loop through and save all the measurements for each source.

# for i in psrcat_query.results:
#     i.write_measurements()

While you can explore the sources as normal, for example

my_source = psrcat_query.results['J1755-2725']
lc = my_source.plot_lightcurve();
No description has been provided for this image
cutout = my_source.show_png_cutout(1);
No description has been provided for this image

it's not recommended to produce cut outs for all sources in the notebook as this will start to take a lot of memory and be quite slow. If you'd like to do this then please use the find_sources.py script.

VAST Tools Variability

Unlike the Pipeline, the sources returned using this method do not contain any of the caluclated metrics. However, you can also perform some rudimentary variablility analysis on the results if you wish.

I would recommened using the VAST Pipeline if possible for this kind of analysis as the associations will be much better and the you'll get a lot more information, but nevertheless this is an example of what you can do with the data from vast-tools.

In the code below I create a dataframe from the query results (which is a pandas series) and assign it to variables_df and define a function that returns the eta and V metrics for each source when passed through .apply(). These are then assigned to new eta and v columns in the variables_df dataframe.

import pandas as pd

def get_variable_metrics(row):
    """
    Function to return the eta and v metrics using apply.
    """
    return row['object'].calc_eta_and_v_metrics()

# create the variables_df dataframe, rename the column holding the objects as 'object'
variables_df = pd.DataFrame(psrcat_query.results).rename(columns={'name':'object'})
# obtain the metrics
variables_df[['eta', 'v']] = variables_df.apply(get_variable_metrics, result_type='expand', axis=1)

We can then, for example, plot the log eta distribution, making sure we choose sources that have more than 2 detections.

mask = [i.detections &gt; 2 for i in variables_df['object']]

import numpy as np
np.log10(variables_df.eta[mask]).hist(bins=100)
plt.show()
No description has been provided for this image

You could then do the same for v and start to fit Gaussians to the distributions and select candidates.

Note for large queries it is recommened to use the script version of find_sources.py to get cutouts for all results.


Last update: March 7, 2024
Created: August 5, 2020