db.sql 20.6 KB
Newer Older
Wei Shoulin's avatar
Wei Shoulin committed
1
2
/*----------------facility------------------------------*/
drop table if exists t_module_status;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
3

Wei Shoulin's avatar
Wei Shoulin committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
drop table if exists t_observation;

drop table if exists t_detector;

drop table if exists t_detector_status;

drop table if exists t_facility_status;

drop table if exists t_guiding;

/*----------------msc------------------------------*/
drop table if exists msc_level0_data;

drop table if exists msc_level0_header;

drop table if exists msc_level0_prc;

drop table if exists msc_cal2level0;

drop table if exists msc_cal_header;

drop table if exists msc_cal_merge;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
26
27
28
29
30

drop table if exists msc_level1_data;

drop table if exists msc_level1_header;

Wei Shoulin's avatar
Wei Shoulin committed
31
drop table if exists msc_level1_prc;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
32

Wei Shoulin's avatar
Wei Shoulin committed
33
34
drop table if exists msc_level1_ref;
/*----------------ifs------------------------------*/
Wei Shoulin's avatar
c3    
Wei Shoulin committed
35

Wei Shoulin's avatar
Wei Shoulin committed
36
drop table if exists ifs_level0_data;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
37

Wei Shoulin's avatar
Wei Shoulin committed
38
drop table if exists ifs_level0_header;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
39

Wei Shoulin's avatar
Wei Shoulin committed
40
drop table if exists ifs_level0_prc;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
41

Wei Shoulin's avatar
Wei Shoulin committed
42
drop table if exists ifs_cal2level0;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
43

Wei Shoulin's avatar
Wei Shoulin committed
44
drop table if exists ifs_cal_header;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
45

Wei Shoulin's avatar
Wei Shoulin committed
46
drop table if exists ifs_cal_merge;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
47

Wei Shoulin's avatar
Wei Shoulin committed
48
drop table if exists ifs_level1_data;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
49

Wei Shoulin's avatar
Wei Shoulin committed
50
drop table if exists ifs_level1_header;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
51

Wei Shoulin's avatar
Wei Shoulin committed
52
drop table if exists ifs_level1_prc;
Wei Shoulin's avatar
c3    
Wei Shoulin committed
53

Wei Shoulin's avatar
Wei Shoulin committed
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
drop table if exists ifs_level1_ref;

/*----------------sls------------------------------*/
drop table if exists sls_level0_data;

drop table if exists sls_level0_header;

drop table if exists sls_level0_prc;

drop table if exists sls_cal2level0;

drop table if exists sls_cal_header;

drop table if exists sls_cal_merge;

drop table if exists sls_level1_data;

drop table if exists sls_level1_header;

drop table if exists sls_level1_prc;

drop table if exists sls_level1_ref;

drop table if exists sls_level2_spectra;

/*===========================facility===================================*/
create table t_detector
(
   no                   varchar(10) not null,
   detector_name        varchar(256) not null,
   module_id            varchar(20),
   filter_id            varchar(20),
   create_time          datetime,
   update_time          datetime,
   primary key (no)
);
Wei Shoulin's avatar
Wei Shoulin committed
90
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
91
/* Table: t_detector_status                                     */
Wei Shoulin's avatar
Wei Shoulin committed
92
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
93
create table t_detector_status
Wei Shoulin's avatar
Wei Shoulin committed
94
95
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
96
97
98
99
   detector_no          varchar(10) not null,
   status               varchar(256) not null,
   status_time          datetime,
   create_time          datetime
Wei Shoulin's avatar
Wei Shoulin committed
100
);
Wei Shoulin's avatar
Wei Shoulin committed
101

Wei Shoulin's avatar
Wei Shoulin committed
102
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
103
/* Table: t_facility_status                                     */
Wei Shoulin's avatar
Wei Shoulin committed
104
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
105
106
107
108
109
110
create table t_facility_status
(
   id                   integer PRIMARY KEY autoincrement,
   status               varchar(256) not null,
   status_time          datetime,
   create_time          datetime
Wei Shoulin's avatar
Wei Shoulin committed
111
);
Wei Shoulin's avatar
Wei Shoulin committed
112

Wei Shoulin's avatar
Wei Shoulin committed
113
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
114
/* Table: t_guiding                                             */
Wei Shoulin's avatar
Wei Shoulin committed
115
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
116
create table t_guiding
Wei Shoulin's avatar
Wei Shoulin committed
117
(
Wei Shoulin's avatar
Wei Shoulin committed
118
119
120
121
122
   id                   integer PRIMARY KEY autoincrement,
   filename             varbinary(128),
   guiding_file_path    varchar(256) not null,
   guiding_no           varchar(256),
   create_time          datetime
Wei Shoulin's avatar
Wei Shoulin committed
123
124
);
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
125
/* Table: t_module_status                                       */
Wei Shoulin's avatar
Wei Shoulin committed
126
/*==============================================================*/
Wei Shoulin's avatar
Wei Shoulin committed
127
create table t_module_status
Wei Shoulin's avatar
Wei Shoulin committed
128
129
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
   module_id            varbinary(20),
   status               varchar(256) not null,
   status_time          datetime,
   create_time          datetime
);

/*==============================================================*/
/* Table: t_observation                                         */
/*==============================================================*/
create table t_observation
(
   id                   integer PRIMARY KEY autoincrement,
   obs_id               varchar(10),
   obs_time             datetime,
   exp_time             float,
   module_id            varchar(20),
   obs_type             varchar(16),
   facility_status_id   int(20),
   module_status_id     int(20),
   qc0_status           tinyint(1),
   qc0_time             datetime,
Wei Shoulin's avatar
Wei Shoulin committed
151
152
153
   prc_status           tinyint(1),
   prc_time             datetime,
   create_time          datetime,
Wei Shoulin's avatar
Wei Shoulin committed
154
   import_status        tinyint(1)
Wei Shoulin's avatar
Wei Shoulin committed
155
);
Wei Shoulin's avatar
Wei Shoulin committed
156
157
158

/*===========================msc===================================*/
create table msc_level0_data
Wei Shoulin's avatar
c3    
Wei Shoulin committed
159
160
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
161
   level0_id            varchar(20) not null,
Wei Shoulin's avatar
Wei Shoulin committed
162
163
164
165
166
167
   obs_id               varchar(10) not null,
   detector_no          varchar(10) not null,
   obs_type             varchar(16),
   obs_time             datetime,
   exp_time             float,
   detector_status_id   int(20),
Wei Shoulin's avatar
c3    
Wei Shoulin committed
168
169
   filename             varchar(128),
   file_path            varchar(256),
Wei Shoulin's avatar
Wei Shoulin committed
170
171
   qc0_status           tinyint(1),
   qc0_time             datetime,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
172
173
   prc_status           tinyint(1),
   prc_time             datetime,
Wei Shoulin's avatar
Wei Shoulin committed
174
   create_time          datetime
Wei Shoulin's avatar
Wei Shoulin committed
175
);
Wei Shoulin's avatar
Wei Shoulin committed
176
177

create table msc_level0_header
Wei Shoulin's avatar
c3    
Wei Shoulin committed
178
179
180
181
182
183
184
185
186
187
(
   id                   int(20) not null,
   obs_time             datetime,
   exp_time             float,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);

Wei Shoulin's avatar
Wei Shoulin committed
188
189
190
191
192
193
194
195
196
197
198
create table msc_level0_prc
(
   id                   integer PRIMARY KEY autoincrement,
   level0_id            varchar(20) not null,
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
   params_file_path     varchar(256),
   prc_status           int(2),
   prc_time             datetime,
   result_file_path            varchar(256)
);
Wei Shoulin's avatar
c3    
Wei Shoulin committed
199
200
201
create table msc_level1_data
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
202
   level0_id            varchar(20) not null,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
203
204
205
206
207
208
209
210
211
212
213
   data_type            varchar(64) not null,
   cor_sci_id           int(20),
   prc_params           varchar(1024),
   filename             varchar(128),
   file_path            varchar(256),
   prc_status           tinyint(1),
   prc_time             datetime,
   qc1_status           tinyint(1),
   qc1_time             datetime,
   create_time          datetime,
   pipeline_id          varchar(60)
Wei Shoulin's avatar
Wei Shoulin committed
214
);
Wei Shoulin's avatar
Wei Shoulin committed
215
216
217
218
219
220
create table msc_level1_ref (
  level1_id int(20) not null,
  ref_type varchar(64) not null,
  cal_id int(20) not null,
  primary key (level1_id, ref_type)
);
Wei Shoulin's avatar
c3    
Wei Shoulin committed
221
222
223
224
225
226
227
228
229
create table msc_level1_header
(
   id                   int(20) not null,
   obs_time             datetime,
   exp_time             float,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
Wei Shoulin's avatar
Wei Shoulin committed
230
);
Wei Shoulin's avatar
Wei Shoulin committed
231
create table msc_cal2level0
Wei Shoulin's avatar
c3    
Wei Shoulin committed
232
233
(
   merge_id             int(20) not null,
Wei Shoulin's avatar
Wei Shoulin committed
234
   level0_id            varchar(20) not null,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
235
   primary key (merge_id, level0_id)
Wei Shoulin's avatar
Wei Shoulin committed
236
237
);

Wei Shoulin's avatar
Wei Shoulin committed
238
create table msc_cal_header
Wei Shoulin's avatar
c3    
Wei Shoulin committed
239
240
241
242
243
244
245
246
(
   id                   int(20) not null,
   obs_time             datetime,
   exp_time             float,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
Wei Shoulin's avatar
Wei Shoulin committed
247
248
);

Wei Shoulin's avatar
Wei Shoulin committed
249
create table msc_cal_merge
Wei Shoulin's avatar
c3    
Wei Shoulin committed
250
251
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
252
253
   cal_id               varchar(20) not null,
   detector_no          varchar(10) not null,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
254
255
256
257
258
259
260
261
262
263
   ref_type             varchar(16),
   obs_time             datetime,
   exp_time             float,
   filename             varchar(128),
   file_path            varchar(256),
   qc1_status           tinyint(1),
   qc1_time             datetime,
   prc_status           tinyint(1),
   prc_time             datetime,
   create_time          datetime
Wei Shoulin's avatar
Wei Shoulin committed
264
);
Wei Shoulin's avatar
Wei Shoulin committed
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
create table msc_level1_prc
(
   id                   integer PRIMARY KEY autoincrement,
   level1_id            int(20) not null,
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
   params_file_path     varchar(256),
   prc_status           int(2),
   prc_time             datetime,
   result_file_path            varchar(256)
);
/*===========================ifs===================================*/
create table ifs_level0_data
(
   id                   integer PRIMARY KEY autoincrement,
   level0_id            varchar(20) not null,
   obs_id               varchar(10) not null,
   detector_no          varchar(10) not null,
   obs_type             varchar(16),
   obs_time             datetime,
   exp_time             float,
   detector_status_id   int(20),
   filename             varchar(128),
   file_path            varchar(256),
   qc0_status           tinyint(1),
   qc0_time             datetime,
   prc_status           tinyint(1),
   prc_time             datetime,
   create_time          datetime
);
Wei Shoulin's avatar
Wei Shoulin committed
295

Wei Shoulin's avatar
Wei Shoulin committed
296
create table ifs_level0_header
Wei Shoulin's avatar
c3    
Wei Shoulin committed
297
(
Wei Shoulin's avatar
Wei Shoulin committed
298
299
300
301
302
   id                   int(20) not null,
   obs_time             datetime,
   exp_time             float,
   ra                   float,
   "dec"                float,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
303
   create_time          datetime,
Wei Shoulin's avatar
Wei Shoulin committed
304
   primary key (id)
Wei Shoulin's avatar
Wei Shoulin committed
305
);
Wei Shoulin's avatar
c3    
Wei Shoulin committed
306

Wei Shoulin's avatar
Wei Shoulin committed
307
create table ifs_level0_prc
Wei Shoulin's avatar
c3    
Wei Shoulin committed
308
309
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
310
311
312
313
314
315
316
317
318
319
320
321
322
   level0_id            varchar(20) not null,
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
   params_file_path     varchar(256),
   prc_status           int(2),
   prc_time             datetime,
   result_file_path            varchar(256)
);
create table ifs_cal2level0
(
   merge_id             int(20) not null,
   level0_id            varchar(20) not null,
   primary key (merge_id, level0_id)
Wei Shoulin's avatar
c3    
Wei Shoulin committed
323
324
);

Wei Shoulin's avatar
Wei Shoulin committed
325
326
327
328
329
330
331
332
333
334
335
336
create table ifs_cal_header
(
   id                   int(20) not null,
   obs_time             datetime,
   exp_time             float,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);

create table ifs_cal_merge
Wei Shoulin's avatar
c3    
Wei Shoulin committed
337
338
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
339
340
341
342
343
344
345
346
347
348
349
   cal_id               varchar(20) not null,
   detector_no          varchar(10) not null,
   ref_type             varchar(16),
   obs_time             datetime,
   exp_time             float,
   filename             varchar(128),
   file_path            varchar(256),
   qc1_status           tinyint(1),
   qc1_time             datetime,
   prc_status           tinyint(1),
   prc_time             datetime,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
350
351
352
   create_time          datetime
);

Wei Shoulin's avatar
Wei Shoulin committed
353
create table ifs_level1_data
Wei Shoulin's avatar
c3    
Wei Shoulin committed
354
355
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
356
357
358
359
360
361
362
363
364
365
366
367
   level0_id            varchar(20) not null,
   data_type            varchar(64) not null,
   cor_sci_id           int(20),
   prc_params           varchar(1024),
   filename             varchar(128),
   file_path            varchar(256),
   prc_status           tinyint(1),
   prc_time             datetime,
   qc1_status           tinyint(1),
   qc1_time             datetime,
   create_time          datetime,
   pipeline_id          varchar(60)
Wei Shoulin's avatar
c3    
Wei Shoulin committed
368
369
);

Wei Shoulin's avatar
Wei Shoulin committed
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
create table ifs_level1_ref (
  level1_id int(20) not null,
  ref_type varchar(64) not null,
  cal_id int(20) not null,
  primary key (level1_id, ref_type)
);

create table ifs_level1_header
(
   id                   int(20) not null,
   obs_time             datetime,
   exp_time             float,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);
create table ifs_level1_prc
(
   id                   integer PRIMARY KEY autoincrement,
   level1_id            int(20) not null,
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
   params_file_path     varchar(256),
   prc_status           int(2),
   prc_time             datetime,
   result_file_path            varchar(256)
);
/*===========================sls===================================*/
create table sls_level0_data
Wei Shoulin's avatar
c3    
Wei Shoulin committed
400
401
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
402
403
404
   level0_id            varchar(20) not null,
   obs_id               varchar(10) not null,
   detector_no          varchar(10) not null,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
405
406
407
408
409
410
411
412
413
414
415
416
417
   obs_type             varchar(16),
   obs_time             datetime,
   exp_time             float,
   detector_status_id   int(20),
   filename             varchar(128),
   file_path            varchar(256),
   qc0_status           tinyint(1),
   qc0_time             datetime,
   prc_status           tinyint(1),
   prc_time             datetime,
   create_time          datetime
);

Wei Shoulin's avatar
Wei Shoulin committed
418
create table sls_level0_header
Wei Shoulin's avatar
c3    
Wei Shoulin committed
419
420
421
422
423
424
425
426
427
428
(
   id                   int(20) not null,
   obs_time             datetime,
   exp_time             float,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);

Wei Shoulin's avatar
Wei Shoulin committed
429
create table sls_level0_prc
Wei Shoulin's avatar
c3    
Wei Shoulin committed
430
431
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
432
   level0_id            varchar(20) not null,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
433
434
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
Wei Shoulin's avatar
Wei Shoulin committed
435
   params_file_path     varchar(256),
Wei Shoulin's avatar
c3    
Wei Shoulin committed
436
437
   prc_status           int(2),
   prc_time             datetime,
Wei Shoulin's avatar
Wei Shoulin committed
438
   result_file_path            varchar(256)
Wei Shoulin's avatar
c3    
Wei Shoulin committed
439
);
Wei Shoulin's avatar
Wei Shoulin committed
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
create table sls_cal2level0
(
   merge_id             int(20) not null,
   level0_id            varchar(20) not null,
   primary key (merge_id, level0_id)
);

create table sls_cal_header
(
   id                   int(20) not null,
   obs_time             datetime,
   exp_time             float,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);

create table sls_cal_merge
(
   id                   integer PRIMARY KEY autoincrement,
   cal_id               varchar(20) not null,
   detector_no          varchar(10) not null,
   ref_type             varchar(16),
   obs_time             datetime,
   exp_time             float,
   filename             varchar(128),
   file_path            varchar(256),
   qc1_status           tinyint(1),
   qc1_time             datetime,
   prc_status           tinyint(1),
   prc_time             datetime,
   create_time          datetime
);

create table sls_level1_data
(
   id                   integer PRIMARY KEY autoincrement,
   level0_id            varchar(20) not null,
   data_type            varchar(64) not null,
   prc_params           varchar(1024),
   filename             varchar(128),
   file_path            varchar(256),
   prc_status           tinyint(1),
   prc_time             datetime,
   qc1_status           tinyint(1),
   qc1_time             datetime,
   create_time          datetime,
   pipeline_id          varchar(60)
);

create table sls_level1_ref (
  level1_id int(20) not null,
  ref_type varchar(64) not null,
  cal_id int(20) not null,
  primary key (level1_id, ref_type)
);

create table sls_level1_header
(
   id                   int(20) not null,
   obs_time             datetime,
   exp_time             float,
   ra                   float,
   "dec"                float,
   create_time          datetime,
   primary key (id)
);

create table sls_level1_prc
Wei Shoulin's avatar
Wei Shoulin committed
510
511
512
513
514
515
516
517
(
   id                   integer PRIMARY KEY autoincrement,
   level1_id            int(20) not null,
   pipeline_id          varchar(64) not null,
   prc_module           varchar(32) not null,
   params_file_path     varchar(256),
   prc_status           int(2),
   prc_time             datetime,
Wei Shoulin's avatar
Wei Shoulin committed
518
   result_file_path     varchar(256)
Wei Shoulin's avatar
Wei Shoulin committed
519
);
Wei Shoulin's avatar
Wei Shoulin committed
520
521

create table sls_level2_spectra
Wei Shoulin's avatar
c3    
Wei Shoulin committed
522
523
(
   id                   integer PRIMARY KEY autoincrement,
Wei Shoulin's avatar
Wei Shoulin committed
524
525
526
527
528
529
530
531
532
533
534
   spectra_id           varchar(40),
   level1_id            int(20) not null,
   region               varchar(128),
   filename             varchar(128),
   file_path            varchar(256),
   prc_status           tinyint(1),
   prc_time             datetime,
   qc1_status           tinyint(1),
   qc1_time             datetime,
   create_time          datetime,
   pipeline_id          varchar(60)
Wei Shoulin's avatar
c3    
Wei Shoulin committed
535
);
Wei Shoulin's avatar
Wei Shoulin committed
536
create table sls_level2_spectra_header
Wei Shoulin's avatar
c3    
Wei Shoulin committed
537
(
Wei Shoulin's avatar
Wei Shoulin committed
538
   id                   int(20) not null,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
539
540
   obs_time             datetime,
   exp_time             float,
Wei Shoulin's avatar
Wei Shoulin committed
541
542
   ra                   float,
   "dec"                float,
Wei Shoulin's avatar
c3    
Wei Shoulin committed
543
   create_time          datetime,
Wei Shoulin's avatar
Wei Shoulin committed
544
   primary key (id)
Wei Shoulin's avatar
c3    
Wei Shoulin committed
545
);
Wei Shoulin's avatar
Wei Shoulin committed
546
-- csst.msc_level2_catalog definition
Wei Shoulin's avatar
c3    
Wei Shoulin committed
547

Wei Shoulin's avatar
Wei Shoulin committed
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
CREATE TABLE msc_level2_catalog (
  source_id integer PRIMARY KEY autoincrement,
  obs_id varchar(12),
  detector_no char(2),
  seq int(20),
  flux_aper_1 double,
  flux_aper_2 double,
  flux_aper_3 double,
  flux_aper_4 double,
  flux_aper_5 double,
  flux_aper_6 double,
  flux_aper_7 double,
  flux_aper_8 double,
  flux_aper_9 double,
  flux_aper_10 double,
  flux_aper_11 double,
  flux_aper_12 double,
  fluxerr_aper_1 double,
  fluxerr_aper_2 double,
  fluxerr_aper_3 double,
  fluxerr_aper_4 double,
  fluxerr_aper_5 double,
  fluxerr_aper_6 double,
  fluxerr_aper_7 double,
  fluxerr_aper_8 double,
  fluxerr_aper_9 double,
  fluxerr_aper_10 double,
  fluxerr_aper_11 double,
  fluxerr_aper_12 double,
  mag_aper_1 double,
  mag_aper_2 double,
  mag_aper_3 double,
  mag_aper_4 double,
  mag_aper_5 double,
  mag_aper_6 double,
  mag_aper_7 double,
  mag_aper_8 double,
  mag_aper_9 double,
  mag_aper_10 double,
  mag_aper_11 double,
  mag_aper_12 double,
  magerr_aper_1 double,
  magerr_aper_2 double,
  magerr_aper_3 double,
  magerr_aper_4 double,
  magerr_aper_5 double,
  magerr_aper_6 double,
  magerr_aper_7 double,
  magerr_aper_8 double,
  magerr_aper_9 double,
  magerr_aper_10 double,
  magerr_aper_11 double,
  magerr_aper_12 double,
  flux_auto double,
  fluxerr_auto double,
  mag_auto double,
  magerr_auto double,
  kron_radius double,
  background double,
  x_image double,
  y_image double,
  alpha_j2000 double,
  delta_j2000 double,
  a_image double,
  b_image double,
  theta_image double,
  a_world double,
  b_world double,
  theta_world double,
  theta_j2000 double,
  errx2_image double,
  erry2_image double,
  erra_image double,
  errb_image double,
  errtheta_image double,
  erra_world double,
  errb_world double,
  errtheta_world double,
  errtheta_j2000 double,
  xwin_image double,
  ywin_image double,
  alphawin_j2000 double,
  deltawin_j2000 double,
  errx2win_image double,
  erry2win_image double,
  flags int(20),
  flags_weight int(20),
  imaflags_iso double,
  nimaflags_iso double,
  fwhm_image double,
  fwhm_world double,
  elongation double,
  ellipticity double,
  class_star double,
  flux_radius double,
  fwhmpsf_image double,
  fwhmpsf_world double,
  xpsf_image double,
  ypsf_image double,
  alphapsf_j2000 double,
  deltapsf_j2000 double,
  flux_psf double,
  fluxerr_psf double,
  mag_psf double,
  magerr_psf double,
  niter_psf int(20),
  chi2_psf double,
  errx2psf_image double,
  erry2psf_image double,
  chi2_model double,
  flags_model tinyint(1),
  niter_model int(20),
  flux_model double,
  fluxerr_model double,
  mag_model double,
  magerr_model double,
  flux_hybrid double,
  fluxerr_hybrid double,
  mag_hybrid double,
  magerr_hybrid double,
  flux_max_model double,
  mu_max_model double,
  flux_eff_model double,
  mu_eff_model double,
  flux_mean_model double,
  mu_mean_model double,
  xmodel_image double,
  ymodel_image double,
  alphamodel_j2000 double,
  deltamodel_j2000 double,
  erry2model_image double,
  erramodel_image double,
  errbmodel_image double,
  errthetamodel_image double,
  erramodel_world double,
  errbmodel_world double,
  errthetamodel_world double,
  errthetamodel_j2000 double,
  amodel_image double,
  bmodel_image double,
  thetamodel_image double,
  amodel_world double,
  bmodel_world double,
  thetamodel_world double,
  thetamodel_j2000 double,
  spread_model double,
  spreaderr_model double,
  noisearea_model double,
  flux_spheroid double,
  fluxerr_spheroid double,
  mag_spheroid double,
  magerr_spheroid double,
  flux_max_spheroid double,
  mu_max_spheroid double,
  flux_eff_spheroid double,
  mu_eff_spheroid double,
  flux_mean_spheroid double,
  mu_mean_spheroid double,
  fluxratio_spheroid double,
  fluxratioerr_spheroid double,
  spheroid_reff_image double,
  spheroid_refferr_image double,
  spheroid_reff_world double,
  spheroid_refferr_world double,
  spheroid_aspect_image double,
  spheroid_aspecterr_image double,
  spheroid_aspect_world double,
  spheroid_aspecterr_world double,
  spheroid_theta_image double,
  spheroid_thetaerr_image double,
  spheroid_theta_world double,
  spheroid_thetaerr_world double,
  spheroid_theta_j2000 double,
  spheroid_sersicn double,
  spheroid_sersicnerr double,
  flux_disk double,
  fluxerr_disk double,
  mag_disk double,
  magerr_disk double,
  flux_max_disk double,
  mu_max_disk double,
  flux_eff_disk double,
  mu_eff_disk double,
  flux_mean_disk double,
  mu_mean_disk double,
  fluxratio_disk double,
  fluxratioerr_disk double,
  disk_scale_image double,
  disk_scaleerr_image double,
  disk_scale_world double,
  disk_scaleerr_world double,
  disk_aspect_image double,
  disk_aspecterr_image double,
  disk_aspect_world double,
  disk_aspecterr_world double,
  disk_inclination double,
  disk_inclinationerr double,
  disk_theta_image double,
  disk_thetaerr_image double,
  disk_theta_world double,
  disk_thetaerr_world double,
  disk_theta_j2000 double,
  obs_time datetime
) ;