Esempio n. 1
0
class User(db.Model, UserMixin):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(20), unique=True, nullable=False)
    email = db.Column(db.String(120), unique=True, nullable=False)
    password = db.Column(db.String(60), nullable=False)
    history = db.Column(db.String(240))

    def __repr__(self):
        return ("User({self.username}, {self.email}").format()
Esempio n. 2
0
class Image(db.Model):

    id = db.Column(db.Integer, primary_key=True)
    date_observed = db.Column(db.DateTime, unique=True, nullable=False)
    jd = db.Column(db.Float, unique=True, nullable=False)

    filter_used = db.Column(db.String(20))
    exposure = db.Column(db.Float)
    air_mass = db.Column(db.Float)
    ccd_temp = db.Column(db.Float)
    image_type = db.Column(db.String(20))
    focus_value = db.Column(db.String(20))
    fwhm = db.Column(db.Float)
    lim_mag = db.Column(db.Float)
    psf_mag = db.Column(db.Float)
    psf_merr = db.Column(db.Float)
    apr_mag = db.Column(db.Float)
    apr_merr = db.Column(db.Float)

    filepath = db.Column(db.String(120), unique=True, nullable=False)

    tel_alt = db.Column(db.Float)
    tel_az = db.Column(db.Float)

    ref_ra = db.Column(db.Float)
    ref_dec = db.Column(db.Float)

    tar_ra = db.Column(db.Float)
    tar_dec = db.Column(db.Float)
    tar_name = db.Column(db.String(20))

    boundry_points = db.Column(db.String(120))

    def __repr__(self):
        attrs = vars(self)
        return ', '.join("%s: %s" % item for item in attrs.items())
Esempio n. 3
0
class Image(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    date_observed = db.Column(db.DateTime, unique=True, nullable=False)
    jd = db.Column(db.Float, unique=True, nullable=False)

    filter_used = db.Column(db.String(20))
    exposure = db.Column(db.Float)
    air_mass = db.Column(db.Float)
    ccd_temp = db.Column(db.Float)
    image_type = db.Column(db.String(20))
    focus_value = db.Column(db.String(20))
    fwhm = db.Column(db.Float)
    lim_mag = db.Column(db.Float)
    psf_mag = db.Column(db.Float)
    psf_merr = db.Column(db.Float)
    apr_mag = db.Column(db.Float)
    apr_merr = db.Column(db.Float)

    filepath = db.Column(db.String(120), unique=True, nullable=False)

    tel_alt = db.Column(db.Float)
    tel_az = db.Column(db.Float)

    ref_ra = db.Column(db.Float)
    ref_dec = db.Column(db.Float)

    tar_ra = db.Column(db.Float)
    tar_dec = db.Column(db.Float)
    tar_name = db.Column(db.String(20))

    boundry_points = db.Column(db.String(120))

    def __repr__(self):
        attrs = vars(self)
        for index, vals in attrs.items():
            if not index.startswith('__') and attrs[index] == None:
                attrs[index] = float("Nan")
        return ', '.join("{}".format(item) for item in attrs.items())