-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_array.py
32 lines (24 loc) · 864 Bytes
/
main_array.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
import iso_code
import pandas as pd
import os.path
import sys
import time
def main():
#name of the open cluster
name = "Praesepe"
#input photometry data
data_input = pd.read_csv("iso_input/Praesepe_sample.csv", dtype={'dr2_source_id': int, 'dr3_source_id': int})
#specify the number of processes to run Isochrones in parallel, change it based on your need
nprocess=20
#clean up records folder before each new run
filelist = [f for f in os.listdir("records") if f.endswith(".csv")]
for f in filelist:
os.remove(os.path.join("records", f))
#read the index of current thread
ind = int(sys.argv[1])
base = "chain{}".format(ind)
#run isochrones
iso_code.iso_process(nprocess,data_input,ind,name,base)
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
main()