Commit 33d7e868 authored by Wei Shoulin's avatar Wei Shoulin
Browse files

ifs ver

parent 1c3e9698
from datetime import datetime
import time
def format_datetime(dt):
return dt.strftime('%Y-%m-%d %H:%M:%S')
......@@ -7,4 +8,10 @@ def format_date(dt):
return dt.strftime('%Y-%m-%d')
def format_sql_datetime(dt):
return str(dt) if isinstance(dt, datetime) else dt
\ No newline at end of file
return str(dt) if isinstance(dt, datetime) else dt
def format_time_ms(float_time):
local_time = time.localtime(float_time)
data_head = time.strftime("%Y-%m-%d %H:%M:%S", local_time)
data_secs = (float_time - int(float_time)) * 1000
return "%s.%03d" % (data_head, data_secs)
\ No newline at end of file
import dataclasses
from email import header
from ensurepip import version
from typing import Dict
from .common import BaseModel, default_field
......@@ -13,6 +15,14 @@ class Level0PrcRecord(BaseModel):
prc_time: str=""
result_file_path: str=""
@dataclasses.dataclass
class Level0HeaderRecord(BaseModel):
id: int = 0
object_name: str = ""
ra: float = 0
dec: float = 0
version: str = ""
@dataclasses.dataclass
class Level0Record(BaseModel):
id: int = 0
......@@ -20,7 +30,6 @@ class Level0Record(BaseModel):
obs_id: str = ""
detector_no: str = ""
obs_type: str = ""
object_name: str = ""
obs_time: str=""
exp_time: float = 0
detector_status_id: int = 0
......
......@@ -13,6 +13,14 @@ class Level0PrcRecord(BaseModel):
prc_time: str=""
result_file_path: str=""
@dataclasses.dataclass
class Level0HeaderRecord(BaseModel):
id: int = 0
object_name: str = ""
ra: float = 0
dec: float = 0
version: str = ""
@dataclasses.dataclass
class Level0Record(BaseModel):
id: int = 0
......
......@@ -81,9 +81,7 @@ class Level2Record(BaseModel):
@dataclasses.dataclass
class Level2CatalogRecord(BaseModel):
source_id: int = 0
obs_id : str = ""
detector_no: str=""
level2_id: int = 0
seq: int = 0
flux_aper: list = dataclasses.field(default_factory=list)
fluxerr_aper: list = dataclasses.field(default_factory=list)
......@@ -238,9 +236,11 @@ class Level2CatalogRecord(BaseModel):
disk_theta_world: float = -1
disk_thetaerr_world: float = -1
disk_theta_j2000: float = -1
obs_time: str = ''
brick_id_8: int = 0
brick_id_16: int = 0
NS8HIdx: int = 0
NS16HIdx: int = 0
NS32HIdx: int = 0
NS64HIdx: int = 0
create_time: str = ''
@dataclasses.dataclass
class Level1PrcRecord(BaseModel):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment