Skip to content
Snippets Groups Projects
Commit 4a87cd79 authored by Sylvia Plöckinger's avatar Sylvia Plöckinger
Browse files

Added data scripts

parent f287417b
Branches
No related tags found
No related merge requests found
import h5py
import sys
def ics_from_snapshot(inputfile, outputfile):
f_input = h5py.File(inputfile, 'r')
f_output = h5py.File(outputfile, 'w')
f_input.copy('Header', f_output)
f_input.copy('Units', f_output)
g_PT0 = f_output.create_group('PartType0')
g_PT4 = f_output.create_group('PartType4')
f_input.copy('PartType0/Coordinates', g_PT0)
f_input.copy('PartType0/InternalEnergies', g_PT0) # InternalEnergy
f_input.copy('PartType0/Masses', g_PT0)
f_input.copy('PartType0/ParticleIDs', g_PT0)
f_input.copy('PartType0/SmoothingLengths', g_PT0) # SmoothingLength
f_input.copy('PartType0/Velocities', g_PT0)
f_input.copy('PartType4/Coordinates', g_PT4)
f_input.copy('PartType4/Masses', g_PT4)
f_input.copy('PartType4/ParticleIDs', g_PT4)
f_input.copy('PartType4/BirthTimes', g_PT4) # StellarFormationTime
f_input.copy('PartType4/Velocities', g_PT4)
f_output['PartType4/StellarFormationTime'] = f_output['PartType4/BirthTimes']
del f_output['PartType4/BirthTimes']
f_output['PartType0/SmoothingLength'] = f_output['PartType0/SmoothingLengths']
del f_output['PartType0/SmoothingLengths']
f_output['PartType0/InternalEnergy'] = f_output['PartType0/InternalEnergies']
del f_output['PartType0/InternalEnergies']
grp = f_output.create_group('Info')
grp.attrs["Input file"] = inputfile
f_input.close()
f_output.close()
return
#!/bin/bash
# from Swift IsolatedGalaxy_feedback example
wget http://virgodb.cosma.dur.ac.uk/swift-webstorage/YieldTables/EAGLE/photometry.tar.gz
tar -xf photometry.tar.gz
#!/bin/bash
# from Swift IsolatedGalaxy_feedback example (see Nobels et al. arXiv:2309.13750 for details)
wget http://virgodb.cosma.dur.ac.uk/swift-webstorage/ICs/IsolatedGalaxies_COLIBRE/M5_disk.hdf5
wget http://virgodb.cosma.dur.ac.uk/swift-webstorage/ICs/IsolatedGalaxies_COLIBRE/M6_disk.hdf5
#!/bin/bash
# get cooling tables from Ploeckinger & Schaye (2020)
wget http://virgodb.cosma.dur.ac.uk/swift-webstorage/CoolingTables/COLIBRE/UV_dust1_CR1_G1_shield1.hdf5
#!/bin/bash
# from Swift IsolatedGalaxy_feedback example
wget http://virgodb.cosma.dur.ac.uk/swift-webstorage/YieldTables/EAGLE/yieldtables.tar.gz
tar -xf yieldtables.tar.gz
#!/bin/bash
./getICs.sh
./getEaglePhotometryTable.sh
./getYieldTable.sh
./getPS20CoolingTables.sh
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment