swiftgalaxy.demo_data module
Functions and definitions to retrieve, generate and use illustrative example data.
- class swiftgalaxy.demo_data.GeneratedExamples[source]
Bases:
objectHelper class to generate example data on demand.
An instantiated helper is available using
from swiftgalaxy.demo_data import generated_examples. The available examples are then:generated_examples.snapshot generated_examples.velociraptor generated_examples.caesar generated_examples.soap generated_examples.virtual_snapshot
Examples
For usage examples see Example data.
- class swiftgalaxy.demo_data.ToyHF(snapfile: str | Path = PosixPath('demo_data/toysnap.hdf5'), index: int | List[int] = 0, extra_mask: str | None = 'bound_only')[source]
Bases:
_HaloCatalogueMinimalist halo catalogue class for use with
SWIFTGalaxy.- Parameters:
snapfile (
strorPath, default:"demo_data/toysnap.hdf5") – The snapshot filename.index (
intorlist, default:0) – The index (position in the catalogue) of the target galaxy.extra_mask (
strorMaskCollection(optional), default:"bound_only") – The “extra” mask to apply to data when it is read (extra in the sense of in addition to the spatial mask applied by theSWIFTGalaxy).
- property centre: cosmo_array
Get the coordinate centre of the target galaxy.
- Returns:
The coordinate centre of the target galaxy.
- Return type:
- property index: int | list[int] | None
Get the position in the catalogue of the target galaxy.
- Returns:
The position in the catalogue of the target galaxy.
- Return type:
int
- property velocity_centre: cosmo_array
Get the velocity centre of the target galaxy.
- Returns:
The velocity centre of the target galaxy.
- Return type:
- class swiftgalaxy.demo_data.WebExamples[source]
Bases:
objectFetch example data from the web storage on demand.
An instantiated helper is available using
from swiftgalaxy.demo_data import web_examples. The available examples are then:web_examples.snapshot web_examples.velociraptor web_examples.caesar web_examples.soap web_examples.virtual_snapshot
Examples
For usage examples see Example data.