コード例 #1
0
  list1.append(i[0])
 return(list1)





## make and test connection to the database
features_file = "../db/derived_features_list.txt"
connection = sqlite3.connect('../db/hip_three_class.db')
cursor = connection.cursor()
create_database.create_db(cursor,features_file=features_file,REMOVE_RECORDS=True)
folder = "../data/debosscher"
connection.commit()
create_database.ingest_many_xml(folder,cursor,connection,
                                survey="hipparcos",
                                number_processors=2)

## make a nice view of the features table
sql_cmd = """CREATE VIEW IF NOT EXISTS features_short AS SELECT source_id,freq1_harmonics_freq_0,std,max,weighted_average FROM features"""
cursor.execute(sql_cmd)

## make a nice view of the features table
sql_cmd = """CREATE VIEW IF NOT EXISTS sources_short AS SELECT source_id,original_source_id,classification,noisification,noise_args,true_period FROM sources"""
cursor.execute(sql_cmd)





## make sure you are selecting the correct sources before deleting
コード例 #2
0
ファイル: interp_test.py プロジェクト: otsegun/lightcurves
## need to tell program ahead of time what features you are using
## so it can create correct columns in database
features_file = "../db/derived_features_list_new.txt"
os.system("rm ../db/debosscher_test.db")
connection = sqlite3.connect('../db/debosscher_test.db')
cursor = connection.cursor()
create_database.create_db(cursor,
                          features_file=features_file,
                          REMOVE_RECORDS=True)
connection.commit()

## now load in all of the light curves, this is a small test set
folder = "../data/debosscher_test"
create_database.ingest_many_xml(folder,
                                cursor,
                                connection,
                                survey="hipparcos",
                                number_processors=2)
connection.commit()

### just for viewing purposes, sometimes I run this line by line for debugging
## make a nice view of the features table
sql_cmd = """CREATE VIEW IF NOT EXISTS features_short AS SELECT source_id,freq1_harmonics_freq_0,std,max,weighted_average FROM features"""
cursor.execute(sql_cmd)

## make a nice view of the sources table
sql_cmd = """CREATE VIEW IF NOT EXISTS sources_short AS SELECT source_id,original_source_id,classification,noisification,noise_args,true_period FROM sources"""
cursor.execute(sql_cmd)

## CHECK
sql_cmd = """SELECT source_id,survey,number_points,classification,true_period FROM sources"""
コード例 #3
0
ファイル: interp_asas.py プロジェクト: otsegun/lightcurves


## make and test connection to the database
## need to tell program ahead of time what features you are using
## so it can create correct columns in database
features_file = "../db/derived_features_list_new.txt"
connection = sqlite3.connect('../db/asas.db')
cursor = connection.cursor()
create_database.create_db(cursor,features_file=features_file,REMOVE_RECORDS=True)
connection.commit()

## now load in all of the light curves, this is a small test set
folder = "../data/asas_ACVS_50k_new_aper_20120221"
create_database.ingest_many_xml(folder,cursor,connection,
                                survey="asas",
                                number_processors=2,
                                max_files=1000)
connection.commit()


rcorbor = [220040,240306,241463,242999,244506,244888,247066,247575,250762,251121,251489,251638,251987,254404,256072,256221,257713,263740]
rcorbor2 = []
for i in rcorbor:
    rcorbor2.append(folder + "/100" + repr(i) + ".xml")

rcorbor = rcorbor2


create_database.ingest_specific_xml(rcorbor,cursor,connection,
                                    survey="asas",
                                    number_processors=2)
コード例 #4
0

folder = "../data/ogle-rr-i"
create_database.ingest_many_tfes(folder,
                                 ".dat",
                                 cursor,
                                 connection,
                                 survey="ogle",
                                 classification="rr",
                                 max_lightcurves=500)
connection.commit()


folder = "../data/debosscher_binary"
create_database.ingest_many_xml(folder,cursor,connection,
                                survey="debosscher_binary",
                                number_processors=2)


connection.commit()


## make a nice view of the features table
sql_cmd = """CREATE VIEW IF NOT EXISTS features_short AS SELECT source_id,freq1_harmonics_freq_0,std,max,weighted_average FROM features"""
cursor.execute(sql_cmd)

## make a nice view of the features table
sql_cmd = """CREATE VIEW IF NOT EXISTS sources_short AS SELECT source_id,original_source_id,classification,noisification,noise_args,true_period FROM sources"""
cursor.execute(sql_cmd)