VELA_dir = args['VELA_dir'] out_dir = args['out_dir'] remove_subhalos = args['remove_subhalos'] halo_mass = args['halo_mass'] #Check if the output directory exists and if it does not, create it. if not os.path.exists(out_dir): print('Creating output directory') os.makedirs(out_dir) VELA_snaps = glob.glob(VELA_dir + '/10MpcBox*') VELA_snaps.sort() print(VELA_snaps) consistent.consistent_catalog_reader(input_dir, remove_subhalos='True', halo_mass=10e9) completed = glob.glob('{}/improvedrvir*.ascii'.format(out_dir)) for snap in reversed(VELA_snaps): ds = yt.load(snap) current_scale = str(ds.scale_factor)[2:5] file_name = '{}/improvedrvir{}.ascii'.format(out_dir, current_scale) if file_name in completed: print('Already Analyzed Snap') continue print('Trying to find matching Consistent File for scale: {}'.format(
parser.add_argument('--subhalos', nargs='?', default=True) args = vars(parser.parse_args()) return args args = parse() print(args) input_dir = args['input_dir'] VELA_dir = args['VELA_dir'] subhalos = args['subhalos'] #Now run the rockstarcatalogreader to get the halo location data. #input_dir = '/Users/user1/Documents/VELA07/baserockstar_ascii/subhalos/' consistent.consistent_catalog_reader(input_dir, subhalos=subhalos) #Collect the names of the VELA simulations in the VELA_dir so that star data can be extracted. VELA_snaps = glob.glob(VELA_dir + '/10MpcBox*') VELA_snaps.sort() #Extract the scale factors from the VELA snapshot files to match to the rockstar catalogs. VELA_index = [] for snap in VELA_snaps: period = [pos for pos, char in enumerate(snap) if char == '.'] number = snap[period[-2] + 1:period[-1]] VELA_index.append(number) VELA_index.sort() #load the tomer catalogs tomer.read_tomer(VELA_number)
print('Generating Images') #Check if the output directory exists and if it does not, create it. if not os.path.exists(out_dir): print('Creating output directory') os.makedirs(out_dir) #if gen_xyz == True: # xyz_dir = '%s/centergraphs' % outdir # if not os.path.exists(xyz_dir): # print('Creating output directory for XYZ graphs') # os.makedirs(xyz_dir) #Now run the rockstarcatalogreader to get the halo location data. #input_dir = '/Users/user1/Documents/VELA07/baserockstar_ascii/subhalos/' consistent.consistent_catalog_reader(input_dir, subhalos=subhalos, halo_number=1) #Collect the names of the VELA simulations in the VELA_dir so that star data can be extracted. VELA_snaps = glob.glob(VELA_dir + '/10MpcBox*') VELA_snaps.sort() #Extract the scale factors from the VELA snapshot files to match to the rockstar catalogs. VELA_index = [] for snap in VELA_snaps: period = [pos for pos, char in enumerate(snap) if char == '.'] number = snap[period[-2] + 1:period[-1]] VELA_index.append(number) VELA_index.sort() #Loop over the rockstar catalogs for each snapshot.
VELA_dir = '/nobackupp2/sflarkin/GEN6/VELA' remove_subhalos = 'True' out_dir = '/nobackupp2/sflarkin/GEN6/highbaryon' halos_of_interest = [(500, '08', 758123.0)]#, (500, '08', 755273.0), (500, '08', 755429.0), (500, '08', 757482.0), (500, '08', 758089.0), (500, '08', 758039.0), (500, '08', 758194.0), (500, '08', 757452.0), (500, '08', 755133.0), (500, '08', 754857.0), (500, '08', 755204.0), (500, '10', 646850.0), (500, '10', 646757.0), (500, '10', 646891.0), (500, '10', 646952.0), (500, '10', 646730.0), (500, '11', 427964.0), (500, '11', 427983.0), (500, '14', 346146.0), (500, '14', 345761.0), (500, '14', 345762.0), (500, '15', 237964.0)] VELAS_of_interest = np.unique([x[1] for x in halos_of_interest]) for VELA_numbers in VELAS_of_interest: VELA_dir = '/nobackupp2/sflarkin/GEN6/VELA{}'.format(VELA_numbers) input_dir = '/nobackupp2/sflarkin/GEN6/rockstar001analysis/VELA{}/hlists'.format(VELA_numbers) print(VELA_dir) print(input_dir) print('') consistent.consistent_catalog_reader(input_dir, remove_subhalos=remove_subhalos) VELA_snaps = glob.glob(VELA_dir + '/10MpcBox*') #now find the scales of the halos of interest scales_of_interest = np.unique([x[0] for x in halos_of_interest]) #now find the consistent indices and VELA_index that match the scales of interest for scale in scales_of_interest: VELA_snap = glob.glob(VELA_dir + '/10MpcBox*{}*'.format(scale)) if VELA_snap == []: print('Could not find corresponding VELA 10Mpc File for snapshot {} in VELA {}'.format(scale, VELA_numbers)) else: #find the index of the consistent_catalog that matches the wanted timestep
parser.add_argument('VELA_dir') parser.add_argument('VELA_number') parser.add_argument('out_dir') args = vars(parser.parse_args()) return args args = parse() input_dir = args['input_dir'] VELA_dir = args['VELA_dir'] VELA_number = args['VELA_number'] out_dir = args['out_dir'] #load in the rockstar catatalog halo data consistent.consistent_catalog_reader(input_dir, halomass=1e+07) #find the VELA snapshots VELA_snaps = glob.glob(VELA_dir + '/10MpcBox_csf512_a0*') VELA_index = [] for snap in VELA_snaps: period = [pos for pos, char in enumerate(snap) if char == '.'] number = snap[period[-2] + 1:period[-1]] VELA_index.append(number) VELA_snaps.sort() VELA_index.sort() for index in consistent.snapshot_index: VELA_a = consistent.consistent_file_index[index] print('Generating Graph Grid for snapshot:', VELA_a) position = [pos for pos, loc in enumerate(VELA_index) if loc == VELA_a]
args = parse() input_dir = args['input_dir'] VELA_dir = args['VELA_dir'] VELA_number = args['VELA_number'] out_dir = args['out_dir'] remove_subhalos = args['remove_subhalos'] halo_mass = args['halo_mass'] #check to see if the out_dir is a valid location. if it is not, create it. if not os.path.exists(out_dir): print('Creating output directory') os.makedirs(out_dir) #load in the rockstar catatalog halo data consistent.consistent_catalog_reader(consistent_dir, remove_subhalos=remove_subhalos, halo_mass=halo_mass) #find the VELA snapshots VELA_snaps = glob.glob(VELA_dir + '/10MpcBox_csf512_a0*') VELA_index = [] for snap in VELA_snaps: period = [pos for pos, char in enumerate(snap) if char == '.'] number = snap[period[-2]+1:period[-1]] VELA_index.append(number) VELA_snaps.sort() VELA_index.sort() for index in consistent.snapshot_index: VELA_a = consistent.consistent_file_index[index] print('Generating Graph Grid for snapshot:', VELA_a) position = [pos for pos, loc in enumerate(VELA_index) if loc == VELA_a]