Usage

A PHRINGE script starts with an instance of the PHRINGE class. Upon its initialization, the user has to specify the observation, instrument and astrophysical scene parameters. This can be done in two ways, as described below.

2. Manually Creating Objects (Advanced)

Manually create the Observation, Instrument and Scene objects. This might be required for more advanced use cases such as looping through a parameter space. The following example shows how to calculate the detector counts using this approach:

# Create a PHRINGE object
phringe = PHRINGE()

# Create objects manually
obs = Observation(...) # Arguments omitted here for brevity
phringe.set(obs) # This will overwrite the the observation if defined in the config file

inst = Instrument(...) # Arguments omitted here for brevity
phringe.set(inst) # This will overwrite the instrument if defined in the config file

scene = Scene(...) # Arguments omitted here for brevity
phringe.set(scene) # This will overwrite the scene if defined in the config file

# Calculate counts
counts = phringe.get_counts()

Note

It is recommended to run PHRINGE on a GPU, as the simulation gets computationally expensive quickly and may take a substantial amount of time on CPUs.