TemplateTags

tom_dataproducts.templatetags.dataproduct_extras.dataproduct_list_for_target(context, target)

Given a Target, returns a list of DataProduct objects associated with that Target

tom_dataproducts.templatetags.dataproduct_extras.dataproduct_list_for_observation_saved(data_products, request)

Given a dictionary of dataproducts from an ObservationRecord, returns the subset that are saved to the TOM. This templatetag paginates the subset of DataProduct, and therefore requires the request to have a ‘page_saved’ key.

This templatetag is intended to be used with the all_data_products() method from a facility, as it returns a dictionary with keys of saved and unsaved that have values of lists of DataProduct objects.

tom_dataproducts.templatetags.dataproduct_extras.dataproduct_list_for_observation_unsaved(data_products)

Given a dictionary of dataproducts from an ObservationRecord, returns a list of the subset that are not saved to the TOM.

This templatetag is intended to be used with the all_data_products() method from a facility, as it returns a dictionary with keys of saved and unsaved that have values of lists of DataProduct objects.

tom_dataproducts.templatetags.dataproduct_extras.dataproduct_list_all(context)

Returns the full list of data products in the TOM, with the most recent first.

tom_dataproducts.templatetags.dataproduct_extras.recent_photometry(target, limit=1)

Displays a table of the most recent photometric points for a target.

tom_dataproducts.templatetags.dataproduct_extras.photometry_for_target(context, target)

Renders a photometric plot for a target.

This templatetag requires all ReducedDatum objects with a data_type of photometry to be structured with the following keys in the JSON representation: magnitude, error, filter

tom_dataproducts.templatetags.dataproduct_extras.spectroscopy_for_target(context, target, dataproduct=None)

Renders a spectroscopic plot for a Target. If a DataProduct is specified, it will only render a plot with that spectrum.