-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_2mass_XMM_LSS.py
More file actions
executable file
·59 lines (56 loc) · 1.72 KB
/
Copy pathget_2mass_XMM_LSS.py
File metadata and controls
executable file
·59 lines (56 loc) · 1.72 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
#!/usr/bin/python3
'''
Abstract:
This is a program for testing how csv works.
Usage:
test_2mass_table.py [XMM-LSS 2MASS table]
Output:
1. TBA
Editor:
Jacob975
##################################
# Python3 #
# This code is made in python3 #
##################################
20190729
####################################
update log
20190729 version alpha 1
1. The code works.
'''
import time
import numpy as np
from sys import argv
import convert_lib
#--------------------------------------------
# Main code
if __name__ == "__main__":
VERBOSE = 0
# Measure time
start_time = time.time()
#-----------------------------------
# Load argv
if len(argv) != 2:
print ("The number of arguments is wrong.")
print ("Usage: test_2mass_table.py [XMM-LSS 2MASS table]")
exit()
2mass_table_name = argv[1]
#-----------------------------------
# Print the test text
2mass_table = np.loadtxt( 2mass_table_name,
dtype = str,
delimiter = ',',)
# Take the AperMag3 as the magnitude.
distance = np.array(2mass_table[:, 1], dtype = float)
Jmag = np.array(2mass_table[:, [11,13]], dtype = float)
Hmag = np.array(2mass_table[:, [15,17]], dtype = float)
Kmag = np.array(2mass_table[:, [19,21]], dtype = float)
# Load 2MASS bands system
2mass_system = convert_lib.set_twomass()
# Convert from 2MASSmag to UKIDSSmag.
# Save the data
np.savetxt('2MASS_JHKflux.txt', output_table)
#-----------------------------------
# Measure time
elapsed_time = time.time() - start_time
print("Exiting Main Program, spending ", elapsed_time, "seconds.")