-
Notifications
You must be signed in to change notification settings - Fork 10
/
data_types.py
51 lines (36 loc) · 1.67 KB
/
data_types.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Martin Raspaud
# Author(s):
# Martin Raspaud <martin.raspaud@smhi.se>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Adds the data types to the database.
"""
from db.pytroll_db import DCManager
dbm = DCManager('postgresql://polar:polar@localhost:5432/sat_db')
dbm.create_file_type(1, 'HRPT 0', 'HRPT level 0 data')
dbm.create_file_type(2, 'EOS 0', 'EOS level 0 data')
dbm.create_file_type(3, 'RDR', 'RDR data')
dbm.create_file_type(4, 'SDR', 'SDR data')
dbm.create_file_format(1, '16-bit HRPT Minor Frame', 'HRPT level 0 data')
dbm.create_parameter_type(1, "normal_parameter", "")
dbm.create_parameter(1, 1, "start_time", "")
dbm.create_parameter(2, 1, "end_time", "")
dbm.create_parameter(3, 1, "orbit number", "")
dbm.create_parameter(4, 1, "risetime", "")
dbm.create_parameter(5, 1, "falltime", "")
dbm.create_parameter(6, 1, "satellite", "")
dbm.create_parameter(7, 1, "format", "")
dbm.create_parameter(8, 1, "type", "")
dbm.create_parameter(9, 1, "uri", "")
dbm.create_parameter(10, 1, "sub_satellite_track", "")
dbm.session.commit()