123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- def setup_folders(num_vincs=6, num_sites=6):
- """
- DESCRIPTION:
- Sets up directory structure for storing plotfiles.
-
-
- CALLING SEQUENCE:
- setup_folders(num_vincs=6, num_sites=6)
-
- KEYWORDS:
- ## num_vincs: number of velocity increments (default 6; +0-5 km/s)
- ## num_sites: number of specific collision sites (default 6)
-
-
- Directory Structure:
- Plots
- - all_ejecta
- - vincs_separate
- - 0vinc
- - all_planets
- - per_planet
- - cols_v_time
- - cols_v_time_fits
- - inc_v_a
- - e_v_a
- - 1vinc
- - 2vinc
- ...
- ...
- - vincs_compared
- - histograms
- - cols_v_time
- - inc_v_a
- - e_v_a
-
- - specific_collision_sites
- - site1
- - vincs_separate
- - 0vinc
- - all_planets
- - per_planet
- - cols_v_time
- - cols_v_time_fits
- - inc_v_a
- - e_v_a
- - 1vinc
- - 2vinc
- ...
- ...
- - vincs_compared
- - histograms
- - cols_v_time
- - inc_v_a
- - e_v_a
- - site2
- ...
- ...
-
- - single_ejecta
- - 0vinc
- - 1vinc
- ...
- ...
-
- """
-
- object_names = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
-
- parent = os.getcwd()
- plotspath = parent + "/Plots"
- all_ejecta_path = plotspath + "/all_ejecta"
- specific_sites_path = plotspath + "/specific_collision_sites"
- single_ejecta_path = plotspath + "/single_ejecta"
-
- #create Plots directory
- Path(plotspath).mkdir(parents=True, exist_ok=True)
-
-
-
- #create all_ejecta folder
- Path(all_ejecta_path).mkdir(parents=True, exist_ok=True)
-
- #populate all_ejecta_folder:
-
- ###1. vincs_separate folder
- Path(all_ejecta_path + "/vincs_separate").mkdir(parents=True, exist_ok=True)
- for i in range(num_vincs):
-
- #make vincs_separate
- vinc_folder = all_ejecta_path + "/vincs_separate/" + str(i) + "vinc"
- Path(vinc_folder).mkdir(parents=True, exist_ok=True)
-
- #make all_planets
- Path(vinc_folder + "/all_planets").mkdir(parents=True, exist_ok=True)
- Path(vinc_folder + "/all_planets/inc_v_a_snapshots").mkdir(parents=True, exist_ok=True)
- Path(vinc_folder + "/all_planets/e_v_a_snapshots").mkdir(parents=True, exist_ok=True)
-
- #make and populate per_planet
- per_p_folder = vinc_folder + "/per_planet"
- Path(per_p_folder).mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/cols_v_time").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/cols_v_time_fits").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/inc_v_a").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/e_v_a").mkdir(parents=True, exist_ok=True)
- for o in object_names[1:]:
- Path(per_p_folder + "/inc_v_a/" + o + "_inc_v_a_snapshots").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/e_v_a/" + o + "_e_v_a_snapshots").mkdir(parents=True, exist_ok=True)
-
- Path(per_p_folder + "/inc_v_a/remaining_inc_v_a_snapshots").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/e_v_a/remaining_e_v_a_snapshots").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/inc_v_a/esc_inc_v_a_snapshots").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/e_v_a/esc_e_v_a_snapshots").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/inc_v_a/mixed_inc_v_a_snapshots").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/e_v_a/mixed_e_v_a_snapshots").mkdir(parents=True, exist_ok=True)
-
-
- ###2. vincs_compared folder
- Path(all_ejecta_path + "/vincs_compared").mkdir(parents=True, exist_ok=True)
- Path(all_ejecta_path + "/vincs_compared/histograms").mkdir(parents=True, exist_ok=True)
- Path(all_ejecta_path + "/vincs_compared/cols_v_time").mkdir(parents=True, exist_ok=True)
- Path(all_ejecta_path + "/vincs_compared/inc_v_a").mkdir(parents=True, exist_ok=True)
- Path(all_ejecta_path + "/vincs_compared/e_v_a").mkdir(parents=True, exist_ok=True)
-
-
-
- #create specific_collision_sites folder
- Path(specific_sites_path).mkdir(parents=True, exist_ok=True)
-
- #populate specific_collision_sites folder
- for j in range(num_sites):
-
- #folder for each site
- site_path = specific_sites_path + "/site" + str(j)
- Path(site_path).mkdir(parents=True, exist_ok=True)
-
- #1. vincs_separate folder
- for i in range(num_vincs):
-
- #make vincs_separate
- vinc_folder = site_path + "/vincs_separate/" + str(i) + "vinc"
- Path(vinc_folder).mkdir(parents=True, exist_ok=True)
- #make all_planets
- Path(vinc_folder + "/all_planets").mkdir(parents=True, exist_ok=True)
- Path(vinc_folder + "/all_planets/inc_v_a_snapshots").mkdir(parents=True, exist_ok=True)
- Path(vinc_folder + "/all_planets/e_v_a_snapshots").mkdir(parents=True, exist_ok=True)
-
- #make and populate per_planet
- per_p_folder = vinc_folder + "/per_planet"
- Path(per_p_folder).mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/cols_v_time").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/cols_v_time_fits").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/inc_v_a").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/e_v_a").mkdir(parents=True, exist_ok=True)
- for o in object_names[1:]:
- Path(per_p_folder + "/inc_v_a/" + o + "_inc_v_a_snapshots").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/e_v_a/" + o + "_e_v_a_snapshots").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/inc_v_a/remaining_inc_v_a_snapshots").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/e_v_a/remaining_e_v_a_snapshots").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/inc_v_a/esc_inc_v_a_snapshots").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/e_v_a/esc_e_v_a_snapshots").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/inc_v_a/mixed_inc_v_a_snapshots").mkdir(parents=True, exist_ok=True)
- Path(per_p_folder + "/e_v_a/mixed_e_v_a_snapshots").mkdir(parents=True, exist_ok=True)
-
- ###2. vincs_compared folder
- Path(site_path + "/vincs_compared").mkdir(parents=True, exist_ok=True)
- Path(site_path + "/vincs_compared/histograms").mkdir(parents=True, exist_ok=True)
- Path(site_path + "/vincs_compared/cols_v_time").mkdir(parents=True, exist_ok=True)
- Path(site_path + "/vincs_compared/inc_v_a").mkdir(parents=True, exist_ok=True)
- Path(site_path + "/vincs_compared/e_v_a").mkdir(parents=True, exist_ok=True)
-
-
- #create single_ejecta_path folder
- Path(single_ejecta_path).mkdir(parents=True, exist_ok=True)
- #populate
- for i in range(num_vincs):
- Path(single_ejecta_path + '/' + str(i) + 'vinc').mkdir(parents=True, exist_ok=True)
-
-
|