Information on Service 'BGDS DR2 time series datalink'

This service produces time series datasets for Bochum Galactic Disk Survey lightcurves.

For a list of all services and tables belonging to this service's resource, see Information on resource 'BGDS DR2 time series'

Service Documentation

The time series from BGDS DR2 by default come as IVOA Spectral Data Model compliant VOTables. If you what plain text instead, add &format=txt to the dlget URIs. The columns you get back then are epoch in MJD, magnitude and magnitude error in mag, and a link to a cutout showing where the measurement came from.

Accessing and Plotting Light Curves From pyVO

Let us briefly illustrate how to access and plot the GDS data with pyVO. First, some basic definitions that we will need in the code below; there is no need to understand this code in detail:

import pyvo as vo
import matplotlib.pyplot as plt
import numpy as np

service = vo.dal.TAPService("http://dc.g-vo.org/tap")

def get_lc(ra, dec, rad, filter):
    """Returns a light curve given by mjds and mags
    around the coordinates ra and dec.
    """
    # Search for the object coordinates in the metadata table:
    id_set = service.search("SELECT obs_id"
            " FROM bgds2.ssa_time_series"
                    f" WHERE DISTANCE({ra}, {dec}, ra, dec)<{rad}/3600."
                    " AND ssa_bandpass like '% " + filter + "%'")
    if len(id_set) >= 1:
      # Use the ID from the first result in the time series metadata table
      # (there is only one result for the examples here, but sources in
      # overlapping observation fields can have up to four light curves
      # per filter) to receive the corresponding light curve from the
      # light curve table:
      lc_set = service.search(
            "SELECT mjds, mags FROM bgds2.lc_allbands"
        "  WHERE obs_id = '" + id_set.getcolumn("obs_id")[0] + "'")
      mjds = lc_set.getcolumn("mjds")
      mags = lc_set.getcolumn("mags")
      return mjds[0], mags[0]

    else:
      print(f"There is no GDS light curve for the filter {filter}"
         f" in a radius of {rad}'' around the coordinates {ra} {dec}.")

def plot_ts(r_mjds, r_mags, i_mjds, i_mags):
    """Plot r' and i' light curves given by r_mjds, i_mjds and r_mags, i_mags.
    """
    plt.plot(r_mjds, r_mags, 'ro', markersize=3.0)
    plt.plot(i_mjds, i_mags, 'ko', markersize=3.0)
    plt.gca().invert_yaxis()
    plt.xlabel('MJD (d)')
    plt.ylabel('Magnitude')
    plt.show()
    return

def fold_lc(mjds, mags, p):
    """Fold a light curve given by mjds and mags with a period p.
    """
    # Fold the dates mjds by the period p:
    mjds_fold = mjds % p / p

    # Sort mjds and mags by the phase:
    idx_fold = np.argsort(mjds_fold)
    mjds_fold = mjds_fold[idx_fold]
    mags_fold = mags[idx_fold]
    return mjds_fold, mags_fold

def find_p(mjds, mags, min_p, max_p, p_step):
    """Find the period p in a given range from min_p to max_p in steps of p_step
    with minimal theta.
    """
    theta_list = []
    p_candidates = np.arange(min_p, max_p, p_step)

    for j in range(len(p_candidates)):
      mjds_fold, mags_fold = fold_lc(mjds, mags, p_candidates[j])
      # Shift the magnitudes of the folded light curve mags_fold by one step to
      # compute differences:
      mags_shift = [mags_fold[1:len(mags_fold)]]
      mags_shift = np.append(mags_shift,mags_fold[0])
      theta = np.sum((mags_fold - mags_shift)**2)
      theta_list.append(theta)

    theta_list = np.asarray(theta_list)
    min_ind = np.argmin(theta_list)
    p = p_candidates[min_ind]
    return p, p_candidates, theta_list

def plot_theta(p_candidates, theta_list):
    """Plot theta (given by a list/array theta_list) in dependence of the period
    given by a an array p_candidates.
    """
    plt.plot(p_candidates, theta_list, 'ko', markersize=2.5)
    plt.xlim([np.min(p_candidates), np.max(p_candidates)])
    plt.xlabel('$P$ (d)')
    plt.ylabel('$\theta$')
    plt.show()
    return

def plot_phase(r_mjds, r_mags, i_mjds, i_mags, p):
    """Fold r' and i' light curves given by r_mjds, i_mjds and r_mags, i_mags
    with a period p and plot two phases.
    """
    r_mjds_fold, r_mags_fold = fold_lc(r_mjds, r_mags, p)
    i_mjds_fold, i_mags_fold = fold_lc(i_mjds, i_mags, p)
    plt.plot([r_mjds_fold, [x+1 for x in r_mjds_fold]],
            [r_mags_fold, r_mags_fold], 'ro', markersize=3.0)
    plt.plot([i_mjds_fold, [x+1 for x in i_mjds_fold]],
            [i_mags_fold, i_mags_fold], 'ko', markersize=3.0)
    plt.axvline(1, color = 'gray', linestyle='-', markersize=0.3)
    plt.xlim([0.,2.])
    plt.gca().invert_yaxis()
    plt.xlabel('Phase')
    plt.ylabel('Magnitude')
    plt.title('$P = %.4f\,\mathrm{d}$' % p)
    plt.show()
    return

def get_multi_wl_set(ra, dec, rad):
    """Returns a data set from the multi-wavelength photometry catalogue
    (matched Gaia DR3 ID gaia_id, arrays for magnitudes multi_wl_mags and
    spectral flux density in mJy multi_wl_fluxes in UBVr'i'z', and an estimated
    spectral type spt from UBV photometry) around the coordinates ra and dec.
    """
    wl_cols = ["u", "b", "v", "r", "i", "z"]
    multi_wl_set = service.search(
            "SELECT gaia_id, u_med_mag, b_med_mag, v_med_mag,"
            " r_med_mag, i_med_mag, z_med_mag, u_flux, b_flux, v_flux,
                    " r_flux, i_flux, z_flux, spt FROM bgds2.multi_wl_phot"
                    f" WHERE DISTANCE({ra}, {dec}, ra, dec)<{rad}/3600.")

    if len(multi_wl_set) >= 1.:
      multi_wl_mags = np.zeros(6)
      multi_wl_fluxes = np.zeros(6)

      for n in range(len(wl_cols)):
          multi_wl_mags[n] = multi_wl_set.getcolumn(wl_cols[n] + "_med_mag")[0]
          multi_wl_fluxes[n] = multi_wl_set.getcolumn(wl_cols[n] + "_flux")[0]

      gaia_id = multi_wl_set.getcolumn("gaia_id")
      spt = multi_wl_set.getcolumn("spt")
      return gaia_id, multi_wl_mags, multi_wl_fluxes, spt

    else:
      print(f"There is no GDS photometry in a radius of {rad}"
                            f" around the coordinates {ra} {dec}.")

def plot_sed(multi_wl_fluxes):
    """Plot the spectral flux density in UBVr'i'z' in dependence of the
    filter wavelength.
    """
    wls = np.array([365, 433, 550, 623, 764, 906])
    filters = ["U", "B", "V", "r'", "i'", "z'"]
    plt.plot(wls, multi_wl_fluxes, 'ko', markersize=5.0)

    for n in range(len(multi_wl_fluxes)):
      plt.text(wls[n]+7, multi_wl_fluxes[n]-8, filters[n])

    plt.xlabel('Wavelength (nm)')
    plt.ylabel('Flux (mJy)')
    plt.show()
    return

def calc_abs_mag(mag, plx):
    """Calculate the absolute magnitude abs_mag from the relative magnitude mag
    and the parallax plx in milli-second of arc.
    """
    # Approximation of the distance dist in parsec:
    dist = 1000./plx

    abs_mag = np.round(mag - 5.*(np.log10(dist) - 1.), 3)
    return abs_mag

Light curves

The GDS contains light curves in up to 10 filters per observation field, among which the r’ and i’ light curves contain the largest numbers of data points. We can take a look at the r’ and i’ light curves of a star, e.g., the highly variable V352 Nor:

r_mjds, r_mags = get_lc(241.71551, -52.07636, 1., "r")
i_mjds, i_mags = get_lc(241.71551, -52.07636, 1., "i")
plot_ts(r_mjds, r_mags, i_mjds, i_mags)

The result is:

A scatterplot of two fairly parallel sets of reddish dots over more than 2000 days, showing steep maxima up to 7 mag, reaching down to 16 mag.  Prominent gaps in the coverage are visible.

Period determination

The periods of many periodic variables in the GDS are still unknown or uncertain. Short periods are not obvious when looking at the (unfolded) light curve, as is the case for the eclipsing binary EH Mon:

r_mjds, r_mags = get_lc(103.03654, -7.06476, 1., "r")
i_mjds, i_mags = get_lc(103.03654, -7.06476, 1., "i")
plot_ts(r_mjds, r_mags, i_mjds, i_mags)
A scatterplot, again in two bands; most dots are about 13, but there are five steep drops down to 15.

Among the numerous options for an automated period classification, here we will use the Lafler-Kinman algorithm.

The light curve is folded by trial periods and the sum of squares θ of the differences between two magnitude measurements of adjacent phase is calculated. Basically, θ measures how smooth a folded light is when folded by a trial period. Usually, θ is minimized when a light curve is folded by a multiple of the correct period, therefore, test values with local minima in θ are the best candidates for the period, in order from low to high.

r_p, r_p_candidates, r_theta_list = find_p(r_mjds, r_mags, 1., 15., 1e-4)
i_p, i_p_candidates, i_theta_list = find_p(i_mjds, i_mags, 1., 15., 1e-4)

# Exemplarily plot theta for the filter i':
plot_theta(i_p_candidates, i_theta_list)
A plot of θ versus the period, ranging from about 2 to about 14 days. there is a broad, dense black field across the plot, with sharp dips at about 3.6 days and its harmonics.
# The final period p is the average between period results from the
# r' and i' light curves:
p = (r_p + i_p) / 2.
plot_phase(r_mjds, r_mags, i_mjds, i_mags, p)
a scatter plot over the phase in two bands, showing fairly parallel primary and secondary dips.

Multi-wavelength catalogue

Median magnitudes and light curves are not only available separately for filters and fields, but there is also a multi-wavelength photometry catalogue that is matched with Gaia DR3 sources. The filter magnitudes can be noticeably effected by reddening; in this case, the roughly estimated spectral types from the GDS UBV photometry might be more useful. For Gaia DR3 3052220093755546112, median magnitudes in UBVr’i’z’ are available:

gaia_id, multi_wl_mags, multi_wl_fluxes, spt = get_multi_wl_set(
    175.11595, -62.02609, 1.)
print("Gaia DR3 ID: " + gaia_id + ", Spectral type from UBV photometry: " + spt)
print(f"U = {multi_wl_mags[0]}, B = {multi_wl_mags[1]},"
    f"V = {multi_wl_mags[2]}, r'; = {multi_wl_mags[3]},"
    f"i'; = {multi_wl_mags[4]}, z' = {multi_wl_mags[5]}")
plot_sed(multi_wl_fluxes)

The result is:

Gaia DR3 ID: 3052220093755546112, Spectral type from UBV photometry: K5
U = 14.15, B = 12.996, V = 11.781, r' = 11.366, i' = 10.853, z' = 10.551
A sparse scatterplot of calibrated flux over wavelength, showing an almost linear growth of dots labelled with the filter designations between 380 and 900 nm.

The match with Gaia DR3 allows to directly get information from the Gaia DR 3 catalogue like the Gaia DR parallaxes to compute absolute magnitudes:

gaia_set = service.search(
    "SELECT parallax FROM gaia.dr3lite WHERE source_id=" + gaia_id)
plx = gaia_set.getcolumn("parallax")[0]
multi_wl_abs_mags = np.zeros(6)

for n in range(len(multi_wl_abs_mags)):
    multi_wl_abs_mags[n] = calc_abs_mag(multi_wl_mags[n], plx)

print(f"M_U = {multi_wl_abs_mags[0]}, M_B = {multi_wl_abs_mags[1]},"
    f"M_V = {multi_wl_abs_mags[2]}, M_r' = {multi_wl_abs_mags[3]},"
    f"M_i' = {multi_wl_abs_mags[4]}, M_z' = {multi_wl_abs_mags[5]}")

This gives:

M_U = 10.193, M_B = 9.039, M_V = 7.824, M_r' = 7.409, M_i' = 6.896, M_z' = 6.594

Overview

You can access this service using:

Coverage

Intervals of messenger energies reflected in this resource: 1.10912 4.1325 eV

Time covered by this resource's data: 2010.69 2019.73

This resource is not (directly) published. This can mean that it was deemed too unimportant, for internal use only, or is just a helper for a published service. Equally likely, however, it is under development, abandoned in development or otherwise unfinished. Exercise some caution.

Other services provided on the underlying data include:

Input Fields

The following fields are available to provide input to the service (with some renderers, some of these fields may be unavailable):

NameTable Head DescriptionUnitUCD
ID Id The publisher DID of the dataset of interest N/A meta.id;meta.main
maxrec Match limit Maximum number of records returned. Pass 0 to retrieve service parameters. N/A N/A
responseformat Output Format File format requested for output. N/A meta.code.mime
verb Verbosity Exhaustiveness of column selection. VERB=1 only returns the most important columns, VERB=2 selects the columns deemed useful to the average user, VERB=3 returns a table with all available columns. N/A N/A

If you use GDS data, please cite 2015AN....336..590H.

Citation Info

VOResource XML (that's something exclusively for VO nerds)