models.py

This modules contains the django code used to create tables in the database backend.

class host.models.Alias(*args, **kwargs)[source]

Model to link aliases to transients and hosts

exception DoesNotExist
exception MultipleObjectsReturned
validate_name()[source]

Alias validation. :param alias: Alias value

class host.models.Aperture(*args, **kwargs)[source]

Model to represent a sky aperture

exception DoesNotExist
exception MultipleObjectsReturned
property sky_aperture

Return photutils object

class host.models.AperturePhotometry(*args, **kwargs)[source]

Model to store the photometric data

exception DoesNotExist
exception MultipleObjectsReturned
save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

class host.models.Cutout(*args, **kwargs)[source]

Model to represent a cutout image of a host galaxy

exception DoesNotExist
exception MultipleObjectsReturned
save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

class host.models.Filter(*args, **kwargs)[source]

Model to represent a survey filter

exception DoesNotExist
exception MultipleObjectsReturned
correlation_model()[source]

Returns the model for correlated errors of the filter, if it exists

transmission_curve()[source]

Returns the transmission curve of the filter

class host.models.Host(*args, **kwargs)[source]

Model to represent a host galaxy.

name

Name of the host galaxy, character limit = 100.

Type:

django.db.model.CharField

ra_deg

Right Ascension (ICRS) in decimal degrees of the host

Type:

django.db.model.FloatField

deg_deg

Declination (ICRS) in decimal degrees of the host

Type:

django.db.model.FloatField

exception DoesNotExist
exception MultipleObjectsReturned
class host.models.SEDFittingResult(*args, **kwargs)[source]

Model to store prospector results

exception DoesNotExist
exception MultipleObjectsReturned
save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

class host.models.SkyObject(*args, **kwargs)[source]

Abstract base model to represent an astrophysical object with an on-sky position.

ra_deg

Right Ascension (ICRS) in decimal degrees of the host

Type:

django.db.model.FloatField

deg_deg

Declination (ICRS) in decimal degrees of the host

Type:

django.db.model.FloatField

property dec

String representation of Declination.

property ra

String representation of Right ascension.

save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

property sky_coord

SkyCoordinate of the object’s position.

class host.models.StarFormationHistoryResult(id, transient, aperture, logsfr_16, logsfr_50, logsfr_84, logsfr_tmin, logsfr_tmax, software_version)[source]
exception DoesNotExist
exception MultipleObjectsReturned
save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

class host.models.Status(*args, **kwargs)[source]

Status of a given processing task

exception DoesNotExist
exception MultipleObjectsReturned
property badge

Returns the Boostrap badge class of the status

class host.models.Survey(*args, **kwargs)[source]

Model to represent a survey

exception DoesNotExist
exception MultipleObjectsReturned
class host.models.Task(*args, **kwargs)[source]

A processing task that needs to be completed for a transient.

exception DoesNotExist
exception MultipleObjectsReturned
class host.models.TaskLock(*args, **kwargs)[source]

Model to provide a global locking mechanism (mutex) to prevent concurrent execution of serial operations.

exception DoesNotExist
exception MultipleObjectsReturned
class host.models.TaskRegister(*args, **kwargs)[source]

Keep track of the the various processing status of a transient.

exception DoesNotExist
exception MultipleObjectsReturned
class host.models.Transient(*args, **kwargs)[source]

Model to represent a transient.

name

Transient Name Server name of the transient, character limit = 64.

Type:

django.db.model.CharField

tns_id

Transient Name Server ID.

Type:

models.IntegerField

tns_prefix

Transient Name Server name prefix, character limit = 20.

Type:

models.CharField

ra_deg

Right Ascension (ICRS) in decimal degrees of the transient.

Type:

django.db.model.FloatField

deg_deg

Declination (ICRS) in decimal degrees of the transient.

Type:

django.db.model.FloatField

host

ForeignKey pointing to a :class:Host representing a transient’s host galaxy.

Type:

django.db.model.ForeignKey

public_timestamp

Transient name server public timestamp for the transient. Field can be null or blank. On Delete is set to cascade.

Type:

django.db.model.DateTimeField

exception DoesNotExist
exception MultipleObjectsReturned
property best_redshift

get the best redshift for a transient

best_spec_redshift()[source]

get the best redshift for a transient

name_regex()[source]

Central location for transient identifier naming regex. Combine with rules defined in validate_name().

validate_name()[source]

Transient name/identifier validation. Central definition of naming rules that complements regular expression from name_regex(). See https://docs.djangoproject.com/en/5.2/ref/validators/

Parameters:

name – Transient identifier

class host.models.UsageMetricsLog(*args, **kwargs)[source]

Model to keep track of usage metrics based on requests. .. attribute:: request_url

The requested URL

type:

models.CharField

request_method

The HTTP method of the request

Type:

models.CharField

request_time

Time of request.

Type:

models.DateTimeField

submitted_data

The data submitted in the request

Type:

models.TextField

request_user

The user that made the request (if authenticated).

Type:

models.CharField

request_ip

The source IP that made the request.

Type:

models.CharField

exception DoesNotExist
exception MultipleObjectsReturned
host.models.fits_file_path(instance)[source]

Constructs a file path for a fits image

host.models.hdf5_file_path(instance)[source]

Constructs a file path for a HDF5 image

host.models.npz_chains_file_path(instance)[source]

Constructs a file path for a npz file

host.models.npz_model_file_path(instance)[source]

Constructs a file path for a npz file

host.models.npz_percentiles_file_path(instance)[source]

Constructs a file path for a npz file