Skip to content

Commit

Permalink
Merge pull request #9 from lsst/tickets/DM-17726-metadata
Browse files Browse the repository at this point in the history
DM-17726: Fix flake8 warnings and max-doc-length
  • Loading branch information
timj committed Feb 5, 2019
2 parents 24fba81 + a07280b commit b00f4c9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
6 changes: 3 additions & 3 deletions python/astro_metadata_translator/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

# PropertyList is optional
try:
import lsst.daf.base as dafBase
import lsst.daf.base as daf_base
except ImportError:
dafBase = None
daf_base = None


# Define a YAML loader for lsst.daf.base.PropertySet serializations that
Expand All @@ -44,7 +44,7 @@ def pl_constructor(loader, node):
pl[key] = value


if dafBase is None:
if daf_base is None:
yaml.add_constructor("lsst.daf.base.PropertyList", pl_constructor)


Expand Down
16 changes: 8 additions & 8 deletions python/astro_metadata_translator/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,14 @@ def __init_subclass__(cls, **kwargs):
The second feature of this method is to convert simple translations
to full translator methods. Sometimes a translation is fixed (for
example a specific instrument name should be used) and rather than provide
a full ``to_property()`` translation method the mapping can be defined
in a class variable named ``_constMap``. Similarly, for one-to-one
trivial mappings from a header to a property, ``_trivialMap`` can be
defined. Trivial mappings are a dict mapping a generic property
to either a header keyword, or a tuple consisting of the header keyword
and a dict containing key value pairs suitable for the
`MetadataTranslator.quantity_from_card()` method.
example a specific instrument name should be used) and rather than
provide a full ``to_property()`` translation method the mapping can be
defined in a class variable named ``_constMap``. Similarly, for
one-to-one trivial mappings from a header to a property,
``_trivialMap`` can be defined. Trivial mappings are a dict mapping a
generic property to either a header keyword, or a tuple consisting of
the header keyword and a dict containing key value pairs suitable for
the `MetadataTranslator.quantity_from_card()` method.
"""
super().__init_subclass__(**kwargs)

Expand Down
6 changes: 4 additions & 2 deletions python/astro_metadata_translator/translators/megaprime.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ def to_location(self):
location : `astropy.coordinates.EarthLocation`
An object representing the location of the telescope.
"""
# Height is not in some MegaPrime files. Use the value from EarthLocation.of_site("CFHT")
# Some data uses OBS-LONG, OBS-LAT, other data uses LONGITUD and LATITUDE
# Height is not in some MegaPrime files. Use the value from
# EarthLocation.of_site("CFHT")
# Some data uses OBS-LONG, OBS-LAT, other data uses LONGITUD and
# LATITUDE
for long_key, lat_key in (("LONGITUD", "LATITUDE"), ("OBS-LONG", "OBS-LAT")):
if long_key in self._header and lat_key in self._header:
value = EarthLocation.from_geodetic(self._header[long_key], self._header[lat_key], 4215.0)
Expand Down

0 comments on commit b00f4c9

Please sign in to comment.