Need Help Accessing 'SubfindHsml' in TNG50 Snapshot Data

Christos Karoumpis
  • 1
  • 19 May '23

Hello!

I've been working with the TNG50 snapshot data and came across an issue which I'm hoping to find some assistance with.

Here's the script I've been running to access the data:

def get(path, params=None):
    # make HTTP GET request to path
    r = requests.get(path, params=params, headers=headers)

    # raise exception if response code is not HTTP SUCCESS (200)
    r.raise_for_status()

    if r.headers['content-type'] == 'application/json':
        return r.json() # parse json responses automatically

    if 'content-disposition' in r.headers:
        filename = r.headers['content-disposition'].split("filename=")[1]
        with open(filename, 'wb') as f:
            f.write(r.content)
        return filename # return the filename string

    return r


cutouturl= 'http://www.tng-project.org/api/TNG50-1/snapshots/14/halos/0/cutout.hdf5'

cutout=get(cutouturl)
with h5py.File(cutout,'r') as f:
    print(f['PartType0']['Coordinates'])

When running this script for keywords like "Coordinates" or "Masses," it functions properly and returns data in this format: "<HDF5 dataset "Coordinates": shape (775716, 3), type "<f8">".

However, when I replace 'Coordinates' with 'SubfindHsml' in the last print statement like this:

print(f['PartType0']['SubfindHsml'])

I receive a KeyError stating, "Unable to open object (object 'SubfindHsml' doesn't exist)".

I need to access the 'SubfindHsml' information for my project. Could anyone advise me on where to locate this data? Any guidance would be greatly appreciated.

Thank you in advance!

Dylan Nelson
  • 20 May '23

This field is not available in mini snapshots.

(You can compute the same information from the particle data if necessary)

  • Page 1 of 1