Пример #1
0
def load_light_select_dataset(input_path, file_name, is_mix=False):
    string_name = file_name.split('_')
    data_type = string_name[0]
    pattern = string_name[1]

    # path = 'C:\\git\\data_stream\\lightcurve_benchmark\\{}'.format(data_type)
    path = '{}{}'.format(input_path, data_type)
    if is_mix:
        data = data_stream(path=path,
                           type=data_type,
                           pattern=pattern,
                           mix_path=file_name[4:])
        data.load_mixdata_fromfile()
    else:
        L = int(string_name[2][1:])
        I = int(string_name[3][1:])
        data = data_stream(path=path,
                           type=data_type,
                           pattern=pattern,
                           len=L,
                           interval=I)
        data.load_data_fromfile()
    return data
Пример #2
0
def load_light_dataset(input_path, data_type):
    data_list = {}
    LS = [1, 5]
    IS = [5, 10, 30, 60]
    patterns = ["sq"]
    for pattern in patterns:
        for L in LS:
            for I in IS:
                title = "{}_{}_L{}_I{}".format(data_type, pattern, L, I)
                path = '{}{}'.format(input_path, data_type)
                # path = 'C:\\git\\data_stream\\lightcurve_benchmark\\{}'.format(data_type)
                data = data_stream(path=path,
                                   type=type,
                                   pattern=pattern,
                                   len=L,
                                   interval=I)
                data.load_data_fromfile()

                data_list[title] = data
    return data_list
Пример #3
0
LS = [5]
IS = [10, 30, 60]
# IS = [5]
process_var = 1
process_mean = 0
dic = {}
for type in types:
    for pattern in patterns:
        for L in LS:
            for I in IS:
                # data = data_stream(path='C:\\Users\\karnk\\git\\data_stream\\dataset', type=type, pattern=pattern, len=L,
                #                  interval=I)
                data = data_stream(
                    path=
                    'D:\\git_project\\data stream\\lightcurve_benchmark\\pca',
                    type=type,
                    pattern=pattern,
                    len=L,
                    interval=I)
                data.load_data_fromfile()
                key_dict = "{}_L{}_I_{}".format(pattern, L, I)
                dic[key_dict] = data
choice = ""

while choice != "exit":
    # try:
    pattern_in = input("Input pattern {} : ".format(patterns))
    # L_in = input("Input Len {} : ".format(LS))
    I_in = input("Input Interval {} : ".format(IS))
    input_format = "{}_L{}_I_{}".format(pattern_in, LS[0], I_in)
    element = dic.get(input_format)
Пример #4
0
    IS = [10, 30, 60]
    bin_periods = [4, 6]

    #  first loop
    for bin_period in bin_periods:
        for data_type in data_types:
            for type in types:
                for pattern in patterns:
                    for L in LS:
                        for I in IS:
                            transfounds = []
                            data = data_stream(
                                path=
                                'C:\\git\\data_stream\\lightcurve_benchmark\\{}'
                                .format(data_type),
                                type=type,
                                # path='D:\\git_project\\data stream\\lightcurve_benchmark\\{}'.format(data_type), type=type,
                                pattern=pattern,
                                len=L,
                                interval=I)
                            # path='C:\\lightcurve_benchmark\\lightcurve_benchmark\\{}'.format(data_type), type=type,
                            # pattern=pattern, len=L,
                            # interval=I)
                            data.load_data_fromfile()
                            for k in K_start:
                                data = cal_k_tran(data=data,
                                                  input_k=k,
                                                  input_bin=bin_period)
                                true_alerts, false_alerts, tran_found = data.count_TF_tranfound(
                                )
                                transfounds.append([k, tran_found])
Пример #5
0
    types = ["Ligthcurve"]
    # types = ["gaia"]
    patterns = ["sq"]
    L = 1
    IS = [5,10,30,60]
    bin_periods = [3,4,10,15,20,23,25,30]

    #  first loop
    for type in types:
        for data_type in data_types:
            for pattern in patterns:
                for I in IS:
                    # path = 'D:\\git_project\\data stream\\lightcurve_benchmark\\{}'.format(data_type)
                    path = 'C:\\git\\data_stream\\lightcurve_benchmark\\{}'.format(data_type)
                    # path = 'C:\\git\\data_stream\\gaia\\{}'.format(data_type)
                    data = data_stream(path=path, type=type,pattern=pattern, len=L,interval=I)
                    data.load_data_fromfile()
                    for bin_period in bin_periods:
                        file_format_name = '{}_{}_bin{}'.format(type, data_type, bin_period)
                        for k in ks:
                            data_sk, result_text = cal_sk_bin(data=data,
                                                              input_bin=bin_period,input_k=k,
                                                              file_format="{}_k{}".format(file_format_name,k), L=L, I=I)
                            print("{}_k{} cheb sk".format(file_format_name,k))
                            head, rows = data_sk.result_for_ROC(data_type, Algo='SK',K=k, Bin=bin_period, cheb_size=Cheb_win)
                            ut.list_to_csv(rows=rows, csv_name="ks_bin//roc_bin.csv", is_append=True)
                            head, rows = data_sk.result_for_ROC(data_type, Algo='SK', K=k,
                                                                Bin=bin_period,is_normalization=True,cheb_size=Cheb_win)
                            ut.list_to_csv(rows=rows, csv_name="ks_bin//roc_nor.csv", is_append=True)
                        #
                        #     # ut.list_to_txt(rows=result_text, csv_name="ks_bin//{}".format(txt_file_name),