def make_cluster_mags(self,masses): db = sqlite3.connect(self.dbname) sc = sqlite_util.SqliteConnection(self.dbname) stmt = "SELECT m_ini,johnson_i_abs,Te,log_g FROM star_info WHERE star_info.age = %f AND star_info.Z = %f" % (self.age,self.metallicity) arr = sc.execute(stmt, asarray=True) star_masses = arr['m_ini'] star_i = arr['johnson_i_abs'] star_t = arr['te'] star_g = arr['log_g'] countrates = np.interp(masses, star_masses, star_i) temps = np.interp(masses, star_masses, star_t) gravs = np.interp(masses, star_masses, star_g) return countrates, temps, gravs
def get_star_info(self): stmt = "SELECT m_ini,Te,log_g,johnson_i_abs FROM star_info WHERE star_info.age = %f AND star_info.Z = %f" % ( self.age, self.metallicity) sc = sqlite_util.SqliteConnection(self.dbname) arr = sc.execute(stmt, asarray=True) return arr['m_ini'], arr['te'], arr['log_g'], arr['johnson_i_abs']