Skip to content

Commit

Permalink
#10 Add _find_sfd_map() function
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-guangtou committed Sep 1, 2018
1 parent a47b088 commit e42cf80
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions kungpao/extinction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,35 @@

from __future__ import print_function, absolute_import, division

import subprocess

from astropy.coordinates import SkyCoord


__all__ = ['radec_extinction']


def _find_sfd_maps(north='SFD_dust_4096_ngp.fits',
south='SFD_dust_4096_sgp.fits', index=0):
"""Use locate command to find the SFD files."""
north_map = subprocess.check_output(
"locate %s" % north, shell=True).splitlines()
south_map = subprocess.check_output(
"locate %s" % south, shell=True).splitlines()

if north_map:
north_file = north_map[index].decode('utf-8')
else:
north_file = None

if south_map:
south_file = south_map[index].decode('utf-8')
else:
south_file = None

return north_file, south_file


def radec_extinction(ra, dec, a_lambda=1.0):
"""Estimate the Galactic extinction for HSC filters.
Expand Down

0 comments on commit e42cf80

Please sign in to comment.