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

No standard progenitor distance for files saved by IO module #45

Closed
rcross2 opened this issue May 18, 2020 · 1 comment · Fixed by #52
Closed

No standard progenitor distance for files saved by IO module #45

rcross2 opened this issue May 18, 2020 · 1 comment · Fixed by #52
Assignees
Labels
enhancement New feature or request

Comments

@rcross2
Copy link
Contributor

rcross2 commented May 18, 2020

Current operations to save a processed simulation is:

E_per_V_1kpc =  E_per_V * ccsn.progenitor_distance.to(u.kpc).value**2
io.save(conf, Interactions, Hierarchy, Flavor, Enu.value, time.value, \
                                    E_per_V_1kpc, force=True)

IO module should do the conversion to 1kpc so that data files are at a standard distance.

@sybenzvi sybenzvi added the enhancement New feature or request label May 20, 2020
@sgriswol
Copy link
Collaborator

sgriswol commented Jul 1, 2020

As of #52 this can now be handled by the SimulationHandler class.
Example:

from asteria.handler import SimulationHandler

conf = config.load_config('path-to-asteria/data/config/default.yaml')
sim = SimulationHandler(conf)
sim.load()
sim.E_per_V 

This assumes a simulation has already been saved.
sim.save() will scale the energy deposition per volume to a progenitor at 1kpc, and then save the result to file.
sim.load() will load the scaled energy deposition per volume and re-scale it to the distance specified by the source.progenitor.distance.distance node of the conf object.

@sgriswol sgriswol linked a pull request Jul 1, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants