-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathattachASCII.py
More file actions
44 lines (37 loc) · 1.34 KB
/
attachASCII.py
File metadata and controls
44 lines (37 loc) · 1.34 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
"""
attachASCII.py - description
---------------------------------------------------------------------------------
attach two ASCII files
---------------------------------------------------------------------------------
copyright : (C) 2016 Valentina Fioretti
email : fioretti@iasfbo.inaf.it
----------------------------------------------
Usage:
attachASCII.py <filename1> <filename1> <filename_out>
---------------------------------------------------------------------------------
Parameters:
- filename1: first file
- filename2: second file
- filename_out: second file
---------------------------------------------------------------------------------
Required data format: .dat
---------------------------------------------------------------------------------
Caveats:
None
---------------------------------------------------------------------------------
Modification history:
- 2016/04/04: Creation date
"""
from astropy.io import ascii
import sys
# Import the input parameters
arg_list = sys.argv
filename1 = arg_list[1]
filename2 = arg_list[2]
filename_out = arg_list[3]
data1 = ascii.read(filename1, format='no_header')
data2 = ascii.read(filename2, format='no_header')
len_data2 = len(data2)
for jrow in range(len_data2):
data1.add_row(data2[jrow])
ascii.write(data1, filename_out, format='no_header')