Source code for skysurvey.survey.des
"""
This module defines the `DES` and `DESWide` survey classes and utilities functions for the DECam footprint and the DES fields.
"""
import pandas
import geopandas
import numpy as np
from ztffields.projection import project_to_radec
from .basesurvey import Survey, GridSurvey
# ============= #
# Top Level #
# ============= #
[docs]
def get_des_field_coordinates(fieldid_name="fieldid"):
""" Get the radec location of the DES shallow (8) and deep (2) fields.
Parameters
----------
fieldid_name: str
name of the fieldid column.
Returns
-------
`pandas.DataFrame`
"""
if fieldid_name is None:
fieldid_name = "fieldid"
radec = {'C1': {'dec': -27.11161, 'ra': 54.274292},
'C2': {'dec': -29.08839, 'ra': 54.274292},
'C3': {'dec': -28.10000, 'ra': 52.648417},
'E1': {'dec': -43.00961, 'ra': 7.8744167},
'E2': {'dec': -43.99800, 'ra': 9.5000000},
'S1': {'dec': 0.00000, 'ra': 42.820000},
'S2': {'dec': -0.988389, 'ra': 41.194417},
'X1': {'dec': -4.929500, 'ra': 34.475708},
'X2': {'dec': -6.412111, 'ra': 35.664500},
'X3': {'dec': -4.600000, 'ra': 36.450000}}
data = pandas.DataFrame(radec).T
data.index.name = fieldid_name
return data
[docs]
def get_des_fields(origin=180, incl_focus=False, fieldid_name=None):
""" Get the DES fields as a geopandas.GeoDataFrame.
Parameters
----------
origin: float
origin of the ra coordinates.
incl_focus: bool
if True, include the focus ccds.
fieldid_name: str
name of the fieldid column.
Returns
-------
`geopandas.GeoDataFrame`
"""
footprint = get_des_footprint(incl_focus=incl_focus)
radec = get_des_field_coordinates(fieldid_name=fieldid_name)
fields = geopandas.GeoDataFrame( geometry=project_to_radec(footprint, radec["ra"]+origin, radec["dec"]),
index=radec.index)
return fields
# ============= #
# Classes #
# ============= #
[docs]
class DES( GridSurvey ):
"""The DES grid-based survey with predefined fields and DECam footprint.
Parameters
----------
data: `pandas.DataFrame`
observing data.
fields: geodataframe
field definitions.
footprint: `shapely.geometry`
footprint in the sky of the observing camera.
_DEFAULT_FIELDS : `geopandas.GeoDataFrame`
The standard DES field definitions loaded via :func:`get_des_fields`.
_FOOTPRINT : `shapely.geometry.Polygon`
The DECam camera footprint loaded via :func:`get_des_footprint`.
"""
_DEFAULT_FIELDS = get_des_fields(fieldid_name="FIELD")
_FOOTPRINT = get_des_footprint()
[docs]
class DESWide( Survey ):
"""The DES wide-field survey with the DECam footprint.
Parameters
----------
footprint: `shapely.geometry`
footprint in the sky of the observing camera
nside : int
healpix nside parameter
data: `pandas.DataFrame`
observing data.
_FOOTPRINT : `shapely.geometry.Polygon`
The DECam camera footprint loaded via :func:`get_des_footprint`.
"""
_FOOTPRINT = get_des_footprint()