-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput_lib.py
More file actions
executable file
·148 lines (143 loc) · 5.53 KB
/
Copy pathinput_lib.py
File metadata and controls
executable file
·148 lines (143 loc) · 5.53 KB
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
52
53
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#!/usr/bin/python
'''
Abstract:
This is a program for reading and loading input files.
Usage:
input_lib.py
Editor:
Jacob975
20181204
####################################
update log
20181204 version alpha 1
1. The code works.
'''
import numpy as np
import time
class option_plotLC():
def __init__(self):
self.opts = None
def create(self):
s = [ '# Where to get data',
'# 1: from given filename, and the name become the filename.',
'# 2: from database, and the name become the target name',
'2',
'# Catalog name',
'# The name of source or the name of files',
'',
'# Common name',
'# The common name of the source',
'',
'# Ingress timing in JD',
'# "skip" means it would not print the ingress timing on plots.',
'skip',
'# Egress timing in JD',
'# "skip" means it would not print the ingress timing on plots.',
'skip',
'# Start date in YYYYMMDD',
'# The first date of the plot showing. Input image folder date minus one.',
'# "skip" will make the program shows all light curves.',
'skip',
'# End date in YYYYMMDD',
'# The last date of the plot showing.',
'# "skip" will make the program shows all light curves.',
'skip',
'# Band',
'# Available options: N, C, A, V, B, R',
'V',
'# Exptime',
'# The exposure time of selected images',
'150',
'# Path of photometry option file',
'# e.g. /home2/TAT/programs/TTV/photometry/',
'',
'# Name of photometry option file',
'option_phot_'
]
np.savetxt('option_plotLC.txt', s, fmt = '%s')
def load(self, file_name):
self.opts = np.loadtxt(file_name, dtype = str)
self.opts = list(self.opts)
return self.opts
class option_plot_auxLC():
def __init__(self):
self.opts = None
def create(self):
s = [ '# Where to get data',
'# 1: from given filename, and the name become the filename.',
'# 2: from database, and the name become the target name',
'2',
'# name',
'# The name of auxiliary star or the name of files',
'',
'# Start date in YYYYMMDD',
'# The first date of the plot showing.',
'# "skip" will make the program shows all light curves. Input image folder date-1.',
'skip',
'# End date in YYYYMMDD',
'# The last date of the plot showing.',
'# "skip" will make the program shows all light curves.',
'skip',
'# Band',
'# Available options: N, C, A, V, B, R',
'V',
'# Exptime',
'# The exposure time of selected images',
'150'
]
np.savetxt('option_plot_auxLC.txt', s, fmt = '%s')
def load(self, file_name):
self.opts = np.loadtxt(file_name, dtype = str)
self.opts = list(self.opts)
return self.opts
class option_photometry():
def __init__(self):
self.opts = None
def create(self):
s = [ '# What kinds of photometry calibration you want',
'# Available options: EP, CATA.',
'# EP: Ensemble Photometry',
'# CATA: Calibrate the magnitude with I/329 catalog',
'EP',
'# The date of starting observation',
'# example: 20181208',
'',
'# The date of end observation',
'# Input image folder date minus one.'
'# example: 20181209',
'',
'# RA centroid (deg)',
'# What is the right ascention of the center of FOV.',
'# example: 239.00',
'',
'# DEC centroid (deg)',
'# What is the declination of the center of FOV.',
'# example: 15.00',
'',
'# Band',
'# Available options: N, C, A, V, B, R',
'# You could type "skip" to ignore this selection.',
'V',
'# Exptime',
'# The exposure time of selected images',
'# You could type "skip" to ignore this selection.',
'150',
'# ID of beginning auxiliary star',
'# From which auxiliary star you want to start with while doing photometry.',
'# example: 10',
'',
'# Number of auxiliary stars',
'# How many stars do you want to use for photometry.',
'# example: 20',
'20',
'# The target name of variables',
'# The program will ignore these stars since their luminosity might changed.',
'# example: target_322.3157_50.8781',
'# You could type "skip" to ignore this selection',
'skip'
]
np.savetxt('option_phot.txt', s, fmt = '%s')
def load(self, file_name):
self.opts = np.loadtxt(file_name, dtype = str)
self.opts = list(self.opts)
return self.opts