Quickstart

Reading Data

If you want to read a simulation snapshot into memory with GadJet.jl, it’s as easy as this:

    data = read_snap(filename)

This will return a dictionary with the header information in data["Header"] and the blocks sorted by particle type.

As an example, this is how you would access the positions of the gas particles:

    data["Parttype0"]["POS"]

If you only want to read a specific block for a single particle type, e.g. positions of gas particles you can use the function with a specified blockname and particle type like so:

    pos = read_snap(filename, "POS", 0)

This will return an array of the datatype of your simulation, usually Float32.

Quick Visualisation

For a quick glimpse at your data you can use the glimpse function (yes, I thought hard about this one…)

    image = glimpse(filename)

This will return a 500x500 pixel image of the whole box, centered on the center of mass.

If you want to look at a specific range you can provide an array with the center coordinates as center_pos = [x, y, z] and the extent in x, y and z direction with dx, dy, dz.

    image = glimpse(filename, center_pos, dx, dy, dz)