Skip to content

Commit

Permalink
Merge pull request #165 from winter-telescope/sdss
Browse files Browse the repository at this point in the history
Bump to sdss 16
  • Loading branch information
robertdstein authored Oct 26, 2022
2 parents df1abaa + bfacb0f commit 22474b3
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions winterdrp/catalog/sdss.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class SDSS(BaseCatalog):

catalog_vizier_code = "V/147"
catalog_vizier_code = "V/154"
abbreviation = "sdss"

def __init__(
Expand All @@ -20,7 +20,7 @@ def __init__(
min_mag: float,
max_mag: float,
filter_name: str,
snr_threshold : float=3.0
snr_threshold: float = 3.0
):
super().__init__(search_radius_arcmin, min_mag, max_mag, filter_name)
self.snr_threshold = snr_threshold
Expand All @@ -40,19 +40,23 @@ def get_catalog(
column_filters={f"{self.filter_name}mag" : f"< {self.max_mag}",
f"e_{self.filter_name}mag" : "<%.3f" % (1.086 / self.snr_threshold)},
row_limit=-1)
Q = v.query_region(SkyCoord(ra=ra_deg, dec=dec_deg, unit=(u.deg, u.deg)),
radius=str(self.search_radius_arcmin) + 'm',
catalog="V/147", cache=False)

if len(Q) == 0:
query = v.query_region(
SkyCoord(ra=ra_deg, dec=dec_deg, unit=(u.deg, u.deg)),
radius=str(self.search_radius_arcmin) + 'm',
catalog=self.catalog_vizier_code,
cache=False
)

if len(query) == 0:
logger.info('No matches found in the given radius in SDSS')
t = Table()
else:
t = Q[0]
t = query[0]
t['ra'] = t['RA_ICRS']
t['dec'] = t['DE_ICRS']
t['magnitude'] = t[f'{self.filter_name}mag']
logger.info(f'{len(t)} matches found in the given radius in SDSS')
t.write('phot_table.csv', overwrite=True)
t = Table.read('phot_table.csv')
return t
return t

0 comments on commit 22474b3

Please sign in to comment.