Skip to content

Commit

Permalink
Adding constant_kwargs dict
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorris3 committed Aug 18, 2015
1 parent 54ed66b commit 2f6523e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion astroplan/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1523,12 +1523,13 @@ class NonFixedTarget(Target):
Currently only some celestial objects are supported in this class.
"""
def __init__(self, coord_function=None, name=None):
def __init__(self, coord_function=None, name=None, constant_kwargs=None):
"""
TODO: Docstring.
"""
self.name = name.lower() if name is not None else name
self.coord_function = coord_function
self.constant_kwargs = constant_kwargs

@classmethod
def from_function(cls, coord_function, name=None):
Expand All @@ -1551,6 +1552,9 @@ def at(self, *args, **kwargs):
-------
A `~astropy.coordinates.SkyCoord` object as specified by the parameters.
"""
if self.constant_kwargs is not None:
for key in self.constant_kwargs:
kwargs[key] = self.constant_kwargs[key]
return self.coord_function(*args, **kwargs)

class Constraint(object):
Expand Down

0 comments on commit 2f6523e

Please sign in to comment.