Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TotalAccretedMasses L1000N1800 HYDRO_JETS_published units issue #191

Open
Em-Costello opened this issue Jun 26, 2024 · 2 comments
Open

TotalAccretedMasses L1000N1800 HYDRO_JETS_published units issue #191

Em-Costello opened this issue Jun 26, 2024 · 2 comments
Assignees

Comments

@Em-Costello
Copy link

I'm currently looking at the ratio between the total_subgrid vs total_accreted BH masses from the snapshots. I'm reading these quantities using swiftsimio in the following way:

import pandas as pd
import numpy as np
from swiftsimio import load as load_snap

sim = 'HYDRO_FIDUCIAL' #sim = 'HYDRO_JETS_published' 
snap = 77 #77 or 78 for high res fiducial
run = 'L1000N1800'

#Snapshots data
run_directory = f'/cosma8/data/dp004/flamingo/Runs/{run}/{sim}/' #simulation directory
snapshot_name = f'snapshots/flamingo_00{snap}/flamingo_0077.hdf5' #snapshot file

snap = load_snap(run_directory + '/' + snapshot_name)

# #Reading in BH particle data
print('Reading BH data...')
data = load_snap(run_directory + '/' + snapshot_name)

df_BH = pd.DataFrame()    
df_BH['BH_subgrid_mass'] = data.black_holes.subgrid_masses.to('Msun').value 
print(data.black_holes.total_accreted_masses.units)
df_BH['BH_accretion_mass'] = data.black_holes.total_accreted_masses.to('Msun').value
df_BH['BH_accretion_rate'] = data.black_holes.accretion_rates.to('Msun/Gyr').value
df_BH['BH_particle_ID'] = data.black_holes.particle_ids.value

print(df_BH)

For the int res fiducial model, this is working fine. But for the int res jets model, swiftsimio seems to think the TotalAccretedMass quantity is given in Msun/Gyr and so I can't read it in. The units listed in the actual snapshots are correct, so I'm not sure what's going on. Could you look into this please?

The actual error it gives me is this:
UnitConversionError: Cannot convert between '10227144.8879616*Msun/Gyr' (dim '(mass)/(time)') and 'Msun' (dim '(mass)').

@MatthieuSchaller
Copy link
Member

@robjmcgibbon any thoughts on this? (I ping you as you are looking at units for SOAP too....)

@robjmcgibbon
Copy link
Collaborator

Thanks for catching this Emily. The problem is due to incorrect metadata stored in the swift snapshot, rather than a problem with swiftsimio. We can got through the snapshots and correct the metadata. I'll leave this issue open until we've done that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants