Skip to content

Commit

Permalink
Gaia VRI and gri transformations tested
Browse files Browse the repository at this point in the history
  • Loading branch information
mommermi committed Oct 5, 2018
1 parent e6ae31c commit 951cfbf
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
version 0.9, 2016-01-27, michael.mommert@nau.edu
"""
from __future__ import print_function, division

# Photometry Pipeline
# Copyright (C) 2016 Michael Mommert, michael.mommert@nau.edu
Expand Down Expand Up @@ -260,7 +259,7 @@ def download_catalog(self, ra_deg, dec_deg, rad_deg,

# --------------------------------------------------------------------
# use astroquery TAP query for SkyMapper; this is experimental!
if self.catalogname == 'SkyMapper':
elif self.catalogname == 'SkyMapper':
from astroquery.utils.tap.core import TapPlus

skymap = TapPlus(url=("http://skymappertap.asvo.nci.org.au/"
Expand Down Expand Up @@ -643,6 +642,14 @@ def download_catalog(self, ra_deg, dec_deg, rad_deg,
self.data['e_ra.deg'] = self.data['e_ra.deg'] * u.arcsec
self.data['e_dec.deg'] = self.data['e_dec.deg'] * u.arcsec

else:
if self.display:
print('catalog {:s} not available.'.format(
self.catalogname))
logging.error('catalog {:s} not available.'.format(
self.catalogname))
return 0

if self.display:
print('{:d} sources retrieved.'.format(len(self.data)))
logging.info('{:d} sources retrieved'.format(len(self.data)))
Expand Down Expand Up @@ -1285,6 +1292,8 @@ def transform_filters(self, targetfilter):
e_r = self.data['e_rp1mag'].data
i = self.data['ip1mag'].data
e_i = self.data['e_ip1mag'].data
z = self.data['zp1mag'].data
e_z = self.data['e_zp1mag'].data

g_sdss = (g + 0.013 + 0.145*(g-r) + 0.019*(g-r)**2)
gerr_sdss = np.sqrt(e_g**2 + 0.008**2)
Expand Down Expand Up @@ -1381,11 +1390,11 @@ def transform_filters(self, targetfilter):
bp = self.data['BPmag'].data
rp = self.data['RPmag'].data

V = g - 0.0176 - 0.00686*(bp-rp) - 0.1732*(bp-rp)**2
V = g - (-0.0176 - 0.00686*(bp-rp) - 0.1732*(bp-rp)**2)
e_V = np.sqrt(e_g**2 + 0.045858**2)
R = g - 0.003226 + 0.3833*(bp-rp) - 0.1345*(bp-rp)**2
R = g - (-0.003226 + 0.3833*(bp-rp) - 0.1345*(bp-rp)**2)
e_R = np.sqrt(e_g**2 + 0.04840**2)
I = g - 0.02085 + 0.7419*(bp-rp) - 0.09531*(bp-rp)**2
I = g - (0.02085 + 0.7419*(bp-rp) - 0.09531*(bp-rp)**2)
e_I = np.sqrt(e_g**2 + 0.04956**2)

self.data.add_column(Column(data=V, name='_Vmag',
Expand Down Expand Up @@ -1425,7 +1434,7 @@ def transform_filters(self, targetfilter):

if targetfilter == 'g':
colormask = ((self.data['BPmag']-self.data['RPmag'] > -0.5) &
(self.data['BPmag']-self.data['RPmag'] < 2.75))
(self.data['BPmag']-self.data['RPmag'] < 2.0))
elif targetfilter == 'r':
colormask = ((self.data['BPmag']-self.data['RPmag'] > 0.2) &
(self.data['BPmag']-self.data['RPmag'] < 2.7))
Expand All @@ -1440,13 +1449,13 @@ def transform_filters(self, targetfilter):
bp = self.data['BPmag'].data
rp = self.data['RPmag'].data

g_sdss = (g + 0.13518 - 0.46245*(bp-rp) -
0.25171*(bp-rp)**2 + 0.021349*(bp-rp)**3)
g_sdss = g - (0.13518 - 0.46245*(bp-rp) -
0.25171*(bp-rp)**2 + 0.021349*(bp-rp)**3)
e_g_sdss = np.sqrt(e_g**2 + 0.16497**2)
r_sdss = (g - 0.12879 + 0.24662*(bp-rp) -
0.027464*(bp-rp)**2 - 0.049465*(bp-rp)**3)
r_sdss = g - (-0.12879 + 0.24662*(bp-rp) -
0.027464*(bp-rp)**2 - 0.049465*(bp-rp)**3)
e_r_sdss = np.sqrt(e_g**2 + 0.066739**2)
i_sdss = g - 0.29676 + 0.64728*(bp-rp) - 0.10141*(bp-rp)**2
i_sdss = g - (-0.29676 + 0.64728*(bp-rp) - 0.10141*(bp-rp)**2)
e_i_sdss = np.sqrt(e_g**2 + 0.098957**2)

self.data.add_column(Column(data=g_sdss, name='_gmag',
Expand Down Expand Up @@ -1552,11 +1561,3 @@ def check_not_nan(x): return not np.isnan(x) if \
for key in extract_other_catalog]

return [output_this_catalog, output_other_catalog]


# test Gaia
cat = catalog('GAIA')
print(cat.download_catalog(294.99525, 0.065194, 0.5, 10000),
'sources grabbed from', cat.catalogname)

print(cat.transform_filters('g'), 'sources transformed to g')

0 comments on commit 951cfbf

Please sign in to comment.