Skip to content

Plotting script suggestions #3

Description

@aussing

Hi Michael, I'm running through the plotting scripts with a non millennium simulation, I have some notes on where things break or where edits could be made to improve usability

allresults-local.py

Nothing breaks when I just run it after changing DirName and Snapshot, so no major changes required here. However, I think you could change the # Simulation details runtime options to be dynamically read from either the model_0.hdf5 file or the input.par file. The script will run even if these params don't match the simulation, so reading them out of the output rather than hard coding them might help stop errors from creating plots for different simulations. (See below for suggestions on reading variables rather than hard coding)

allresults-history.py

Things break here, mostly due to hard coded redshift/snapshot values - these should definitely be changed to something dynamically assigned, here is my recommendation for getting the variables:

Under Simulation Details
VolumeFraction = 1.0
sage_data = h5.File(DirName+FileName,'r')
Hubble_h = sage_data['Header/Simulation'].attrs['hubble_h']
BoxSize = sage_data['Header/Simulation'].attrs['box_size']
redshifts = np.array(sage_data['Header/snapshot_redshifts'])
FirstSnap = 0
LastSnap = len(redshifts)-1

Under Plotting Details
high_redshift = 10
end_redshift = 0
num_SMFs = 5
SMFsnaps = np.linspace(np.abs(redshifts-high_redshift).argmin(), np.abs(redshifts-end_redshift).argmin(), num_SMFs, dtype=int)

This should fix the issues of hardcoded values in both local and history scripts, at least it does in the current version, although I still get the following error:
Warning: Could not load ./data/fig4_bhmf_z0.1.txt: ./data/fig4_bhmf_z0.1.txt not found.,
Seems like there's a data file that's missing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions