configs = [
    # (time_integrated, "fixed_weights", "fixed_box", "Time-Integrated (n_s > 0)"),
    (time_integrated_negative_n_s, "fixed_weights", "fixed_box_negative", "Time-Integrated"),
    (time_integrated, "flare", "flare", "Cluster Search")
]

cluster = True

job_ids = []

for j, cat in enumerate(individual_tdes[-1:]):

    name = name_root + cat.replace(" ", "") + "/"

    cat_path = individual_tde_cat(cat)
    catalogue = load_catalogue(cat_path)

    t_start = catalogue["start_time_mjd"]
    t_end = catalogue["end_time_mjd"]

    max_window = float(t_end - t_start)

    src_res = dict()

    lengths = np.logspace(-2, 0, 2) * max_window

    # Loop over likelihood methods

    for (llh_dict, mh_name, f_name, label) in configs:
t_start = ref_time - 30.
t_end = ref_time + 100.

# Ra and dec of source, from TNS (https://wis-tns.weizmann.ac.il/object/2018cow)
ra = 244.000927647
dec = 22.2680094118

# Distance to source,from http://www.astronomerstelegram.org/?read=11727
z = 0.014145
lumdist = Distance(z=z).to("Mpc").value

# Creates the .npy source catalogue
at2018cow_catalogue = custom_sources(name="AT2018cow",
                                     ra=ra,
                                     dec=dec,
                                     weight=1.,
                                     distance=lumdist,
                                     start_time=t_start,
                                     end_time=t_end,
                                     ref_time=t_start)

at2018cow_cat_path = individual_tde_cat("AT2018cow")

try:
    os.makedirs(os.path.dirname(at2018cow_cat_path))
except OSError:
    pass

np.save(at2018cow_cat_path, at2018cow_catalogue)