Template Tags#

Inclusion Tags#

tom_targets.templatetags.targets_extras.aladin_finderchart(target)[source]#

Displays Aladin skyview of the given target along with basic finder chart annotations including a compass and a scale bar. The resulting image is downloadable. This templatetag only works for sidereal targets.

tom_targets.templatetags.targets_extras.aladin_skymap(targets)[source]#

Displays aladin skyview on Target Distribution skymap. Markers on the skymap show where your targets are. Max of 25 targets show at a time (one page of targets). This templatetag converts the targets queryset into a list of dictionaries suitable for javascript and aladin, and only works for sidereal targets.

Also, puts the current Moon and Sun positions (from astropy) into the context.

tom_targets.templatetags.targets_extras.aladin_skymap_targets_oob(targets)[source]#

Lightweight template tag for HTMX responses – sends only the updated target list as JSON to the existing Aladin viewer via an OOB swap.

Unlike aladin_skymap, this does not recompute Moon/Sun positions or reinitialize the viewer, making it suitable for repeated HTMX calls.

tom_targets.templatetags.targets_extras.recent_targets(context, limit=10)[source]#

Displays a list of the most recently created targets in the TOM up to the given limit, or 10 if not specified.

tom_targets.templatetags.targets_extras.select_target_js()[source]#
tom_targets.templatetags.targets_extras.target_data(target)[source]#

Displays the data of a target.

tom_targets.templatetags.targets_extras.target_distribution(targets)[source]#

Allows users to reference the old skymap; target list page won’t break.

tom_targets.templatetags.targets_extras.target_feature(target)[source]#

Displays the featured image for a target.

tom_targets.templatetags.targets_extras.target_groups(target)[source]#

Widget displaying groups this target is in and controls for modifying group association for the given target.

tom_targets.templatetags.targets_extras.target_plan(
context,
fast_render=False,
width=600,
height=400,
background=None,
label_color=None,
grid=True,
)[source]#

Displays form and renders plot for visibility calculation. Using this templatetag to render a plot requires that the context of the parent view have values for start_time, end_time, and airmass.

Parameters:
  • fast_render (bool) – Render the plot on page load, defaults to the next 24hrs and 2.5 airmass

  • width (int) – Width of generated plot

  • height – Height of generated plot

  • background (str) – Color of the background of generated plot. Can be rgba or hex string.

  • label_color (str) – Color of labels/tick labels. Can be rgba or hex string.

  • grid (bool) – Whether to show grid lines.

Filters#

tom_targets.templatetags.targets_extras.deg_to_sexigesimal(value, fmt)[source]

Displays a degree coordinate value in sexagesimal, given a format of hms or dms.

tom_targets.templatetags.targets_extras.target_extra_field(target, name)[source]

Returns a TargetExtra value of the given name, if one exists.