25 lines
1.2 KiB
Python
25 lines
1.2 KiB
Python
from django.db import models
|
|
|
|
# Create your models here.
|
|
class Isotope(models.Model):
|
|
n_protons = models.IntegerField(help_text="Protons in isotope")
|
|
n_nucleons = models.IntegerField(help_text="Nucleons in isotope")
|
|
stable = models.BooleanField(help_text="Is isotope stable?")
|
|
symbol = models.CharField(max_length=2, help_text="Symbol of isotope")
|
|
name = models.CharField(max_length=255, help_text="Name of isotope")
|
|
spin_quantum_number = models.FloatField(help_text="Spin quantum number")
|
|
gamma = models.FloatField(help_text="Gyromagnetic ratio in MHz/T") # MHz/T
|
|
natural_abundance = models.FloatField(help_text="Natural abundance")
|
|
quadrupole_moment = models.FloatField(null=True, help_text="Quadrupole moment")
|
|
|
|
class FieldProfile(models.Model):
|
|
name = models.CharField(max_length=100, unique=True)
|
|
file = models.FileField(upload_to='magnet-profiles')
|
|
step = models.FloatField(default=0.0008333333333333334, help_text="Step size in m (or appropriate unit)")
|
|
cryo_length = models.FloatField(default=1113.0, help_text="Cryo length in mm")
|
|
reverse_offset = models.BooleanField(default=False, help_text="Check for Magnex style offset calculation")
|
|
|
|
def __str__(self):
|
|
return self.name
|
|
|