uploader.models.SpectralData

class uploader.models.SpectralData(*args, **kwargs)[source]

Model spectral data measured by spectrometer instrument.

id

The database primary key for the entry, Autogenerated if not provided.

Type:

django.models.UUIDField

data

The uploaded file containing the spectral data.

Type:

django.models.FileField

instrument

The instrument used to spectroscopically produce the data.

Type:

django.models.ForeignKey of Instrument

bio_sample

The biosample that was analyzed.

Type:

django.models.CharField of BioSample

measurement_type

The measurement type e.g., atr-ftir.

Type:

django.models.ForeignKey of SpectralMeasurementType

measurement_id

Identifier string for data.

Type:

django.models.CharField, optional

atr_crystal

The ATR crystal used (if at all).

Type:

django.models.CharField, optional

n_coadditions

The number of co-additions (if relevant).

Type:

django.models.IntegerField, optional

acquisition_time

The acquisition time [s].

Type:

django.models.IntegerField, optional

resolution

The resolution [1/cm]

Type:

django.models.CharField, IntegerField

power

Power incident to the sample [mW]

Type:

django.models.FloatField, optional

temperature (:obj:`django.models.FloatField`, optional

Temperature [C].

pressure

Pressure [bar].

Type:

django.models.FloatField, optional

date

Humidity [%].

Type:

django.models.DateTimeField, optional

sers_description

SERS description.

Type:

django.models.CharField, optional

sers_particle_material

SERS particle material.

Type:

django.models.CharField, optional

sers_particle_size

SERS particle size [μm].

Type:

django.models.CharField, optional

sers_particle_concentration

SERS particle concentration.

Type:

django.models.CharField, optional

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

adelete(*args, **kwargs)

annotate([annotator, force])

Run the quality control annotation on the spectral data.

arefresh_from_db([using, fields, from_queryset])

asave(*args, **kwargs)

check(**kwargs)

clean()

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields.

clean_data_file()

Read in data from uploaded file and store as json.

clean_fields([exclude])

Clean all fields and raise a ValidationError containing a dict of all validation errors if any occur.

date_error_message(lookup_type, field_name, ...)

delete(*args[, delete_files])

from_db(db, field_names, values)

full_clean([exclude, validate_unique, ...])

Call clean_fields(), clean(), validate_unique(), and validate_constraints() on the model.

generate_filename()

get_annotators()

Return list of all quality control annotators.

get_column_names([help_text])

get_constraints()

get_deferred_fields()

Return a set containing names of deferred fields for this instance.

get_next_by_created_at(*[, field, is_next])

get_next_by_updated_at(*[, field, is_next])

get_orphan_files()

get_previous_by_created_at(*[, field, is_next])

get_previous_by_updated_at(*[, field, is_next])

get_spectral_data()

Return spectral data as instance of uploader.io.SpectralData.

get_unrun_annotators([existing_annotators])

Return list of default quality control annotators that have not yet been run against this data.

parse_fields_from_pandas_series(series)

Parse the pandas series for field values returning a dict.

prepare_database_save(field)

refresh_from_db([using, fields, from_queryset])

Reload field values from the database.

save(*args, **kwargs)

Save the current instance.

save_base([raw, force_insert, force_update, ...])

Handle the parts of saving which should be done only once per save, yet need to be done in raw saves, too.

serializable_value(field_name)

Return the value of the field name for this instance.

unique_error_message(model_class, unique_check)

validate_constraints([exclude])

validate_unique([exclude])

Check unique constraints on the model and raise ValidationError if any failed.

Attributes

UPLOAD_DIR

acquisition_time

A wrapper for a deferred-loading field.

atr_crystal

A wrapper for a deferred-loading field.

bio_sample

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

bio_sample_id

center

created_at

A wrapper for a deferred-loading field.

data

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like::.

date

A wrapper for a deferred-loading field.

humidity

A wrapper for a deferred-loading field.

id

A wrapper for a deferred-loading field.

instrument

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

instrument_id

measurement_id

A wrapper for a deferred-loading field.

measurement_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

measurement_type_id

n_coadditions

A wrapper for a deferred-loading field.

objects

pk

power

A wrapper for a deferred-loading field.

pressure

A wrapper for a deferred-loading field.

qc_annotation

Accessor to the related objects manager on the reverse side of a many-to-one relation.

resolution

A wrapper for a deferred-loading field.

sers_description

A wrapper for a deferred-loading field.

sers_particle_concentration

A wrapper for a deferred-loading field.

sers_particle_material

A wrapper for a deferred-loading field.

sers_particle_size

A wrapper for a deferred-loading field.

temperature

A wrapper for a deferred-loading field.

updated_at

A wrapper for a deferred-loading field.