Exemple #1
0
# TODO: Complete helioviewer sdk

# http://helioviewer.org/api/docs/v1/
# The Helioviewer Project maintains a set of Public APIs with the goal of improving access to solar and heliospheric datasets to scientists, educators, developers, and the general public. Read below for descriptions of each API endpoint and examples of usage.
from bowshock.helpers import bowshock_logger, validate_iso8601, dispatch_http_get

logger = bowshock_logger()


def getjp2image(date,
                sourceId=None,
                observatory=None,
                instrument=None,
                detector=None,
                measurement=None):
    '''
    Helioviewer.org and JHelioviewer operate off of JPEG2000 formatted image data generated from science-quality FITS files. Use the APIs below to interact directly with these intermediary JPEG2000 files.
    
    Download a JP2 image for the specified datasource that is the closest match in time to the `date` requested.

    Either `sourceId` must be specified, or the combination of `observatory`, `instrument`, `detector`, and `measurement`.

    Request Parameters:

    Parameter	Required	Type	Example	Description
    date	Required	string	2014-01-01T23:59:59Z	Desired date/time of the JP2 image. ISO 8601 combined UTC date and time UTC format.
    sourceId	Optional	number	14	Unique image datasource identifier.
    observatory	Optional	string	SDO	Observatory name.
    instrument	Optional	string	AIA	Instrument name.
    detector	Optional	string	AIA	Detector name.
    measurement	Optional	string	335	Measurement name.
Exemple #2
0
# http://www.asterank.com/skymorph

#This API wraps NASA's SkyMorph archive in a RESTful JSON interface. Currently, it provides observation and image data from the NEAT survey.
from bowshock.helpers import bowshock_logger, dispatch_http_get

logger = bowshock_logger()


def search_target_obj(target):
    '''
    Query for a specific target:

    http://asterank.com/api/skymorph/search?<params>
    target	Target object (lookup in MPC).
    '''
    base_url = "http://asterank.com/api/skymorph/search?"

    if not isinstance(target, str):
        raise ValueError("The target arg you provided is not the type of str")
    else:
        base_url += "target=" + target

    return dispatch_http_get(base_url)


def search_orbit(**kwargs):
    '''
    Query based on orbital elements:

    http://asterank.com/api/skymorph/search_orbit?<params>
    epoch	Epoch ([M]JD or ISO)