How to use the jplephem.names.target_names function in jplephem

To help you get started, we’ve selected a few jplephem examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github skyfielders / python-skyfield / skyfield / vectorlib.py View on Github external
def _jpl_name(code_or_string):
    if isinstance(code_or_string, int):
        name = _jpl_code_name_dict.get(code_or_string)
        if name is not None:
            return '{0} {1}'.format(code_or_string, name)
    return str(code_or_string)
github galactics / beyond / beyond / env / jpl.py View on Github external
segments.extend(SPK.open(str(filepath)).segments)

        if not segments:
            raise JplError("No segment loaded")

        # list of available segments
        self.segments = dict(((s.center, s.target), s) for s in segments)

        # This variable will contain the Target of reference from which
        # all relations between frames are linked
        targets = {}

        for center_id, target_id in self.segments.keys():

            center_name = target_names.get(center_id, "Unknown")
            target_name = target_names.get(target_id, "Unknown")

            # Retrieval of the Target object representing the center if it exists
            # or creation of said object if it doesn't.
            center = targets.setdefault(center_id, Target(center_name, center_id))
            target = targets.setdefault(target_id, Target(target_name, target_id))

            # Link between the Target objects (see Node2)
            center + target

        # We take the Earth target and make it the top of the structure.
        # That way, it is easy to link it to the already declared earth-centered reference frames
        # from the `frames.frame` module.
        self.top = targets[399]
github galactics / beyond / beyond / env / jpl.py View on Github external
segments.extend(SPK.open(str(filepath)).segments)

        if not segments:
            raise JplError("No segment loaded")

        # list of available segments
        self.segments = dict(((s.center, s.target), s) for s in segments)

        # This variable will contain the Target of reference from which
        # all relations between frames are linked
        targets = {}

        for center_id, target_id in self.segments.keys():

            center_name = target_names.get(center_id, "Unknown")
            target_name = target_names.get(target_id, "Unknown")

            # Retrieval of the Target object representing the center if it exists
            # or creation of said object if it doesn't.
            center = targets.setdefault(center_id, Target(center_name, center_id))
            target = targets.setdefault(target_id, Target(target_name, target_id))

            # Link between the Target objects (see Node2)
            center + target

        # We take the Earth target and make it the top of the structure.
        # That way, it is easy to link it to the already declared earth-centered reference frames
        # from the `frames.frame` module.
        self.top = targets[399]