sout.temperature_field[-1] = sout.temperature_field[-2] sout.density_field[-1] = sout.density_field[-2] sout.luminosity_field[-1] = sout.luminosity_field[-2] return sout settings = Settings() star_group = [] infile = open('unique_stars_final_model.txt', 'r') for row in infile: s = row.split(',') star = Star(settings, float(s[0]), float(s[1]), float(s[2]), float(s[3]), float(s[4]), float(s[5]), float(s[6])) star.filename = s[7].strip() star_group.append(star) star_group.sort() print(len(star_group)) print(star_group) metalicities = [(0.70, 0.25), (0.70, 0.26), (0.70, 0.28), (0.70, 0.29), (0.70, 0.30), (0.71, 0.25), (0.71, 0.26), (0.71, 0.28), (0.71, 0.29), (0.72, 0.25), (0.72, 0.26), (0.72, 0.28), (0.74, 0.25), (0.74, 0.26), (0.75, 0.25)] i = 0 for m in metalicities: plot_each_metallicity(m, star_group, ('coordinate_field', 'temperature_field'),
s += row nextrow = False # print(s) #s: M...N= 2.000, X= 0.670, Y= 0.130, Pc: 6.2312D+16, Tc: 1.8647D+07, R: 1.2960D+11, L: 2.7493D+34 mass = float(s[12:18]) X = float(s[23:28]) Y = float(s[33:38]) Pc = float(s[43:54].replace('D','e')) Tc = float(s[59:70].replace('D','e')) R = float(s[74:85].replace('D','e')) L = float(s[89:99].replace('D','e')) star = Star(settings, mass, X, Y, Pc, Tc, L, R) star.filename = f star_group.append(star) star_group.sort() uniq = [] for i in range(len(star_group)): not_seen = True for j in range(i): if j != i and star_group[i] == star_group[j]: not_seen = False if not_seen: uniq.append(star_group[i]) print(len(uniq))