├── .gitattributes ├── MANIFEST.in ├── .gitignore ├── skymap ├── data │ ├── macho_corners_xy.dat │ ├── bliss-poly.txt │ ├── decals-poly.txt │ ├── maglites-poly.txt │ ├── des-round19-poly.txt │ ├── subaru_hsc_ccds.dat │ ├── ccd_corners_xy_fill.dat │ ├── des-round13-poly.txt │ ├── des-round17-poly.txt │ └── smash_fields_final.txt ├── instrument │ ├── camera.py │ ├── macho.py │ ├── __init__.py │ ├── hsc.py │ └── decam.py ├── __init__.py ├── constants.py ├── utils.py ├── healpix.py ├── _version.py ├── survey.py └── core.py ├── setup.cfg ├── tutorial └── README.md ├── LICENSE ├── setup.py ├── .travis.yml ├── README.md └── tests ├── test_tutorial.py └── test_skymap.py /.gitattributes: -------------------------------------------------------------------------------- 1 | skymap/_version.py export-subst 2 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include versioneer.py 2 | include skymap/_version.py 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Emacs 2 | \#*# 3 | \.#* 4 | *~ 5 | 6 | ### Python 7 | *.pyc 8 | *.egg-info/ 9 | build/ 10 | dist/ 11 | tutorial/.ipynb_checkpoints/ 12 | 13 | ### Latex 14 | *.fls 15 | *.aux 16 | *.log 17 | *.fdb_* 18 | *.out 19 | *.blg 20 | *.bbl 21 | -------------------------------------------------------------------------------- /skymap/data/macho_corners_xy.dat: -------------------------------------------------------------------------------- 1 | # MACHO camera assumed to be 40' x 40' 2 | {0: [[-0.35833333333333334, 0.35833333333333334 ], 3 | [-0.35833333333333334, -0.35833333333333334], 4 | [ 0.35833333333333334, -0.35833333333333334], 5 | [ 0.35833333333333334, 0.35833333333333334]], 6 | } -------------------------------------------------------------------------------- /skymap/instrument/camera.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Generic python script. 4 | """ 5 | __author__ = "Alex Drlica-Wagner" 6 | 7 | 8 | 9 | 10 | 11 | if __name__ == "__main__": 12 | import argparse 13 | parser = argparse.ArgumentParser(description=__doc__) 14 | args = parser.parse_args() 15 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | # See the docstring in versioneer.py for instructions. Note that you must 2 | # re-run 'versioneer.py setup' after changing this section, and commit the 3 | # resulting files. 4 | 5 | [versioneer] 6 | VCS = git 7 | style = pep440 8 | versionfile_source = skymap/_version.py 9 | versionfile_build = skymap/_version.py 10 | tag_prefix = v 11 | parentdir_prefix = skymap- 12 | 13 | [metadata] 14 | description-file = README.md -------------------------------------------------------------------------------- /skymap/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Skymap 3 | ====== 4 | 5 | Provides utilities for plotting skymaps. 6 | """ 7 | __author__ = 'Alex Drlica-Wagner' 8 | from ._version import get_versions 9 | __version__ = get_versions()['version'] 10 | del get_versions 11 | 12 | from skymap.core import Skymap, McBrydeSkymap, OrthoSkymap 13 | from skymap.survey import SurveySkymap,SurveyMcBryde,SurveyOrtho 14 | from skymap.survey import DESSkymap, BlissSkymap 15 | 16 | import warnings 17 | from matplotlib.cbook import MatplotlibDeprecationWarning 18 | warnings.filterwarnings("ignore",category=MatplotlibDeprecationWarning) 19 | -------------------------------------------------------------------------------- /skymap/instrument/macho.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Generic python script. 4 | """ 5 | __author__ = "Alex Drlica-Wagner" 6 | import os 7 | 8 | import numpy as np 9 | 10 | from skymap.utils import get_datadir 11 | from skymap.utils import SphericalRotator 12 | from skymap.instrument import FocalPlane 13 | 14 | class MachoFocalPlane(FocalPlane): 15 | """Class for storing and manipulating the corners of the DECam CCDs. 16 | """ 17 | 18 | filename = os.path.join(get_datadir(),'macho_corners_xy.dat') 19 | 20 | def __init__(self): 21 | # This is not safe. Use yaml instead (extra dependency) 22 | self.ccd_dict = eval(''.join(open(self.filename).readlines())) 23 | 24 | # These are x,y coordinates 25 | self.corners = np.array(list(self.ccd_dict.values())) 26 | -------------------------------------------------------------------------------- /tutorial/README.md: -------------------------------------------------------------------------------- 1 | # Skymap Tutorial 2 | 3 | Welcome to [`skymap`](https://github.com/kadrlica/skymap)! At it's core, `skymap` is a wrapper around Python's [`basemap`](https://matplotlib.org/basemap/) module for plotting geographic features. This is is a brief tutorial consisting of ipython notebooks that should get you up to speed with `skymap` and it's features. 4 | 5 | * [Chapter 1: Skymap Base Class](https://github.com/kadrlica/skymap/blob/master/tutorial/chapter1_skymap_base_class.ipynb) 6 | * [Chapter 2: Skymap Subclasses](https://github.com/kadrlica/skymap/blob/master/tutorial/chapter2_skymap_subclasses.ipynb) 7 | * [Chapter 3: Skymap and HEALPix](https://github.com/kadrlica/skymap/blob/master/tutorial/chapter3_skymap_healpix.ipynb) 8 | * [Chapter 4: Skymap and DECam](https://github.com/kadrlica/skymap/blob/master/tutorial/chapter4_skymap_decam.ipynb) -------------------------------------------------------------------------------- /skymap/constants.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Various constants used for plotting 4 | """ 5 | __author__ = "Alex Drlica-Wagner" 6 | 7 | import numpy as np 8 | from collections import OrderedDict as odict 9 | 10 | # Plotting DECam 11 | DECAM=1.1 # DECam radius (deg) 12 | 13 | # Marker size depends on figsize and DPI 14 | FIGSIZE=(10.5,8.5) 15 | SCALE=np.sqrt((8.0*6.0)/(FIGSIZE[0]*FIGSIZE[1])) 16 | DPI=80; 17 | 18 | # LMC and SMC 19 | RA_LMC = 80.8939 20 | DEC_LMC = -69.7561 21 | RADIUS_LMC = 5.3667 # semi-major axis (deg) 22 | RA_SMC = 13.1867 23 | DEC_SMC = -72.8286 24 | RADIUS_SMC = 2.667 # semi_major axis (deg) 25 | 26 | COLORS = odict([ 27 | ('u','#56b4e9'), 28 | ('g','#008060'), 29 | ('r','#ff4000'), 30 | ('i','#850000'), 31 | ('z','#6600cc'), 32 | ('Y','#000000'), 33 | ]) 34 | 35 | # Band colormaps 36 | CMAPS = odict([ 37 | ('none','binary'), 38 | ('u','Blues'), 39 | ('g','Greens'), 40 | ('r','Reds'), 41 | ('i','YlOrBr'), 42 | ('z','RdPu'), 43 | ('Y','Greys'), 44 | ('VR','Greys'), 45 | ]) 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Alex Drlica-Wagner 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | try: from setuptools import setup 4 | except ImportError: from distutils.core import setup 5 | import versioneer 6 | 7 | URL = 'https://github.com/kadrlica/skymap' 8 | 9 | setup( 10 | name='skymap', 11 | version=versioneer.get_version(), 12 | cmdclass=versioneer.get_cmdclass(), 13 | url=URL, 14 | author='Alex Drlica-Wagner', 15 | author_email='kadrlica@fnal.gov', 16 | scripts = [], 17 | install_requires=[ 18 | 'matplotlib', 19 | 'numpy', 20 | 'scipy', 21 | 'basemap', 22 | 'ephem', 23 | 'healpy > 1.10.2', # This is required for `lonlat` argument 24 | 'astropy', 25 | 'pandas', 26 | ], 27 | packages=['skymap','skymap.instrument'], 28 | package_data={'skymap':['data/*.txt','data/*.dat']}, 29 | description="Python tools for making skymaps", 30 | long_description="See %s"%URL, 31 | platforms='any', 32 | keywords='python astronomy plotting', 33 | classifiers = [ 34 | 'Programming Language :: Python', 35 | 'Development Status :: 2 - Pre-Alpha', 36 | 'Natural Language :: English', 37 | 'Intended Audience :: Science/Research', 38 | ] 39 | ) 40 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | dist: xenial 3 | python: 4 | - "2.7" 5 | - "3.7" 6 | 7 | sudo: false 8 | 9 | notifications: 10 | email: false 11 | 12 | # Setup dependencies and install package 13 | install: 14 | - wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh 15 | - bash miniconda.sh -b -p $HOME/miniconda 16 | - export PATH="$HOME/miniconda/bin:$PATH" 17 | - conda config --set always_yes yes --set changeps1 no 18 | - conda update -q conda 19 | - conda info -a 20 | # There is a (temporary?) issue with conda-forge build that requires proj4 21 | # https://github.com/conda-forge/basemap-feedstock/issues/30 22 | - conda create -q -n travis-env python=$TRAVIS_PYTHON_VERSION setuptools numpy scipy matplotlib basemap astropy ephem healpy pandas nose -c conda-forge 23 | - source activate travis-env 24 | - python setup.py install 25 | 26 | before_script: 27 | - export MPLBACKEND=Agg 28 | - conda install -q ipython notebook -c conda-forge --no-update-deps 29 | 30 | # command to run tests 31 | script: 32 | - python -c "import skymap; print(skymap.__version__)" 33 | - if [[ $TRAVIS_PYTHON_VERSION < 3.0 ]]; then 34 | nosetests ; 35 | else 36 | nosetests -I test_tutorial.py ; 37 | fi 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # skymap 2 | 3 | [![Build](https://img.shields.io/travis/kadrlica/skymap.svg)](https://travis-ci.org/kadrlica/skymap) 4 | [![PyPI](https://img.shields.io/pypi/v/skymap.svg)](https://pypi.python.org/pypi/skymap) 5 | [![Release](https://img.shields.io/github/release/kadrlica/skymap.svg?include_prereleases)](../../releases) 6 | [![License](https://img.shields.io/badge/license-MIT-blue.svg)](../../) 7 | 8 | The `skymap` package provides a astronomically oriented interface to ploting sky maps based on [`matplotlib.basemap`](http://matplotlib.org/basemap/). This package addresses several issues present in the [`healpy`](https://healpy.readthedocs.io/en/latest/) plotting routines: 9 | 1. `healpy` supports a limited set of sky projections (`cartview`, `mollview`, and `gnomview`) 10 | 2. `healpy` converts sparse healpix maps to full maps to plot; this is memory intensive for large `nside` 11 | 12 | In addition, `skymap` provides some convenience functionality for large optical surveys. 13 | 14 | ## Installation 15 | 16 | The best way to install skymap is if you have [anaconda](https://anaconda.org/) installed. If you have trouble, check out the [.travis.yml](.travis.yml) file. The procedure below will create a conda environment and pip install skymap: 17 | ``` 18 | conda create -n skymap numpy scipy pandas matplotlib basemap astropy ephem healpy nose -c conda-forge 19 | source activate skymap 20 | pip install skymap 21 | ``` 22 | If you want the bleeding edge of skymap, you can follow the directions above to create the conda environment, but then install by cloning directly from github: 23 | ``` 24 | git clone https://github.com/kadrlica/skymap.git 25 | cd skymap 26 | python setup.py install 27 | ``` 28 | 29 | ## Tutorial 30 | 31 | If you want to see what you can do with `skymap`, check out the [tutorial](tutorial/). 32 | -------------------------------------------------------------------------------- /tests/test_tutorial.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Test ipython notebooks in skymap tutorial. 4 | 5 | Adapted from: 6 | https://blog.thedataincubator.com/2016/06/testing-jupyter-notebooks/ 7 | """ 8 | __author__ = "Alex Drlica-Wagner" 9 | 10 | import os 11 | import unittest 12 | import glob 13 | 14 | import subprocess 15 | import tempfile 16 | 17 | import nbformat 18 | 19 | def _notebook_run(path): 20 | """Execute a notebook via nbconvert and collect output. 21 | :returns (parsed nb object, execution errors) 22 | """ 23 | with tempfile.NamedTemporaryFile(suffix=".ipynb") as fout: 24 | args = ["jupyter", "nbconvert", "--to", "notebook", "--execute", 25 | "--ExecutePreprocessor.timeout=60", 26 | "--output", fout.name, path] 27 | subprocess.check_call(args) 28 | 29 | fout.seek(0) 30 | nb = nbformat.read(fout, nbformat.current_nbformat) 31 | 32 | errors = [output for cell in nb.cells if "outputs" in cell 33 | for output in cell["outputs"]\ 34 | if output.output_type == "error"] 35 | 36 | return nb, errors 37 | 38 | 39 | class TestTutorial(unittest.TestCase): 40 | """ Test the tutorial ipython notebooks. """ 41 | 42 | def _test_chapter(self, i=1): 43 | """ Test a specific chapter of the tutorial. """ 44 | path = glob.glob('tutorial/chapter%i_*.ipynb'%i)[0] 45 | abspath = os.path.abspath(path) 46 | nb, errors = _notebook_run(abspath) 47 | assert errors == [] 48 | 49 | def test_chapter1(self): 50 | return self._test_chapter(1) 51 | 52 | def test_chapter2(self): 53 | return self._test_chapter(2) 54 | 55 | def test_chapter3(self): 56 | return self._test_chapter(3) 57 | 58 | def test_chapter4(self): 59 | return self._test_chapter(4) 60 | 61 | 62 | 63 | if __name__ == "__main__": 64 | unittest.main() 65 | -------------------------------------------------------------------------------- /skymap/data/bliss-poly.txt: -------------------------------------------------------------------------------- 1 | # BLISS footprint polygon 2 | # Poly 1: Planet 9 (RA < 360) 3 | # Poly 2: Planet 9 (RA > 360) 4 | # Poly 3: LIGO/MW & Alfredo 5 | #RA DEC POLY 6 | -0.1 -30 1 7 | -10 -30 1 8 | -20 -30 1 9 | -30 -30 1 10 | -40 -30 1 11 | -53 -30 1 12 | -54 -30 1 13 | -55 -30 1 14 | -55 -35 1 15 | -55 -40 1 16 | -55 -40 1 17 | -50 -40 1 18 | -40 -40 1 19 | -30 -40 1 20 | -20 -40 1 21 | -10 -40 1 22 | -4 -40 1 23 | -0.1 -35 1 24 | #0 -25 2 25 | #5 -25 2 26 | #3 -28 2 27 | 0.1 -30 2 28 | 1 -30 2 29 | 2 -30 2 30 | 2 -31 2 31 | 1 -32.5 2 32 | 0.1 -35 2 33 | 179.9 -52.0 3 34 | 173.8 -51.1 3 35 | 168.5 -49.9 3 36 | 163.5 -48.4 3 37 | 158.8 -46.7 3 38 | 154.5 -44.8 3 39 | 150.5 -42.7 3 40 | 146.7 -40.5 3 41 | 143.3 -38.1 3 42 | 140.1 -35.5 3 43 | 137.2 -32.9 3 44 | 134.0 -30.0 3 45 | 134 -30 3 46 | 140 -30 3 47 | 145 -30 3 48 | 150 -30 3 49 | 148 -28 3 50 | 145 -25 3 51 | 139 -20 3 52 | 135 -16 3 53 | 135 -13 3 54 | 137 -11 3 55 | 139 -10.5 3 56 | 142 -10.5 3 57 | 144 -10.5 3 58 | 145 -11 3 59 | 148 -15 3 60 | 154 -20 3 61 | 162 -25 3 62 | 173 -30 3 63 | 179.9 -30 3 64 | -179.9 -30 4 65 | -170 -30 4 66 | -160 -30 4 67 | -150 -30 4 68 | -140 -30 4 69 | -130 -30 4 70 | -120 -30 4 71 | -110 -30 4 72 | -110.4 -31.9 4 73 | -113.2 -34.5 4 74 | -116.3 -37.1 4 75 | -119.7 -39.5 4 76 | -123.3 -41.9 4 77 | -127.2 -44.0 4 78 | -131.4 -46.0 4 79 | -135.9 -47.8 4 80 | -140.8 -49.3 4 81 | -146.0 -50.7 4 82 | -151.5 -51.7 4 83 | -157.2 -52.4 4 84 | -163.0 -52.8 4 85 | -169.0 -52.9 4 86 | -174.9 -52.6 4 87 | -179.9 -52.6 4 88 | -------------------------------------------------------------------------------- /skymap/data/decals-poly.txt: -------------------------------------------------------------------------------- 1 | # DECaLS Footprint (estimated from exposures) 2 | #RA DEC POLY 3 | 0.1 34.0 1 4 | 16 34.0 1 5 | 31.6 33.2 1 6 | 36.7 29.5 1 7 | 41.3 26.3 1 8 | 43.2 13.6 1 9 | 44.5 8.1 1 10 | 48.4 4.2 1 11 | 53.5 1.4 1 12 | 59.3 0.4 1 13 | 67.1 0.4 1 14 | 74.2 0.4 1 15 | 76.8 0.4 1 16 | 76.8 -4.2 1 17 | 76.8 -7.1 1 18 | 75.5 -10.3 1 19 | 74.8 -11.9 1 20 | 69.0 -13.8 1 21 | 67.7 -18.2 1 22 | 7.1 -20.6 1 23 | 1.3 -20.2 1 24 | 0.1 -18.4 1 25 | 3.9 -16.8 1 26 | 7.7 -15.4 1 27 | 0.6 -15.0 1 28 | 0.1 -15.0 1 29 | -0.1 -15.0 2 30 | -9.0 -15.0 2 31 | -18.7 -15.0 2 32 | -32.9 -15.0 2 33 | -45.8 -13.4 2 34 | -52.3 -10.9 2 35 | -53.5 -9.5 2 36 | -54.2 -6.5 2 37 | -54.2 -3.8 2 38 | -53.5 -0.4 2 39 | -56.8 2.6 2 40 | -54.8 6.5 2 41 | -51.6 10.5 2 42 | -51.6 12.3 2 43 | -47.1 13.8 2 44 | -43.2 17.2 2 45 | -40.0 20.4 2 46 | -38.1 24.5 2 47 | -36.1 29.3 2 48 | -25.8 32.4 2 49 | -18.7 34.0 2 50 | -7.7 34.0 2 51 | -0.1 34.0 2 52 | # Region accross RA = 180 53 | 179.9 -10 3 54 | 170.0 -10 3 55 | 160.0 -10 3 56 | 140.0 -10 3 57 | 121.0 -10 3 58 | 117.0 -4.25 3 59 | 117.0 0.4 3 60 | 113.0 5.9 3 61 | 115.4 9.31 3 62 | 113.3 13.4 3 63 | 108.9 18.0 3 64 | 104.6 23.3 3 65 | 102.4 27.9 3 66 | 101.0 32.0 3 67 | 100.0 34.0 3 68 | 100.0 34 3 69 | 120.0 34 3 70 | 110.0 34 3 71 | 140.0 34 3 72 | 160.0 34 3 73 | 170.0 34 3 74 | 179.9 34 3 75 | -179.9 34 4 76 | -170.0 34 4 77 | -160.0 34 4 78 | -140.0 34 4 79 | -120.0 34 4 80 | -100.0 34 4 81 | -80.0 34 4 82 | -83.0 28 4 83 | -84.0 23 4 84 | -86.0 20 4 85 | -89.0 15 4 86 | -92.0 12 4 87 | -96.0 9 4 88 | -100.0 6 4 89 | -103.0 1 4 90 | -108.0 -1 4 91 | -126.0 -3 4 92 | -126.0 -10 4 93 | -130.0 -10 4 94 | -140.0 -10 4 95 | -150.0 -10 4 96 | -160.0 -10 4 97 | -170.0 -10 4 98 | -179.9 -10 4 99 | -------------------------------------------------------------------------------- /skymap/instrument/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import numpy as np 4 | 5 | from skymap.utils import get_datadir 6 | from skymap.utils import SphericalRotator 7 | 8 | class FocalPlane(object): 9 | """Class for storing and manipulating the corners of the DECam CCDs. 10 | """ 11 | 12 | filename = os.path.join(get_datadir(),'ccd_corners_xy_fill.dat') 13 | 14 | def __init__(self): 15 | # This is not safe. Use yaml instead (extra dependency) 16 | self.ccd_dict = eval(''.join(open(self.filename).readlines())) 17 | 18 | # These are x,y coordinates 19 | self.corners = np.array(list(self.ccd_dict.values())) 20 | 21 | # Since we don't know the original projection of the DECam 22 | # focal plane into x,y it is probably not worth trying to 23 | # deproject it right now... 24 | 25 | #x,y = self.ccd_array[:,:,0],self.ccd_array[:,:,1] 26 | #ra,dec = Projector(0,0).image2sphere(x.flat,y.flat) 27 | #self.corners[:,:,0] = ra.reshape(x.shape) 28 | #self.corners[:,:,1] = dec.reshape(y.shape) 29 | 30 | def rotate(self, ra, dec): 31 | """Rotate the corners of the DECam CCDs to a given sky location. 32 | 33 | Parameters: 34 | ----------- 35 | ra : The right ascension (deg) of the focal plane center 36 | dec : The declination (deg) of the focal plane center 37 | 38 | Returns: 39 | -------- 40 | corners : The rotated corner locations of the CCDs 41 | """ 42 | corners = np.copy(self.corners) 43 | 44 | R = SphericalRotator(ra,dec) 45 | _ra,_dec = R.rotate(corners[:,:,0].flat,corners[:,:,1].flat,invert=True) 46 | 47 | corners[:,:,0] = _ra.reshape(corners.shape[:2]) 48 | corners[:,:,1] = _dec.reshape(corners.shape[:2]) 49 | return corners 50 | 51 | def project(self, basemap, ra, dec): 52 | """Apply the given basemap projection to the DECam focal plane at a 53 | location given by ra,dec. 54 | 55 | Parameters: 56 | ----------- 57 | basemap : The Basemap to project to. 58 | ra : The right ascension (deg) of the focal plane center 59 | dec : The declination (deg) of the focal plane center 60 | 61 | Returns: 62 | -------- 63 | corners : Projected corner locations of the CCDs 64 | """ 65 | corners = self.rotate(ra,dec) 66 | 67 | x,y = basemap.proj(corners[:,:,0],corners[:,:,1]) 68 | 69 | # Remove CCDs that cross the map boundary 70 | x[(np.ptp(x,axis=1) > np.pi)] = np.nan 71 | 72 | corners[:,:,0] = x 73 | corners[:,:,1] = y 74 | return corners 75 | -------------------------------------------------------------------------------- /skymap/instrument/hsc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Generic python script. 4 | """ 5 | __author__ = "Alex Drlica-Wagner" 6 | import os 7 | 8 | import numpy as np 9 | 10 | from skymap.utils import get_datadir 11 | from skymap.utils import SphericalRotator 12 | 13 | class HSCFocalPlane(object): 14 | """Class for storing and manipulating the corners of the HSC CCDs. 15 | """ 16 | 17 | filename = os.path.join(get_datadir(),'subaru_hsc_ccds.dat') 18 | 19 | def __init__(self): 20 | # This is not safe. Use yaml instead (extra dependency) 21 | self.ccd_dict = eval(''.join(open(self.filename).readlines())) 22 | 23 | # These are x,y coordinates 24 | self.corners = np.array(list(self.ccd_dict.values())) 25 | 26 | # Since we don't know the original projection of the HSC 27 | # focal plane into x,y it is probably not worth trying to 28 | # deproject it right now... 29 | 30 | #x,y = self.ccd_array[:,:,0],self.ccd_array[:,:,1] 31 | #ra,dec = Projector(0,0).image2sphere(x.flat,y.flat) 32 | #self.corners[:,:,0] = ra.reshape(x.shape) 33 | #self.corners[:,:,1] = dec.reshape(y.shape) 34 | 35 | def rotate(self, ra, dec): 36 | """Rotate the corners of the HSC CCDs to a given sky location. 37 | 38 | Parameters: 39 | ----------- 40 | ra : The right ascension (deg) of the focal plane center 41 | dec : The declination (deg) of the focal plane center 42 | 43 | Returns: 44 | -------- 45 | corners : The rotated corner locations of the CCDs 46 | """ 47 | corners = np.copy(self.corners) 48 | 49 | R = SphericalRotator(ra,dec) 50 | _ra,_dec = R.rotate(corners[:,:,0].flat,corners[:,:,1].flat,invert=True) 51 | 52 | corners[:,:,0] = _ra.reshape(corners.shape[:2]) 53 | corners[:,:,1] = _dec.reshape(corners.shape[:2]) 54 | return corners 55 | 56 | def project(self, basemap, ra, dec): 57 | """Apply the given basemap projection to the HSC focal plane at a 58 | location given by ra,dec. 59 | 60 | Parameters: 61 | ----------- 62 | basemap : The Basemap to project to. 63 | ra : The right ascension (deg) of the focal plane center 64 | dec : The declination (deg) of the focal plane center 65 | 66 | Returns: 67 | -------- 68 | corners : Projected corner locations of the CCDs 69 | """ 70 | corners = self.rotate(ra,dec) 71 | 72 | x,y = basemap.proj(corners[:,:,0],corners[:,:,1]) 73 | 74 | # Remove CCDs that cross the map boundary 75 | x[(np.ptp(x,axis=1) > np.pi)] = np.nan 76 | 77 | corners[:,:,0] = x 78 | corners[:,:,1] = y 79 | return corners 80 | -------------------------------------------------------------------------------- /skymap/instrument/decam.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Generic python script. 4 | """ 5 | __author__ = "Alex Drlica-Wagner" 6 | import os 7 | 8 | import numpy as np 9 | 10 | from skymap.utils import get_datadir 11 | from skymap.utils import SphericalRotator 12 | 13 | class DECamFocalPlane(object): 14 | """Class for storing and manipulating the corners of the DECam CCDs. 15 | """ 16 | 17 | filename = os.path.join(get_datadir(),'ccd_corners_xy_fill.dat') 18 | 19 | def __init__(self): 20 | # This is not safe. Use yaml instead (extra dependency) 21 | self.ccd_dict = eval(''.join(open(self.filename).readlines())) 22 | 23 | # These are x,y coordinates 24 | self.corners = np.array(list(self.ccd_dict.values())) 25 | 26 | # Since we don't know the original projection of the DECam 27 | # focal plane into x,y it is probably not worth trying to 28 | # deproject it right now... 29 | 30 | #x,y = self.ccd_array[:,:,0],self.ccd_array[:,:,1] 31 | #ra,dec = Projector(0,0).image2sphere(x.flat,y.flat) 32 | #self.corners[:,:,0] = ra.reshape(x.shape) 33 | #self.corners[:,:,1] = dec.reshape(y.shape) 34 | 35 | def rotate(self, ra, dec): 36 | """Rotate the corners of the DECam CCDs to a given sky location. 37 | 38 | Parameters: 39 | ----------- 40 | ra : The right ascension (deg) of the focal plane center 41 | dec : The declination (deg) of the focal plane center 42 | 43 | Returns: 44 | -------- 45 | corners : The rotated corner locations of the CCDs 46 | """ 47 | corners = np.copy(self.corners) 48 | 49 | R = SphericalRotator(ra,dec) 50 | _ra,_dec = R.rotate(corners[:,:,0].flat,corners[:,:,1].flat,invert=True) 51 | 52 | corners[:,:,0] = _ra.reshape(corners.shape[:2]) 53 | corners[:,:,1] = _dec.reshape(corners.shape[:2]) 54 | return corners 55 | 56 | def project(self, basemap, ra, dec): 57 | """Apply the given basemap projection to the DECam focal plane at a 58 | location given by ra,dec. 59 | 60 | Parameters: 61 | ----------- 62 | basemap : The Basemap to project to. 63 | ra : The right ascension (deg) of the focal plane center 64 | dec : The declination (deg) of the focal plane center 65 | 66 | Returns: 67 | -------- 68 | corners : Projected corner locations of the CCDs 69 | """ 70 | corners = self.rotate(ra,dec) 71 | 72 | x,y = basemap.proj(corners[:,:,0],corners[:,:,1]) 73 | 74 | # Remove CCDs that cross the map boundary 75 | x[(np.ptp(x,axis=1) > np.pi)] = np.nan 76 | 77 | corners[:,:,0] = x 78 | corners[:,:,1] = y 79 | return corners 80 | 81 | 82 | -------------------------------------------------------------------------------- /skymap/data/maglites-poly.txt: -------------------------------------------------------------------------------- 1 | # This file is an approximation to the footprint for ease of plotting. 2 | # It should not be used for any real footprint selection. 3 | #RA DEC 4 | -60.00 -65.00 5 | -59.00 -65.00 6 | -58.00 -65.00 7 | -57.00 -65.00 8 | -56.00 -65.00 9 | -55.00 -65.00 10 | -54.00 -65.00 11 | -53.00 -65.00 12 | -52.00 -65.00 13 | -51.00 -65.00 14 | -50.00 -65.00 15 | -49.00 -65.00 16 | -48.00 -65.00 17 | -47.00 -65.00 18 | -46.00 -65.00 19 | -45.00 -65.00 20 | -44.00 -65.00 21 | -43.00 -65.00 22 | -42.00 -65.00 23 | -41.00 -65.00 24 | -40.00 -65.00 25 | -39.00 -65.00 26 | -38.00 -65.00 27 | -37.00 -65.00 28 | -36.00 -65.00 29 | -35.00 -65.00 30 | -34.00 -65.00 31 | -33.00 -65.00 32 | -32.00 -65.00 33 | -31.00 -65.00 34 | -30.00 -65.00 35 | -29.00 -65.00 36 | -28.00 -65.00 37 | -27.00 -65.00 38 | -26.00 -65.00 39 | -25.00 -65.00 40 | -24.00 -65.00 41 | -23.00 -65.00 42 | -22.00 -65.00 43 | -21.00 -65.00 44 | -20.00 -65.00 45 | -19.00 -65.00 46 | -18.00 -65.00 47 | -17.00 -65.00 48 | -16.00 -65.00 49 | -15.00 -65.00 50 | -14.00 -65.00 51 | -13.00 -65.00 52 | -12.00 -65.00 53 | -11.00 -65.00 54 | -10.00 -65.00 55 | -9.00 -65.00 56 | -8.00 -65.00 57 | -7.00 -65.00 58 | -6.00 -65.00 59 | -5.00 -65.00 60 | -4.00 -65.00 61 | -3.00 -65.00 62 | -2.00 -65.00 63 | -1.00 -65.00 64 | 0.00 -65.00 65 | 0.00 -66.00 66 | 0.00 -67.00 67 | 0.00 -68.00 68 | 0.00 -69.00 69 | 0.00 -70.00 70 | 0.00 -71.00 71 | 0.00 -72.00 72 | 0.00 -73.00 73 | 0.00 -74.00 74 | 0.00 -75.00 75 | 0.00 -76.00 76 | 0.00 -77.00 77 | 0.00 -78.00 78 | 0.00 -79.00 79 | 0.00 -80.00 80 | 1.00 -80.00 81 | 2.00 -80.00 82 | 3.00 -80.00 83 | 4.00 -80.00 84 | 5.00 -80.00 85 | 6.00 -80.00 86 | 7.00 -80.00 87 | 8.00 -80.00 88 | 9.00 -80.00 89 | 10.00 -80.00 90 | 11.00 -80.00 91 | 12.00 -80.00 92 | 13.00 -80.00 93 | 14.00 -80.00 94 | 15.00 -80.00 95 | 16.00 -80.00 96 | 17.00 -80.00 97 | 18.00 -80.00 98 | 19.00 -80.00 99 | 20.00 -80.00 100 | 21.00 -80.00 101 | 22.00 -80.00 102 | 23.00 -80.00 103 | 24.00 -80.00 104 | 25.00 -80.00 105 | 26.00 -80.00 106 | 27.00 -80.00 107 | 28.00 -80.00 108 | 29.00 -80.00 109 | 30.00 -80.00 110 | 31.00 -80.00 111 | 32.00 -80.00 112 | 33.00 -80.00 113 | 34.00 -80.00 114 | 35.00 -80.00 115 | 36.00 -80.00 116 | 37.00 -80.00 117 | 38.00 -80.00 118 | 39.00 -80.00 119 | 40.00 -80.00 120 | 41.00 -80.00 121 | 42.00 -80.00 122 | 43.00 -80.00 123 | 44.00 -80.00 124 | 45.00 -80.00 125 | 46.00 -80.00 126 | 47.00 -80.00 127 | 48.00 -80.00 128 | 49.00 -80.00 129 | 50.00 -80.00 130 | 51.00 -80.00 131 | 52.00 -80.00 132 | 53.00 -80.00 133 | 54.00 -80.00 134 | 55.00 -80.00 135 | 56.00 -80.00 136 | 57.00 -80.00 137 | 58.00 -80.00 138 | 59.00 -80.00 139 | 60.00 -80.00 140 | 61.00 -80.00 141 | 62.00 -80.00 142 | 63.00 -80.00 143 | 64.00 -80.00 144 | 65.00 -80.00 145 | 66.00 -80.00 146 | 67.00 -80.00 147 | 68.00 -80.00 148 | 69.00 -80.00 149 | 70.00 -80.00 150 | 71.00 -80.00 151 | 72.00 -80.00 152 | 73.00 -80.00 153 | 74.00 -80.00 154 | 75.00 -80.00 155 | 76.00 -80.00 156 | 77.00 -80.00 157 | 78.00 -80.00 158 | 79.00 -80.00 159 | 80.00 -80.00 160 | 81.00 -80.00 161 | 82.00 -80.00 162 | 83.00 -80.00 163 | 84.00 -80.00 164 | 85.00 -80.00 165 | 86.00 -80.00 166 | 87.00 -80.00 167 | 88.00 -80.00 168 | 89.00 -80.00 169 | 90.00 -80.00 170 | 91.00 -80.00 171 | 92.00 -80.00 172 | 93.00 -80.00 173 | 94.00 -80.00 174 | 95.00 -80.00 175 | 96.00 -80.00 176 | 97.00 -80.00 177 | 98.00 -80.00 178 | 99.00 -80.00 179 | 100.00 -80.00 180 | 100.00 -79.00 181 | 100.00 -78.00 182 | 100.00 -77.00 183 | 100.00 -76.00 184 | 100.00 -75.00 185 | 100.00 -74.00 186 | 100.00 -73.00 187 | 100.00 -72.00 188 | 100.00 -71.00 189 | 100.00 -70.00 190 | 100.00 -69.00 191 | 100.00 -68.00 192 | 100.00 -67.00 193 | 100.00 -66.00 194 | 100.00 -65.00 195 | 100.00 -64.00 196 | 100.00 -63.00 197 | 100.00 -62.00 198 | 100.00 -61.00 199 | 100.00 -60.00 200 | 100.00 -59.00 201 | 100.00 -58.00 202 | 100.00 -57.00 203 | 100.00 -56.00 204 | 100.00 -55.00 205 | 101.00 -55.00 206 | 102.00 -55.00 207 | 103.00 -55.00 208 | 104.00 -55.00 209 | 105.00 -55.00 210 | 106.00 -55.00 211 | 107.00 -55.00 212 | 108.00 -55.00 213 | 109.00 -55.00 214 | 110.00 -55.00 215 | 111.00 -55.00 216 | 112.00 -55.00 217 | 113.00 -55.00 218 | 114.00 -55.00 219 | 115.00 -55.00 220 | 116.00 -55.00 221 | 117.00 -55.00 222 | 118.00 -55.00 223 | 119.00 -55.00 224 | 120.00 -55.00 225 | 121.00 -55.00 226 | 122.00 -55.00 227 | 123.00 -55.00 228 | 124.00 -55.00 229 | 125.00 -55.00 230 | 126.00 -55.00 231 | 128.04 -56.84 232 | 129.8 -58.1 233 | 134.1 -60.92 234 | 137.4 -62.68 235 | 140.93 -64.33 236 | 144.9 -66.1 237 | 148.98 -67.42 238 | 152.83 -68.52 239 | 157.24 -69.51 240 | 162.42 -70.61 241 | 167.16 -71.28 242 | 172.56 -72.0 243 | 180.00 -72.6 244 | -179.90 -72.6 245 | -171.59 -72.82 246 | -162.23 -75.1 247 | -154.73 -76.3 248 | -152.9 -76.9 249 | -147.0 -76.73 250 | -135.83 -76.02 251 | -125.05 -74.77 252 | -114.62 -73.68 253 | -106.58 -72.38 254 | -96.99 -70.39 255 | -88.5 -68.41 256 | -81.01 -66.3 257 | -75.5 -64.55 258 | -69.88 -62.79 259 | -63.49 -60.72 260 | -60.00 -59.4 261 | -60.00 -60.00 262 | -60.00 -61.00 263 | -60.00 -62.00 264 | -60.00 -63.00 265 | -60.00 -64.00 266 | -60.00 -65.00 267 | -------------------------------------------------------------------------------- /tests/test_skymap.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Unit tests for skymap 4 | """ 5 | __author__ = "Alex Drlica-Wagner" 6 | 7 | import os,sys 8 | import unittest 9 | 10 | # Careful, have a local .matplotlibrc 11 | import matplotlib 12 | 13 | import pylab as plt 14 | import numpy as np 15 | import healpy as hp 16 | 17 | import skymap 18 | from skymap import Skymap,McBrydeSkymap,OrthoSkymap 19 | from skymap import SurveySkymap,SurveyMcBryde,SurveyOrtho 20 | from skymap import DESSkymap,BlissSkymap 21 | 22 | nside = 8 23 | 24 | SKYMAPS = [Skymap,McBrydeSkymap,OrthoSkymap] 25 | SURVEYS = [SurveySkymap,SurveyMcBryde,SurveyOrtho] 26 | ZOOMS = [DESSkymap,BlissSkymap] 27 | 28 | class TestSkymap(unittest.TestCase): 29 | 30 | def test_skymap(self): 31 | fig,axes = plt.subplots(1,3,figsize=(12,3)) 32 | for i,cls in enumerate(SKYMAPS): 33 | plt.sca(axes[i]) 34 | m = cls() 35 | m.draw_milky_way() 36 | plt.title('Galactic Plane (%s)'%cls.__name__) 37 | 38 | def test_survey_skymap(self): 39 | fig,axes = plt.subplots(1,3,figsize=(12,3)) 40 | for i,cls in enumerate(SURVEYS): 41 | plt.sca(axes[i]) 42 | m = cls() 43 | m.draw_des() 44 | m.draw_maglites() 45 | m.draw_bliss() 46 | plt.title('Footprints (%s)'%cls.__name__) 47 | 48 | def test_zoom_skymap(self): 49 | for i,cls in enumerate(ZOOMS): 50 | plt.figure() 51 | m = cls() 52 | m.draw_des() 53 | m.draw_maglites() 54 | m.draw_bliss() 55 | plt.suptitle('Zoom Footprints (%s)'%cls.__name__) 56 | 57 | def test_draw_hpxmap(self): 58 | """ Test drawing a full healpix skymap """ 59 | hpxmap = np.arange(hp.nside2npix(nside)) 60 | fig,axes = plt.subplots(1,3,figsize=(12,3)) 61 | for i,cls in enumerate(SKYMAPS): 62 | plt.sca(axes[i]) 63 | m = cls() 64 | m.draw_hpxmap(hpxmap,xsize=400) 65 | plt.title('HEALPix Map (%s)'%cls.__name__) 66 | 67 | def test_draw_explicit_hpxmap(self): 68 | """ Test an explicit healpix map """ 69 | pix = hpxmap = np.arange(525,535) 70 | fig,axes = plt.subplots(1,3,figsize=(12,3)) 71 | for i,cls in enumerate(SKYMAPS): 72 | plt.sca(axes[i]) 73 | m = cls() 74 | m.draw_hpxmap(hpxmap,pix,nside,xsize=400) 75 | plt.title('Partial HEALPix Map (%s)'%cls.__name__) 76 | 77 | def test_draw_hpxbin(self): 78 | """ Test drawing hpxbin from points """ 79 | kwargs = dict(nside=64) 80 | fig,axes = plt.subplots(1,3,figsize=(12,3)) 81 | for i,cls in enumerate(SKYMAPS): 82 | plt.sca(axes[i]) 83 | m = cls() 84 | # This is not uniform 85 | size = int(1e6) 86 | lon = np.random.uniform(0,360,size=size) 87 | lat = np.random.uniform(-90,90,size=size) 88 | m.draw_hpxbin(lon,lat,**kwargs) 89 | plt.title('HEALPix Bin (%s)'%cls.__name__) 90 | 91 | def test_draw_hires(self): 92 | """ Draw a partial healpix map with very large nside """ 93 | nside = 4096*2**5 94 | ra,dec = 45,-45 95 | radius = 0.05 96 | pixels = skymap.healpix.ang2disc(nside,ra,dec,radius) 97 | values = pixels 98 | 99 | plt.figure() 100 | # Use the Cassini projection (because we can) 101 | m = Skymap(projection='cass', lon_0=ra, lat_0=dec, celestial=False, 102 | llcrnrlon=ra+2*radius,urcrnrlon=ra-2*radius, 103 | llcrnrlat=dec-2*radius,urcrnrlat=dec+2*radius) 104 | 105 | m.draw_hpxmap(values,pixels,nside=nside,xsize=400) 106 | m.draw_parallels(np.linspace(dec-2*radius,dec+2*radius,5), 107 | labelstyle='+/-',labels=[1,0,0,0]) 108 | m.draw_meridians(np.linspace(ra-2*radius,ra+2*radius,5), 109 | labelstyle='+/-',labels=[0,0,0,1]) 110 | plt.title('HEALPix Zoom (nside=%i)'%nside) 111 | 112 | 113 | def test_draw_focal_planes(self): 114 | """ Draw a DECam focal planes """ 115 | ra,dec = 45,-45 116 | radius = 1.5 117 | delta = 1.0 118 | 119 | plt.figure() 120 | # Use the Cassini projection (because we can) 121 | m = Skymap(projection='cass', lon_0=ra, lat_0=dec, celestial=False, 122 | llcrnrlon=ra+2*radius,urcrnrlon=ra-2*radius, 123 | llcrnrlat=dec-2*radius,urcrnrlat=dec+2*radius) 124 | 125 | # Can plot individual fields 126 | m.draw_focal_planes([ra+delta/2],[dec-delta/2],color='g') 127 | # Or as arrays 128 | m.draw_focal_planes([ra,ra-delta,ra-delta],[dec,dec+delta,dec-delta],color='r') 129 | # Draw the grid lines 130 | m.draw_parallels(np.linspace(dec-2*radius,dec+2*radius,5), 131 | labelstyle='+/-',labels=[1,0,0,0]) 132 | m.draw_meridians(np.linspace(ra-2*radius,ra+2*radius,5), 133 | labelstyle='+/-',labels=[0,0,0,1]) 134 | plt.title('DECam Focal Planes') 135 | 136 | def test_zoom_to_fit(self): 137 | nside = 64 138 | ra,dec = 15,-45 139 | radius = 10.0 140 | pixels = skymap.healpix.ang2disc(nside,ra,dec,radius) 141 | values = pixels 142 | 143 | fig,axes = plt.subplots(1,3,figsize=(12,3)) 144 | for i,cls in enumerate(SKYMAPS): 145 | plt.sca(axes[i]) 146 | m = cls() 147 | m.draw_hpxmap(values,pixels,nside=nside,xsize=200) 148 | m.zoom_to_fit(values,pixels,nside) 149 | m.draw_parallels(np.linspace(dec-2*radius,dec+2*radius,5), 150 | labelstyle='+/-',labels=[1,0,0,0]) 151 | m.draw_meridians(np.linspace(ra-2*radius,ra+2*radius,5), 152 | labelstyle='+/-',labels=[0,0,0,1]) 153 | plt.title('Zoom to Fit (%s)'%cls.__name__) 154 | 155 | 156 | if __name__ == '__main__': 157 | if sys.flags.interactive: plt.ion() 158 | unittest.main() 159 | 160 | -------------------------------------------------------------------------------- /skymap/utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Random utilities 4 | """ 5 | import os, os.path 6 | 7 | import numpy as np 8 | import healpy as hp 9 | 10 | def get_datadir(): 11 | from os.path import abspath,dirname,join 12 | return join(dirname(abspath(__file__)),'data') 13 | 14 | def setdefaults(kwargs,defaults): 15 | for k,v in defaults.items(): 16 | kwargs.setdefault(k,v) 17 | return kwargs 18 | 19 | 20 | # Astropy is still way to inefficient with coordinate transformations: 21 | # https://github.com/astropy/astropy/issues/1717 22 | 23 | def gal2cel(glon, glat): 24 | """ 25 | Converts Galactic (deg) to Celestial J2000 (deg) coordinates 26 | """ 27 | glat = np.radians(glat) 28 | sin_glat = np.sin(glat) 29 | cos_glat = np.cos(glat) 30 | 31 | glon = np.radians(glon) 32 | ra_gp = np.radians(192.85948) 33 | de_gp = np.radians(27.12825) 34 | lcp = np.radians(122.932) 35 | 36 | sin_lcp_glon = np.sin(lcp - glon) 37 | cos_lcp_glon = np.cos(lcp - glon) 38 | 39 | sin_d = (np.sin(de_gp) * sin_glat) \ 40 | + (np.cos(de_gp) * cos_glat * cos_lcp_glon) 41 | ramragp = np.arctan2(cos_glat * sin_lcp_glon, 42 | (np.cos(de_gp) * sin_glat) \ 43 | - (np.sin(de_gp) * cos_glat * cos_lcp_glon)) 44 | dec = np.arcsin(sin_d) 45 | ra = (ramragp + ra_gp + (2. * np.pi)) % (2. * np.pi) 46 | return np.degrees(ra), np.degrees(dec) 47 | 48 | def cel2gal(ra, dec): 49 | """ 50 | Converts Celestial J2000 (deg) to Calactic (deg) coordinates 51 | """ 52 | dec = np.radians(dec) 53 | sin_dec = np.sin(dec) 54 | cos_dec = np.cos(dec) 55 | 56 | ra = np.radians(ra) 57 | ra_gp = np.radians(192.85948) 58 | de_gp = np.radians(27.12825) 59 | 60 | sin_ra_gp = np.sin(ra - ra_gp) 61 | cos_ra_gp = np.cos(ra - ra_gp) 62 | 63 | lcp = np.radians(122.932) 64 | sin_b = (np.sin(de_gp) * sin_dec) \ 65 | + (np.cos(de_gp) * cos_dec * cos_ra_gp) 66 | lcpml = np.arctan2(cos_dec * sin_ra_gp, 67 | (np.cos(de_gp) * sin_dec) \ 68 | - (np.sin(de_gp) * cos_dec * cos_ra_gp)) 69 | glat = np.arcsin(sin_b) 70 | glon = (lcp - lcpml + (2. * np.pi)) % (2. * np.pi) 71 | return np.degrees(glon), np.degrees(glat) 72 | 73 | def phi2lon(phi): return np.degrees(phi) 74 | def lon2phi(lon): return np.radians(lon) 75 | 76 | def theta2lat(theta): return 90. - np.degrees(theta) 77 | def lat2theta(lat): return np.radians(90. - lat) 78 | 79 | def hpx_gal2cel(galhpx): 80 | npix = len(galhpx) 81 | nside = hp.npix2nside(npix) 82 | pix = np.arange(npix) 83 | 84 | ra,dec = pix2ang(nside,pix) 85 | glon,glat = cel2gal(ra,dec) 86 | 87 | return galhpx[ang2pix(nside,glon,glat)] 88 | 89 | def pix2ang(nside, pix): 90 | """ 91 | Return (lon, lat) in degrees instead of (theta, phi) in radians 92 | """ 93 | theta, phi = hp.pix2ang(nside, pix) 94 | lon = phi2lon(phi) 95 | lat = theta2lat(theta) 96 | return lon, lat 97 | 98 | def ang2pix(nside, lon, lat, coord='GAL'): 99 | """ 100 | Input (lon, lat) in degrees instead of (theta, phi) in radians 101 | """ 102 | theta = np.radians(90. - lat) 103 | phi = np.radians(lon) 104 | return hp.ang2pix(nside, theta, phi) 105 | 106 | def angsep(lon1,lat1,lon2,lat2): 107 | """ 108 | Angular separation (deg) between two sky coordinates. 109 | Borrowed from astropy (www.astropy.org) 110 | 111 | Notes 112 | ----- 113 | The angular separation is calculated using the Vincenty formula [1], 114 | which is slighly more complex and computationally expensive than 115 | some alternatives, but is stable at at all distances, including the 116 | poles and antipodes. 117 | 118 | [1] http://en.wikipedia.org/wiki/Great-circle_distance 119 | """ 120 | lon1,lat1 = np.radians([lon1,lat1]) 121 | lon2,lat2 = np.radians([lon2,lat2]) 122 | 123 | sdlon = np.sin(lon2 - lon1) 124 | cdlon = np.cos(lon2 - lon1) 125 | slat1 = np.sin(lat1) 126 | slat2 = np.sin(lat2) 127 | clat1 = np.cos(lat1) 128 | clat2 = np.cos(lat2) 129 | 130 | num1 = clat2 * sdlon 131 | num2 = clat1 * slat2 - slat1 * clat2 * cdlon 132 | denominator = slat1 * slat2 + clat1 * clat2 * cdlon 133 | 134 | return np.degrees(np.arctan2(np.hypot(num1,num2), denominator)) 135 | 136 | class SphericalRotator: 137 | """ 138 | Base class for rotating points on a sphere. 139 | 140 | The input is a fiducial point (deg) which becomes (0, 0) in rotated coordinates. 141 | """ 142 | 143 | def __init__(self, lon_ref, lat_ref, zenithal=False): 144 | self.setReference(lon_ref, lat_ref, zenithal) 145 | 146 | def setReference(self, lon_ref, lat_ref, zenithal=False): 147 | 148 | if zenithal: 149 | phi = (np.pi / 2.) + np.radians(lon_ref) 150 | theta = (np.pi / 2.) - np.radians(lat_ref) 151 | psi = 0. 152 | if not zenithal: 153 | phi = (-np.pi / 2.) + np.radians(lon_ref) 154 | theta = np.radians(lat_ref) 155 | psi = np.radians(90.) # psi = 90 corresponds to (0, 0) psi = -90 corresponds to (180, 0) 156 | 157 | 158 | cos_psi,sin_psi = np.cos(psi),np.sin(psi) 159 | cos_phi,sin_phi = np.cos(phi),np.sin(phi) 160 | cos_theta,sin_theta = np.cos(theta),np.sin(theta) 161 | 162 | self.rotation_matrix = np.matrix([ 163 | [cos_psi * cos_phi - cos_theta * sin_phi * sin_psi, 164 | cos_psi * sin_phi + cos_theta * cos_phi * sin_psi, 165 | sin_psi * sin_theta], 166 | [-sin_psi * cos_phi - cos_theta * sin_phi * cos_psi, 167 | -sin_psi * sin_phi + cos_theta * cos_phi * cos_psi, 168 | cos_psi * sin_theta], 169 | [sin_theta * sin_phi, 170 | -sin_theta * cos_phi, 171 | cos_theta] 172 | ]) 173 | 174 | self.inverted_rotation_matrix = np.linalg.inv(self.rotation_matrix) 175 | 176 | def cartesian(self,lon,lat): 177 | lon = np.radians(lon) 178 | lat = np.radians(lat) 179 | 180 | x = np.cos(lat) * np.cos(lon) 181 | y = np.cos(lat) * np.sin(lon) 182 | z = np.sin(lat) 183 | return np.array([x,y,z]) 184 | 185 | 186 | def rotate(self, lon, lat, invert=False): 187 | vec = self.cartesian(lon,lat) 188 | 189 | if invert: 190 | vec_prime = np.dot(np.array(self.inverted_rotation_matrix), vec) 191 | else: 192 | vec_prime = np.dot(np.array(self.rotation_matrix), vec) 193 | 194 | lon_prime = np.arctan2(vec_prime[1], vec_prime[0]) 195 | lat_prime = np.arcsin(vec_prime[2]) 196 | 197 | return (np.degrees(lon_prime) % 360.), np.degrees(lat_prime) 198 | -------------------------------------------------------------------------------- /skymap/healpix.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Tools for working with healpix. 4 | """ 5 | __author__ = "Alex Drlica-Wagner" 6 | import numpy as np 7 | import healpy as hp 8 | import pandas as pd 9 | 10 | import warnings 11 | warnings.simplefilter("always") 12 | 13 | def masked_array(array,badval=hp.UNSEEN): 14 | if isinstance(array,np.ma.MaskedArray): 15 | return array 16 | mask = ~np.isfinite(array) | np.in1d(array,badval) 17 | return np.ma.MaskedArray(array,mask=mask) 18 | 19 | def check_hpxmap(hpxmap,pixel,nside): 20 | if pixel is None and not hp.isnpixok(hpxmap.shape[-1]): 21 | msg = "'hpxmap' has invalid dimension: %s"%(hpxmap.shape) 22 | raise Exception(msg) 23 | 24 | if pixel is not None and nside is None: 25 | msg = "'nside' must be specified for explicit maps" 26 | raise Exception(msg) 27 | 28 | if pixel is not None and (hpxmap.shape != pixel.shape): 29 | msg = "'hpxmap' and 'pixel' must have same shape" 30 | raise Exception(msg) 31 | 32 | def create_map(hpxmap,pixel,nside,badval=hp.UNSEEN): 33 | """ Create the full map from hpxmap,pixel,nside combo 34 | """ 35 | if pixel is None: return hpxmap 36 | m = badval*np.ones(hp.nside2npix(nside),dtype=hpxmap.dtype) 37 | m[pixel] = hpxmap 38 | return m 39 | 40 | def get_map_range(hpxmap, pixel=None, nside=None, wrap_angle=180): 41 | """ Calculate the longitude and latitude range for a map. """ 42 | check_hpxmap(hpxmap,pixel,nside) 43 | if isinstance(hpxmap,np.ma.MaskedArray): 44 | hpxmap = hpxmap.data 45 | 46 | if pixel is None: 47 | nside = hp.get_nside(hpxmap) 48 | pixel = np.arange(len(hpxmap),dtype=int) 49 | 50 | ipring,=np.where(np.isfinite(hpxmap) & (hpxmap!=hp.UNSEEN)) 51 | theta,phi = hp.pix2ang(nside, pixel[ipring]) 52 | lon = np.mod(np.degrees(phi),360) 53 | lat = 90.0-np.degrees(theta) 54 | 55 | # Small offset to add to make sure we get the whole pixel 56 | eps = np.degrees(hp.max_pixrad(nside)) 57 | 58 | # CHECK ME 59 | hi,=np.where(lon > wrap_angle) 60 | lon[hi] -= 360.0 61 | 62 | lon_min = max(np.nanmin(lon)-eps,wrap_angle-360) 63 | lon_max = min(np.nanmax(lon)+eps,wrap_angle) 64 | lat_min = max(np.nanmin(lat)-eps,-90) 65 | lat_max = min(np.nanmax(lat)+eps,90) 66 | 67 | return (lon_min,lon_max), (lat_min,lat_max) 68 | 69 | def hpx2xy(hpxmap, pixel=None, nside=None, xsize=800, aspect=1.0, 70 | lonra=None, latra=None): 71 | """ Convert a healpix map into x,y pixels and values""" 72 | check_hpxmap(hpxmap,pixel,nside) 73 | 74 | if lonra is None and latra is None: 75 | lonra,latra = get_map_range(hpxmap,pixel,nside) 76 | elif (lonra is None) or (latra is None): 77 | msg = "Both lonra and latra must be specified" 78 | raise Exception(msg) 79 | 80 | lon = np.linspace(lonra[0],lonra[1], xsize) 81 | lat = np.linspace(latra[0],latra[1], int(aspect*xsize)) 82 | lon, lat = np.meshgrid(lon, lat) 83 | 84 | # Calculate the value at the average location for pcolormesh 85 | # ADW: How does this play with RA = 360 boundary? 86 | llon = (lon[1:,1:]+lon[:-1,:-1])/2. 87 | llat = (lat[1:,1:]+lat[:-1,:-1])/2. 88 | 89 | if nside is None: 90 | if isinstance(hpxmap,np.ma.MaskedArray): 91 | nside = hp.get_nside(hpxmap.data) 92 | else: 93 | nside = hp.get_nside(hpxmap) 94 | 95 | # Old version of healpy 96 | try: 97 | pix = hp.ang2pix(nside,llon,llat,lonlat=True) 98 | except TypeError: 99 | pix = hp.ang2pix(nside,np.radians(90-llat),np.radians(llon)) 100 | 101 | if pixel is None: 102 | values = masked_array(hpxmap[pix]) 103 | else: 104 | # Things get fancy here... 105 | # Match the arrays on the pixel index 106 | pixel_df = pd.DataFrame({'pix':pixel,'idx':np.arange(len(pixel))}) 107 | # Pandas warns about type comparison. 108 | # It probably doesn't like `pix.flat`, but it would save space 109 | #pix_df = pd.DataFrame({'pix':pix.flat},dtype=int) 110 | pix_df = pd.DataFrame({'pix':pix.ravel()},dtype=int) 111 | idx = pix_df.merge(pixel_df,on='pix',how='left')['idx'].values 112 | mask = np.isnan(idx) 113 | 114 | # Index the values by the matched index 115 | values = np.nan*np.ones(pix.shape,dtype=hpxmap.dtype) 116 | values[np.where(~mask.reshape(pix.shape))] = hpxmap[idx[~mask].astype(int)] 117 | values = np.ma.array(values,mask=mask) 118 | 119 | return lon,lat,values 120 | 121 | def hpxbin(lon, lat, nside=256): 122 | """ 123 | Create a healpix histogram of the counts. 124 | 125 | Parameters: 126 | ----------- 127 | lon : input longitude (deg) 128 | lat : input latitude (deg) 129 | nside : healpix nside resolution 130 | 131 | Returns: 132 | -------- 133 | hpxmap : healpix map of counts 134 | """ 135 | try: 136 | pix = hp.ang2pix(nside,lon,lat,lonlat=True) 137 | except TypeError: 138 | pix = hp.ang2pix(nside,np.radians(90-lat),np.radians(lon)) 139 | npix = hp.nside2npix(nside) 140 | hpxmap = hp.UNSEEN*np.ones(npix) 141 | idx,cts = np.unique(pix,return_counts=True) 142 | hpxmap[idx] = cts 143 | 144 | return hpxmap 145 | 146 | 147 | def pd_index_pix_in_pixels(pix,pixels): 148 | pixel_df = pd.DataFrame({'pix':pixel,'idx':np.arange(len(pixel))}) 149 | # Pandas warns about type comparison (probably doesn't like `pix.flat`)... 150 | pix_df = pd.DataFrame({'pix':pix.flat},dtype=int) 151 | idx = pix_df.merge(pixel_df,on='pix',how='left')['idx'].values 152 | return idx 153 | 154 | def np_index_pix_in_pixels(pix,pixels): 155 | """ 156 | Find the indices of a set of pixels into another set of pixels 157 | """ 158 | # Are the pixels always sorted? Is it quicker to check? 159 | pixels = np.sort(pixels) 160 | # Assumes that 'pixels' is pre-sorted, otherwise...??? 161 | index = np.searchsorted(pixels,pix) 162 | if np.isscalar(index): 163 | if not np.in1d(pix,pixels).any(): index = np.nan 164 | else: 165 | # Find objects that are outside the pixels 166 | index[~np.in1d(pix,pixels)] = np.nan 167 | return index 168 | 169 | def index_lonlat_in_pixels(lon,lat,pixels,nside): 170 | pix = ang2pix(nside,lon,lat) 171 | return index_pix_in_pixels(pix,pixels) 172 | 173 | def ang2disc(nside, lon, lat, radius, inclusive=False, fact=4, nest=False): 174 | """ 175 | Wrap `query_disc` to use lon, lat, and radius in degrees. 176 | """ 177 | vec = hp.ang2vec(lon,lat,lonlat=True) 178 | return hp.query_disc(nside,vec,np.radians(radius),inclusive,fact,nest) 179 | 180 | if __name__ == "__main__": 181 | import argparse 182 | parser = argparse.ArgumentParser(description=__doc__) 183 | args = parser.parse_args() 184 | -------------------------------------------------------------------------------- /skymap/data/des-round19-poly.txt: -------------------------------------------------------------------------------- 1 | # 2 | # DES round19 footprint 3 | # March 19, 2019 4 | # Eric Neilsen 5 | # 6 | # This is a minor update of round17 to add back some of the southern region of the footprint 7 | # near the LMC that was completed an the end of the survey. 8 | # 9 | # 10 | # DES round17 footprint 11 | # August 30, 2017 12 | # Alex Drlica-Wagner 13 | # 14 | # 15 | # This is a minor update of round13 to remove the southern region of the footprint 16 | # near the LMC that has been phased out of obstac. 17 | # 18 | # 19 | # DES round13 footprint 20 | # August 20, 2013 21 | # Jim Annis 22 | # 23 | # Consisting of the SPT-SZ survey area, the SDSS equatorial area, 24 | # a 3000 sq-degree circle centered at ra,dec= 38.8, -39.5 (r=30.91 deg), 25 | # and the weak lensing poop deck in the East centered at a declination 26 | # corresponding to CTIO zenith, an area optimal for DES weak lensing. 27 | # We attempted to stay in regions where the stellar density was < 7*rho_{sp}, 28 | # where rho_{sp} is the south pole stellar desnity, both as measured by 2MASS J-band star counts. 29 | # We also attempted to stary in regions where the SFD dust map estimates the i-band 30 | # extinction is < 0.15 mags. We did a better job with the stars than with the dust 31 | # as the star density is smooth, whereas the dust can be found in clouds, particularily in the NE 32 | # We estimate the footprint area at 5200 sq-degrees, 33 | # though my current 1-sigma error estimate is 150 sq-degrees 34 | # 35 | # The footprint consists of 567 coordinate pairs. 36 | # For questions of whether a point is inside the footprint and area, 37 | # we recommend ray casting algorithms; your milage may vary. 38 | # Point in polygon algorithms are well studied (think: video games and movies) 39 | # 40 | # With that, we shall consider the footprint complete. 41 | # (Note that a 2014 iteration would natually be called round14.) 42 | # 43 | # typedef struct { 44 | # double ra; 45 | # double dec; 46 | # } COORDINATE; 47 | # 48 | 49 | 23.0 -7.0 50 | 22.0 -7.0 51 | 21.0 -7.0 52 | 20.0 -7.0 53 | 19.0 -7.0 54 | 18.0 -7.0 55 | 17.0 -7.0 56 | 16.0 -7.0 57 | 15.0 -7.0 58 | 14.0 -7.0 59 | 13.0 -7.0 60 | 12.0 -7.0 61 | 11.0 -7.0 62 | 10.0 -7.0 63 | 9.0 -7.0 64 | 8.0 -7.0 65 | 7.0 -7.0 66 | 6.0 -7.0 67 | 5.0 -7.0 68 | 4.0 -7.0 69 | 3.0 -7.0 70 | 2.0 -7.0 71 | 1.0 -7.0 72 | 0.0 -7.0 73 | 0.0 -6.0 74 | 0.0 -5.0 75 | 0.0 -4.0 76 | 0.0 -3.0 77 | 0.0 -2.0 78 | -1.0 -2.0 79 | -2.0 -2.0 80 | -3.0 -2.0 81 | -4.0 -2.0 82 | -5.0 -2.0 83 | -6.0 -2.0 84 | -7.0 -2.0 85 | -8.0 -2.0 86 | -9.0 -2.0 87 | -10.0 -2.0 88 | -11.0 -2.0 89 | -12.0 -2.0 90 | -13.0 -2.0 91 | -14.0 -2.0 92 | -15.0 -2.0 93 | -16.0 -2.0 94 | -17.0 -2.0 95 | -18.0 -2.0 96 | -19.0 -2.0 97 | -20.0 -2.0 98 | -21.0 -2.0 99 | -22.0 -2.0 100 | -23.0 -2.0 101 | -24.0 -2.0 102 | -25.0 -2.0 103 | -26.0 -2.0 104 | -27.0 -2.0 105 | -28.0 -2.0 106 | -29.0 -2.0 107 | -30.0 -2.0 108 | -31.0 -2.0 109 | -32.0 -2.0 110 | -33.0 -2.0 111 | -34.0 -2.0 112 | -35.0 -2.0 113 | -36.0 -2.0 114 | -37.0 -2.0 115 | -38.0 -2.0 116 | -39.0 -2.0 117 | -40.0 -2.0 118 | -41.0 -2.0 119 | -42.0 -2.0 120 | -43.0 -2.0 121 | -43.0 -1.0 122 | -43.0 0.0 123 | -43.0 1.0 124 | -43.0 2.0 125 | -42.0 2.0 126 | -41.0 2.0 127 | -40.0 2.0 128 | -39.0 2.0 129 | -38.0 2.0 130 | -37.0 2.0 131 | -36.0 2.0 132 | -35.0 2.0 133 | -34.0 2.0 134 | -33.0 2.0 135 | -32.0 2.0 136 | -31.0 2.0 137 | -30.0 2.0 138 | -29.0 2.0 139 | -28.0 2.0 140 | -27.0 2.0 141 | -26.0 2.0 142 | -25.0 2.0 143 | -24.0 2.0 144 | -23.0 2.0 145 | -22.0 2.0 146 | -21.0 2.0 147 | -20.0 2.0 148 | -19.0 2.0 149 | -18.0 2.0 150 | -17.0 2.0 151 | -16.0 2.0 152 | -15.0 2.0 153 | -14.0 2.0 154 | -13.0 2.0 155 | -12.0 2.0 156 | -11.0 2.0 157 | -10.0 2.0 158 | -9.0 2.0 159 | -8.0 2.0 160 | -7.0 2.0 161 | -6.0 2.0 162 | -5.0 2.0 163 | -4.0 2.0 164 | -3.0 2.0 165 | -2.0 2.0 166 | -1.0 2.0 167 | 0.0 2.0 168 | 0.0 2.0 169 | 0.0 3.0 170 | 0.0 4.0 171 | 0.0 5.0 172 | 1.0 5.0 173 | 2.0 5.0 174 | 3.0 5.0 175 | 4.0 5.0 176 | 5.0 5.0 177 | 6.0 5.0 178 | 7.0 5.0 179 | 8.0 5.0 180 | 9.0 5.0 181 | 10.0 5.0 182 | 11.0 5.0 183 | 12.0 5.0 184 | 13.0 5.0 185 | 14.0 5.0 186 | 15.0 5.0 187 | 16.0 5.0 188 | 17.0 5.0 189 | 18.0 5.0 190 | 19.0 5.0 191 | 20.0 5.0 192 | 21.0 5.0 193 | 22.0 5.0 194 | 23.0 5.0 195 | 24.0 5.0 196 | 25.0 5.0 197 | 26.0 5.0 198 | 27.0 5.0 199 | 28.0 5.0 200 | 29.0 5.0 201 | 30.0 5.0 202 | 31.0 5.0 203 | 32.0 5.0 204 | 33.0 5.0 205 | 34.0 5.0 206 | 35.0 5.0 207 | 36.0 5.0 208 | 37.0 5.0 209 | 38.0 5.0 210 | 39.0 5.0 211 | 40.0 5.0 212 | 41.0 5.0 213 | 42.0 5.0 214 | 43.0 5.0 215 | 44.0 5.0 216 | 45.0 5.0 217 | 45.0 5.0 218 | 45.0 4.0 219 | 45.0 3.0 220 | 45.0 2.0 221 | 45.0 1.0 222 | 45.0 0.0 223 | 45.0 -1.0 224 | 45.0 -2.0 225 | 45.0 -3.0 226 | 45.0 -4.0 227 | 45.0 -5.0 228 | 45.0 -6.0 229 | 45.0 -7.0 230 | 45.0 -8.0 231 | 45.0 -9.0 232 | 45.835840000000005 -9.06842 233 | 46.36744 -9.145669999999999 234 | 46.89697 -9.22888 235 | 47.42429 -9.3181 236 | 47.94928 -9.41337 237 | 48.47183 -9.51474 238 | 48.99181 -9.62226 239 | 49.50912 -9.73598 240 | 50.02364 -9.855939999999999 241 | 50.53529 -9.98221 242 | 51.04396 -10.11482 243 | 51.54955 -10.25382 244 | 52.05199 -10.39926 245 | 52.55118 -10.55119 246 | 53.047059999999995 -10.70965 247 | 53.53954 -10.87467 248 | 54.02856 -11.0463 249 | 54.51405 -11.22457 250 | 54.99596 -11.40952 251 | 55.474230000000006 -11.601180000000001 252 | 55.948809999999995 -11.79957 253 | 56.41965 -12.004710000000001 254 | 56.88672 -12.21663 255 | 57.34998 -12.43534 256 | 57.80939 -12.660860000000001 257 | 58.26493000000001 -12.893180000000001 258 | 58.71657 -13.132320000000002 259 | 59.16429 -13.37827 260 | 59.60807 -13.631020000000001 261 | 60.0479 -13.89057 262 | 60.48376999999999 -14.156889999999999 263 | 60.91568 -14.42997 264 | 61.3436 -14.70979 265 | 61.76755 -14.996310000000001 266 | 62.18753 -15.2895 267 | 62.60354 -15.589310000000001 268 | 63.01557 -15.89572 269 | 63.42365 -16.208660000000002 270 | 63.827780000000004 -16.52808 271 | 64.22797 -16.85393 272 | 66.0 -18.0 273 | 67.0 -18.0 274 | 68.0 -18.0 275 | 69.0 -18.0 276 | 70.0 -18.0 277 | 71.0 -18.0 278 | 72.0 -18.0 279 | 73.0 -18.0 280 | 74.0 -18.0 281 | 75.0 -18.0 282 | 76.0 -18.0 283 | 77.0 -18.0 284 | 78.0 -18.0 285 | 79.0 -18.0 286 | 80.0 -18.0 287 | 81.0 -18.0 288 | 82.0 -18.0 289 | 83.0 -18.0 290 | 84.0 -18.0 291 | 85.0 -18.0 292 | 86.0 -18.0 293 | 86.66667 -19.0 294 | 87.33333 -20.0 295 | 88.0 -21.0 296 | 88.66667 -22.0 297 | 89.41596 -23.1317 298 | 89.68146 -24.3655 299 | 89.95879000000001 -25.59111 300 | 90.24749 -26.80814 301 | 90.54705 -28.01619 302 | 90.8569 -29.214879999999997 303 | 91.17643000000001 -30.403809999999996 304 | 91.50499 -31.582629999999998 305 | 91.84185 -32.75095 306 | 92.18623000000001 -33.908409999999996 307 | 92.53729 -35.05464 308 | 92.89409 -36.18931 309 | 93.25565 -37.31205 310 | 93.62088 -38.42252 311 | 93.98862 -39.5204 312 | 94.35759 -40.60535 313 | 94.72643000000001 -41.677040000000005 314 | 95.09366999999999 -42.735170000000004 315 | 95.45770999999999 -43.77942 316 | 95.81685 -44.809490000000004 317 | 96.16922 -45.82508 318 | 96.51286 -46.8259 319 | 96.84562 -47.811679999999996 320 | 97.16521 -48.78213 321 | 97.46918000000001 -49.736979999999996 322 | 97.75487 -50.67597 323 | 98.01948 -51.59884 324 | 98.25999 -52.505359999999996 325 | 98.47317 -53.39526 326 | 98.65561 -54.268319999999996 327 | 98.80364 -55.1243 328 | 98.91339 -55.962990000000005 329 | 98.98075 -56.784169999999996 330 | 99.00135999999999 -57.587619999999994 331 | 98.97062 -58.37314 332 | 98.88371 -59.14055 333 | 98.73552 -59.88964 334 | 98.52073 -60.62023000000001 335 | 98.23379 -61.33214 336 | 98.0 -61.5 337 | 97.0 -61.5 338 | 96.0 -61.5 339 | 95.0 -61.5 340 | 94.0 -61.5 341 | 93.0 -61.5 342 | 92.0 -61.5 343 | 91.0 -61.5 344 | 90.0 -61.5 345 | 89.0 -61.5 346 | 88.0 -61.5 347 | 87.0 -61.5 348 | 86.0 -61.5 349 | 85.0 -61.5 350 | 84.0 -61.5 351 | 83.0 -62.0 352 | 78.66667 -63.0 353 | 74.33333 -64.0 354 | 69.1922 -65.62708 355 | 68.293 -65.99135 356 | 67.35218 -66.34555 357 | 66.36917 -66.68914000000001 358 | 65.34355 -66.9 359 | 64.27503 -66.9 360 | 63.1635 -66.9 361 | 62.00905 -66.9 362 | 60.811969999999995 -66.9 363 | 59.5728 -66.9 364 | 58.29235 -66.9 365 | 56.97169 -66.9 366 | 55.6122 -66.9 367 | 54.21558 -66.9 368 | 52.783809999999995 -66.9 369 | 51.31925 -66.9 370 | 49.82454 -66.9 371 | 48.30265 -66.5 372 | 46.75683 -66.5 373 | 45.19062 -66.5 374 | 43.60779 -66.5 375 | 42.0123 -66.5 376 | 40.4083 -66.5 377 | 23.384420000000002 -65.5 378 | 21.9878 -65.5 379 | 20.62831 -65.5 380 | 19.30765 -65.5 381 | 18.0272 -65.5 382 | 16.78803 -65.5 383 | 15.59095 -65.5 384 | 14.4365 -65.5 385 | 13.32497 -65.5 386 | 12.25645 -65.5 387 | 11.230830000000001 -65.5 388 | 10.247819999999999 -65.5 389 | 9.307 -65.2 390 | 8.4078 -65.2 391 | 7.54955 -65.2 392 | 4.0 -65.0 393 | 3.0 -65.0 394 | 2.0 -65.0 395 | 1.0 -65.0 396 | 0.0 -65.0 397 | -1.0 -65.0 398 | -2.0 -65.0 399 | -3.0 -65.0 400 | -4.0 -65.0 401 | -5.0 -65.0 402 | -6.0 -65.0 403 | -7.0 -65.0 404 | -8.0 -65.0 405 | -9.0 -65.0 406 | -10.0 -65.0 407 | -11.0 -65.0 408 | -12.0 -65.0 409 | -13.0 -65.0 410 | -14.0 -65.0 411 | -15.0 -65.0 412 | -16.0 -65.0 413 | -17.0 -65.0 414 | -18.0 -65.0 415 | -19.0 -65.0 416 | -20.0 -65.0 417 | -21.0 -65.0 418 | -22.0 -65.0 419 | -23.0 -65.0 420 | -24.0 -65.0 421 | -25.0 -65.0 422 | -26.0 -65.0 423 | -27.0 -65.0 424 | -28.0 -65.0 425 | -29.0 -65.0 426 | -30.0 -65.0 427 | -31.0 -65.0 428 | -32.0 -65.0 429 | -33.0 -65.0 430 | -34.0 -65.0 431 | -35.0 -65.0 432 | -36.0 -65.0 433 | -37.0 -65.0 434 | -38.0 -65.0 435 | -39.0 -65.0 436 | -40.0 -65.0 437 | -41.0 -65.0 438 | -42.0 -65.0 439 | -43.0 -65.0 440 | -44.0 -65.0 441 | -45.0 -65.0 442 | -46.0 -65.0 443 | -47.0 -65.0 444 | -48.0 -65.0 445 | -49.0 -65.0 446 | -50.0 -65.0 447 | -51.0 -65.0 448 | -52.0 -65.0 449 | -53.0 -65.0 450 | -54.0 -65.0 451 | -55.0 -65.0 452 | -56.0 -65.0 453 | -57.0 -65.0 454 | -56.8 -64.0 455 | -56.6 -63.0 456 | -56.4 -62.0 457 | -56.2 -61.0 458 | -56.0 -60.0 459 | -60.0 -60.0 460 | -60.0 -55.2685 461 | -60.0 -52.4931 462 | -59.9266 -50.9207 463 | -58.355 -50.0 464 | -56.6089 -50.0 465 | -54.9615 -50.0 466 | -54.8 -48.0 467 | -54.7 -47.0 468 | -54.6 -46.0 469 | -54.5 -45.0 470 | -54.4 -44.0 471 | -54.3 -43.0 472 | -54.2 -42.0 473 | -54.1 -41.0 474 | -54.0 -40.0 475 | -53.0 -40.0 476 | -52.0 -40.0 477 | -51.0 -40.0 478 | -50.0 -40.0 479 | -49.0 -40.0 480 | -48.0 -40.0 481 | -47.0 -40.0 482 | -46.0 -40.0 483 | -45.0 -40.0 484 | -44.0 -40.0 485 | -43.0 -40.0 486 | -42.0 -40.0 487 | -41.0 -40.0 488 | -40.0 -40.0 489 | -39.0 -40.0 490 | -38.0 -40.0 491 | -37.0 -40.0 492 | -36.0 -40.0 493 | -35.0 -40.0 494 | -34.0 -40.0 495 | -33.0 -40.0 496 | -32.0 -40.0 497 | -31.0 -40.0 498 | -30.0 -40.0 499 | -29.0 -40.0 500 | -28.0 -40.0 501 | -27.0 -40.0 502 | -26.0 -40.0 503 | -25.0 -40.0 504 | -24.0 -40.0 505 | -23.0 -40.0 506 | -22.0 -40.0 507 | -21.0 -40.0 508 | -20.0 -40.0 509 | -19.0 -40.0 510 | -18.0 -40.0 511 | -17.0 -40.0 512 | -16.0 -40.0 513 | -15.0 -40.0 514 | -14.0 -40.0 515 | -13.0 -40.0 516 | -12.0 -40.0 517 | -11.0 -40.0 518 | -10.0 -40.0 519 | -9.0 -40.0 520 | -8.0 -40.0 521 | -7.0 -40.0 522 | -6.0 -40.0 523 | -5.0 -40.0 524 | -4.0 -40.0 525 | -3.0 -40.0 526 | -1.4721899999999999 -38.64048 527 | -1.27518 -38.12814 528 | -1.07231 -37.61674 529 | -0.8637600000000001 -37.1064 530 | -0.6497 -36.597229999999996 531 | -0.43028 -36.08933 532 | -0.20564000000000002 -35.58282 533 | 0.024059999999999998 -35.07782 534 | 0.25871 -34.57444 535 | 0.49818 -34.0728 536 | 0.74235 -33.57301 537 | 0.99113 -33.0752 538 | 1.24441 -32.5795 539 | 1.50209 -32.086009999999995 540 | 1.7641 -31.59488 541 | 2.03036 -31.106209999999997 542 | 2.30079 -30.62015 543 | 2.57532 -30.136809999999997 544 | 2.85391 -29.65632 545 | 3.1364799999999997 -29.17881 546 | 3.423 -28.70441 547 | 3.7134199999999997 -28.23325 548 | 4.0077 -27.765459999999997 549 | 4.30581 -27.30116 550 | 4.60772 -26.84048 551 | 4.9134 -26.38355 552 | 5.22284 -25.93051 553 | 5.53601 -25.48147 554 | 5.8529 -25.03656 555 | 6.17351 -24.59591 556 | 6.49782 -24.15964 557 | 6.8258399999999995 -23.72788 558 | 7.15756 -23.30074 559 | 7.49299 -22.87835 560 | 7.83212 -22.460810000000002 561 | 8.17498 -22.04826 562 | 8.52155 -21.6408 563 | 8.87186 -21.23855 564 | 9.22592 -20.8416 565 | 9.583739999999999 -20.45008 566 | 9.94533 -20.06407 567 | 10.3107 -19.68369 568 | 10.679889999999999 -19.30903 569 | 11.05289 -18.940179999999998 570 | 11.429730000000001 -18.57723 571 | 11.81042 -18.220270000000003 572 | 12.194980000000001 -17.86938 573 | 12.58343 -17.52465 574 | 12.975769999999999 -17.186139999999998 575 | 13.372029999999999 -16.85393 576 | 13.77222 -16.52808 577 | 14.17635 -16.208660000000002 578 | 14.58443 -15.89572 579 | 14.99646 -15.589310000000001 580 | 15.41247 -15.2895 581 | 15.83245 -14.996310000000001 582 | 16.2564 -14.70979 583 | 16.68432 -14.42997 584 | 17.116229999999998 -14.156889999999999 585 | 17.5521 -13.89057 586 | 17.99193 -13.631020000000001 587 | 18.43571 -13.37827 588 | 18.88343 -13.132320000000002 589 | 19.33507 -12.893180000000001 590 | 19.79061 -12.660860000000001 591 | 20.250020000000003 -12.43534 592 | 20.713279999999997 -12.21663 593 | 21.18035 -12.004710000000001 594 | 21.65119 -11.79957 595 | 22.125770000000003 -11.601180000000001 596 | 22.604039999999998 -11.40952 597 | 23.08595 -11.22457 598 | 23.0 -10.0 599 | 23.0 -9.0 600 | 23.0 -8.0 601 | 23.0 -7.0 602 | -------------------------------------------------------------------------------- /skymap/data/subaru_hsc_ccds.dat: -------------------------------------------------------------------------------- 1 | {1: [[0.39653516, -0.6286637 ], [0.3933348 , -0.7159011 ], 2 | [0.20659168, -0.72131836], [0.20817918, -0.633192 ]], 3 | 2: [[0.19435775, -0.6334257 ], [0.19288903, -0.7215945 ], 4 | [0.00318626, -0.72341704], [0.00318298, -0.6349506 ]], 5 | 3: [[-0.01058951, -0.63500184], [-0.01050191, -0.7234671 ], 6 | [-0.20018217, -0.7217893 ], [-0.2017484 , -0.6336263 ]], 7 | 4: [[-0.2155426 , -0.6333948 ], [-0.21385345, -0.72151417], 8 | [-0.40049192, -0.7162459 ], [-0.40381992, -0.6290791 ]], 9 | 5: [[0.596407 , -0.5289796 ], [0.5921391 , -0.61699605], 10 | [0.40998155, -0.62488174], [0.41268745, -0.53542227]], 11 | 6: [[0.3991729 , -0.5358151 ], [0.3966113 , -0.6253528 ], 12 | [0.2081988 , -0.62991977], [0.20944336, -0.53956157]], 13 | 7: [[0.1956144 , -0.53969115], [0.194475 , -0.6300891 ], 14 | [0.00325116, -0.63169044], [0.00319112, -0.5410236 ]], 15 | 8: [[-0.01065033, -0.54108304], [-0.0106128 , -0.6317489 ], 16 | [-0.20182124, -0.6302995 ], [-0.20306481, -0.5398966 ]], 17 | 9: [[-0.2169961 , -0.5397481], [-0.21558514, -0.6301129], 18 | [-0.40391544, -0.6258722], [-0.406651 , -0.5363268]], 19 | 10: [[-0.42014495, -0.5358879 ], [-0.41727048, -0.6253555 ], 20 | [-0.59928924, -0.61769295], [-0.60377026, -0.5297272 ]], 21 | 11: [[0.59994614, -0.4357169 ], [0.5965233 , -0.52571046], 22 | [0.4127496 , -0.53213036], [0.41488957, -0.44082332]], 23 | 12: [[0.40138173, -0.4411675 ], [0.39924935, -0.5325474 ], 24 | [0.20947972, -0.53606015], [0.21056549, -0.44394314]], 25 | 13: [[0.19641912, -0.4441261 ], [0.1955317 , -0.536276 ], 26 | [0.00306734, -0.5376103 ], [0.00298741, -0.44522986]], 27 | 14: [[-0.01081574, -0.44511062], [-0.0106765 , -0.5374924 ], 28 | [-0.20313069, -0.5365235 ], [-0.20424464, -0.4443889 ]], 29 | 15: [[-0.21810018, -0.4443612 ], [-0.21702826, -0.5364582 ], 30 | [-0.40673062, -0.5328943 ], [-0.4088565 , -0.44152635]], 31 | 16: [[-0.42249328, -0.44125837], [-0.42020166, -0.5325565 ], 32 | [-0.60388476, -0.5263736 ], [-0.60745484, -0.43639037]], 33 | 17: [[0.5930071 , -0.34094107], [0.590453 , -0.4325684 ], 34 | [0.4049789 , -0.43758067], [0.40654802, -0.34479138]], 35 | 18: [[0.39271173, -0.3449524 ], [0.39119214, -0.43780714], 36 | [0.20013769, -0.44064817], [0.20085649, -0.3471544 ]], 37 | 19: [[ 0.18696783, -0.34725985], [ 0.18630344, -0.4407827 ], 38 | [-0.00721937, -0.44172764], [-0.00731574, -0.34802225]], 39 | 20: [[-0.01085914, -0.34802547], [-0.01079593, -0.44173038], 40 | [-0.20425797, -0.44088086], [-0.20509008, -0.34740487]], 41 | 21: [[-0.219112 , -0.34727812], [-0.21820083, -0.4407226 ], 42 | [-0.40898946, -0.43805203], [-0.41071326, -0.34527358]], 43 | 22: [[-0.42422482, -0.3452616 ], [-0.42253935, -0.4379713 ], 44 | [-0.60755 , -0.43291196], [-0.610216 , -0.3413842 ]], 45 | 23: [[0.786095 , -0.240438 ], [0.7832508 , -0.33141387], 46 | [0.60608435, -0.33716977], [0.6080235 , -0.24449083]], 47 | 24: [[0.5948611 , -0.24489623], [0.59293437, -0.33767167], 48 | [0.40644214, -0.34131888], [0.40765586, -0.24747089]], 49 | 25: [[0.39387655, -0.24769679], [0.3927112 , -0.34160316], 50 | [0.20083123, -0.3436553 ], [0.20141266, -0.24915601]], 51 | 26: [[ 0.18735372, -0.24927354], [ 0.18682835, -0.34379965], 52 | [-0.00748059, -0.34445837], [-0.00752403, -0.24976104]], 53 | 27: [[-0.01092159, -0.24983573], [-0.01083775, -0.3445321 ], 54 | [-0.20509322, -0.34397992], [-0.20575202, -0.24949548]], 55 | 28: [[-0.21981859, -0.24944702], [-0.21915723, -0.34390122], 56 | [-0.4107844 , -0.3418545 ], [-0.4120413 , -0.248019 ]], 57 | 29: [[-0.4256771 , -0.24805526], [-0.42441636, -0.34182847], 58 | [-0.6104321 , -0.33804786], [-0.6124016 , -0.24536762]], 59 | 30: [[-0.6256516 , -0.24508241], [-0.62355536, -0.33766437], 60 | [-0.7999512 , -0.33188766], [-0.8029974 , -0.2410833 ]], 61 | 31: [[0.78806853, -0.1453105 ], [0.78617257, -0.23718324], 62 | [0.60807484, -0.24111217], [0.60936517, -0.1476458 ]], 63 | 32: [[0.5961978 , -0.14774743], [0.59500307, -0.24130432], 64 | [0.40777662, -0.243992 ], [0.40850693, -0.14942122]], 65 | 33: [[0.39469665, -0.14942437], [0.3939457 , -0.24405241], 66 | [0.20146354, -0.24553117], [0.20182985, -0.15033732]], 67 | 34: [[ 0.1877767 , -0.15060717], [ 0.18740462, -0.24582618], 68 | [-0.00749022, -0.24625196], [-0.00750092, -0.15086448]], 69 | 35: [[-0.01099489, -0.15088506], [-0.01091903, -0.24627213], 70 | [-0.20576747, -0.24593998], [-0.20622899, -0.15075026]], 71 | 36: [[-0.22030911, -0.15063784], [-0.21979646, -0.24579991], 72 | [-0.41203752, -0.244523 ], [-0.41294262, -0.1499496 ]], 73 | 37: [[-0.4266116 , -0.14991401], [-0.42571503, -0.24442963], 74 | [-0.61245966, -0.2419175 ], [-0.61381775, -0.14843935]], 75 | 38: [[-0.627122 , -0.14824906], [-0.6257135 , -0.24163282], 76 | [-0.80308825, -0.23771267], [-0.80512255, -0.14598683]], 77 | 39: [[0.7890425 , -0.04946193], [0.7881232 , -0.14185274], 78 | [0.6094022 , -0.14418556], [0.61001664, -0.05026414]], 79 | 40: [[0.59673274, -0.05021773], [0.5961678 , -0.14422804], 80 | [0.40846184, -0.14586188], [0.40879524, -0.05086742]], 81 | 41: [[0.39503747, -0.05091225], [0.39469466, -0.14596134], 82 | [0.20181681, -0.14690644], [0.20196316, -0.05130429]], 83 | 42: [[ 0.18784323, -0.05135069], [ 0.1876934 , -0.14697874], 84 | [-0.00759576, -0.14731295], [-0.00764417, -0.05151681]], 85 | 43: [[-0.01107113, -0.05165216], [-0.01104361, -0.14744776], 86 | [-0.20628822, -0.14723514], [-0.20651355, -0.05162815]], 87 | 44: [[-0.2205977 , -0.05158741], [-0.22036591, -0.14716712], 88 | [-0.41301036, -0.14635243], [-0.4134432 , -0.05134647]], 89 | 45: [[-0.42723212, -0.0514477 ], [-0.42677277, -0.14639708], 90 | [-0.6139875 , -0.14491467], [-0.61468214, -0.05097564]], 91 | 46: [[-0.6278933, -0.05095592], [-0.6271644, -0.1448039 ], 92 | [-0.8051827, -0.14256199], [-0.8062255, -0.05030048]], 93 | 47: [[0.7890551 , 0.04655813], [0.7890767 , -0.04600133], 94 | [0.610046 , -0.04676561], [0.61001784, 0.04730344]], 95 | 48: [[0.5967424 , 0.04742928], [0.5967502 , -0.04672796], 96 | [0.40880877, -0.04725082], [0.40879288, 0.04788421]], 97 | 49: [[0.39506054, 0.04778962], [0.39509335, -0.04739944], 98 | [0.20201612, -0.04776512], [0.20197059, 0.04797421]], 99 | 50: [[ 0.18789275, 0.04795766], [ 0.18792096, -0.04780744], 100 | [-0.00756996, -0.04795993], [-0.00761183, 0.04797373]], 101 | 51: [[-0.01119275, 0.04792992], [-0.01122409, -0.04800359], 102 | [-0.20666964, -0.04787947], [-0.20664832, 0.04786716]], 103 | 52: [[-0.22061959, 0.04759191], [-0.22065048, -0.0481277 ], 104 | [-0.41349918, -0.04779455], [-0.4134829 , 0.04735209]], 105 | 53: [[-0.42738143, 0.04723708], [-0.42727417, -0.04785307], 106 | [-0.6147273 , -0.04753551], [-0.614851 , 0.04654744]], 107 | 54: [[-0.627969 , 0.04649482], [-0.62789685, -0.04749819], 108 | [-0.8062357 , -0.04687394], [-0.8063151 , 0.04556149]], 109 | 55: [[0.7881268 , 0.14234269], [0.78908527, 0.04995008], 110 | [0.6100562 , 0.05073136], [0.6093873 , 0.14464872]], 111 | 56: [[0.59606344, 0.14487828], [0.59673935, 0.05087139], 112 | [0.4087941 , 0.05124411], [0.40832996, 0.14624178]], 113 | 57: [[0.39455637, 0.14632662], [0.39496338, 0.05127415], 114 | [0.20187473, 0.05148639], [0.20163895, 0.14709382]], 115 | 58: [[ 0.18769725, 0.14719042], [ 0.18797047, 0.05155748], 116 | [-0.00753058, 0.05144904], [-0.0076332 , 0.14725138]], 117 | 59: [[-0.01120548, 0.1472782 ], [-0.01116513, 0.05147607], 118 | [-0.20661792, 0.05124651], [-0.2064813 , 0.14685915]], 119 | 60: [[-0.22058876, 0.14677204], [-0.22072569, 0.051187 ], 120 | [-0.4135843 , 0.05071937], [-0.41327423, 0.14572206]], 121 | 61: [[-0.42700168, 0.14557202], [-0.42733416, 0.05062617], 122 | [-0.6148018 , 0.04996723], [-0.614268 , 0.14388938]], 123 | 62: [[-0.6274645 , 0.14381862], [-0.62803936, 0.04998835], 124 | [-0.8063752 , 0.04900107], [-0.8054979 , 0.14126268]], 125 | 63: [[0.786191 , 0.23756164], [0.7880432 , 0.14567508], 126 | [0.60931635, 0.1481464 ], [0.60805357, 0.24160479]], 127 | 64: [[0.59480244, 0.24189524], [0.596058 , 0.14834437], 128 | [0.40833694, 0.14984454], [0.4075243 , 0.24441732]], 129 | 65: [[0.39372084, 0.24452884], [0.39452094, 0.14989918], 130 | [0.20161332, 0.15066405], [0.20117348, 0.24586211]], 131 | 66: [[ 0.18719423, 0.24590063], [ 0.18759373, 0.15067619], 132 | [-0.00772771, 0.15085118], [-0.00777209, 0.24624734]], 133 | 67: [[-0.01127098, 0.24622531], [-0.0112296 , 0.15082923], 134 | [-0.2064953 , 0.15038407], [-0.20617384, 0.24558587]], 135 | 68: [[-0.22028841, 0.24548855], [-0.22062339, 0.15031517], 136 | [-0.4132982 , 0.14922357], [-0.41259888, 0.24379796]], 137 | 69: [[-0.42618212, 0.2436917 ], [-0.42693284, 0.14917573], 138 | [-0.6141888 , 0.1474636 ], [-0.6130055 , 0.24092123]], 139 | 70: [[-0.6262375 , 0.24063225], [-0.6274157 , 0.14727034], 140 | [-0.805435 , 0.14452976], [-0.80363375, 0.2362719 ]], 141 | 71: [[0.78318316, 0.33219793], [0.7861264 , 0.24117684], 142 | [0.6080244 , 0.24502882], [0.6059658 , 0.3377044 ]], 143 | 72: [[0.59282434, 0.3381156 ], [0.5947374 , 0.24534535], 144 | [0.40747988, 0.24790156], [0.4062568 , 0.34174582]], 145 | 73: [[0.39255214, 0.3418538 ], [0.3937232 , 0.24794973], 146 | [0.20119289, 0.24934877], [0.20058171, 0.34384564]], 147 | 74: [[ 0.18669625, 0.34404936], [ 0.18724556, 0.24952641], 148 | [-0.00770329, 0.24994184], [-0.00771168, 0.34464335]], 149 | 75: [[-0.01133302, 0.34444523], [-0.01131732, 0.2497422 ], 150 | [-0.2062029 , 0.24912861], [-0.20566931, 0.34363148]], 151 | 76: [[-0.21969399, 0.34350815], [-0.22025867, 0.24903454], 152 | [-0.41255167, 0.2473621 ], [-0.41142106, 0.3412123 ]], 153 | 77: [[-0.42508766, 0.34101894], [-0.42623138, 0.24723102], 154 | [-0.6130321 , 0.24434912], [-0.6112027 , 0.33702335]], 155 | 78: [[-0.62427455, 0.33666968], [-0.62619114, 0.24409506], 156 | [-0.80355537, 0.23975211], [-0.80069065, 0.33060735]], 157 | 79: [[0.5902297 , 0.43306217], [0.59277916, 0.34142876], 158 | [0.40624014, 0.34523976], [0.40465242, 0.4380253 ]], 159 | 80: [[0.39086297, 0.43817973], [0.39241603, 0.34532836], 160 | [0.20046823, 0.34741038], [0.19969128, 0.44089317]], 161 | 81: [[ 0.18578507, 0.4409632 ], [ 0.18656161, 0.34745032], 162 | [-0.00782395, 0.34796417], [-0.00786918, 0.4416681 ]], 163 | 82: [[-0.01145274, 0.4417453 ], [-0.01143229, 0.3480425 ], 164 | [-0.2057436 , 0.34719202], [-0.20502253, 0.4406862 ]], 165 | 83: [[-0.21882604, 0.44050583], [-0.21963087, 0.34704143], 166 | [-0.4113327 , 0.34477153], [-0.40974274, 0.4375749 ]], 167 | 84: [[-0.4233349 , 0.43717465], [-0.42497793, 0.3444356 ], 168 | [-0.6110629 , 0.340494 ], [-0.6084572 , 0.4320336 ]], 169 | 85: [[0.58663684, 0.5265689 ], [0.5899542 , 0.43647078], 170 | [0.40441185, 0.44147992], [0.40235135, 0.53284734]], 171 | 86: [[0.38878685, 0.53306204], [0.39080992, 0.44162214], 172 | [0.19967209, 0.44433028], [0.19866465, 0.53646153]], 173 | 87: [[ 0.18471973, 0.5366242 ], [ 0.18568972, 0.44446078], 174 | [-0.00793361, 0.44518444], [-0.00796775, 0.5375552 ]], 175 | 88: [[-0.02171836, 0.5376406 ], [-0.02170023, 0.44527283], 176 | [-0.21517174, 0.44400027], [-0.21423994, 0.5361201 ]], 177 | 89: [[-0.22815824, 0.5359842 ], [-0.22917308, 0.44390053], 178 | [-0.4198486 , 0.4406958 ], [-0.4177959 , 0.53203136]], 179 | 90: [[-0.43126342, 0.5316725], [-0.43342173, 0.4404109], 180 | [-0.6181123 , 0.4350156], [-0.6146718 , 0.524913 ]], 181 | 91: [[0.5821666 , 0.61799806], [0.586401 , 0.5299079 ], 182 | [0.40216777, 0.536108 ], [0.39950565, 0.6256454 ]], 183 | 92: [[0.38613245, 0.626079 ], [0.3886404 , 0.536465 ], 184 | [0.19855915, 0.53995764], [0.19733958, 0.63035154]], 185 | 93: [[ 0.1835389 , 0.6304008 ], [ 0.18472522, 0.5399676 ], 186 | [-0.00792375, 0.54092944], [-0.00794346, 0.6315906 ]], 187 | 94: [[-0.0217507 , 0.6316435 ], [-0.02176725, 0.540986 ], 188 | [-0.21424939, 0.53948385], [-0.21304898, 0.6298554 ]], 189 | 95: [[-0.22684711, 0.6296107], [-0.22816606, 0.5392787], 190 | [-0.41775876, 0.5353595], [-0.41512427, 0.6248386]], 191 | 96: [[-0.4284478 , 0.62437946], [-0.43119088, 0.5349849 ], 192 | [-0.61454475, 0.52819747], [-0.61020815, 0.6160262 ]], 193 | 97: [[0.3828616 , 0.71665126], [0.38604003, 0.62938267], 194 | [0.19730288, 0.633571 ], [0.19572645, 0.72175986]], 195 | 98: [[ 0.18201634, 0.72199386], [ 0.18347773, 0.6337638 ], 196 | [-0.007956 , 0.6349651 ], [-0.00797608, 0.72345245]], 197 | 99: [[-0.021709 , 0.7234718 ], [-0.02171942, 0.63498914], 198 | [-0.2129696 , 0.6331431 ], [-0.21149884, 0.72127825]], 199 | 100: [[-0.22517627, 0.72111464], [-0.22675106, 0.633031 ], 200 | [-0.41497684, 0.6281084 ], [-0.41177505, 0.7151825 ]], 201 | 101: [[0.69412595, -0.33961084], [0.68659335, -0.5228873 ], 202 | [0.5997196 , -0.5272329 ], [0.6059368 , -0.34220907]], 203 | 102: [[-0.6234447 , -0.34269935], [-0.6168044 , -0.52751166], 204 | [-0.70331305, -0.5230921 ], [-0.71133554, -0.34011313]], 205 | 103: [[0.6864978 , 0.52349395], [0.6940297 , 0.34015313], 206 | [0.6057903 , 0.34279728], [0.59957427, 0.52784353]], 207 | 104: [[-0.61780757, 0.52644145], [-0.62414753, 0.3416074 ], 208 | [-0.712048 , 0.33888832], [-0.7043382 , 0.5219157 ]]} 209 | -------------------------------------------------------------------------------- /skymap/data/ccd_corners_xy_fill.dat: -------------------------------------------------------------------------------- 1 | # We need some documentation for this file. 2 | # Did it come from Felipe? 3 | {1: [[-0.45778384629488372, 0.98410157378127883], 4 | [-0.45828909318446914, 0.83476848057903796], 5 | [-0.15912774420066531, 0.83445513530000281], 6 | [-0.15868302805568274, 0.98362578080929597]], 7 | 3: [[0.16320657012750425, 0.98300684547545536], 8 | [0.16289957974452132, 0.83384248837987918], 9 | [0.46203365672761143, 0.83282590039447491], 10 | [0.46228868774584231, 0.98214701477337762]], 11 | 4: [[-0.61347351269140304, 0.82016562358851464], 12 | [-0.61407794542401273, 0.67080363376837349], 13 | [-0.31501649655480596, 0.67060804315846712], 14 | [-0.31444329463079218, 0.81987264248047043]], 15 | 5: [[-0.30312266855018838, 0.81991657890076119], 16 | [-0.30362590145102258, 0.67065903838575802], 17 | [-0.0041470197361652365, 0.6703237334414287], 18 | [-0.0038271138522912081, 0.8195727248288559]], 19 | 6: [[0.0075607422638477376, 0.8195127203899919], 20 | [0.0071396991103752083, 0.67026636287353902], 21 | [0.30660428848991955, 0.66931652084671844], 22 | [0.30685154579798229, 0.81857385913555736]], 23 | 7: [[0.31804576310285759, 0.81854413121146863], 24 | [0.31786866593594615, 0.66928583892379145], 25 | [0.6168904962397378, 0.66818669850477408], 26 | [0.61703403282415648, 0.81752758941319781]], 27 | 8: [[-0.76911405892376583, 0.65595059672885969], 28 | [-0.76964727006834932, 0.50649477127732434], 29 | [-0.47083157914063706, 0.5064661302602157], 30 | [-0.47026561551723062, 0.65591044243943519]], 31 | 9: [[-0.45892424088841871, 0.6560528203245054], 32 | [-0.45963156196823723, 0.50661436291472828], 33 | [-0.1601777297719704, 0.50612531749390421], 34 | [-0.15961709643592034, 0.65560963382883419]], 35 | 10: [[-0.14836936418268282, 0.65558197450339517], 36 | [-0.14881886348659853, 0.5060961304067455], 37 | [0.15092656460772319, 0.50549178165261877], 38 | [0.15119317715346964, 0.65497485784171161]], 39 | 11: [[0.16245162805990651, 0.65501675037789819], 40 | [0.1621473881137159, 0.50553522842592791], 41 | [0.46157866235063871, 0.5045156350711133], 42 | [0.4617355387348378, 0.65394881531128357]], 43 | 12: [[0.47313319894186434, 0.65387533574627332], 44 | [0.47295024417396553, 0.5044362417815007], 45 | [0.77173056378769, 0.50321421728876303], 46 | [0.77193371556416746, 0.65264994547178878]], 47 | 13: [[-0.9247479065777563, 0.49178251052981947], 48 | [-0.92526337475201381, 0.34224590894852225], 49 | [-0.62671469965411875, 0.34196674163875534], 50 | [-0.62609642566972268, 0.49154941272951774]], 51 | 14: [[-0.61493519806383956, 0.49178900613772247], 52 | [-0.61556603955480893, 0.34220153984212914], 53 | [-0.31633494870089751, 0.34185855892634642], 54 | [-0.31578938348532137, 0.49155294501944791]], 55 | 15: [[-0.30438214565242622, 0.49165829733845318], 56 | [-0.30489357210910301, 0.34195968538011301], 57 | [-0.0050637838972655081, 0.34146338579900654], 58 | [-0.0046944848708372249, 0.49120499715853744]], 59 | 16: [[0.0066389799983192594, 0.49091993331747863], 60 | [0.0062978510147855089, 0.34118150397720481], 61 | [0.30611392550609029, 0.34049339992497429], 62 | [0.3063166095368095, 0.49018253104625331]], 63 | 17: [[0.31770076139879749, 0.49031819098711471], 64 | [0.31740945906980528, 0.34063619629053288], 65 | [0.61661039993470368, 0.33955181282154923], 66 | [0.61680965911639651, 0.48911973368462708]], 67 | 18: [[0.62825150125011053, 0.48898594787231398], 68 | [0.62815626212652431, 0.33940972120973339], 69 | [0.92665605608196522, 0.33849898261716677], 70 | [0.92684535261925982, 0.48801653297014619]], 71 | 19: [[-0.92519669615686739, 0.32765941297848439], 72 | [-0.92566797178916882, 0.17807999493665891], 73 | [-0.62716670981126665, 0.17772644842636764], 74 | [-0.62666265363759643, 0.32744984485323009]], 75 | 20: [[-0.61555269723706019, 0.32726744585400647], 76 | [-0.61612096148295992, 0.17753882333144175], 77 | [-0.31681933400392587, 0.17703148216014852], 78 | [-0.31631570858479136, 0.32689789173202283]], 79 | 21: [[-0.30498768242183344, 0.32709211559629853], 80 | [-0.30545382516473368, 0.17722182938772127], 81 | [-0.0055262183242535236, 0.17666668742063502], 82 | [-0.0051497532684346408, 0.32659040068256051]], 83 | 22: [[0.0062656437172269137, 0.32666429516759182], 84 | [0.0058358272986235834, 0.17673960675235398], 85 | [0.30575291231457896, 0.17593851947425895], 86 | [0.3060911775496401, 0.32580427220061747]], 87 | 23: [[0.31762181068526635, 0.3257767472303128], 88 | [0.31731190487342575, 0.17590723764771593], 89 | [0.61657923082949362, 0.17503909134826262], 90 | [0.61682383392458418, 0.32475729854971652]], 91 | 24: [[0.62801268463152204, 0.32470903978125226], 92 | [0.62777512121615964, 0.17499753847361008], 93 | [0.92622717146663414, 0.17410367050236911], 94 | [0.92650515091061458, 0.32366721440314888]], 95 | 25: [[-1.080907885590376, 0.16329459202122754], 96 | [-1.0812769725861335, 0.013722267402831811], 97 | [-0.78281492184816115, 0.013174404677384989], 98 | [-0.78240677469695774, 0.16288745857902417]], 99 | 26: [[-0.77109218348773412, 0.16304710591953839], 100 | [-0.77153935782481142, 0.013336022506021564], 101 | [-0.47266454440618161, 0.012721006658966442], 102 | [-0.4722324684063271, 0.16261825583752304]], 103 | 27: [[-0.46085434526821589, 0.16245969657629547], 104 | [-0.46131141669251952, 0.012555581532072436], 105 | [-0.16159242006769226, 0.011881916007312605], 106 | [-0.16116632967277425, 0.16189241442980817]], 107 | 28: [[-0.14962873817821881, 0.16200814095546656], 108 | [-0.14998102258246448, 0.011998500791550681], 109 | [0.1500644088356651, 0.011462390534469666], 110 | [0.15038579390286622, 0.16147265036960323]], 111 | 29: [[0.16153183796215945, 0.16120575527817693], 112 | [0.16120138762185998, 0.011207926588418668], 113 | [0.46089231346183723, 0.01064190926903138], 114 | [0.46118947677671884, 0.1605240672114806]], 115 | 30: [[0.4727638135958292, 0.16047371274774483], 116 | [0.47245272988857695, 0.010588938658497844], 117 | [0.77128243236585425, 0.0099886690236073734], 118 | [0.77158053454724862, 0.15968283725334934]], 119 | # 31: [[1.080907885590376, 0.16329459202122754], 120 | # [1.0812769725861335, 0.013722267402831811], 121 | # [0.78281492184816115, 0.013174404677384989], 122 | # [0.78240677469695774, 0.16288745857902417]], 123 | # Top half of CCD 31 124 | 31: [[1.080907885590376, 0.16329459202122754], 125 | [1.0812769725861335, 0.07478616230919787], 126 | [0.78281492184816115, 0.0748565269508196], 127 | [0.78240677469695774, 0.16288745857902417]], 128 | 32: [[-1.0814387166262027, -0.00095729634957476904], 129 | [-1.0818904231692548, -0.15053098565295023], 130 | [-0.78337004214235606, -0.1514139266995429], 131 | [-0.78296800824364632, -0.0017091486376906446]], 132 | 33: [[-0.77164728022211482, -0.0015855344611188774], 133 | [-0.77199457677770267, -0.15129721673181143], 134 | [-0.47313024786510288, -0.1521388542379904], 135 | [-0.47277183278113483, -0.0022430834586511235]], 136 | 34: [[-0.46145284114237201, -0.0022991110472016254], 137 | [-0.46175507329089377, -0.15219938807851777], 138 | [-0.16206249359175512, -0.15285060972710696], 139 | [-0.16173816998519114, -0.0028447451787994796]], 140 | 35: [[-0.1503366350886034, -0.0028893487273140956], 141 | [-0.15069961414184246, -0.15289666321844467], 142 | [0.14931934728079099, -0.15350680371477099], 143 | [0.14970756088359291, -0.0035043565445660313]], 144 | 36: [[0.16084660895398312, -0.0037197839501672525], 145 | [0.16056849886636695, -0.15372677041108174], 146 | [0.46024256730024971, -0.15399721105089353], 147 | [0.46054429232367788, -0.0041090713336336395]], 148 | 37: [[0.4720265648369783, -0.00414408945366407], 149 | [0.47161671051683279, -0.15403033054041806], 150 | [0.77044535537969583, -0.1544473837386815], 151 | [0.77085956282795409, -0.0047517521837332826]], 152 | 38: [[0.78230119009281385, -0.0048519285876578843], 153 | [0.78183724056269677, -0.15454468524731529], 154 | [1.0802613109347405, -0.1551074534031163], 155 | [1.0806786372187964, -0.005563695837911384]], 156 | 39: [[-0.92690445188717763, -0.16581995866851537], 157 | [-0.92713847033063335, -0.3154084837634285], 158 | [-0.628583422073833, -0.31626819739213546], 159 | [-0.62839947895378301, -0.16653555023577019]], 160 | 40: [[-0.61714267364411268, -0.16665241251536045], 161 | [-0.61733438281775899, -0.31637742188915996], 162 | [-0.31808440639992858, -0.31721805529952846], 163 | [-0.31783602372354636, -0.16734959994676962]], 164 | 41: [[-0.30633723161342741, -0.16733547998418072], 165 | [-0.30658123891980127, -0.31720849480679641], 166 | [-0.0067302081780236615, -0.31782855206402932], 167 | [-0.0064027101463844018, -0.16790383561977881]], 168 | 42: [[0.0050345270931093939, -0.16813510407606708], 169 | [0.0046739081474848967, -0.31805688630799828], 170 | [0.30451023735452754, -0.31851283695827903], 171 | [0.30495525252389172, -0.16864930516278212]], 172 | 43: [[0.3163076641553213, -0.16870353889366574], 173 | [0.3158596121496553, -0.31856707963200354], 174 | [0.61508690991925352, -0.31883531133592957], 175 | [0.61558922729537757, -0.1691182825473366]], 176 | 44: [[0.62680544885014022, -0.16919385584168567], 177 | [0.62629157237413191, -0.31891220378067764], 178 | [0.92479411363255148, -0.31917265350081681], 179 | [0.92527030622251005, -0.16960393970282647]], 180 | 45: [[-0.92725737030910438, -0.33009576226996507], 181 | [-0.92746830113873902, -0.47964284358033843], 182 | [-0.62878552806361199, -0.48050447404996499], 183 | [-0.62868999462188824, -0.33091264560163525]], 184 | 46: [[-0.6176268148108669, -0.33112190419426013], 185 | [-0.61772782737879128, -0.48071135880272886], 186 | [-0.31856336023876902, -0.48163807252695223], 187 | [-0.31837980785765019, -0.33193828076354565]], 188 | 47: [[-0.30666849049689043, -0.33203599256822469], 189 | [-0.30695929791749338, -0.48172768386781595], 190 | [-0.0072594970535422567, -0.48259141230974556], 191 | [-0.0068343077777618935, -0.33285973518218276]], 192 | 48: [[0.0042720467038136166, -0.33294566340698939], 193 | [0.0039546610594390248, -0.48268407060519558], 194 | [0.30364887441159594, -0.48300901581987749], 195 | [0.30410101091124503, -0.3333174221321103]], 196 | 49: [[0.31578013231328655, -0.33331478286810173], 197 | [0.31525245279222008, -0.4830050083789833], 198 | [0.61439274163586866, -0.48320681712584829], 199 | [0.61500268535617431, -0.33362899571063792]], 200 | 50: [[0.62627658388930552, -0.33356963470150031], 201 | [0.62568828206549088, -0.48315401115721701], 202 | [0.92431077925097804, -0.4833382334544955], 203 | [0.92479110954283905, -0.33381577428660453]], 204 | 51: [[-0.77240965863138134, -0.49493988356563134], 205 | [-0.77263203030593852, -0.64440903150282347], 206 | [-0.47374908322362158, -0.64554652743423191], 207 | [-0.4735670581664928, -0.49609435796882678]], 208 | # 52: [[-0.15966812729880486, -0.49769900766933101], 209 | # [-0.1591517175657555, -0.64718338808713338], 210 | # [-0.4584707321285616, -0.64751711108365861], 211 | # [-0.45912758820279587, -0.49807745239590412]], 212 | 52: [[-0.46235347, -0.49602301], 213 | [-0.46244884, -0.64551869], 214 | [-0.16260084, -0.64645377], 215 | [-0.16228459, -0.49692481]], 216 | 53: [[-0.15134267308393803, -0.49686100960300783], 217 | [-0.15164856166362331, -0.64635103945578076], 218 | [0.14793494667286552, -0.64698544001558689], 219 | [0.14842149684798833, -0.49750113242972099]], 220 | 54: [[0.15966812729880486, -0.49769900766933101], 221 | [0.1591517175657555, -0.64718338808713338], 222 | [0.4584707321285616, -0.64751711108365861], 223 | [0.45912758820279587, -0.49807745239590412]], 224 | 55: [[0.47041913753058689, -0.49793605429852361], 225 | [0.46980753299400468, -0.64737848216541483], 226 | [0.76863433704603279, -0.64750663709499146], 227 | [0.76921771768307423, -0.4980584377107321]], 228 | 56: [[-0.61754971691092275, -0.65969423490720502], 229 | [-0.61775916819582444, -0.80906427094530242], 230 | [-0.31869217842653719, -0.81008061686918886], 231 | [-0.31846278722207766, -0.66080647475804477]], 232 | 57: [[-0.30734062849214772, -0.66077156117217417], 233 | [-0.30753207342385008, -0.81004200964241457], 234 | [-0.0082007811172393093, -0.81080667701576192], 235 | [-0.0078296524474074994, -0.66155222500441568]], 236 | 58: [[0.0036125981436012445, -0.66173038791217087], 237 | [0.0033204571169864242, -0.81099634497696316], 238 | [0.30264915798707887, -0.8112307972381233], 239 | [0.30311076278912275, -0.66195663835855623]], 240 | 59: [[0.31437703264827249, -0.66204733532756999], 241 | [0.31386806670077044, -0.81132217060070833], 242 | [0.61288687701954114, -0.81145662307254196], 243 | [0.61342990780339635, -0.66209356377271167]], 244 | 60: [[-0.46259313452006806, -0.82434825740800843], 245 | [-0.46291374969213489, -0.97370576366759876], 246 | [-0.16375962701154942, -0.97458041877189405], 247 | [-0.16339168969905915, -0.82539665979023569]], 248 | 62: [[0.15868819258697092, -0.82595834473411223], 249 | [0.15818041448201781, -0.97514350068853606], 250 | [0.45731137056217025, -0.97568473900021224], 251 | [0.45786399461612898, -0.82634373342930445]]} -------------------------------------------------------------------------------- /skymap/data/des-round13-poly.txt: -------------------------------------------------------------------------------- 1 | # 2 | # DES round13 footprint 3 | # August 20, 2013 4 | # Jim Annis 5 | # 6 | # Consisting of the SPT-SZ survey area, the SDSS equatorial area, 7 | # a 3000 sq-degree circle centered at ra,dec= 38.8, -39.5 (r=30.91 deg), 8 | # and the weak lensing poop deck in the East centered at a declination 9 | # corresponding to CTIO zenith, an area optimal for DES weak lensing. 10 | # We attempted to stay in regions where the stellar density was < 7*rho_{sp}, 11 | # where rho_{sp} is the south pole stellar desnity, both as measured by 2MASS J-band star counts. 12 | # We also attempted to stary in regions where the SFD dust map estimates the i-band 13 | # extinction is < 0.15 mags. We did a better job with the stars than with the dust 14 | # as the star density is smooth, whereas the dust can be found in clouds, particularily in the NE 15 | # We estimate the footprint area at 5200 sq-degrees, 16 | # though my current 1-sigma error estimate is 150 sq-degrees 17 | # 18 | # The footprint consists of 567 coordinate pairs. 19 | # For questions of whether a point is inside the footprint and area, 20 | # we recommend ray casting algorithms; your milage may vary. 21 | # Point in polygon algorithms are well studied (think: video games and movies) 22 | # 23 | # With that, we shall consider the footprint complete. 24 | # (Note that a 2014 iteration would natually be called round14.) 25 | # 26 | # typedef struct { 27 | # double ra; 28 | # double dec; 29 | # } COORDINATE; 30 | # 31 | 23.00000 -7.00000 32 | 22.00000 -7.00000 33 | 21.00000 -7.00000 34 | 20.00000 -7.00000 35 | 19.00000 -7.00000 36 | 18.00000 -7.00000 37 | 17.00000 -7.00000 38 | 16.00000 -7.00000 39 | 15.00000 -7.00000 40 | 14.00000 -7.00000 41 | 13.00000 -7.00000 42 | 12.00000 -7.00000 43 | 11.00000 -7.00000 44 | 10.00000 -7.00000 45 | 9.00000 -7.00000 46 | 8.00000 -7.00000 47 | 7.00000 -7.00000 48 | 6.00000 -7.00000 49 | 5.00000 -7.00000 50 | 4.00000 -7.00000 51 | 3.00000 -7.00000 52 | 2.00000 -7.00000 53 | 1.00000 -7.00000 54 | 0.00000 -7.00000 55 | 0.00000 -6.00000 56 | 0.00000 -5.00000 57 | 0.00000 -4.00000 58 | 0.00000 -3.00000 59 | 0.00000 -2.00000 60 | -1.00000 -2.00000 61 | -2.00000 -2.00000 62 | -3.00000 -2.00000 63 | -4.00000 -2.00000 64 | -5.00000 -2.00000 65 | -6.00000 -2.00000 66 | -7.00000 -2.00000 67 | -8.00000 -2.00000 68 | -9.00000 -2.00000 69 | -10.00000 -2.00000 70 | -11.00000 -2.00000 71 | -12.00000 -2.00000 72 | -13.00000 -2.00000 73 | -14.00000 -2.00000 74 | -15.00000 -2.00000 75 | -16.00000 -2.00000 76 | -17.00000 -2.00000 77 | -18.00000 -2.00000 78 | -19.00000 -2.00000 79 | -20.00000 -2.00000 80 | -21.00000 -2.00000 81 | -22.00000 -2.00000 82 | -23.00000 -2.00000 83 | -24.00000 -2.00000 84 | -25.00000 -2.00000 85 | -26.00000 -2.00000 86 | -27.00000 -2.00000 87 | -28.00000 -2.00000 88 | -29.00000 -2.00000 89 | -30.00000 -2.00000 90 | -31.00000 -2.00000 91 | -32.00000 -2.00000 92 | -33.00000 -2.00000 93 | -34.00000 -2.00000 94 | -35.00000 -2.00000 95 | -36.00000 -2.00000 96 | -37.00000 -2.00000 97 | -38.00000 -2.00000 98 | -39.00000 -2.00000 99 | -40.00000 -2.00000 100 | -41.00000 -2.00000 101 | -42.00000 -2.00000 102 | -43.00000 -2.00000 103 | -43.00000 -1.00000 104 | -43.00000 0.00000 105 | -43.00000 1.00000 106 | -43.00000 2.00000 107 | -42.00000 2.00000 108 | -41.00000 2.00000 109 | -40.00000 2.00000 110 | -39.00000 2.00000 111 | -38.00000 2.00000 112 | -37.00000 2.00000 113 | -36.00000 2.00000 114 | -35.00000 2.00000 115 | -34.00000 2.00000 116 | -33.00000 2.00000 117 | -32.00000 2.00000 118 | -31.00000 2.00000 119 | -30.00000 2.00000 120 | -29.00000 2.00000 121 | -28.00000 2.00000 122 | -27.00000 2.00000 123 | -26.00000 2.00000 124 | -25.00000 2.00000 125 | -24.00000 2.00000 126 | -23.00000 2.00000 127 | -22.00000 2.00000 128 | -21.00000 2.00000 129 | -20.00000 2.00000 130 | -19.00000 2.00000 131 | -18.00000 2.00000 132 | -17.00000 2.00000 133 | -16.00000 2.00000 134 | -15.00000 2.00000 135 | -14.00000 2.00000 136 | -13.00000 2.00000 137 | -12.00000 2.00000 138 | -11.00000 2.00000 139 | -10.00000 2.00000 140 | -9.00000 2.00000 141 | -8.00000 2.00000 142 | -7.00000 2.00000 143 | -6.00000 2.00000 144 | -5.00000 2.00000 145 | -4.00000 2.00000 146 | -3.00000 2.00000 147 | -2.00000 2.00000 148 | -1.00000 2.00000 149 | 0.00000 2.00000 150 | 0.00000 2.00000 151 | 0.00000 3.00000 152 | 0.00000 4.00000 153 | 0.00000 5.00000 154 | 1.00000 5.00000 155 | 2.00000 5.00000 156 | 3.00000 5.00000 157 | 4.00000 5.00000 158 | 5.00000 5.00000 159 | 6.00000 5.00000 160 | 7.00000 5.00000 161 | 8.00000 5.00000 162 | 9.00000 5.00000 163 | 10.00000 5.00000 164 | 11.00000 5.00000 165 | 12.00000 5.00000 166 | 13.00000 5.00000 167 | 14.00000 5.00000 168 | 15.00000 5.00000 169 | 16.00000 5.00000 170 | 17.00000 5.00000 171 | 18.00000 5.00000 172 | 19.00000 5.00000 173 | 20.00000 5.00000 174 | 21.00000 5.00000 175 | 22.00000 5.00000 176 | 23.00000 5.00000 177 | 24.00000 5.00000 178 | 25.00000 5.00000 179 | 26.00000 5.00000 180 | 27.00000 5.00000 181 | 28.00000 5.00000 182 | 29.00000 5.00000 183 | 30.00000 5.00000 184 | 31.00000 5.00000 185 | 32.00000 5.00000 186 | 33.00000 5.00000 187 | 34.00000 5.00000 188 | 35.00000 5.00000 189 | 36.00000 5.00000 190 | 37.00000 5.00000 191 | 38.00000 5.00000 192 | 39.00000 5.00000 193 | 40.00000 5.00000 194 | 41.00000 5.00000 195 | 42.00000 5.00000 196 | 43.00000 5.00000 197 | 44.00000 5.00000 198 | 45.00000 5.00000 199 | 45.00000 5.00000 200 | 45.00000 4.00000 201 | 45.00000 3.00000 202 | 45.00000 2.00000 203 | 45.00000 1.00000 204 | 45.00000 0.00000 205 | 45.00000 -1.00000 206 | 45.00000 -2.00000 207 | 45.00000 -3.00000 208 | 45.00000 -4.00000 209 | 45.00000 -5.00000 210 | 45.00000 -6.00000 211 | 45.00000 -7.00000 212 | 45.00000 -8.00000 213 | 45.00000 -9.00000 214 | 45.83584 -9.06842 215 | 46.36744 -9.14567 216 | 46.89697 -9.22888 217 | 47.42429 -9.31810 218 | 47.94928 -9.41337 219 | 48.47183 -9.51474 220 | 48.99181 -9.62226 221 | 49.50912 -9.73598 222 | 50.02364 -9.85594 223 | 50.53529 -9.98221 224 | 51.04396 -10.11482 225 | 51.54955 -10.25382 226 | 52.05199 -10.39926 227 | 52.55118 -10.55119 228 | 53.04706 -10.70965 229 | 53.53954 -10.87467 230 | 54.02856 -11.04630 231 | 54.51405 -11.22457 232 | 54.99596 -11.40952 233 | 55.47423 -11.60118 234 | 55.94881 -11.79957 235 | 56.41965 -12.00471 236 | 56.88672 -12.21663 237 | 57.34998 -12.43534 238 | 57.80939 -12.66086 239 | 58.26493 -12.89318 240 | 58.71657 -13.13232 241 | 59.16429 -13.37827 242 | 59.60807 -13.63102 243 | 60.04790 -13.89057 244 | 60.48377 -14.15689 245 | 60.91568 -14.42997 246 | 61.34360 -14.70979 247 | 61.76755 -14.99631 248 | 62.18753 -15.28950 249 | 62.60354 -15.58931 250 | 63.01557 -15.89572 251 | 63.42365 -16.20866 252 | 63.82778 -16.52808 253 | 64.22797 -16.85393 254 | 66.00000 -18.00000 255 | 67.00000 -18.00000 256 | 68.00000 -18.00000 257 | 69.00000 -18.00000 258 | 70.00000 -18.00000 259 | 71.00000 -18.00000 260 | 72.00000 -18.00000 261 | 73.00000 -18.00000 262 | 74.00000 -18.00000 263 | 75.00000 -18.00000 264 | 76.00000 -18.00000 265 | 77.00000 -18.00000 266 | 78.00000 -18.00000 267 | 79.00000 -18.00000 268 | 80.00000 -18.00000 269 | 81.00000 -18.00000 270 | 82.00000 -18.00000 271 | 83.00000 -18.00000 272 | 84.00000 -18.00000 273 | 85.00000 -18.00000 274 | 86.00000 -18.00000 275 | 86.66667 -19.00000 276 | 87.33333 -20.00000 277 | 88.00000 -21.00000 278 | 88.66667 -22.00000 279 | 89.41596 -23.13170 280 | 89.68146 -24.36550 281 | 89.95879 -25.59111 282 | 90.24749 -26.80814 283 | 90.54705 -28.01619 284 | 90.85690 -29.21488 285 | 91.17643 -30.40381 286 | 91.50499 -31.58263 287 | 91.84185 -32.75095 288 | 92.18623 -33.90841 289 | 92.53729 -35.05464 290 | 92.89409 -36.18931 291 | 93.25565 -37.31205 292 | 93.62088 -38.42252 293 | 93.98862 -39.52040 294 | 94.35759 -40.60535 295 | 94.72643 -41.67704 296 | 95.09367 -42.73517 297 | 95.45771 -43.77942 298 | 95.81685 -44.80949 299 | 96.16922 -45.82508 300 | 96.51286 -46.82590 301 | 96.84562 -47.81168 302 | 97.16521 -48.78213 303 | 97.46918 -49.73698 304 | 97.75487 -50.67597 305 | 98.01948 -51.59884 306 | 98.25999 -52.50536 307 | 98.47317 -53.39526 308 | 98.65561 -54.26832 309 | 98.80364 -55.12430 310 | 98.91339 -55.96299 311 | 98.98075 -56.78417 312 | 99.00136 -57.58762 313 | 98.97062 -58.37314 314 | 98.88371 -59.14055 315 | 98.73552 -59.88964 316 | 98.52073 -60.62023 317 | 98.23379 -61.33214 318 | 98.00000 -61.50000 319 | 97.00000 -61.50000 320 | 96.00000 -61.50000 321 | 95.00000 -61.50000 322 | 94.00000 -61.50000 323 | 93.00000 -61.50000 324 | 92.00000 -61.50000 325 | 91.00000 -61.50000 326 | 90.00000 -61.50000 327 | 89.00000 -61.50000 328 | 88.00000 -61.50000 329 | 87.00000 -61.50000 330 | 86.00000 -61.50000 331 | 85.00000 -61.50000 332 | 84.00000 -61.50000 333 | 83.00000 -62.00000 334 | 78.66667 -63.00000 335 | 74.33333 -64.00000 336 | 69.19220 -65.62708 337 | 68.29300 -65.99135 338 | 67.35218 -66.34555 339 | 66.36917 -66.68914 340 | 65.34355 -67.02152 341 | 64.27503 -67.34210 342 | 63.16350 -67.65026 343 | 62.00905 -67.94540 344 | 60.81197 -68.22686 345 | 59.57280 -68.49402 346 | 58.29235 -68.74623 347 | 56.97169 -68.98287 348 | 55.61220 -69.20331 349 | 54.21558 -69.40695 350 | 52.78381 -69.59321 351 | 51.31925 -69.76152 352 | 49.82454 -69.91137 353 | 48.30265 -70.04227 354 | 46.75683 -70.15381 355 | 45.19062 -70.24560 356 | 43.60779 -70.31734 357 | 42.01230 -70.36875 358 | 40.40830 -70.39968 359 | 38.80000 -70.41000 360 | 37.19170 -70.39968 361 | 35.58770 -70.36875 362 | 33.99221 -70.31734 363 | 32.40938 -70.24560 364 | 30.84317 -70.15381 365 | 29.29735 -70.04227 366 | 27.77546 -69.91137 367 | 26.28075 -69.76152 368 | 24.81619 -69.59321 369 | 23.38442 -69.40695 370 | 21.98780 -69.20331 371 | 20.62831 -68.98287 372 | 19.30765 -68.74623 373 | 18.02720 -68.49402 374 | 16.78803 -68.22686 375 | 15.59095 -67.94540 376 | 14.43650 -67.65026 377 | 13.32497 -67.34210 378 | 12.25645 -67.02152 379 | 11.23083 -66.68914 380 | 10.24782 -66.34555 381 | 9.30700 -65.99135 382 | 8.40780 -65.62708 383 | 7.54955 -65.25330 384 | 4.00000 -65.00000 385 | 3.00000 -65.00000 386 | 2.00000 -65.00000 387 | 1.00000 -65.00000 388 | 0.00000 -65.00000 389 | -1.00000 -65.00000 390 | -2.00000 -65.00000 391 | -3.00000 -65.00000 392 | -4.00000 -65.00000 393 | -5.00000 -65.00000 394 | -6.00000 -65.00000 395 | -7.00000 -65.00000 396 | -8.00000 -65.00000 397 | -9.00000 -65.00000 398 | -10.00000 -65.00000 399 | -11.00000 -65.00000 400 | -12.00000 -65.00000 401 | -13.00000 -65.00000 402 | -14.00000 -65.00000 403 | -15.00000 -65.00000 404 | -16.00000 -65.00000 405 | -17.00000 -65.00000 406 | -18.00000 -65.00000 407 | -19.00000 -65.00000 408 | -20.00000 -65.00000 409 | -21.00000 -65.00000 410 | -22.00000 -65.00000 411 | -23.00000 -65.00000 412 | -24.00000 -65.00000 413 | -25.00000 -65.00000 414 | -26.00000 -65.00000 415 | -27.00000 -65.00000 416 | -28.00000 -65.00000 417 | -29.00000 -65.00000 418 | -30.00000 -65.00000 419 | -31.00000 -65.00000 420 | -32.00000 -65.00000 421 | -33.00000 -65.00000 422 | -34.00000 -65.00000 423 | -35.00000 -65.00000 424 | -36.00000 -65.00000 425 | -37.00000 -65.00000 426 | -38.00000 -65.00000 427 | -39.00000 -65.00000 428 | -40.00000 -65.00000 429 | -41.00000 -65.00000 430 | -42.00000 -65.00000 431 | -43.00000 -65.00000 432 | -44.00000 -65.00000 433 | -45.00000 -65.00000 434 | -46.00000 -65.00000 435 | -47.00000 -65.00000 436 | -48.00000 -65.00000 437 | -49.00000 -65.00000 438 | -50.00000 -65.00000 439 | -51.00000 -65.00000 440 | -52.00000 -65.00000 441 | -53.00000 -65.00000 442 | -54.00000 -65.00000 443 | -55.00000 -65.00000 444 | -56.00000 -65.00000 445 | -57.00000 -65.00000 446 | -56.80000 -64.00000 447 | -56.60000 -63.00000 448 | -56.40000 -62.00000 449 | -56.20000 -61.00000 450 | -56.00000 -60.00000 451 | -55.90000 -59.00000 452 | -55.80000 -58.00000 453 | -55.70000 -57.00000 454 | -55.60000 -56.00000 455 | -55.50000 -55.00000 456 | -55.40000 -54.00000 457 | -55.30000 -53.00000 458 | -55.20000 -52.00000 459 | -55.10000 -51.00000 460 | -55.00000 -50.00000 461 | -54.90000 -49.00000 462 | -54.80000 -48.00000 463 | -54.70000 -47.00000 464 | -54.60000 -46.00000 465 | -54.50000 -45.00000 466 | -54.40000 -44.00000 467 | -54.30000 -43.00000 468 | -54.20000 -42.00000 469 | -54.10000 -41.00000 470 | -54.00000 -40.00000 471 | -53.00000 -40.00000 472 | -52.00000 -40.00000 473 | -51.00000 -40.00000 474 | -50.00000 -40.00000 475 | -49.00000 -40.00000 476 | -48.00000 -40.00000 477 | -47.00000 -40.00000 478 | -46.00000 -40.00000 479 | -45.00000 -40.00000 480 | -44.00000 -40.00000 481 | -43.00000 -40.00000 482 | -42.00000 -40.00000 483 | -41.00000 -40.00000 484 | -40.00000 -40.00000 485 | -39.00000 -40.00000 486 | -38.00000 -40.00000 487 | -37.00000 -40.00000 488 | -36.00000 -40.00000 489 | -35.00000 -40.00000 490 | -34.00000 -40.00000 491 | -33.00000 -40.00000 492 | -32.00000 -40.00000 493 | -31.00000 -40.00000 494 | -30.00000 -40.00000 495 | -29.00000 -40.00000 496 | -28.00000 -40.00000 497 | -27.00000 -40.00000 498 | -26.00000 -40.00000 499 | -25.00000 -40.00000 500 | -24.00000 -40.00000 501 | -23.00000 -40.00000 502 | -22.00000 -40.00000 503 | -21.00000 -40.00000 504 | -20.00000 -40.00000 505 | -19.00000 -40.00000 506 | -18.00000 -40.00000 507 | -17.00000 -40.00000 508 | -16.00000 -40.00000 509 | -15.00000 -40.00000 510 | -14.00000 -40.00000 511 | -13.00000 -40.00000 512 | -12.00000 -40.00000 513 | -11.00000 -40.00000 514 | -10.00000 -40.00000 515 | -9.00000 -40.00000 516 | -8.00000 -40.00000 517 | -7.00000 -40.00000 518 | -6.00000 -40.00000 519 | -5.00000 -40.00000 520 | -4.00000 -40.00000 521 | -3.00000 -40.00000 522 | -1.47219 -38.64048 523 | -1.27518 -38.12814 524 | -1.07231 -37.61674 525 | -0.86376 -37.10640 526 | -0.64970 -36.59723 527 | -0.43028 -36.08933 528 | -0.20564 -35.58282 529 | 0.02406 -35.07782 530 | 0.25871 -34.57444 531 | 0.49818 -34.07280 532 | 0.74235 -33.57301 533 | 0.99113 -33.07520 534 | 1.24441 -32.57950 535 | 1.50209 -32.08601 536 | 1.76410 -31.59488 537 | 2.03036 -31.10621 538 | 2.30079 -30.62015 539 | 2.57532 -30.13681 540 | 2.85391 -29.65632 541 | 3.13648 -29.17881 542 | 3.42300 -28.70441 543 | 3.71342 -28.23325 544 | 4.00770 -27.76546 545 | 4.30581 -27.30116 546 | 4.60772 -26.84048 547 | 4.91340 -26.38355 548 | 5.22284 -25.93051 549 | 5.53601 -25.48147 550 | 5.85290 -25.03656 551 | 6.17351 -24.59591 552 | 6.49782 -24.15964 553 | 6.82584 -23.72788 554 | 7.15756 -23.30074 555 | 7.49299 -22.87835 556 | 7.83212 -22.46081 557 | 8.17498 -22.04826 558 | 8.52155 -21.64080 559 | 8.87186 -21.23855 560 | 9.22592 -20.84160 561 | 9.58374 -20.45008 562 | 9.94533 -20.06407 563 | 10.31070 -19.68369 564 | 10.67989 -19.30903 565 | 11.05289 -18.94018 566 | 11.42973 -18.57723 567 | 11.81042 -18.22027 568 | 12.19498 -17.86938 569 | 12.58343 -17.52465 570 | 12.97577 -17.18614 571 | 13.37203 -16.85393 572 | 13.77222 -16.52808 573 | 14.17635 -16.20866 574 | 14.58443 -15.89572 575 | 14.99646 -15.58931 576 | 15.41247 -15.28950 577 | 15.83245 -14.99631 578 | 16.25640 -14.70979 579 | 16.68432 -14.42997 580 | 17.11623 -14.15689 581 | 17.55210 -13.89057 582 | 17.99193 -13.63102 583 | 18.43571 -13.37827 584 | 18.88343 -13.13232 585 | 19.33507 -12.89318 586 | 19.79061 -12.66086 587 | 20.25002 -12.43534 588 | 20.71328 -12.21663 589 | 21.18035 -12.00471 590 | 21.65119 -11.79957 591 | 22.12577 -11.60118 592 | 22.60404 -11.40952 593 | 23.08595 -11.22457 594 | 23.00000 -10.00000 595 | 23.00000 -9.00000 596 | 23.00000 -8.00000 597 | 23.00000 -7.00000 598 | -------------------------------------------------------------------------------- /skymap/data/des-round17-poly.txt: -------------------------------------------------------------------------------- 1 | # 2 | # DES round17 footprint 3 | # August 30, 2017 4 | # Alex Drlica-Wagner 5 | # 6 | # This is a minor update of round13 to remove the southern region of the footprint 7 | # near the LMC that has been phased out of obstac. 8 | # 9 | # 10 | # DES round13 footprint 11 | # August 20, 2013 12 | # Jim Annis 13 | # 14 | # Consisting of the SPT-SZ survey area, the SDSS equatorial area, 15 | # a 3000 sq-degree circle centered at ra,dec= 38.8, -39.5 (r=30.91 deg), 16 | # and the weak lensing poop deck in the East centered at a declination 17 | # corresponding to CTIO zenith, an area optimal for DES weak lensing. 18 | # We attempted to stay in regions where the stellar density was < 7*rho_{sp}, 19 | # where rho_{sp} is the south pole stellar desnity, both as measured by 2MASS J-band star counts. 20 | # We also attempted to stary in regions where the SFD dust map estimates the i-band 21 | # extinction is < 0.15 mags. We did a better job with the stars than with the dust 22 | # as the star density is smooth, whereas the dust can be found in clouds, particularily in the NE 23 | # We estimate the footprint area at 5200 sq-degrees, 24 | # though my current 1-sigma error estimate is 150 sq-degrees 25 | # 26 | # The footprint consists of 567 coordinate pairs. 27 | # For questions of whether a point is inside the footprint and area, 28 | # we recommend ray casting algorithms; your milage may vary. 29 | # Point in polygon algorithms are well studied (think: video games and movies) 30 | # 31 | # With that, we shall consider the footprint complete. 32 | # (Note that a 2014 iteration would natually be called round14.) 33 | # 34 | # typedef struct { 35 | # double ra; 36 | # double dec; 37 | # } COORDINATE; 38 | # 39 | 23.00000 -7.00000 40 | 22.00000 -7.00000 41 | 21.00000 -7.00000 42 | 20.00000 -7.00000 43 | 19.00000 -7.00000 44 | 18.00000 -7.00000 45 | 17.00000 -7.00000 46 | 16.00000 -7.00000 47 | 15.00000 -7.00000 48 | 14.00000 -7.00000 49 | 13.00000 -7.00000 50 | 12.00000 -7.00000 51 | 11.00000 -7.00000 52 | 10.00000 -7.00000 53 | 9.00000 -7.00000 54 | 8.00000 -7.00000 55 | 7.00000 -7.00000 56 | 6.00000 -7.00000 57 | 5.00000 -7.00000 58 | 4.00000 -7.00000 59 | 3.00000 -7.00000 60 | 2.00000 -7.00000 61 | 1.00000 -7.00000 62 | 0.00000 -7.00000 63 | 0.00000 -6.00000 64 | 0.00000 -5.00000 65 | 0.00000 -4.00000 66 | 0.00000 -3.00000 67 | 0.00000 -2.00000 68 | -1.00000 -2.00000 69 | -2.00000 -2.00000 70 | -3.00000 -2.00000 71 | -4.00000 -2.00000 72 | -5.00000 -2.00000 73 | -6.00000 -2.00000 74 | -7.00000 -2.00000 75 | -8.00000 -2.00000 76 | -9.00000 -2.00000 77 | -10.00000 -2.00000 78 | -11.00000 -2.00000 79 | -12.00000 -2.00000 80 | -13.00000 -2.00000 81 | -14.00000 -2.00000 82 | -15.00000 -2.00000 83 | -16.00000 -2.00000 84 | -17.00000 -2.00000 85 | -18.00000 -2.00000 86 | -19.00000 -2.00000 87 | -20.00000 -2.00000 88 | -21.00000 -2.00000 89 | -22.00000 -2.00000 90 | -23.00000 -2.00000 91 | -24.00000 -2.00000 92 | -25.00000 -2.00000 93 | -26.00000 -2.00000 94 | -27.00000 -2.00000 95 | -28.00000 -2.00000 96 | -29.00000 -2.00000 97 | -30.00000 -2.00000 98 | -31.00000 -2.00000 99 | -32.00000 -2.00000 100 | -33.00000 -2.00000 101 | -34.00000 -2.00000 102 | -35.00000 -2.00000 103 | -36.00000 -2.00000 104 | -37.00000 -2.00000 105 | -38.00000 -2.00000 106 | -39.00000 -2.00000 107 | -40.00000 -2.00000 108 | -41.00000 -2.00000 109 | -42.00000 -2.00000 110 | -43.00000 -2.00000 111 | -43.00000 -1.00000 112 | -43.00000 0.00000 113 | -43.00000 1.00000 114 | -43.00000 2.00000 115 | -42.00000 2.00000 116 | -41.00000 2.00000 117 | -40.00000 2.00000 118 | -39.00000 2.00000 119 | -38.00000 2.00000 120 | -37.00000 2.00000 121 | -36.00000 2.00000 122 | -35.00000 2.00000 123 | -34.00000 2.00000 124 | -33.00000 2.00000 125 | -32.00000 2.00000 126 | -31.00000 2.00000 127 | -30.00000 2.00000 128 | -29.00000 2.00000 129 | -28.00000 2.00000 130 | -27.00000 2.00000 131 | -26.00000 2.00000 132 | -25.00000 2.00000 133 | -24.00000 2.00000 134 | -23.00000 2.00000 135 | -22.00000 2.00000 136 | -21.00000 2.00000 137 | -20.00000 2.00000 138 | -19.00000 2.00000 139 | -18.00000 2.00000 140 | -17.00000 2.00000 141 | -16.00000 2.00000 142 | -15.00000 2.00000 143 | -14.00000 2.00000 144 | -13.00000 2.00000 145 | -12.00000 2.00000 146 | -11.00000 2.00000 147 | -10.00000 2.00000 148 | -9.00000 2.00000 149 | -8.00000 2.00000 150 | -7.00000 2.00000 151 | -6.00000 2.00000 152 | -5.00000 2.00000 153 | -4.00000 2.00000 154 | -3.00000 2.00000 155 | -2.00000 2.00000 156 | -1.00000 2.00000 157 | 0.00000 2.00000 158 | 0.00000 2.00000 159 | 0.00000 3.00000 160 | 0.00000 4.00000 161 | 0.00000 5.00000 162 | 1.00000 5.00000 163 | 2.00000 5.00000 164 | 3.00000 5.00000 165 | 4.00000 5.00000 166 | 5.00000 5.00000 167 | 6.00000 5.00000 168 | 7.00000 5.00000 169 | 8.00000 5.00000 170 | 9.00000 5.00000 171 | 10.00000 5.00000 172 | 11.00000 5.00000 173 | 12.00000 5.00000 174 | 13.00000 5.00000 175 | 14.00000 5.00000 176 | 15.00000 5.00000 177 | 16.00000 5.00000 178 | 17.00000 5.00000 179 | 18.00000 5.00000 180 | 19.00000 5.00000 181 | 20.00000 5.00000 182 | 21.00000 5.00000 183 | 22.00000 5.00000 184 | 23.00000 5.00000 185 | 24.00000 5.00000 186 | 25.00000 5.00000 187 | 26.00000 5.00000 188 | 27.00000 5.00000 189 | 28.00000 5.00000 190 | 29.00000 5.00000 191 | 30.00000 5.00000 192 | 31.00000 5.00000 193 | 32.00000 5.00000 194 | 33.00000 5.00000 195 | 34.00000 5.00000 196 | 35.00000 5.00000 197 | 36.00000 5.00000 198 | 37.00000 5.00000 199 | 38.00000 5.00000 200 | 39.00000 5.00000 201 | 40.00000 5.00000 202 | 41.00000 5.00000 203 | 42.00000 5.00000 204 | 43.00000 5.00000 205 | 44.00000 5.00000 206 | 45.00000 5.00000 207 | 45.00000 5.00000 208 | 45.00000 4.00000 209 | 45.00000 3.00000 210 | 45.00000 2.00000 211 | 45.00000 1.00000 212 | 45.00000 0.00000 213 | 45.00000 -1.00000 214 | 45.00000 -2.00000 215 | 45.00000 -3.00000 216 | 45.00000 -4.00000 217 | 45.00000 -5.00000 218 | 45.00000 -6.00000 219 | 45.00000 -7.00000 220 | 45.00000 -8.00000 221 | 45.00000 -9.00000 222 | 45.83584 -9.06842 223 | 46.36744 -9.14567 224 | 46.89697 -9.22888 225 | 47.42429 -9.31810 226 | 47.94928 -9.41337 227 | 48.47183 -9.51474 228 | 48.99181 -9.62226 229 | 49.50912 -9.73598 230 | 50.02364 -9.85594 231 | 50.53529 -9.98221 232 | 51.04396 -10.11482 233 | 51.54955 -10.25382 234 | 52.05199 -10.39926 235 | 52.55118 -10.55119 236 | 53.04706 -10.70965 237 | 53.53954 -10.87467 238 | 54.02856 -11.04630 239 | 54.51405 -11.22457 240 | 54.99596 -11.40952 241 | 55.47423 -11.60118 242 | 55.94881 -11.79957 243 | 56.41965 -12.00471 244 | 56.88672 -12.21663 245 | 57.34998 -12.43534 246 | 57.80939 -12.66086 247 | 58.26493 -12.89318 248 | 58.71657 -13.13232 249 | 59.16429 -13.37827 250 | 59.60807 -13.63102 251 | 60.04790 -13.89057 252 | 60.48377 -14.15689 253 | 60.91568 -14.42997 254 | 61.34360 -14.70979 255 | 61.76755 -14.99631 256 | 62.18753 -15.28950 257 | 62.60354 -15.58931 258 | 63.01557 -15.89572 259 | 63.42365 -16.20866 260 | 63.82778 -16.52808 261 | 64.22797 -16.85393 262 | 66.00000 -18.00000 263 | 67.00000 -18.00000 264 | 68.00000 -18.00000 265 | 69.00000 -18.00000 266 | 70.00000 -18.00000 267 | 71.00000 -18.00000 268 | 72.00000 -18.00000 269 | 73.00000 -18.00000 270 | 74.00000 -18.00000 271 | 75.00000 -18.00000 272 | 76.00000 -18.00000 273 | 77.00000 -18.00000 274 | 78.00000 -18.00000 275 | 79.00000 -18.00000 276 | 80.00000 -18.00000 277 | 81.00000 -18.00000 278 | 82.00000 -18.00000 279 | 83.00000 -18.00000 280 | 84.00000 -18.00000 281 | 85.00000 -18.00000 282 | 86.00000 -18.00000 283 | 86.66667 -19.00000 284 | 87.33333 -20.00000 285 | 88.00000 -21.00000 286 | 88.66667 -22.00000 287 | 89.41596 -23.13170 288 | 89.68146 -24.36550 289 | 89.95879 -25.59111 290 | 90.24749 -26.80814 291 | 90.54705 -28.01619 292 | 90.85690 -29.21488 293 | 91.17643 -30.40381 294 | 91.50499 -31.58263 295 | 91.84185 -32.75095 296 | 92.18623 -33.90841 297 | 92.53729 -35.05464 298 | 92.89409 -36.18931 299 | 93.25565 -37.31205 300 | 93.62088 -38.42252 301 | 93.98862 -39.52040 302 | 94.35759 -40.60535 303 | 94.72643 -41.67704 304 | 95.09367 -42.73517 305 | 95.45771 -43.77942 306 | 95.81685 -44.80949 307 | 96.16922 -45.82508 308 | 96.51286 -46.82590 309 | 96.84562 -47.81168 310 | 97.16521 -48.78213 311 | 97.46918 -49.73698 312 | 97.75487 -50.67597 313 | 98.01948 -51.59884 314 | 98.25999 -52.50536 315 | 98.47317 -53.39526 316 | 98.65561 -54.26832 317 | 98.80364 -55.12430 318 | 98.91339 -55.96299 319 | 98.98075 -56.78417 320 | 99.00136 -57.58762 321 | 98.97062 -58.37314 322 | 98.88371 -59.14055 323 | 98.73552 -59.88964 324 | 98.52073 -60.62023 325 | 98.23379 -61.33214 326 | 98.00000 -61.50000 327 | 97.00000 -61.50000 328 | 96.00000 -61.50000 329 | 95.00000 -61.50000 330 | 94.00000 -61.50000 331 | 93.00000 -61.50000 332 | 92.00000 -61.50000 333 | 91.00000 -61.50000 334 | 90.00000 -61.50000 335 | 89.00000 -61.50000 336 | 88.00000 -61.50000 337 | 87.00000 -61.50000 338 | 86.00000 -61.50000 339 | 85.00000 -61.50000 340 | 84.00000 -61.50000 341 | 83.00000 -62.00000 342 | 78.66667 -63.00000 343 | 74.33333 -64.00000 344 | 69.19220 -65.62708 345 | 68.29300 -65.99135 346 | 67.35218 -66.34555 347 | 66.36917 -66.68914 348 | 65.34355 -67.02152 349 | 64.27503 -67.34210 350 | 63.16350 -67.65026 351 | 62.00905 -67.94540 352 | 60.81197 -68.22686 353 | 59.57280 -68.49402 354 | 58.29235 -68.00000 355 | 56.97169 -68.00000 356 | 55.61220 -67.00000 357 | 54.21558 -66.00000 358 | 52.78381 -65.50000 359 | 51.31925 -65.00000 360 | 49.82454 -65.00000 361 | 48.30265 -65.00000 362 | 46.75683 -65.00000 363 | 45.19062 -65.00000 364 | 43.60779 -65.00000 365 | 42.01230 -65.00000 366 | 40.40830 -65.00000 367 | 38.80000 -65.00000 368 | 37.19170 -65.00000 369 | 35.58770 -65.00000 370 | 33.99221 -65.00000 371 | 32.40938 -65.00000 372 | 30.84317 -65.00000 373 | 29.29735 -65.00000 374 | 27.77546 -65.00000 375 | 26.28075 -65.00000 376 | 24.81619 -65.00000 377 | 23.38442 -65.00000 378 | 21.98780 -65.00000 379 | 20.62831 -65.00000 380 | 19.30765 -65.00000 381 | 18.02720 -65.00000 382 | 16.78803 -65.00000 383 | 15.59095 -65.00000 384 | 14.43650 -65.00000 385 | 13.32497 -65.00000 386 | 12.25645 -65.00000 387 | 11.23083 -65.00000 388 | 10.24782 -65.00000 389 | 9.30700 -65.00000 390 | 8.40780 -65.00000 391 | 7.54955 -65.00000 392 | 4.00000 -65.00000 393 | 3.00000 -65.00000 394 | 2.00000 -65.00000 395 | 1.00000 -65.00000 396 | 0.00000 -65.00000 397 | -1.00000 -65.00000 398 | -2.00000 -65.00000 399 | -3.00000 -65.00000 400 | -4.00000 -65.00000 401 | -5.00000 -65.00000 402 | -6.00000 -65.00000 403 | -7.00000 -65.00000 404 | -8.00000 -65.00000 405 | -9.00000 -65.00000 406 | -10.00000 -65.00000 407 | -11.00000 -65.00000 408 | -12.00000 -65.00000 409 | -13.00000 -65.00000 410 | -14.00000 -65.00000 411 | -15.00000 -65.00000 412 | -16.00000 -65.00000 413 | -17.00000 -65.00000 414 | -18.00000 -65.00000 415 | -19.00000 -65.00000 416 | -20.00000 -65.00000 417 | -21.00000 -65.00000 418 | -22.00000 -65.00000 419 | -23.00000 -65.00000 420 | -24.00000 -65.00000 421 | -25.00000 -65.00000 422 | -26.00000 -65.00000 423 | -27.00000 -65.00000 424 | -28.00000 -65.00000 425 | -29.00000 -65.00000 426 | -30.00000 -65.00000 427 | -31.00000 -65.00000 428 | -32.00000 -65.00000 429 | -33.00000 -65.00000 430 | -34.00000 -65.00000 431 | -35.00000 -65.00000 432 | -36.00000 -65.00000 433 | -37.00000 -65.00000 434 | -38.00000 -65.00000 435 | -39.00000 -65.00000 436 | -40.00000 -65.00000 437 | -41.00000 -65.00000 438 | -42.00000 -65.00000 439 | -43.00000 -65.00000 440 | -44.00000 -65.00000 441 | -45.00000 -65.00000 442 | -46.00000 -65.00000 443 | -47.00000 -65.00000 444 | -48.00000 -65.00000 445 | -49.00000 -65.00000 446 | -50.00000 -65.00000 447 | -51.00000 -65.00000 448 | -52.00000 -65.00000 449 | -53.00000 -65.00000 450 | -54.00000 -65.00000 451 | -55.00000 -65.00000 452 | -56.00000 -65.00000 453 | -57.00000 -65.00000 454 | -56.80000 -64.00000 455 | -56.60000 -63.00000 456 | -56.40000 -62.00000 457 | -56.20000 -61.00000 458 | -56.00000 -60.00000 459 | -60.97560 -58.52000 460 | -60.77920 -55.26850 461 | -60.27960 -52.49310 462 | -59.92660 -50.92070 463 | -58.35500 -50.41540 464 | -56.60890 -49.56360 465 | -54.96150 -48.77660 466 | -54.80000 -48.00000 467 | -54.70000 -47.00000 468 | -54.60000 -46.00000 469 | -54.50000 -45.00000 470 | -54.40000 -44.00000 471 | -54.30000 -43.00000 472 | -54.20000 -42.00000 473 | -54.10000 -41.00000 474 | -54.00000 -40.00000 475 | -53.00000 -40.00000 476 | -52.00000 -40.00000 477 | -51.00000 -40.00000 478 | -50.00000 -40.00000 479 | -49.00000 -40.00000 480 | -48.00000 -40.00000 481 | -47.00000 -40.00000 482 | -46.00000 -40.00000 483 | -45.00000 -40.00000 484 | -44.00000 -40.00000 485 | -43.00000 -40.00000 486 | -42.00000 -40.00000 487 | -41.00000 -40.00000 488 | -40.00000 -40.00000 489 | -39.00000 -40.00000 490 | -38.00000 -40.00000 491 | -37.00000 -40.00000 492 | -36.00000 -40.00000 493 | -35.00000 -40.00000 494 | -34.00000 -40.00000 495 | -33.00000 -40.00000 496 | -32.00000 -40.00000 497 | -31.00000 -40.00000 498 | -30.00000 -40.00000 499 | -29.00000 -40.00000 500 | -28.00000 -40.00000 501 | -27.00000 -40.00000 502 | -26.00000 -40.00000 503 | -25.00000 -40.00000 504 | -24.00000 -40.00000 505 | -23.00000 -40.00000 506 | -22.00000 -40.00000 507 | -21.00000 -40.00000 508 | -20.00000 -40.00000 509 | -19.00000 -40.00000 510 | -18.00000 -40.00000 511 | -17.00000 -40.00000 512 | -16.00000 -40.00000 513 | -15.00000 -40.00000 514 | -14.00000 -40.00000 515 | -13.00000 -40.00000 516 | -12.00000 -40.00000 517 | -11.00000 -40.00000 518 | -10.00000 -40.00000 519 | -9.00000 -40.00000 520 | -8.00000 -40.00000 521 | -7.00000 -40.00000 522 | -6.00000 -40.00000 523 | -5.00000 -40.00000 524 | -4.00000 -40.00000 525 | -3.00000 -40.00000 526 | -1.47219 -38.64048 527 | -1.27518 -38.12814 528 | -1.07231 -37.61674 529 | -0.86376 -37.10640 530 | -0.64970 -36.59723 531 | -0.43028 -36.08933 532 | -0.20564 -35.58282 533 | 0.02406 -35.07782 534 | 0.25871 -34.57444 535 | 0.49818 -34.07280 536 | 0.74235 -33.57301 537 | 0.99113 -33.07520 538 | 1.24441 -32.57950 539 | 1.50209 -32.08601 540 | 1.76410 -31.59488 541 | 2.03036 -31.10621 542 | 2.30079 -30.62015 543 | 2.57532 -30.13681 544 | 2.85391 -29.65632 545 | 3.13648 -29.17881 546 | 3.42300 -28.70441 547 | 3.71342 -28.23325 548 | 4.00770 -27.76546 549 | 4.30581 -27.30116 550 | 4.60772 -26.84048 551 | 4.91340 -26.38355 552 | 5.22284 -25.93051 553 | 5.53601 -25.48147 554 | 5.85290 -25.03656 555 | 6.17351 -24.59591 556 | 6.49782 -24.15964 557 | 6.82584 -23.72788 558 | 7.15756 -23.30074 559 | 7.49299 -22.87835 560 | 7.83212 -22.46081 561 | 8.17498 -22.04826 562 | 8.52155 -21.64080 563 | 8.87186 -21.23855 564 | 9.22592 -20.84160 565 | 9.58374 -20.45008 566 | 9.94533 -20.06407 567 | 10.31070 -19.68369 568 | 10.67989 -19.30903 569 | 11.05289 -18.94018 570 | 11.42973 -18.57723 571 | 11.81042 -18.22027 572 | 12.19498 -17.86938 573 | 12.58343 -17.52465 574 | 12.97577 -17.18614 575 | 13.37203 -16.85393 576 | 13.77222 -16.52808 577 | 14.17635 -16.20866 578 | 14.58443 -15.89572 579 | 14.99646 -15.58931 580 | 15.41247 -15.28950 581 | 15.83245 -14.99631 582 | 16.25640 -14.70979 583 | 16.68432 -14.42997 584 | 17.11623 -14.15689 585 | 17.55210 -13.89057 586 | 17.99193 -13.63102 587 | 18.43571 -13.37827 588 | 18.88343 -13.13232 589 | 19.33507 -12.89318 590 | 19.79061 -12.66086 591 | 20.25002 -12.43534 592 | 20.71328 -12.21663 593 | 21.18035 -12.00471 594 | 21.65119 -11.79957 595 | 22.12577 -11.60118 596 | 22.60404 -11.40952 597 | 23.08595 -11.22457 598 | 23.00000 -10.00000 599 | 23.00000 -9.00000 600 | 23.00000 -8.00000 601 | 23.00000 -7.00000 602 | -------------------------------------------------------------------------------- /skymap/data/smash_fields_final.txt: -------------------------------------------------------------------------------- 1 | # NUM NAME RAJ2000 DEJ2000 RADEG DEDEG MSLON MSLAT 2 | 1 0010-6947 00:10:19.87 -69:47:40.56 2.58282 -69.794600 -19.56937 -13.84173 3 | 2 0018-7705 00:18:57.90 -77:05:00.23 4.74128 -77.083400 -12.11547 -15.01799 4 | 3 0023-7358 00:23:19.08 -73:58:08.04 5.82950 -73.968900 -15.14808 -13.94466 5 | 4 0024-7223 00:24:56.64 -72:23:08.15 6.23604 -72.385600 -16.67737 -13.38564 6 | 5 0044-7137 00:44:06.76 -71:37:45.84 11.02820 -71.629400 -16.91433 -11.74021 7 | 6 0044-7313 00:44:32.54 -73:13:31.79 11.13560 -73.225500 -15.38135 -12.28828 8 | 7 0045-7448 00:45:03.28 -74:48:14.76 11.26370 -74.804100 -13.85882 -12.82186 9 | 8 0050-8228 00:50:34.51 -82:28:26.40 12.64380 -82.474000 -6.36406 -15.28088 10 | 9 0101-7043 01:01:27.40 -70:43:05.51 15.36420 -70.718200 -17.19874 -10.09455 11 | 10 0103-7218 01:03:36.31 -72:18:54.36 15.90130 -72.315100 -15.66017 -10.63165 12 | 11 0106-7353 01:06:08.44 -73:53:32.28 16.53520 -73.892300 -14.13343 -11.15486 13 | 12 0109-7527 01:09:11.01 -75:27:01.80 17.29590 -75.450500 -12.61727 -11.66435 14 | 13 0117-7830 01:17:34.29 -78:30:40.32 19.39290 -78.511200 -9.61217 -12.64309 15 | 14 0120-7115 01:20:26.78 -71:15:32.76 20.11160 -71.259100 -15.98573 -8.97582 16 | 15 0124-7249 01:24:33.52 -72:49:30.00 21.13970 -72.825000 -14.45277 -9.48853 17 | 16 0129-7422 01:29:25.34 -74:22:02.64 22.35560 -74.367400 -12.93183 -9.98812 18 | 17 0159-8421 01:59:53.35 -84:21:53.64 29.97230 -84.364900 -3.68420 -14.44414 19 | 18 0209-7316 02:09:12.33 -73:16:18.11 32.30140 -73.271700 -12.17151 -7.10881 20 | 19 0213-7730 02:13:11.68 -77:30:44.63 33.29870 -77.512400 -8.77495 -9.70837 21 | 20 0215-6726 02:15:05.64 -67:26:07.44 33.77350 -67.435400 -16.21016 -2.85180 22 | 21 0232-7017 02:32:03.69 -70:17:01.67 38.01540 -70.283800 -13.10265 -3.75649 23 | 22 0243-7432 02:43:29.49 -74:32:00.24 40.87290 -74.533400 -9.58711 -6.31237 24 | 23 0313-6752 03:13:19.51 -67:52:10.56 48.33130 -67.869600 -11.74157 0.42381 25 | 24 0314-7229 03:14:54.04 -72:29:21.48 48.72520 -72.489300 -9.05691 -3.33905 26 | 25 0320-7948 03:20:58.24 -79:48:58.31 50.24270 -79.816200 -4.71684 -9.27324 27 | 26 0340-7624 03:40:17.13 -76:24:52.91 55.07140 -76.414700 -5.57921 -5.83697 28 | 27 0408-7202 04:08:09.57 -72:02:18.23 62.03990 -72.038400 -5.66787 -1.07660 29 | 28 0408-6825 04:08:49.82 -68:25:01.56 62.20760 -68.417100 -6.91676 2.32309 30 | 29 0446-7522 04:46:05.37 -75:22:26.04 71.52240 -75.373900 -2.16584 -3.50019 31 | 30 0451-6846 04:51:31.05 -68:46:39.71 72.87940 -68.777700 -3.07401 3.04616 32 | 31 0452-8044 04:52:55.82 -80:44:52.44 73.23260 -80.747900 -0.74803 -8.69756 33 | 32 0455-7034 04:55:18.23 -70:34:47.63 73.82600 -70.579900 -2.42422 1.33321 34 | 33 0457-8418 04:57:31.12 -84:18:30.95 74.37970 -84.308600 0.03944 -12.17607 35 | 34 0459-7222 04:59:18.02 -72:22:36.11 74.82510 -72.376700 -1.81493 -0.38662 36 | 35 0502-6731 05:02:34.00 -67:31:32.88 75.64170 -67.525800 -2.26678 4.45122 37 | 36 0507-6918 05:07:22.41 -69:18:49.68 76.84340 -69.313800 -1.58843 2.73842 38 | 37 0512-6612 05:12:13.03 -66:12:50.76 78.05430 -66.214100 -1.48575 5.86998 39 | 38 0512-7105 05:12:33.47 -71:05:41.99 78.13950 -71.095000 -0.95091 1.01825 40 | 39 0517-6759 05:17:47.59 -67:59:02.39 79.44830 -67.984000 -0.77945 4.15786 41 | 40 0518-7252 05:18:15.45 -72:52:07.32 79.56440 -72.868700 -0.35176 -0.70826 42 | 41 0523-6944 05:23:50.59 -69:44:43.44 80.96080 -69.745400 -0.11440 2.43779 43 | 42 0526-6636 05:26:47.37 -66:36:07.91 81.69740 -66.602200 0.00417 5.59062 44 | 43 0530-7129 05:30:31.17 -71:29:48.83 82.62990 -71.496900 0.51195 0.71098 45 | 44 0532-7623 05:32:05.52 -76:23:18.95 83.02300 -76.388600 0.74026 -4.17658 46 | 45 0533-6820 05:33:27.45 -68:20:29.03 83.36440 -68.341400 0.69611 3.87113 47 | 46 0538-7314 05:38:02.08 -73:14:12.11 84.50870 -73.236700 1.10201 -1.02162 48 | 47 0540-7004 05:40:47.92 -70:04:06.60 85.19970 -70.068500 1.34897 2.14437 49 | 48 0541-6653 05:41:39.83 -66:53:38.04 85.41600 -66.893900 1.48214 5.31718 50 | 49 0549-7146 05:49:00.98 -71:46:51.24 87.25410 -71.780900 1.96518 0.41155 51 | 50 0549-6835 05:49:26.52 -68:35:44.16 87.36050 -68.595600 2.16083 3.59105 52 | 51 0558-7016 05:58:05.06 -70:16:49.07 89.52110 -70.280300 2.80250 1.85833 53 | 52 0625-7959 06:25:24.84 -79:59:53.51 96.35350 -79.998200 3.14014 -7.99408 54 | 53 0626-6710 06:26:59.85 -67:10:49.79 96.74940 -67.180500 5.85329 4.53505 55 | 54 0632-7511 06:32:08.92 -75:11:07.80 98.03720 -75.185500 4.52871 -3.37023 56 | 55 0632-7022 06:32:55.60 -70:22:00.47 98.23170 -70.366800 5.68330 1.30858 57 | 56 0709-6818 07:09:11.52 -68:18:49.31 107.29800 -68.313700 9.34975 2.29606 58 | 57 0714-5437 07:14:32.88 -54:37:20.28 108.63700 -54.622300 15.32143 14.66950 59 | 58 0725-5921 07:25:02.40 -59:21:01.79 111.26000 -59.350500 14.60656 9.78066 60 | 59 0725-6431 07:25:08.64 -64:31:12.35 111.28600 -64.520100 12.34506 5.12240 61 | 60 0736-7611 07:36:20.88 -76:11:28.67 114.08700 -76.191300 7.88512 -5.70334 62 | 61 0738-7059 07:38:41.52 -70:59:29.76 114.67300 -70.991600 10.52295 -1.21621 63 | 62 0745-8756 07:45:16.79 -87:56:51.00 116.32000 -87.947500 2.17277 -16.04148 64 | 63 0752-6700 07:52:11.76 -67:00:32.03 118.04900 -67.008900 13.57954 1.60725 65 | 64 0800-8426 08:00:26.87 -84:26:33.35 120.11200 -84.442600 4.37821 -13.25179 66 | 65 0801-8056 08:01:10.07 -80:56:26.52 120.29200 -80.940700 6.43914 -10.38900 67 | 66 0832-7239 08:32:36.95 -72:39:34.19 128.15400 -72.659500 13.00449 -4.98657 68 | 67 0837-6827 08:37:29.51 -68:27:43.56 129.37300 -68.462100 16.11781 -2.13568 69 | 68 0843-7605 08:43:40.56 -76:05:58.55 130.91900 -76.099600 11.19699 -8.01271 70 | 69 0923-7836 09:23:02.39 -78:36:25.19 140.76000 -78.607000 10.70599 -11.27451 71 | 70 0925-2836 09:25:11.76 -28:36:37.07 141.29900 -28.610300 51.77110 17.99772 72 | 71 0940-3226 09:40:50.87 -32:26:03.48 145.21200 -32.434300 50.26981 13.11048 73 | 72 0940-2659 09:40:50.87 -26:59:22.91 145.21200 -26.989700 55.10511 15.89173 74 | 73 0941-2128 09:41:14.88 -21:28:34.31 145.31200 -21.476200 60.18390 18.51388 75 | 74 0952-1802 09:52:13.91 -18:02:21.84 148.05800 -18.039400 64.64611 17.79915 76 | 75 0956-2756 09:56:19.67 -27:56:00.95 149.08200 -27.933600 55.97663 12.43232 77 | 76 0959-2402 09:59:35.51 -24:02:20.76 149.89800 -24.039100 59.87010 13.57872 78 | 77 1001-3212 10:01:16.07 -32:12:13.68 150.31700 -32.203800 52.65326 9.47722 79 | 78 1010-2029 10:10:05.03 -20:29:07.79 152.52100 -20.485500 64.24284 12.94341 80 | 79 1012-2841 10:12:10.07 -28:41:34.07 153.04200 -28.692800 56.90325 8.98265 81 | 80 1012-7523 10:12:35.51 -75:23:52.44 153.14800 -75.397900 14.95268 -12.06215 82 | 81 1021-3811 10:21:20.40 -38:11:53.15 155.33500 -38.198100 49.14246 3.11025 83 | 82 1023-1821 10:23:58.55 -18:21:52.19 155.99400 -18.364500 67.58115 10.80953 84 | 83 1027-8320 10:27:06.47 -83:20:34.07 156.77700 -83.342800 7.63377 -15.67351 85 | 84 1029-3155 10:29:57.12 -31:55:17.40 157.48800 -31.921500 55.59236 4.13984 86 | 85 1031-2801 10:31:34.80 -28:01:30.35 157.89500 -28.025100 59.31484 5.38294 87 | 86 1033-2405 10:33:21.12 -24:05:32.28 158.33800 -24.092300 63.10817 6.56284 88 | 87 1037-7928 10:37:37.68 -79:28:46.91 159.40700 -79.479700 11.55695 -14.81140 89 | 88 1040-3444 10:40:37.19 -34:44:15.71 160.15500 -34.737700 53.88373 0.98056 90 | 89 1042-2017 10:42:40.79 -20:17:53.52 160.67000 -20.298200 67.46224 5.99387 91 | 90 1047-2820 10:47:44.16 -28:20:26.15 161.93400 -28.340600 60.38469 1.97215 92 | 91 1049-4231 10:49:08.63 -42:31:47.63 162.28600 -42.529900 47.27001 -3.46668 93 | 92 1055-3218 10:55:27.84 -32:18:28.43 163.86600 -32.307900 57.27839 -1.00644 94 | 93 1059-2310 10:59:25.43 -23:10:59.87 164.85600 -23.183300 66.14119 1.33560 95 | 94 1104-3610 11:04:22.08 -36:10:34.32 166.09200 -36.176200 54.26095 -4.04973 96 | 95 1106-2707 11:06:47.76 -27:07:38.28 166.69900 -27.127300 62.98737 -1.56125 97 | 96 1114-2308 11:14:50.40 -23:08:36.59 168.71000 -23.143500 67.34765 -1.99619 98 | 97 1116-4344 11:16:21.60 -43:44:21.48 169.09000 -43.739300 47.72678 -8.55518 99 | 98 1121-3210 11:21:11.75 -32:10:06.60 170.29900 -32.168500 59.17091 -6.11060 100 | 99 1124-3948 11:24:11.76 -39:48:19.80 171.04900 -39.805500 51.96013 -8.86554 101 | 100 1128-2808 11:28:34.07 -28:08:46.32 172.14200 -28.146200 63.50896 -6.46168 102 | 101 1130-2252 11:30:16.55 -22:52:37.19 172.56900 -22.877000 68.68954 -5.29676 103 | 102 1131-3549 11:31:27.12 -35:49:05.51 172.86300 -35.818200 56.23849 -9.17502 104 | 103 1140-3024 11:40:30.00 -30:24:23.76 175.12500 -30.406600 62.03461 -9.58367 105 | 104 1143-3920 11:43:10.08 -39:20:14.27 175.79200 -39.337300 53.34727 -12.28956 106 | 105 1146-2615 11:46:58.32 -26:15:50.39 176.74300 -26.264000 66.46862 -9.88261 107 | 106 1149-8037 11:49:58.31 -80:37:04.08 177.49300 -80.617800 10.89805 -18.06019 108 | 107 1153-3230 11:53:16.08 -32:30:33.83 178.31700 -32.509400 60.63310 -12.73696 109 | 108 1154-4404 11:54:44.88 -44:04:17.40 178.68700 -44.071500 49.01856 -15.35748 110 | 109 1156-3615 11:56:18.48 -36:15:46.79 179.07700 -36.263000 57.00487 -14.16231 111 | 110 1159-2819 11:59:01.68 -28:19:37.20 179.75700 -28.327000 65.10082 -12.98603 112 | 111 1200-3958 12:00:06.00 -39:58:35.03 180.02500 -39.976400 53.38330 -15.61000 113 | 112 1210-2501 12:10:37.19 -25:01:03.36 182.65500 -25.017600 69.02852 -14.75120 114 | 113 1214-3520 12:14:01.19 -35:20:36.59 183.50500 -35.343500 58.64187 -17.51795 115 | 114 1222-2647 12:22:59.28 -26:47:52.43 185.74700 -26.797900 67.82848 -17.84589 116 | 115 1225-8421 12:25:08.64 -84:21:34.92 186.28600 -84.359700 6.87165 -18.86908 117 | 116 1225-4112 12:25:29.76 -41:12:40.31 186.37400 -41.211200 52.82196 -20.55670 118 | 117 1228-3700 12:28:54.96 -37:00:07.55 187.22900 -37.002100 57.37156 -20.73436 119 | 118 1232-4446 12:32:05.51 -44:46:07.67 188.02300 -44.768800 49.12556 -22.05733 120 | 119 1233-3118 12:33:35.51 -31:18:05.40 188.39800 -31.301500 63.55501 -20.91215 121 | 120 1240-4816 12:40:03.59 -48:16:07.67 190.01500 -48.268800 45.38687 -23.55746 122 | 121 1243-2740 12:43:47.75 -27:40:16.31 190.94900 -27.671200 67.78216 -22.55231 123 | 122 1246-3536 12:46:11.76 -35:36:46.44 191.54900 -35.612900 59.26990 -24.04586 124 | 123 1252-4031 12:52:16.79 -40:31:46.19 193.07000 -40.529500 53.94986 -25.55808 125 | 124 1300-4356 13:00:26.63 -43:56:40.56 195.11100 -43.944600 50.15682 -27.10380 126 | 125 1310-3557 13:10:08.16 -35:57:44.64 197.53400 -35.962400 59.21212 -28.91234 127 | 126 1310-4716 13:10:08.87 -47:16:35.76 197.53700 -47.276600 46.30110 -28.64120 128 | 127 1318-3918 13:18:12.48 -39:18:52.55 199.55200 -39.314600 55.35816 -30.52109 129 | 128 1318-3205 13:18:28.79 -32:05:48.48 199.62000 -32.096800 63.73751 -30.48731 130 | 129 1357-8104 13:57:02.15 -81:04:01.19 209.25900 -81.067000 8.97106 -22.73500 131 | 130 1446-8736 14:46:59.99 -87:36:23.76 221.75000 -87.606600 2.75745 -19.54048 132 | 131 1533-8322 15:33:16.79 -83:22:26.75 233.32000 -83.374100 4.75129 -23.42858 133 | 132 1541-7629 15:41:26.15 -76:29:06.72 235.35900 -76.485200 8.50165 -29.45451 134 | 133 1644-7911 16:44:30.72 -79:11:00.95 251.12800 -79.183600 3.82320 -28.29506 135 | 134 1814-8529 18:14:40.55 -85:29:55.68 273.66900 -85.498800 0.24926 -22.22423 136 | 135 1818-8038 18:18:07.68 -80:38:09.24 274.53200 -80.635900 -0.81914 -26.99022 137 | 136 1941-7849 19:41:01.68 -78:49:56.28 295.25700 -78.832300 -5.39463 -27.24562 138 | 137 1957-7519 19:57:12.48 -75:19:39.71 299.30200 -75.327700 -8.57394 -29.54018 139 | 138 2033-8310 20:33:49.19 -83:10:45.84 308.45500 -83.179400 -4.10145 -22.60703 140 | 139 2100-7704 21:00:13.92 -77:04:47.99 315.05800 -77.080000 -10.03254 -25.61866 141 | 140 2114-6901 21:14:19.92 -69:01:54.48 318.58300 -69.031800 -18.35380 -28.95458 142 | 141 2134-7942 21:34:07.44 -79:42:11.16 323.53100 -79.703100 -8.55088 -22.80434 143 | 142 2135-7328 21:35:25.91 -73:28:06.95 323.85800 -73.468600 -14.72750 -25.47233 144 | 143 2204-7549 22:04:55.92 -75:49:53.75 331.23300 -75.831600 -13.09958 -22.79618 145 | 144 2211-6822 22:11:14.64 -68:22:21.36 332.81100 -68.372600 -21.07530 -24.36045 146 | 145 2244-7202 22:44:29.03 -72:02:25.08 341.12100 -72.040300 -17.71173 -20.94539 147 | 146 2248-8721 22:48:00.72 -87:21:41.40 342.00300 -87.361500 -1.67539 -18.32769 148 | 147 2254-6742 22:54:01.43 -67:42:15.12 343.50600 -67.704200 -22.40544 -20.50160 149 | 148 2301-8319 23:01:11.99 -83:19:29.27 345.30000 -83.324800 -5.92166 -18.70395 150 | 149 2326-7205 23:26:40.07 -72:05:10.67 351.66700 -72.086300 -17.77569 -17.70196 151 | 150 2327-6741 23:27:15.60 -67:41:23.63 351.81500 -67.689900 -22.37182 -17.35080 152 | 151 2327-7621 23:27:48.24 -76:21:23.39 351.95100 -76.356500 -13.29265 -17.81901 153 | 152 2332-8031 23:32:27.60 -80:31:08.40 353.11500 -80.519000 -8.91581 -17.72816 154 | 153 LAF1 06:55:16.69 -36:55:08.00 103.81954 -36.918889 19.46357 32.27822 155 | 154 LAF2 07:10:46.15 -43:52:26.20 107.69229 -43.873944 19.41033 24.72612 156 | 155 LAF3 07:24:54.78 -49:24:31.70 111.22825 -49.408806 19.16704 18.68823 157 | 156 LAF4 07:41:32.79 -54:53:18.90 115.38663 -54.888583 18.76365 12.65857 158 | 157 LAF5 08:01:46.75 -62:58:29.90 120.44479 -62.974972 16.63569 4.43208 159 | 158 LAF6 09:23:02.31 -24:43:19.00 140.75962 -24.721944 54.97078 20.49333 160 | 159 LAF7 09:33:17.01 -72:33:51.40 143.32088 -72.564278 16.08880 -8.31236 161 | 160 LAF8 10:08:44.84 -15:02:06.10 152.18683 -15.035028 69.23177 15.47812 162 | 161 LAF9 10:08:57.62 -33:56:13.00 152.24008 -33.936944 51.85727 7.24558 163 | 162 LAF10 10:17:20.50 -25:23:38.10 154.33542 -25.393917 60.42185 9.36106 164 | 163 LAF11 10:39:55.51 -38:09:52.10 159.98129 -38.164472 50.66680 -0.20875 165 | 164 LAF12 11:00:06.01 -17:54:03.20 165.02504 -17.900889 71.16560 2.98539 166 | 165 LAF13 11:07:46.22 -40:56:20.80 166.94258 -40.939111 49.94447 -6.20520 167 | 166 LAF14 11:38:12.36 -43:04:01.80 174.55150 -43.067167 49.41346 -12.22109 168 | 167 LAF15 11:51:22.70 -21:57:19.80 177.84458 -21.955500 70.95543 -9.72244 169 | 168 LAF16 12:13:29.79 -45:51:53.30 183.37412 -45.864806 47.65894 -18.89563 170 | 169 LAF17 12:19:58.15 -31:27:20.80 184.99229 -31.455778 62.88876 -18.06911 171 | 170 LAF18 12:55:28.60 -31:55:35.20 193.86917 -31.926444 63.51670 -25.61245 172 | 171 LAF19 12:59:19.76 -78:03:10.30 194.83233 -78.052861 13.07378 -21.59095 173 | 172 LAF20 13:27:10.15 -44:35:46.00 201.79229 -44.596111 49.07016 -31.83720 174 | 173 LAF21 13:44:37.73 -30:33:05.20 206.15721 -30.551444 65.77684 -36.02417 175 | 174 LAF22 13:59:59.32 -43:19:13.60 209.99717 -43.320444 49.49060 -37.86695 176 | 175 LAF23 14:46:50.21 -76:32:16.70 221.70921 -76.537972 11.26160 -27.40400 177 | 176 PRE1 00:42:36.24 -67:47:37.32 10.65102 -67.793700 -20.59929 -10.45394 178 | 177 PRE2 01:29:50.11 -67:23:34.18 22.45883 -67.392830 -18.89355 -6.26954 179 | 178 PRE3 01:40:28.90 -71:13:03.00 25.12044 -71.217500 -15.15628 -7.58949 180 | 179 1708-8320 17:08:36.48 -83:20:43.09 257.15200 -83.345300 1.94700 -24.38561 181 | 180 1830-7727 18:30:04.08 -77:27:14.40 277.51700 -77.454000 -2.24732 -29.96751 182 | 181 2246-7746 22:46:33.84 -77:46:19.20 341.64100 -77.772000 -11.66731 -20.04114 183 | 182 2204-7116 22:04:34.80 -71:16:54.84 331.14500 -71.281900 -17.82950 -24.16859 184 | 183 1528-8043 15:28:35.52 -80:43:04.80 232.14800 -80.718000 6.49956 -25.56164 185 | -------------------------------------------------------------------------------- /skymap/_version.py: -------------------------------------------------------------------------------- 1 | 2 | # This file helps to compute a version number in source trees obtained from 3 | # git-archive tarball (such as those provided by githubs download-from-tag 4 | # feature). Distribution tarballs (built by setup.py sdist) and build 5 | # directories (produced by setup.py build) will contain a much shorter file 6 | # that just contains the computed version number. 7 | 8 | # This file is released into the public domain. Generated by 9 | # versioneer-0.16 (https://github.com/warner/python-versioneer) 10 | 11 | """Git implementation of _version.py.""" 12 | 13 | import errno 14 | import os 15 | import re 16 | import subprocess 17 | import sys 18 | 19 | 20 | def get_keywords(): 21 | """Get the keywords needed to look up the version information.""" 22 | # these strings will be replaced by git during git-archive. 23 | # setup.py/versioneer.py will grep for the variable names, so they must 24 | # each be defined on a line of their own. _version.py will just call 25 | # get_keywords(). 26 | git_refnames = " (HEAD -> master)" 27 | git_full = "c78701c19de7ff3867d4e7559dc9ec8574abb5dc" 28 | keywords = {"refnames": git_refnames, "full": git_full} 29 | return keywords 30 | 31 | 32 | class VersioneerConfig: 33 | """Container for Versioneer configuration parameters.""" 34 | 35 | 36 | def get_config(): 37 | """Create, populate and return the VersioneerConfig() object.""" 38 | # these strings are filled in when 'setup.py versioneer' creates 39 | # _version.py 40 | cfg = VersioneerConfig() 41 | cfg.VCS = "git" 42 | cfg.style = "pep440" 43 | cfg.tag_prefix = "v" 44 | cfg.parentdir_prefix = "skymap-" 45 | cfg.versionfile_source = "skymap/_version.py" 46 | cfg.verbose = False 47 | return cfg 48 | 49 | 50 | class NotThisMethod(Exception): 51 | """Exception raised if a method is not valid for the current scenario.""" 52 | 53 | 54 | LONG_VERSION_PY = {} 55 | HANDLERS = {} 56 | 57 | 58 | def register_vcs_handler(vcs, method): # decorator 59 | """Decorator to mark a method as the handler for a particular VCS.""" 60 | def decorate(f): 61 | """Store f in HANDLERS[vcs][method].""" 62 | if vcs not in HANDLERS: 63 | HANDLERS[vcs] = {} 64 | HANDLERS[vcs][method] = f 65 | return f 66 | return decorate 67 | 68 | 69 | def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False): 70 | """Call the given command(s).""" 71 | assert isinstance(commands, list) 72 | p = None 73 | for c in commands: 74 | try: 75 | dispcmd = str([c] + args) 76 | # remember shell=False, so use git.cmd on windows, not just git 77 | p = subprocess.Popen([c] + args, cwd=cwd, stdout=subprocess.PIPE, 78 | stderr=(subprocess.PIPE if hide_stderr 79 | else None)) 80 | break 81 | except EnvironmentError: 82 | e = sys.exc_info()[1] 83 | if e.errno == errno.ENOENT: 84 | continue 85 | if verbose: 86 | print("unable to run %s" % dispcmd) 87 | print(e) 88 | return None 89 | else: 90 | if verbose: 91 | print("unable to find command, tried %s" % (commands,)) 92 | return None 93 | stdout = p.communicate()[0].strip() 94 | if sys.version_info[0] >= 3: 95 | stdout = stdout.decode() 96 | if p.returncode != 0: 97 | if verbose: 98 | print("unable to run %s (error)" % dispcmd) 99 | return None 100 | return stdout 101 | 102 | 103 | def versions_from_parentdir(parentdir_prefix, root, verbose): 104 | """Try to determine the version from the parent directory name. 105 | 106 | Source tarballs conventionally unpack into a directory that includes 107 | both the project name and a version string. 108 | """ 109 | dirname = os.path.basename(root) 110 | if not dirname.startswith(parentdir_prefix): 111 | if verbose: 112 | print("guessing rootdir is '%s', but '%s' doesn't start with " 113 | "prefix '%s'" % (root, dirname, parentdir_prefix)) 114 | raise NotThisMethod("rootdir doesn't start with parentdir_prefix") 115 | return {"version": dirname[len(parentdir_prefix):], 116 | "full-revisionid": None, 117 | "dirty": False, "error": None} 118 | 119 | 120 | @register_vcs_handler("git", "get_keywords") 121 | def git_get_keywords(versionfile_abs): 122 | """Extract version information from the given file.""" 123 | # the code embedded in _version.py can just fetch the value of these 124 | # keywords. When used from setup.py, we don't want to import _version.py, 125 | # so we do it with a regexp instead. This function is not used from 126 | # _version.py. 127 | keywords = {} 128 | try: 129 | f = open(versionfile_abs, "r") 130 | for line in f.readlines(): 131 | if line.strip().startswith("git_refnames ="): 132 | mo = re.search(r'=\s*"(.*)"', line) 133 | if mo: 134 | keywords["refnames"] = mo.group(1) 135 | if line.strip().startswith("git_full ="): 136 | mo = re.search(r'=\s*"(.*)"', line) 137 | if mo: 138 | keywords["full"] = mo.group(1) 139 | f.close() 140 | except EnvironmentError: 141 | pass 142 | return keywords 143 | 144 | 145 | @register_vcs_handler("git", "keywords") 146 | def git_versions_from_keywords(keywords, tag_prefix, verbose): 147 | """Get version information from git keywords.""" 148 | if not keywords: 149 | raise NotThisMethod("no keywords at all, weird") 150 | refnames = keywords["refnames"].strip() 151 | if refnames.startswith("$Format"): 152 | if verbose: 153 | print("keywords are unexpanded, not using") 154 | raise NotThisMethod("unexpanded keywords, not a git-archive tarball") 155 | refs = set([r.strip() for r in refnames.strip("()").split(",")]) 156 | # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of 157 | # just "foo-1.0". If we see a "tag: " prefix, prefer those. 158 | TAG = "tag: " 159 | tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)]) 160 | if not tags: 161 | # Either we're using git < 1.8.3, or there really are no tags. We use 162 | # a heuristic: assume all version tags have a digit. The old git %d 163 | # expansion behaves like git log --decorate=short and strips out the 164 | # refs/heads/ and refs/tags/ prefixes that would let us distinguish 165 | # between branches and tags. By ignoring refnames without digits, we 166 | # filter out many common branch names like "release" and 167 | # "stabilization", as well as "HEAD" and "master". 168 | tags = set([r for r in refs if re.search(r'\d', r)]) 169 | if verbose: 170 | print("discarding '%s', no digits" % ",".join(refs-tags)) 171 | if verbose: 172 | print("likely tags: %s" % ",".join(sorted(tags))) 173 | for ref in sorted(tags): 174 | # sorting will prefer e.g. "2.0" over "2.0rc1" 175 | if ref.startswith(tag_prefix): 176 | r = ref[len(tag_prefix):] 177 | if verbose: 178 | print("picking %s" % r) 179 | return {"version": r, 180 | "full-revisionid": keywords["full"].strip(), 181 | "dirty": False, "error": None 182 | } 183 | # no suitable tags, so version is "0+unknown", but full hex is still there 184 | if verbose: 185 | print("no suitable tags, using unknown + full revision id") 186 | return {"version": "0+unknown", 187 | "full-revisionid": keywords["full"].strip(), 188 | "dirty": False, "error": "no suitable tags"} 189 | 190 | 191 | @register_vcs_handler("git", "pieces_from_vcs") 192 | def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): 193 | """Get version from 'git describe' in the root of the source tree. 194 | 195 | This only gets called if the git-archive 'subst' keywords were *not* 196 | expanded, and _version.py hasn't already been rewritten with a short 197 | version string, meaning we're inside a checked out source tree. 198 | """ 199 | if not os.path.exists(os.path.join(root, ".git")): 200 | if verbose: 201 | print("no .git in %s" % root) 202 | raise NotThisMethod("no .git directory") 203 | 204 | GITS = ["git"] 205 | if sys.platform == "win32": 206 | GITS = ["git.cmd", "git.exe"] 207 | # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] 208 | # if there isn't one, this yields HEX[-dirty] (no NUM) 209 | describe_out = run_command(GITS, ["describe", "--tags", "--dirty", 210 | "--always", "--long", 211 | "--match", "%s*" % tag_prefix], 212 | cwd=root) 213 | # --long was added in git-1.5.5 214 | if describe_out is None: 215 | raise NotThisMethod("'git describe' failed") 216 | describe_out = describe_out.strip() 217 | full_out = run_command(GITS, ["rev-parse", "HEAD"], cwd=root) 218 | if full_out is None: 219 | raise NotThisMethod("'git rev-parse' failed") 220 | full_out = full_out.strip() 221 | 222 | pieces = {} 223 | pieces["long"] = full_out 224 | pieces["short"] = full_out[:7] # maybe improved later 225 | pieces["error"] = None 226 | 227 | # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] 228 | # TAG might have hyphens. 229 | git_describe = describe_out 230 | 231 | # look for -dirty suffix 232 | dirty = git_describe.endswith("-dirty") 233 | pieces["dirty"] = dirty 234 | if dirty: 235 | git_describe = git_describe[:git_describe.rindex("-dirty")] 236 | 237 | # now we have TAG-NUM-gHEX or HEX 238 | 239 | if "-" in git_describe: 240 | # TAG-NUM-gHEX 241 | mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe) 242 | if not mo: 243 | # unparseable. Maybe git-describe is misbehaving? 244 | pieces["error"] = ("unable to parse git-describe output: '%s'" 245 | % describe_out) 246 | return pieces 247 | 248 | # tag 249 | full_tag = mo.group(1) 250 | if not full_tag.startswith(tag_prefix): 251 | if verbose: 252 | fmt = "tag '%s' doesn't start with prefix '%s'" 253 | print(fmt % (full_tag, tag_prefix)) 254 | pieces["error"] = ("tag '%s' doesn't start with prefix '%s'" 255 | % (full_tag, tag_prefix)) 256 | return pieces 257 | pieces["closest-tag"] = full_tag[len(tag_prefix):] 258 | 259 | # distance: number of commits since tag 260 | pieces["distance"] = int(mo.group(2)) 261 | 262 | # commit: short hex revision ID 263 | pieces["short"] = mo.group(3) 264 | 265 | else: 266 | # HEX: no tags 267 | pieces["closest-tag"] = None 268 | count_out = run_command(GITS, ["rev-list", "HEAD", "--count"], 269 | cwd=root) 270 | pieces["distance"] = int(count_out) # total number of commits 271 | 272 | return pieces 273 | 274 | 275 | def plus_or_dot(pieces): 276 | """Return a + if we don't already have one, else return a .""" 277 | if "+" in pieces.get("closest-tag", ""): 278 | return "." 279 | return "+" 280 | 281 | 282 | def render_pep440(pieces): 283 | """Build up version string, with post-release "local version identifier". 284 | 285 | Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you 286 | get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty 287 | 288 | Exceptions: 289 | 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty] 290 | """ 291 | if pieces["closest-tag"]: 292 | rendered = pieces["closest-tag"] 293 | if pieces["distance"] or pieces["dirty"]: 294 | rendered += plus_or_dot(pieces) 295 | rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) 296 | if pieces["dirty"]: 297 | rendered += ".dirty" 298 | else: 299 | # exception #1 300 | rendered = "0+untagged.%d.g%s" % (pieces["distance"], 301 | pieces["short"]) 302 | if pieces["dirty"]: 303 | rendered += ".dirty" 304 | return rendered 305 | 306 | 307 | def render_pep440_pre(pieces): 308 | """TAG[.post.devDISTANCE] -- No -dirty. 309 | 310 | Exceptions: 311 | 1: no tags. 0.post.devDISTANCE 312 | """ 313 | if pieces["closest-tag"]: 314 | rendered = pieces["closest-tag"] 315 | if pieces["distance"]: 316 | rendered += ".post.dev%d" % pieces["distance"] 317 | else: 318 | # exception #1 319 | rendered = "0.post.dev%d" % pieces["distance"] 320 | return rendered 321 | 322 | 323 | def render_pep440_post(pieces): 324 | """TAG[.postDISTANCE[.dev0]+gHEX] . 325 | 326 | The ".dev0" means dirty. Note that .dev0 sorts backwards 327 | (a dirty tree will appear "older" than the corresponding clean one), 328 | but you shouldn't be releasing software with -dirty anyways. 329 | 330 | Exceptions: 331 | 1: no tags. 0.postDISTANCE[.dev0] 332 | """ 333 | if pieces["closest-tag"]: 334 | rendered = pieces["closest-tag"] 335 | if pieces["distance"] or pieces["dirty"]: 336 | rendered += ".post%d" % pieces["distance"] 337 | if pieces["dirty"]: 338 | rendered += ".dev0" 339 | rendered += plus_or_dot(pieces) 340 | rendered += "g%s" % pieces["short"] 341 | else: 342 | # exception #1 343 | rendered = "0.post%d" % pieces["distance"] 344 | if pieces["dirty"]: 345 | rendered += ".dev0" 346 | rendered += "+g%s" % pieces["short"] 347 | return rendered 348 | 349 | 350 | def render_pep440_old(pieces): 351 | """TAG[.postDISTANCE[.dev0]] . 352 | 353 | The ".dev0" means dirty. 354 | 355 | Eexceptions: 356 | 1: no tags. 0.postDISTANCE[.dev0] 357 | """ 358 | if pieces["closest-tag"]: 359 | rendered = pieces["closest-tag"] 360 | if pieces["distance"] or pieces["dirty"]: 361 | rendered += ".post%d" % pieces["distance"] 362 | if pieces["dirty"]: 363 | rendered += ".dev0" 364 | else: 365 | # exception #1 366 | rendered = "0.post%d" % pieces["distance"] 367 | if pieces["dirty"]: 368 | rendered += ".dev0" 369 | return rendered 370 | 371 | 372 | def render_git_describe(pieces): 373 | """TAG[-DISTANCE-gHEX][-dirty]. 374 | 375 | Like 'git describe --tags --dirty --always'. 376 | 377 | Exceptions: 378 | 1: no tags. HEX[-dirty] (note: no 'g' prefix) 379 | """ 380 | if pieces["closest-tag"]: 381 | rendered = pieces["closest-tag"] 382 | if pieces["distance"]: 383 | rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) 384 | else: 385 | # exception #1 386 | rendered = pieces["short"] 387 | if pieces["dirty"]: 388 | rendered += "-dirty" 389 | return rendered 390 | 391 | 392 | def render_git_describe_long(pieces): 393 | """TAG-DISTANCE-gHEX[-dirty]. 394 | 395 | Like 'git describe --tags --dirty --always -long'. 396 | The distance/hash is unconditional. 397 | 398 | Exceptions: 399 | 1: no tags. HEX[-dirty] (note: no 'g' prefix) 400 | """ 401 | if pieces["closest-tag"]: 402 | rendered = pieces["closest-tag"] 403 | rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) 404 | else: 405 | # exception #1 406 | rendered = pieces["short"] 407 | if pieces["dirty"]: 408 | rendered += "-dirty" 409 | return rendered 410 | 411 | 412 | def render(pieces, style): 413 | """Render the given version pieces into the requested style.""" 414 | if pieces["error"]: 415 | return {"version": "unknown", 416 | "full-revisionid": pieces.get("long"), 417 | "dirty": None, 418 | "error": pieces["error"]} 419 | 420 | if not style or style == "default": 421 | style = "pep440" # the default 422 | 423 | if style == "pep440": 424 | rendered = render_pep440(pieces) 425 | elif style == "pep440-pre": 426 | rendered = render_pep440_pre(pieces) 427 | elif style == "pep440-post": 428 | rendered = render_pep440_post(pieces) 429 | elif style == "pep440-old": 430 | rendered = render_pep440_old(pieces) 431 | elif style == "git-describe": 432 | rendered = render_git_describe(pieces) 433 | elif style == "git-describe-long": 434 | rendered = render_git_describe_long(pieces) 435 | else: 436 | raise ValueError("unknown style '%s'" % style) 437 | 438 | return {"version": rendered, "full-revisionid": pieces["long"], 439 | "dirty": pieces["dirty"], "error": None} 440 | 441 | 442 | def get_versions(): 443 | """Get version information or return default if unable to do so.""" 444 | # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have 445 | # __file__, we can work backwards from there to the root. Some 446 | # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which 447 | # case we can only use expanded keywords. 448 | 449 | cfg = get_config() 450 | verbose = cfg.verbose 451 | 452 | try: 453 | return git_versions_from_keywords(get_keywords(), cfg.tag_prefix, 454 | verbose) 455 | except NotThisMethod: 456 | pass 457 | 458 | try: 459 | root = os.path.realpath(__file__) 460 | # versionfile_source is the relative path from the top of the source 461 | # tree (where the .git directory might live) to this file. Invert 462 | # this to find the root from __file__. 463 | for i in cfg.versionfile_source.split('/'): 464 | root = os.path.dirname(root) 465 | except NameError: 466 | return {"version": "0+unknown", "full-revisionid": None, 467 | "dirty": None, 468 | "error": "unable to find root of source tree"} 469 | 470 | try: 471 | pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose) 472 | return render(pieces, cfg.style) 473 | except NotThisMethod: 474 | pass 475 | 476 | try: 477 | if cfg.parentdir_prefix: 478 | return versions_from_parentdir(cfg.parentdir_prefix, root, verbose) 479 | except NotThisMethod: 480 | pass 481 | 482 | return {"version": "0+unknown", "full-revisionid": None, 483 | "dirty": None, 484 | "error": "unable to compute version"} 485 | -------------------------------------------------------------------------------- /skymap/survey.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Extension for individual surveys. 4 | """ 5 | import os 6 | 7 | import numpy as np 8 | import pylab as plt 9 | import pandas as pd 10 | from collections import OrderedDict as odict 11 | 12 | from mpl_toolkits.basemap import Basemap 13 | from mpl_toolkits.axisartist.grid_helper_curvelinear import GridHelperCurveLinear 14 | from mpl_toolkits.axisartist import Subplot 15 | import mpl_toolkits.axisartist as axisartist 16 | import mpl_toolkits.axisartist.angle_helper as angle_helper 17 | 18 | from skymap.utils import setdefaults,get_datadir,hpx_gal2cel 19 | from skymap.core import Skymap,McBrydeSkymap,OrthoSkymap 20 | from skymap.constants import DECAM 21 | 22 | # Derived from telra,teldec of 10000 exposures 23 | DES_SN = odict([ 24 | ('E1',dict(ra=7.874, dec=-43.010)), 25 | ('E2',dict(ra=9.500, dec=-43.999)), 26 | ('X1',dict(ra=34.476, dec=-4.931 )), 27 | ('X2',dict(ra=35.664, dec=-6.413 )), 28 | ('X3',dict(ra=36.449, dec=-4.601 )), 29 | ('S1',dict(ra=42.818, dec=0.000 )), 30 | ('S2',dict(ra=41.193, dec=-0.991 )), 31 | ('C1',dict(ra=54.274, dec=-27.113)), 32 | ('C2',dict(ra=54.274, dec=-29.090)), 33 | ('C3',dict(ra=52.647, dec=-28.101)), 34 | ]) 35 | 36 | DES_SN_LABELS = odict([ 37 | ('SN-E', dict(ra=15, dec=-38, ha='center')), 38 | ('SN-X', dict(ra=35, dec=-13, ha='center')), 39 | ('SN-S', dict(ra=55, dec=0, ha='center')), 40 | ('SN-C', dict(ra=57, dec=-36, ha='center')), 41 | ]) 42 | 43 | 44 | class SurveySkymap(Skymap): 45 | """Extending to survey specific functions. 46 | """ 47 | def draw_maglites(self,**kwargs): 48 | """Draw the MagLiteS footprint""" 49 | defaults=dict(color='blue', lw=2) 50 | setdefaults(kwargs,defaults) 51 | 52 | filename = os.path.join(get_datadir(),'maglites-poly.txt') 53 | self.draw_polygon(filename,**kwargs) 54 | 55 | def draw_bliss(self,**kwargs): 56 | """Draw the BLISS footprint""" 57 | defaults=dict(color='magenta', lw=2) 58 | setdefaults(kwargs,defaults) 59 | 60 | filename = os.path.join(get_datadir(),'bliss-poly.txt') 61 | self.draw_polygons(filename,**kwargs) 62 | 63 | #data = np.genfromtxt(filename,names=['ra','dec','poly']) 64 | #for p in np.unique(data['poly']): 65 | # poly = data[data['poly'] == p] 66 | # self.draw_polygon_radec(poly['ra'],poly['dec'],**kwargs) 67 | 68 | def draw_des(self,**kwargs): 69 | """ Draw the DES footprint. """ 70 | return self.draw_des19(**kwargs) 71 | 72 | def draw_des13(self,**kwargs): 73 | """ Draw the DES footprint. """ 74 | defaults=dict(color='red', lw=2) 75 | setdefaults(kwargs,defaults) 76 | 77 | filename = os.path.join(get_datadir(),'des-round13-poly.txt') 78 | return self.draw_polygon(filename,**kwargs) 79 | 80 | def draw_des17(self,**kwargs): 81 | """ Draw the DES footprint. """ 82 | defaults=dict(color='blue', lw=2) 83 | setdefaults(kwargs,defaults) 84 | 85 | filename = os.path.join(get_datadir(),'des-round17-poly.txt') 86 | return self.draw_polygon(filename,**kwargs) 87 | 88 | def draw_des19(self,**kwargs): 89 | """ Draw the DES footprint. """ 90 | defaults=dict(color='blue', lw=2) 91 | setdefaults(kwargs,defaults) 92 | 93 | filename = os.path.join(get_datadir(),'des-round19-poly.txt') 94 | return self.draw_polygon(filename,**kwargs) 95 | 96 | def draw_des_sn(self,**kwargs): 97 | defaults = dict(facecolor='none',edgecolor='k',lw=1,zorder=10) 98 | setdefaults(kwargs,defaults) 99 | for v in DES_SN.values(): 100 | # This does the projection correctly, but fails at boundary 101 | self.tissot(v['ra'],v['dec'],DECAM,100,**kwargs) 102 | 103 | def draw_smash(self,**kwargs): 104 | """ Draw the SMASH fields. """ 105 | defaults=dict(facecolor='none',color='k') 106 | setdefaults(kwargs,defaults) 107 | 108 | filename = os.path.join(get_datadir(),'smash_fields_final.txt') 109 | smash=np.genfromtxt(filename,dtype=[('ra',float),('dec',float)],usecols=[4,5]) 110 | xy = self.proj(smash['ra'],smash['dec']) 111 | self.scatter(*xy,**kwargs) 112 | 113 | def draw_decals(self,**kwargs): 114 | defaults=dict(color='red', lw=2) 115 | setdefaults(kwargs,defaults) 116 | 117 | filename = os.path.join(get_datadir(),'decals-poly.txt') 118 | return self.draw_polygon(filename,**kwargs) 119 | 120 | def draw_jethwa(self,filename=None,log=True,**kwargs): 121 | import healpy as hp 122 | if not filename: 123 | datadir = '/home/s1/kadrlica/projects/bliss/v0/data/' 124 | datadir = '/Users/kadrlica/bliss/observing/data' 125 | filename = os.path.join(datadir,'jethwa_satellites_n256.fits.gz') 126 | hpxmap = hp.read_map(filename) 127 | if log: 128 | return self.draw_hpxmap(np.log10(hpxmap),**kwargs) 129 | else: 130 | return self.draw_hpxmap(hpxmap,**kwargs) 131 | 132 | def draw_planet9(self,**kwargs): 133 | from scipy.interpolate import interp1d 134 | from scipy.interpolate import UnivariateSpline 135 | defaults=dict(color='b',lw=3) 136 | setdefaults(kwargs,defaults) 137 | datadir = '/home/s1/kadrlica/projects/bliss/v0/data/' 138 | datadir = '/Users/kadrlica/bliss/observing/data/' 139 | ra_lo,dec_lo=np.genfromtxt(datadir+'p9_lo.txt',usecols=(0,1)).T 140 | ra_lo,dec_lo = self.roll(ra_lo,dec_lo) 141 | ra_lo += -360*(ra_lo > 180) 142 | ra_lo,dec_lo = ra_lo[::-1],dec_lo[::-1] 143 | ra_hi,dec_hi=np.genfromtxt(datadir+'p9_hi.txt',usecols=(0,1)).T 144 | ra_hi,dec_hi = self.roll(ra_hi,dec_hi) 145 | ra_hi += -360*(ra_hi > 180) 146 | ra_hi,dec_hi = ra_hi[::-1],dec_hi[::-1] 147 | 148 | spl_lo = UnivariateSpline(ra_lo,dec_lo) 149 | ra_lo_smooth = np.linspace(ra_lo[0],ra_lo[-1],360) 150 | dec_lo_smooth = spl_lo(ra_lo_smooth) 151 | 152 | spl_hi = UnivariateSpline(ra_hi,dec_hi) 153 | ra_hi_smooth = np.linspace(ra_hi[0],ra_hi[-1],360) 154 | dec_hi_smooth = spl_hi(ra_hi_smooth) 155 | 156 | #self.plot(ra_lo,dec_lo,latlon=True,**kwargs) 157 | #self.plot(ra_hi,dec_hi,latlon=True,**kwargs) 158 | self.plot(ra_lo_smooth,dec_lo_smooth,latlon=True,**kwargs) 159 | self.plot(ra_hi_smooth,dec_hi_smooth,latlon=True,**kwargs) 160 | 161 | orb = pd.read_csv(datadir+'P9_orbit_Cassini.csv').to_records(index=False)[::7] 162 | kwargs = dict(marker='o',s=40,edgecolor='none',cmap='jet_r') 163 | self.scatter(*self.proj(orb['ra'],orb['dec']),c=orb['cassini'],**kwargs) 164 | 165 | def draw_ligo(self,filename=None, log=True,**kwargs): 166 | import healpy as hp 167 | from astropy.io import fits as pyfits 168 | if not filename: 169 | datadir = '/home/s1/kadrlica/projects/bliss/v0/data/' 170 | datadir = '/Users/kadrlica/bliss/observing/data' 171 | filename = datadir + 'obsbias_heatmap_semesterA.fits' 172 | hpxmap = pyfits.open(filename)[0].data 173 | if log: self.draw_hpxmap(np.log10(hpxmap)) 174 | else: self.draw_hpxmap(hpxmap) 175 | 176 | def draw_sfd(self,filename=None,**kwargs): 177 | import healpy as hp 178 | defaults = dict(rasterized=True,cmap=plt.cm.binary) 179 | setdefaults(kwargs,defaults) 180 | if not filename: 181 | datadir = '/Users/kadrlica/bliss/observing/data/' 182 | filename = datadir+'lambda_sfd_ebv.fits' 183 | 184 | galhpx = hp.read_map(filename) 185 | celhpx = hpx_gal2cel(galhpx) 186 | return self.draw_hpxmap(np.log10(celhpx),**kwargs) 187 | 188 | class SurveyMcBryde(SurveySkymap,McBrydeSkymap): pass 189 | class SurveyOrtho(SurveySkymap,OrthoSkymap): pass 190 | 191 | # Original DES Formatter 192 | # ADW: Why doesn't ZoomFormatter180 work? 193 | class ZoomFormatterDES(angle_helper.FormatterDMS): 194 | 195 | def __call__(self, direction, factor, values): 196 | values = np.asarray(values) 197 | ss = np.where(values>=0, 1, -1) 198 | values = np.mod(np.abs(values),360) 199 | values -= 360*(values > 180) 200 | return [self.fmt_d % (s*int(v),) for (s, v) in zip(ss, values)] 201 | 202 | class ZoomFormatter(angle_helper.FormatterDMS): 203 | def _wrap_angle(self, angle): 204 | return angle 205 | 206 | def __call__(self, direction, factor, values): 207 | values = np.asarray(values) 208 | values = self._wrap_angle(values) 209 | ticks = [self.fmt_d % int(v) for v in values] 210 | return ticks 211 | 212 | class ZoomFormatter360(ZoomFormatter): 213 | def _wrap_angle(self, angle): 214 | """Ticks go from 0 to 360""" 215 | angle = np.mod(angle,360) 216 | return angle 217 | 218 | class ZoomFormatter180(ZoomFormatter): 219 | def _wrap_angle(self, angle): 220 | """Ticks go from -180 to 180""" 221 | angle = np.mod(np.abs(angle),360) 222 | angle -= 360*(angle > 180) 223 | return angle 224 | 225 | class SurveyZoom(SurveyMcBryde): 226 | FRAME = [[-50,-50,90,90],[10,-75,10,-75]] 227 | FIGSIZE=(8,5) 228 | 229 | def __init__(self, rect=None, *args, **kwargs): 230 | super(SurveyZoom,self).__init__(*args, **kwargs) 231 | self.create_axes(rect) 232 | 233 | @classmethod 234 | def figure(cls,**kwargs): 235 | """ Create a figure of proper size """ 236 | defaults=dict(figsize=cls.FIGSIZE) 237 | setdefaults(kwargs,defaults) 238 | return plt.figure(**kwargs) 239 | 240 | def draw_parallels(*args, **kwargs): return 241 | def draw_meridians(*args, **kwargs): return 242 | 243 | def set_axes_limits(self, ax=None): 244 | if ax is None: ax = plt.gca() 245 | 246 | x,y = self(*self.FRAME) 247 | ax.set_xlim(min(x),max(x)) 248 | ax.set_ylim(min(y),max(y)) 249 | ax.grid(True,linestyle=':',color='k',lw=0.5) 250 | 251 | # Fix the aspect ratio for full-sky projections 252 | if self.fix_aspect: 253 | ax.set_aspect('equal',anchor=self.anchor) 254 | else: 255 | ax.set_aspect('auto',anchor=self.anchor) 256 | 257 | return ax.get_xlim(),ax.get_ylim() 258 | 259 | def create_tick_formatter(self): 260 | return ZoomFormatter() 261 | 262 | def create_axes(self,rect=111): 263 | """ 264 | Create a special AxisArtist to overlay grid coordinates. 265 | 266 | Much of this taken from the examples here: 267 | http://matplotlib.org/mpl_toolkits/axes_grid/users/axisartist.html 268 | """ 269 | 270 | # from curved coordinate to rectlinear coordinate. 271 | def tr(x, y): 272 | x, y = np.asarray(x), np.asarray(y) 273 | return self(x,y) 274 | 275 | # from rectlinear coordinate to curved coordinate. 276 | def inv_tr(x,y): 277 | x, y = np.asarray(x), np.asarray(y) 278 | return self(x,y,inverse=True) 279 | 280 | 281 | # Cycle the coordinates 282 | extreme_finder = angle_helper.ExtremeFinderCycle(20, 20) 283 | 284 | # Find a grid values appropriate for the coordinate. 285 | # The argument is a approximate number of grid lines. 286 | grid_locator1 = angle_helper.LocatorD(9,include_last=False) 287 | #grid_locator1 = angle_helper.LocatorD(8,include_last=False) 288 | grid_locator2 = angle_helper.LocatorD(6,include_last=False) 289 | 290 | # Format the values of the grid 291 | tick_formatter1 = self.create_tick_formatter() 292 | tick_formatter2 = angle_helper.FormatterDMS() 293 | 294 | grid_helper = GridHelperCurveLinear((tr, inv_tr), 295 | extreme_finder=extreme_finder, 296 | grid_locator1=grid_locator1, 297 | grid_locator2=grid_locator2, 298 | tick_formatter1=tick_formatter1, 299 | tick_formatter2=tick_formatter2, 300 | ) 301 | 302 | fig = plt.gcf() 303 | if rect is None: 304 | # This doesn't quite work. Need to remove the existing axis... 305 | rect = plt.gca().get_position() 306 | plt.gca().axis('off') 307 | ax = axisartist.Axes(fig,rect,grid_helper=grid_helper) 308 | fig.add_axes(ax) 309 | else: 310 | ax = axisartist.Subplot(fig,rect,grid_helper=grid_helper) 311 | fig.add_subplot(ax) 312 | 313 | ## Coordinate formatter 314 | def format_coord(x, y): 315 | return 'lon=%1.4f, lat=%1.4f'%inv_tr(x,y) 316 | ax.format_coord = format_coord 317 | ax.axis['left'].major_ticklabels.set_visible(True) 318 | ax.axis['right'].major_ticklabels.set_visible(False) 319 | ax.axis['bottom'].major_ticklabels.set_visible(True) 320 | ax.axis['top'].major_ticklabels.set_visible(True) 321 | 322 | ax.set_xlabel("Right Ascension") 323 | ax.set_ylabel("Declination") 324 | #self.set_axes_limits() 325 | 326 | self.axisartist = ax 327 | return fig,ax 328 | 329 | class DESSkymapMcBryde(SurveyZoom): 330 | """Class for plotting a zoom on DES. This is relatively inflexible.""" 331 | # RA, DEC frame limits 332 | FRAME = [[-50,-50,90,90],[10,-75,10,-75]] 333 | FIGSIZE=(8,5) 334 | 335 | def __init__(self, *args, **kwargs): 336 | defaults = dict(lon_0=0,celestial=True) 337 | setdefaults(kwargs,defaults) 338 | super(DESSkymap,self).__init__(*args, **kwargs) 339 | 340 | def create_tick_formatter(self): 341 | return ZoomFormatterDES() 342 | #return ZoomFormatter180() 343 | 344 | DESSkymap = DESSkymapMcBryde 345 | 346 | ### These should be moved into streamlib 347 | 348 | class DESSkymapQ1(DESSkymapMcBryde): 349 | """Class for plotting a zoom on DES. This is relatively inflexible.""" 350 | # RA, DEC frame limits 351 | FRAME = [[10,-46],[-68,-38]] 352 | 353 | def draw_inset_colorbar(self, *args, **kwargs): 354 | defaults = dict(loc=4,height="6%",width="20%",bbox_to_anchor=(0,0.05,1,1)) 355 | setdefaults(kwargs,defaults) 356 | super(DESSkymapMcBryde,self).draw_inset_colorbar(*args,**kwargs) 357 | 358 | class DESSkymapQ2(DESSkymapMcBryde): 359 | """Class for plotting a zoom on DES. This is relatively inflexible.""" 360 | # RA, DEC frame limits 361 | FRAME = [[60,0],[8,-45]] 362 | 363 | def draw_inset_colorbar(self, *args, **kwargs): 364 | defaults = dict(loc=2,width="30%",height="4%",bbox_to_anchor=(0,-0.1,1,1)) 365 | setdefaults(kwargs,defaults) 366 | super(DESSkymapMcBryde,self).draw_inset_colorbar(*args,**kwargs) 367 | 368 | class DESSkymapQ3(DESSkymapMcBryde): 369 | """Class for plotting a zoom on DES. This is relatively inflexible.""" 370 | # RA, DEC frame limits 371 | FRAME = [[5,60],[-68,-38]] 372 | 373 | def draw_inset_colorbar(self, *args, **kwargs): 374 | defaults = dict(loc=3,height="7%",bbox_to_anchor=(0,0.05,1,1)) 375 | setdefaults(kwargs,defaults) 376 | super(DESSkymapMcBryde,self).draw_inset_colorbar(*args,**kwargs) 377 | 378 | class DESSkymapQ4(DESSkymapMcBryde): 379 | """Class for plotting a zoom on DES. This is relatively inflexible.""" 380 | # RA, DEC frame limits 381 | FRAME = [[90,70],[-15,-55]] 382 | 383 | def draw_inset_colorbar(self, *args, **kwargs): 384 | defaults = dict(loc=3,width="30%",height="4%",bbox_to_anchor=(0,0.05,1,1)) 385 | setdefaults(kwargs,defaults) 386 | super(DESSkymapMcBryde,self).draw_inset_colorbar(*args,**kwargs) 387 | 388 | class DESSkymapSPT(DESSkymapMcBryde): 389 | """Class for plotting a zoom on DES. This is relatively inflexible.""" 390 | # RA, DEC frame limits 391 | FRAME = [[-55,-55,95,95],[-35,-75,-35,-75]] 392 | FIGSIZE=(8,3) 393 | 394 | def draw_inset_colorbar(self, *args, **kwargs): 395 | defaults = dict(loc=3,width="30%",height="4%",bbox_to_anchor=(0,0.05,1,1)) 396 | setdefaults(kwargs,defaults) 397 | super(DESSkymapMcBryde,self).draw_inset_colorbar(*args,**kwargs) 398 | 399 | class DESSkymapCart(SurveyZoom): 400 | """Class for plotting a zoom on DES. This is relatively inflexible.""" 401 | # RA, DEC frame limits 402 | FRAME = [[-60,-60,100,100],[10,-75,10,-75]] 403 | FIGSIZE=(8,5) 404 | 405 | def __init__(self, *args, **kwargs): 406 | defaults = dict(projection='cyl',celestial=True) 407 | setdefaults(kwargs,defaults) 408 | super(DESSkymapCart,self).__init__(*args, **kwargs) 409 | 410 | def create_tick_formatter(self): 411 | return ZoomFormatterDES() 412 | #return ZoomFormatter180() 413 | 414 | 415 | class DESLambert(SurveySkymap): 416 | """Class for plotting a zoom on DES. This is relatively inflexible.""" 417 | # RA, DEC frame limits 418 | FIGSIZE=(8,5) 419 | 420 | def __init__(self, *args, **kwargs): 421 | defaults = dict(projection='laea',lon_0=120,lat_0=-90, 422 | llcrnrlon=-110,llcrnrlat=8, 423 | urcrnrlon=60,urcrnrlat=-15, 424 | round=False,celestial=False) 425 | 426 | setdefaults(kwargs,defaults) 427 | super(SurveySkymap,self).__init__(*args, **kwargs) 428 | 429 | 430 | def draw_meridians(self,*args,**kwargs): 431 | 432 | def lon2str(deg): 433 | # This is a function just to remove some weird string formatting 434 | deg -= 360. * (deg >= 180) 435 | if (np.abs(deg) == 0): 436 | return r"$%d{}^{\circ}$"%(deg) 437 | elif (np.abs(deg) == 180): 438 | return r"$%+d{}^{\circ}$"%(np.abs(deg)) 439 | else: 440 | return r"$%+d{}^{\circ}$"%(deg) 441 | 442 | #defaults = dict(labels=[1,1,1,1],labelstyle='+/-', 443 | # fontsize=14,fmt=lon2str) 444 | defaults = dict(fmt=lon2str,labels=[1,1,1,1],fontsize=14) 445 | if not args: 446 | defaults.update(meridians=np.arange(0,360,60)) 447 | setdefaults(kwargs,defaults) 448 | 449 | #return self.drawmeridians(*args,**kwargs) 450 | return super(DESLambert,self).draw_meridians(*args,**kwargs) 451 | 452 | def draw_parallels(self,*args,**kwargs): 453 | defaults = dict(labels=[0,0,0,0]) 454 | setdefaults(kwargs,defaults) 455 | ret = super(DESLambert,self).draw_parallels(*args,**kwargs) 456 | 457 | ax = plt.gca() 458 | for l in ret.keys(): 459 | ax.annotate(r"$%+d{}^{\circ}$"%(l), self(0,l),xycoords='data', 460 | xytext=(+5,+5),textcoords='offset points', 461 | va='top',ha='left',fontsize=12) 462 | return ret 463 | 464 | def draw_inset_colorbar(self,*args,**kwargs): 465 | defaults = dict(bbox_to_anchor=(-0.01,0.07,1,1)) 466 | setdefaults(kwargs,defaults) 467 | return super(DESLambert,self).draw_inset_colorbar(*args,**kwargs) 468 | 469 | 470 | class DESPolarLambert(DESLambert): 471 | """Class for plotting a zoom on DES. This is relatively inflexible.""" 472 | # RA, DEC frame limits 473 | FIGSIZE=(8,8) 474 | 475 | def __init__(self, *args, **kwargs): 476 | defaults = dict(projection='splaea',lon_0=60,boundinglat=-20, 477 | round=True,celestial=True,parallels=True) 478 | setdefaults(kwargs,defaults) 479 | super(SurveySkymap,self).__init__(*args, **kwargs) 480 | 481 | class BlissSkymap(SurveyZoom): 482 | """Class for plotting a zoom on BLISS. This is relatively inflexible.""" 483 | # RA, DEC frame limits 484 | FRAME = [[130,130,0,0],[-5,-55,-5,-55]] 485 | FIGSIZE = (12,3) 486 | defaults = dict(lon_0=-100) 487 | wrap_angle = 60 488 | 489 | def __init__(self, *args, **kwargs): 490 | setdefaults(kwargs,self.defaults) 491 | super(BlissSkymap,self).__init__(*args, **kwargs) 492 | 493 | def create_tick_formatter(self): 494 | return ZoomFormatter360() 495 | 496 | class DelveR1Skymap(SurveyZoom): 497 | """Class for plotting a zoom on DES. This is relatively inflexible.""" 498 | # RA, DEC frame limits 499 | FRAME = [[110,110,-85,-85],[10,-75,10,-75]] 500 | FIGSIZE=(8,5) 501 | 502 | def __init__(self, *args, **kwargs): 503 | defaults = dict(lon_0=-155,celestial=True) 504 | setdefaults(kwargs,defaults) 505 | super(DelveSkymap,self).__init__(*args, **kwargs) 506 | 507 | def create_tick_formatter(self): 508 | return ZoomFormatter360() 509 | 510 | DelveSkymap = DelveR1Skymap 511 | 512 | class MaglitesSkymap(SurveyOrtho): 513 | defaults = dict(SurveyOrtho.defaults,lat_0=-90,celestial=True) 514 | 515 | def draw_meridians(self,*args,**kwargs): 516 | defaults = dict(labels=[1,1,1,1],fontsize=14,labelstyle='+/-') 517 | setdefaults(kwargs,defaults) 518 | cardinal = kwargs.pop('cardinal',False) 519 | meridict = super(OrthoSkymap,self).draw_meridians(*args,**kwargs) 520 | # We've switched to celestial, need to update meridian text 521 | for k,v in meridict.items(): 522 | text = v[1][0].get_text() 523 | if text.startswith('-'): text = text.replace('-','+') 524 | elif text.startswith('+'): text = text.replace('+','-') 525 | v[1][0].set_text(text) 526 | return meridict 527 | -------------------------------------------------------------------------------- /skymap/core.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Core skymap classes 4 | """ 5 | import os 6 | from os.path import expandvars 7 | import logging 8 | from collections import OrderedDict as odict 9 | 10 | import matplotlib 11 | from matplotlib import mlab 12 | import pylab as plt 13 | import numpy as np 14 | import ephem 15 | import healpy as hp 16 | import scipy.ndimage as nd 17 | 18 | from matplotlib.collections import LineCollection 19 | from matplotlib.patches import Polygon 20 | 21 | from mpl_toolkits.basemap import Basemap 22 | from mpl_toolkits.basemap import pyproj 23 | from mpl_toolkits.axes_grid1.inset_locator import inset_axes 24 | 25 | from skymap.utils import setdefaults,get_datadir 26 | from skymap.utils import cel2gal, gal2cel 27 | from skymap import healpix 28 | 29 | # TODO: 30 | # - abstract interface between new and old healpy pixfuncs 31 | # - abstract wrapper around pixfuncs for masked and unmasked arrays 32 | # - abstract function for coordinate wrapping 33 | 34 | class Skymap(Basemap): 35 | """ Skymap base class. """ 36 | 37 | COLORS = odict([ 38 | ('none','black'), 39 | ('u','blue'), 40 | ('g','green'), 41 | ('r','red'), 42 | ('i','#EAC117'), 43 | ('z','darkorchid'), 44 | ('Y','black'), 45 | ('VR','gray'), 46 | ]) 47 | 48 | defaults = dict(celestial=True, rsphere=1.0, lon_0=0, lat_0=0, 49 | parallels=True,meridians=True) 50 | 51 | def __init__(self, *args, **kwargs): 52 | self.set_observer(kwargs.pop('observer',None)) 53 | self.set_date(kwargs.pop('date',None)) 54 | 55 | setdefaults(kwargs,self.defaults) 56 | parallels = kwargs.pop('parallels',True) 57 | meridians = kwargs.pop('meridians',True) 58 | super(Skymap,self).__init__(*args,**kwargs) 59 | 60 | if parallels: 61 | self.draw_parallels() 62 | if meridians: 63 | self.draw_meridians() 64 | 65 | # Coordinate formatter 66 | # This is creating an axes (which we really don't want) 67 | # Better to stick in set_axes_limits 68 | ax = self._check_ax() 69 | def format_coord(x, y): 70 | return 'lon=%1.4f, lat=%1.4f'%self(x,y,inverse=True) 71 | plt.gca().format_coord = format_coord 72 | 73 | self.wrap_angle = np.mod(kwargs['lon_0'] + 180,360) 74 | 75 | self.resolution = 'c' 76 | 77 | def set_observer(self, observer): 78 | observer = observer.copy() if observer else ephem.Observer() 79 | self.observer = observer 80 | 81 | def set_date(self,date): 82 | date = ephem.Date(date) if date else ephem.now() 83 | self.observer.date = date 84 | 85 | def draw_parallels(self,*args,**kwargs): 86 | defaults = dict(labels=[1,0,0,1],labelstyle='+/-',dashes=(2,3), 87 | color='gray',linewidth=0.75) 88 | if not args: 89 | defaults.update(circles=np.arange(-60,90,30)) 90 | if self.projection in ['ortho','geos','nsper','aeqd','vandg']: 91 | defaults.update(labels=[0,0,0,0]) 92 | setdefaults(kwargs,defaults) 93 | return self.drawparallels(*args, **kwargs) 94 | 95 | def draw_meridians(self,*args,**kwargs): 96 | defaults = dict(labels=[1,0,0,1],labelstyle='+/-',dashes=(2,3), 97 | color='gray',linewidth=0.75) 98 | if self.projection in ['ortho','geos','nsper','aeqd','vandg', 99 | 'sinu','hammer']: 100 | defaults.update(labels=[0,0,0,0]) 101 | if not args: 102 | #defaults.update(meridians=np.arange(0,420,60)) 103 | defaults.update(meridians=np.arange(0,360,60)) 104 | setdefaults(kwargs,defaults) 105 | return self.drawmeridians(*args,**kwargs) 106 | 107 | def cartesian(self, ra, dec): 108 | x = np.cos(ra) * np.cos(dec) 109 | y = np.sin(ra) * np.cos(dec) 110 | z = np.sin(dec) 111 | return x, y, z 112 | 113 | def spherical(self, x, y, z): 114 | ra = np.arctan2(y, x) 115 | dec = np.pi / 2 - np.arccos(z) 116 | return ra, dec 117 | 118 | def proj(self,lon,lat): 119 | """ Remove points outside of projection """ 120 | # Should this overload __call__? 121 | x, y = self(np.atleast_1d(lon),np.atleast_1d(lat)) 122 | x[np.abs(x) > 1e29] = None 123 | y[np.abs(y) > 1e29] = None 124 | return x, y 125 | 126 | def get_zenith(self): 127 | # RA and Dec of zenith 128 | lon_zen, lat_zen = np.degrees(self.observer.radec_of(0,'90')) 129 | return -lon_zen 130 | 131 | @staticmethod 132 | def wrap_index(lon, lat, wrap=180.): 133 | """ Find the index where the array wraps. 134 | """ 135 | # No wrap: ignore 136 | if wrap is None: return None 137 | 138 | lon = np.atleast_1d(lon) 139 | lat = np.atleast_1d(lat) 140 | 141 | # No array: ignore 142 | if len(lon)==1 or len(lat)==1: return None 143 | 144 | # Map [0,360) 145 | lon = np.mod(lon,360) 146 | wrap = np.mod(wrap,360) 147 | 148 | # Find the index of the entry closest to the wrap angle 149 | idx = np.abs(lon - wrap).argmin() 150 | # First or last index: ignore 151 | if idx == 0 or idx+1 == len(lon): return None 152 | # Value exactly equals wrap, choose next value 153 | elif (lon[idx] == wrap): idx += 1 154 | # Wrap angle sandwiched 155 | elif (lon[idx]wrap): idx += 1 156 | elif (lon[idx]wrap): idx += 0 157 | elif (lon[idx]>wrap) and (lon[idx+1]wrap) and (lon[idx-1] 50. else 'white' 429 | #text = '%.2f'%(0.01 * moon.phase) 430 | text = '%2.0f%%'%(moon.phase) 431 | plt.text(x, y, text, fontsize=10, ha='center', va='center', color=color) 432 | 433 | def draw_milky_way(self,width=10,**kwargs): 434 | """ Draw the Milky Way galaxy. """ 435 | defaults = dict(color='k',lw=1.5,ls='-') 436 | setdefaults(kwargs,defaults) 437 | 438 | glon = np.linspace(0,360,500) 439 | glat = np.zeros_like(glon) 440 | ra,dec = self.roll(*gal2cel(glon,glat),wrap=self.wrap_angle) 441 | ra -= 360*(ra > self.wrap_angle) 442 | 443 | self.draw_polygon_radec(ra,dec,**kwargs) 444 | 445 | if width: 446 | kwargs.update(dict(ls='--',lw=1)) 447 | for delta in [+width,-width]: 448 | ra,dec = self.roll(*gal2cel(glon,glat+delta)) 449 | ra -= 360*(ra > self.wrap_angle) 450 | self.draw_polygon_radec(ra,dec,**kwargs) 451 | 452 | def draw_magellanic_stream(self,**kwargs): 453 | import fitsio 454 | defaults = dict(xsize=800, vmin=17., vmax=25.0, rasterized=True, 455 | cmap=plt.cm.binary) 456 | setdefaults(kwargs,defaults) 457 | 458 | dirname = get_datadir() 459 | filename = 'allms_coldens_gal_nside_1024.fits' 460 | galhpx = fitsio.read(os.path.join(dirname,filename))['coldens'] 461 | celhpx = obztak.utils.projector.hpx_gal2cel(galhpx) 462 | return self.draw_hpxmap(celhpx,**kwargs) 463 | 464 | def draw_sfd(self,**kwargs): 465 | defaults = dict(rasterized=True,cmap=plt.cm.binary) 466 | setdefaults(kwargs,defaults) 467 | dirname = get_datadir() 468 | filename = 'lambda_sfd_ebv.fits' 469 | 470 | galhpx = hp.read_map(os.path.join(dirname,filename)) 471 | celhpx = obztak.utils.projector.hpx_gal2cel(galhpx) 472 | return self.draw_hpxmap(np.log10(celhpx),**kwargs) 473 | 474 | def draw_lmc(self,**kwargs): 475 | from skymap.constants import RA_LMC, DEC_LMC, RADIUS_LMC 476 | defaults = dict(npts=100,fc='0.7',ec='0.5') 477 | setdefaults(kwargs,defaults) 478 | proj = self.proj(RA_LMC,DEC_LMC) 479 | self.tissot(RA_LMC,DEC_LMC,RADIUS_LMC,**kwargs) 480 | plt.text(proj[0],proj[1], 'LMC', weight='bold', 481 | fontsize=10, ha='center', va='center', color='k') 482 | 483 | def draw_smc(self,**kwargs): 484 | from skymap.constants import RA_SMC, DEC_SMC, RADIUS_SMC 485 | defaults = dict(npts=100,fc='0.7',ec='0.5') 486 | setdefaults(kwargs,defaults) 487 | proj = self.proj(RA_SMC,DEC_SMC) 488 | self.tissot(RA_SMC,DEC_SMC,RADIUS_SMC,**kwargs) 489 | plt.text(proj[0],proj[1], 'SMC', weight='bold', 490 | fontsize=8, ha='center', va='center', color='k') 491 | 492 | def draw_fields(self,fields,**kwargs): 493 | # Scatter point size is figsize dependent... 494 | defaults = dict(edgecolor='none',s=15) 495 | # case insensitive without changing input array 496 | names = dict([(n.lower(),n) for n in fields.dtype.names]) 497 | 498 | if self.projection == 'ortho': defaults.update(s=50) 499 | if 'filter' in names: 500 | colors = [self.COLORS[b] for b in fields[names['filter']]] 501 | defaults.update(c=colors) 502 | elif 'band' in names: 503 | colors = [self.COLORS[b] for b in fields[names['band']]] 504 | defaults.update(c=colors) 505 | 506 | setdefaults(kwargs,defaults) 507 | ra,dec = fields[names['ra']],fields[names['dec']] 508 | self.scatter(*self.proj(ra,dec),**kwargs) 509 | 510 | def draw_hpxbin(self, lon, lat, nside=256, **kwargs): 511 | """ 512 | Create a healpix histogram of the counts. 513 | 514 | Like `hexbin` from matplotlib 515 | 516 | Parameters: 517 | ----------- 518 | lon : input longitude (deg) 519 | lat : input latitude (deg) 520 | nside : heaplix nside resolution 521 | kwargs : passed to draw_hpxmap and plt.pcolormesh 522 | 523 | Returns: 524 | -------- 525 | hpxmap, im : healpix map and image 526 | """ 527 | hpxmap = healpix.hpxbin(lon,lat,nside=nside) 528 | return hpxmap,self.draw_hpxmap(hpxmap,**kwargs) 529 | 530 | def get_map_range(self, hpxmap, pixel=None, nside=None): 531 | """ Calculate the longitude and latitude range for an implicit map. """ 532 | return healpix.get_map_range(hpxmap,pixel,nside,wrap_angle=self.wrap_angle) 533 | 534 | def hpx2xy(self, hpxmap, pixel=None, nside=None, xsize=800, 535 | lonra=None, latra=None): 536 | """ Convert from healpix map to longitude and latitude coordinates """ 537 | return healpix.hpx2xy(hpxmap,pixel=pixel,nside=nside, 538 | xsize=xsize,aspect=self.aspect, 539 | lonra=lonra,latra=latra) 540 | 541 | 542 | def smooth(self,hpxmap,badval=hp.UNSEEN,sigma=None): 543 | """ Smooth a healpix map """ 544 | healpix.check_hpxmap(hpxmap,None,None) 545 | hpxmap = healpix.masked_array(hpxmap,badval) 546 | hpxmap.fill_value = np.ma.median(hpxmap) 547 | smooth = hp.smoothing(hpxmap,sigma=np.radians(sigma),verbose=False) 548 | return np.ma.array(smooth,mask=hpxmap.mask) 549 | 550 | def draw_hpxmap(self, hpxmap, pixel=None, nside=None, xsize=800, 551 | lonra=None, latra=None, badval=hp.UNSEEN, smooth=None, **kwargs): 552 | """ 553 | Use pcolor/pcolormesh to draw healpix map. 554 | 555 | Parameters: 556 | ----------- 557 | hpxmap: input healpix map 558 | pixel: explicit pixel indices (required for partial maps) 559 | nside: explicit nside of the map (required for partial maps) 560 | xsize: resolution of the output image 561 | lonra: longitude range [-180,180] (deg) 562 | latra: latitude range [-90,90] (deg) 563 | badval: set of values considered "bad" 564 | smooth: gaussian smoothing kernel (deg) 565 | 566 | Returns: 567 | -------- 568 | im,lon,lat,values : mpl image with pixel longitude, latitude (deg), and values 569 | """ 570 | healpix.check_hpxmap(hpxmap,pixel,nside) 571 | hpxmap = healpix.masked_array(hpxmap,badval) 572 | 573 | if smooth: 574 | # To smooth we need the full map 575 | hpxmap = healpix.create_map(hpxmap,pixel,nside,badval) 576 | pixel,nside = None,None 577 | hpxmap = healpix.masked_array(hpxmap,badval) 578 | hpxmap = self.smooth(hpxmap,sigma=smooth) 579 | 580 | #if pixel is None: 581 | # nside = hp.get_nside(hpxmap.data) 582 | # pixel = np.arange(len(hpxmap),dtype=int) 583 | #elif nside is None: 584 | # msg = "'nside' must be specified for explicit maps" 585 | # raise Exception(msg) 586 | 587 | vmin,vmax = np.percentile(hpxmap.compressed(),[2.5,97.5]) 588 | 589 | defaults = dict(latlon=True, rasterized=True, vmin=vmin, vmax=vmax) 590 | setdefaults(kwargs,defaults) 591 | 592 | lon,lat,values = healpix.hpx2xy(hpxmap,pixel=pixel,nside=nside, 593 | xsize=xsize, 594 | lonra=lonra,latra=latra) 595 | 596 | # pcolormesh doesn't work in Ortho... 597 | if self.projection == 'ortho': 598 | im = self.pcolor(lon,lat,values,**kwargs) 599 | else: 600 | # Why were we plotting the values.data? 601 | #im = self.pcolormesh(lon,lat,values.data,**kwargs) 602 | 603 | # pcolormesh recommends that values be larger than x,y 604 | # but basemap has problems with this (sometimes?) 605 | # https://github.com/matplotlib/basemap/issues/182 606 | try: 607 | im = self.pcolormesh(lon,lat,values,**kwargs) 608 | except IndexError: 609 | im = self.pcolormesh(lon[:-1,:-1],lat[:-1,:-1],values,**kwargs) 610 | 611 | return im,lon,lat,values 612 | 613 | def draw_hpxmap_rgb(self, r, g, b, xsize=800, **kwargs): 614 | hpxmap = healpix.masked_array(np.array([r,g,b])) 615 | 616 | vmin,vmax = np.percentile(hpxmap.compressed(),[0.1,99.9]) 617 | 618 | defaults = dict(latlon=True, rasterized=True, vmin=vmin, vmax=vmax) 619 | setdefaults(kwargs,defaults) 620 | 621 | #ax = plt.gca() 622 | #lonra = [-180.,180.] 623 | #latra = [-90.,90] 624 | 625 | #lon = np.linspace(lonra[0], lonra[1], xsize) 626 | #lat = np.linspace(latra[0], latra[1], xsize*self.aspect) 627 | #lon, lat = np.meshgrid(lon, lat) 628 | 629 | #nside = hp.get_nside(hpxmap.data) 630 | #try: 631 | # pix = hp.ang2pix(nside,lon,lat,lonlat=True) 632 | #except TypeError: 633 | # pix = hp.ang2pix(nside,np.radians(90-lat),np.radians(lon)) 634 | 635 | lonra,latra = self.get_map_range(r) 636 | 637 | lon, lat, R = self.hpx2xy(r,lonra=lonra,latra=latra,xsize=xsize) 638 | _, _, G = self.hpx2xy(g,lonra=lonra,latra=latra,xsize=xsize) 639 | _, _, B = self.hpx2xy(b,lonra=lonra,latra=latra,xsize=xsize) 640 | 641 | # Colors are all normalized to R... probably not desired... 642 | #norm = np.nanmax(R) 643 | #r = self.set_scale(R,norm=norm) 644 | #g = self.set_scale(G,norm=norm) 645 | #b = self.set_scale(B,norm=norm) 646 | 647 | # Better? 648 | norm=np.percentile(R[~np.isnan(R)],97.5) 649 | kw = dict(log=False,sigma=0.5,norm=norm) 650 | r = self.set_scale(R,**kw) 651 | g = self.set_scale(G,**kw) 652 | b = self.set_scale(B,**kw) 653 | 654 | #rgb = np.array([r,g,b]).T 655 | color_tuples = np.array([r[:-1,:-1].filled(np.nan).flatten(), 656 | g[:-1,:-1].filled(np.nan).flatten(), 657 | b[:-1,:-1].filled(np.nan).flatten()]).T 658 | color_tuples[np.where(np.isnan(color_tuples))] = 0.0 659 | setdefaults(kwargs,{'color':color_tuples}) 660 | 661 | if self.projection is 'ortho': 662 | im = self.pcolor(lon,lat,r,**kwargs) 663 | else: 664 | im = self.pcolormesh(lon,lat,r,**kwargs) 665 | plt.gca().set_facecolor((0,0,0)) 666 | plt.draw() 667 | 668 | return im,lon,lat,r,color_tuples 669 | 670 | def draw_focal_planes(self, ra, dec, **kwargs): 671 | from skymap.instrument.decam import DECamFocalPlane 672 | defaults = dict(alpha=0.2,color='red',edgecolors='none',lw=0) 673 | setdefaults(kwargs,defaults) 674 | ra,dec = np.atleast_1d(ra,dec) 675 | if len(ra) != len(dec): 676 | msg = "Dimensions of 'ra' and 'dec' do not match" 677 | raise ValueError(msg) 678 | decam = DECamFocalPlane() 679 | # Should make sure axis exists.... 680 | ax = plt.gca() 681 | for _ra,_dec in zip(ra,dec): 682 | corners = decam.project(self,_ra,_dec) 683 | collection = matplotlib.collections.PolyCollection(corners,**kwargs) 684 | ax.add_collection(collection) 685 | plt.draw() 686 | draw_decam = draw_focal_planes 687 | 688 | def draw_hsc_focal_planes(self, ra, dec, **kwargs): 689 | from skymap.instrument.hsc import HSCFocalPlane 690 | defaults = dict(alpha=0.2,color='red',edgecolors='none',lw=0) 691 | setdefaults(kwargs,defaults) 692 | ra,dec = np.atleast_1d(ra,dec) 693 | if len(ra) != len(dec): 694 | msg = "Dimensions of 'ra' and 'dec' do not match" 695 | raise ValueError(msg) 696 | hsc = HSCFocalPlane() 697 | # Should make sure axis exists.... 698 | ax = plt.gca() 699 | for _ra,_dec in zip(ra,dec): 700 | corners = hsc.project(self,_ra,_dec) 701 | collection = matplotlib.collections.PolyCollection(corners,**kwargs) 702 | ax.add_collection(collection) 703 | plt.draw() 704 | 705 | def draw_macho(self, ra, dec, **kwargs): 706 | from skymap.instrument.macho import MachoFocalPlane 707 | defaults = dict(alpha=0.2,color='gray',edgecolors='none',lw=0) 708 | setdefaults(kwargs,defaults) 709 | ra,dec = np.atleast_1d(ra,dec) 710 | if len(ra) != len(dec): 711 | msg = "Dimensions of 'ra' and 'dec' do not match" 712 | raise ValueError(msg) 713 | camera = MachoFocalPlane() 714 | # Should make sure axis exists.... 715 | ax = plt.gca() 716 | for _ra,_dec in zip(ra,dec): 717 | corners = camera.project(self,_ra,_dec) 718 | collection = matplotlib.collections.PolyCollection(corners,**kwargs) 719 | ax.add_collection(collection) 720 | plt.draw() 721 | 722 | 723 | # Adapted from Reed Essick 724 | # https://github.com/reedessick/skymap_statistics 725 | 726 | @classmethod 727 | def read_constellations(cls): 728 | import json 729 | dirname = get_datadir() 730 | filename = 'constellationsANDstars.json' 731 | with open(os.path.join(dirname,filename), 'r') as f: 732 | data = json.load(f) 733 | 734 | # Constellation shapes 735 | shapes = [] 736 | for const in data['constellations'].values(): 737 | for shape in const: 738 | shapes.append( np.degrees(shape) ) 739 | shapes = np.array(shapes) 740 | 741 | # Stars 742 | stars = np.array(data['stars']) 743 | stars[:,:2] = np.degrees(stars[:,:2]) 744 | 745 | # Boundaries 746 | boundaries = [np.degrees(e) for e in data['boundaries']] 747 | 748 | # Centers 749 | centers = data['centers'] 750 | for k,v in centers.items(): 751 | centers[k] = np.degrees(v) 752 | 753 | return shapes, stars, boundaries, centers 754 | 755 | def draw_constellations(self,**kwargs): 756 | defaults = dict(color='k',alpha=1.0) 757 | setdefaults(kwargs,defaults) 758 | ax = plt.gca() 759 | 760 | shapes, stars, boundaries, centers = self.read_constellations() 761 | 762 | ### add constellations 763 | for shape in shapes: 764 | self.plot(*self.proj(*shape.T),lw=0.5,**kwargs) 765 | 766 | ### add stars FIXME: hard coded...bad? 767 | mag = stars[:,-1] 768 | size = 7*np.max([np.ones_like(mag), 5-mag], axis=0) 769 | self.scatter(*self.proj(stars[:,0],stars[:,1]), 770 | s=size,marker='o',edgecolor='none',**kwargs) 771 | 772 | ### add constellation boundaries 773 | # Use the safe projection 774 | bound = [np.array(self.proj(*b)).T for b in boundaries] 775 | collect = LineCollection(bound,linestyle='--',linewidth=0.5,**kwargs) 776 | ax.add_collection(collect) 777 | 778 | ### add constellation centers 779 | for (name, (x, y)) in centers.items(): 780 | ax.text(*self(x, y), s=name, 781 | ha='center',va='center',fontsize=8, 782 | **kwargs) 783 | 784 | def set_scale(self, array, log=False, sigma=1.0, norm=None): 785 | if isinstance(array,np.ma.MaskedArray): 786 | out = np.ma.copy(array) 787 | else: 788 | out = np.ma.array(array,mask=np.isnan(array),fill_value=np.nan) 789 | 790 | if sigma > 0: 791 | out.data[:] = nd.gaussian_filter(out.filled(0),sigma=sigma)[:] 792 | 793 | if norm is None: 794 | norm = np.percentile(out.compressed(),97.5) 795 | 796 | if log: 797 | out = np.log10(out) 798 | if norm: norm = np.log10(norm) 799 | 800 | out /= norm 801 | out = np.clip(out,0.0,1.0) 802 | return out 803 | 804 | def draw_inset_colorbar(self,format=None,label=None,ticks=None,fontsize=11,**kwargs): 805 | defaults = dict(width="25%", height="5%", loc=7, 806 | bbox_to_anchor=(0.,-0.04,1,1)) 807 | setdefaults(kwargs,defaults) 808 | 809 | ax = plt.gca() 810 | im = plt.gci() 811 | cax = inset_axes(ax,bbox_transform=ax.transAxes,**kwargs) 812 | cmin,cmax = im.get_clim() 813 | 814 | if (ticks is None) and (cmin is not None) and (cmax is not None): 815 | cmed = (cmax+cmin)/2. 816 | delta = (cmax-cmin)/10. 817 | ticks = np.array([cmin+delta,cmed,cmax-delta]) 818 | 819 | tmin = np.min(np.abs(ticks[0])) 820 | tmax = np.max(np.abs(ticks[1])) 821 | 822 | if format is None: 823 | if (tmin < 1e-2) or (tmax > 1e3): 824 | format = '$%.1e$' 825 | elif (tmin > 0.1) and (tmax < 100): 826 | format = '$%.1f$' 827 | elif (tmax > 100): 828 | format = '$%i$' 829 | else: 830 | format = '$%.2g$' 831 | #format = '%.2f' 832 | 833 | kwargs = dict(format=format,ticks=ticks,orientation='horizontal') 834 | 835 | if format == 'custom': 836 | ticks = np.array([cmin,0.85*cmax]) 837 | kwargs.update(format='$%.0e$',ticks=ticks) 838 | 839 | cbar = plt.colorbar(cax=cax,**kwargs) 840 | cax.xaxis.set_ticks_position('top') 841 | cax.tick_params(axis='x', labelsize=fontsize) 842 | 843 | if format == 'custom': 844 | ticklabels = cax.get_xticklabels() 845 | for i,l in enumerate(ticklabels): 846 | val,exp = ticklabels[i].get_text().split('e') 847 | ticklabels[i].set_text(r'$%s \times 10^{%i}$'%(val,int(exp))) 848 | cax.set_xticklabels(ticklabels) 849 | 850 | if label is not None: 851 | cbar.set_label(label,size=fontsize) 852 | cax.xaxis.set_label_position('top') 853 | 854 | plt.sca(ax) 855 | return cbar,cax 856 | 857 | def zoom_to_fit(self, hpxmap, pixel=None, nside=None): 858 | lonra, latra = self.get_map_range(hpxmap, pixel, nside) 859 | self.zoom_to(lonra,latra) 860 | 861 | def zoom_to(self, lonra, latra): 862 | """ Zoom the map to a specific longitude and latitude range. 863 | 864 | Parameters: 865 | ----------- 866 | lonra : Longitude range [lonmin,lonmax] 867 | latra : Latitude range [latmin,latmax] 868 | 869 | Returns: 870 | -------- 871 | None 872 | """ 873 | 874 | (lonmin,lonmax), (latmin,latmax) = lonra, latra 875 | 876 | ax = plt.gca() 877 | self.llcrnrx,self.llcrnry = self(lonmin,latmin) 878 | self.urcrnrx,self.urcrnry = self(lonmax,latmax) 879 | 880 | ax.set_xlim(self.llcrnrx,self.urcrnrx) 881 | ax.set_ylim(self.llcrnry,self.urcrnry) 882 | 883 | self.set_axes_limits(ax=ax) 884 | 885 | class McBrydeSkymap(Skymap): 886 | defaults = dict(Skymap.defaults,projection='mbtfpq') 887 | 888 | def __init__(self,*args,**kwargs): 889 | setdefaults(kwargs,self.defaults) 890 | if np.abs(kwargs['lon_0']) > 180: 891 | raise Exception("Basemap requires: -180 < lon_0 < 180") 892 | super(McBrydeSkymap,self).__init__(*args, **kwargs) 893 | 894 | class OrthoSkymap(Skymap): 895 | 896 | # To get oriented on zenith: 897 | #lon_0=self.get_zenith(),lat_0=self.observer.lat 898 | 899 | defaults = dict(Skymap.defaults,projection='ortho',celestial=False) 900 | 901 | def __init__(self,*args,**kwargs): 902 | setdefaults(kwargs,self.defaults) 903 | super(OrthoSkymap,self).__init__(*args, **kwargs) 904 | 905 | def draw_meridians(self,*args,**kwargs): 906 | cardinal = kwargs.pop('cardinal',False) 907 | meridict = super(OrthoSkymap,self).draw_meridians(*args,**kwargs) 908 | ax = plt.gca() 909 | for mer in meridict.keys(): 910 | ax.annotate(r'$%i^{\circ}$'%mer,self.proj(mer,5),ha='center') 911 | if cardinal: 912 | ax.annotate('West',xy=(1.0,0.5),ha='left',xycoords='axes fraction') 913 | ax.annotate('East',xy=(0.0,0.5),ha='right',xycoords='axes fraction') 914 | return meridict 915 | 916 | 917 | if __name__ == "__main__": 918 | import argparse 919 | parser = argparse.ArgumentParser(description=__doc__) 920 | args = parser.parse_args() 921 | --------------------------------------------------------------------------------