示例#1
0
def double_star_chart_legend_img(double_star_id, ra, dec):
    double_star = DoubleStar.query.filter_by(id=double_star_id).first()
    if double_star is None:
        abort(404)

    img_bytes = common_chart_legend_img(double_star.ra_first, double_star.dec_first, ra, dec, )
    return send_file(img_bytes, mimetype='image/png')
示例#2
0
def observed_list_chart_legend_img(ra, dec):
    observed_list = ObservedList.create_get_observed_list_by_user_id(current_user.id)
    if observed_list is None:
        abort(404)

    img_bytes = common_chart_legend_img(None, None, ra, dec, )
    return send_file(img_bytes, mimetype='image/png')
示例#3
0
def comet_chart_legend_img(comet_id, ra, dec):
    comet = _find_comet(comet_id)
    if comet is None:
        abort(404)

    comet_ra = to_float(request.args.get('obj_ra'), None)
    comet_dec = to_float(request.args.get('obj_dec'), None)

    img_bytes = common_chart_legend_img(comet_ra, comet_dec, ra, dec, )
    return send_file(img_bytes, mimetype='image/png')
示例#4
0
def planet_chart_legend_img(planet_name, ra, dec):
    planet = _find_planet(planet_name)
    if planet is None:
        abort(404)

    planet_ra = to_float(request.args.get('obj_ra'), None)
    planet_dec = to_float(request.args.get('obj_dec'), None)

    img_bytes = common_chart_legend_img(planet_ra, planet_dec, ra, dec, )
    return send_file(img_bytes, mimetype='image/png')
示例#5
0
def session_plan_chart_legend_img(session_plan_id, ra, dec):
    session_plan = SessionPlan.query.filter_by(id=session_plan_id).first()
    _check_session_plan(session_plan, allow_public=True)

    img_bytes = common_chart_legend_img(
        None,
        None,
        ra,
        dec,
    )
    return send_file(img_bytes, mimetype='image/png')
示例#6
0
def constellation_chart_legend_img(constellation_id, ra, dec):
    constellation = _find_constellation(constellation_id)
    if constellation is None:
        abort(404)

    img_bytes = common_chart_legend_img(
        constellation.label_ra,
        constellation.label_dec,
        ra,
        dec,
    )
    return send_file(img_bytes, mimetype='image/png')
示例#7
0
def dso_list_chart_legend_img(dso_list_id, ra, dec):
    highlights_dso_list = _find_highlights_dso_list(dso_list_id)
    if highlights_dso_list is None:
        abort(404)

    img_bytes = common_chart_legend_img(
        None,
        None,
        ra,
        dec,
    )
    return send_file(img_bytes, mimetype='image/png')
示例#8
0
def star_chart_legend_img(star_id, ra, dec):
    star = Star.query.filter_by(id=star_id).first()
    if star is None:
        abort(404)

    img_bytes = common_chart_legend_img(
        star.ra,
        star.dec,
        ra,
        dec,
    )
    return send_file(img_bytes, mimetype='image/png')
示例#9
0
def deepskyobject_chart_legend_img(dso_id, ra, dec):
    dso, orig_dso = _find_dso(dso_id)
    if dso is None:
        abort(404)

    img_bytes = common_chart_legend_img(
        dso.ra,
        dso.dec,
        ra,
        dec,
    )

    return send_file(img_bytes, mimetype='image/png')
示例#10
0
def observing_session_chart_legend_img(observing_session_id, ra, dec):
    observing_session = ObservingSession.query.filter_by(
        id=observing_session_id).first()
    is_mine_observing_session = _check_observing_session(observing_session,
                                                         allow_public=True)

    img_bytes = common_chart_legend_img(
        None,
        None,
        ra,
        dec,
    )
    return send_file(img_bytes, mimetype='image/png')
示例#11
0
def news_chart_legend_img(news_id, ra, dec):
    news = News.query.filter_by(id=news_id).first()
    if news is None:
        abort(404)
    if not news.is_released and (current_user.is_anonymous
                                 or not current_user.is_editor):
        abort(404)

    img_bytes = common_chart_legend_img(
        news.ra,
        news.dec,
        ra,
        dec,
    )
    return send_file(img_bytes, mimetype='image/png')
示例#12
0
def minor_planet_chart_legend_img(minor_planet_id, ra, dec):
    minor_planet = MinorPlanet.query.filter_by(id=minor_planet_id).first()
    if minor_planet is None:
        abort(404)

    minor_planet_ra = to_float(request.args.get('obj_ra'), None)
    minor_planet_dec = to_float(request.args.get('obj_dec'), None)

    img_bytes = common_chart_legend_img(
        minor_planet_ra,
        minor_planet_dec,
        ra,
        dec,
    )
    return send_file(img_bytes, mimetype='image/png')
示例#13
0
def chart_legend_img(ra, dec):
    img_bytes = common_chart_legend_img(None, None, ra, dec)
    return send_file(img_bytes, mimetype='image/png')