Open manodeep opened 3 years ago
@manodeep Can you try using plotting/example.py
rather than galaxy_properties.py
? I think galaxy_properties.py
hasn't been updated to support the new sage-analysis
version.
Here's what I get - though looks like the images are generated
/home/msinha/research/codes/sage-home/sage-analysis/sage_analysis/example_plots.py:123: MatplotlibDeprecationWarning: The 'nonposy' parameter of __init__() has been renamed 'nonpositive' since Matplotlib 3.3; support for the old name will be dropped two minor releases later.
ax.set_yscale("log", nonposy="clip")
100%|████████████████████████████████████████████████████████████████████████████████████████████████| 619k/619k [00:07<00:00, 80.4kGals/s, file=Core_0]
Saved file to ./plots/1.StellarMassFunction.png
/home/msinha/research/codes/sage-home/sage-analysis/sage_analysis/example_plots.py:208: MatplotlibDeprecationWarning: The 'nonposy' parameter of __init__() has been renamed 'nonpositive' since Matplotlib 3.3; support for the old name will be dropped two minor releases later.
ax.set_yscale("log", nonposy="clip")
Saved file to ./plots/2.BaryonicMassFunction.png
/home/msinha/research/codes/sage-home/sage-analysis/sage_analysis/example_plots.py:292: MatplotlibDeprecationWarning: The 'nonposy' parameter of __init__() has been renamed 'nonpositive' since Matplotlib 3.3; support for the old name will be dropped two minor releases later.
ax.set_yscale("log", nonposy="clip")
Saved file to ./plots/3.GasMassFunction.png
Saved file to ./plots/4.BaryonicTullyFisher.png
Saved file to ./plots/5.SpecificStarFormationRate.png
Saved file to ./plots/6.GasFraction.png
Saved file to ./plots/7.Metallicity.png
Saved file to ./plots/8.BlackHoleBulgeRelationship.png
Saved file to ./plots/9.QuiescentFraction.png
Saved file to ./plots/10.BulgeMassFraction.png
Saved file to ./plots/11.BaryonFraction.png
Saved file to ./plots/12.MassReservoirs_Genesis_L52pt5_N1080_calibration_snapshot249.png
Saved file to ./plots/13.SpatialDistribution.png
/home/msinha/research/codes/sage-home/sage-analysis/sage_analysis/example_plots.py:1361: MatplotlibDeprecationWarning: The 'nonposy' parameter of __init__() has been renamed 'nonpositive' since Matplotlib 3.3; support for the old name will be dropped two minor releases later.
ax.set_yscale("log", nonposy="clip")
Traceback (most recent call last):
File "example.py", line 27, in <module>
galaxy_analysis.generate_plots()
File "/home/msinha/research/codes/sage-home/sage-analysis/sage_analysis/galaxy_analysis.py", line 926, in generate_plots
fig = func(
File "/home/msinha/research/codes/sage-home/sage-analysis/sage_analysis/example_plots.py", line 1368, in plot_SMF_history
plot_helper.adjust_legend(ax, location="lower left", scatter_plot=0)
NameError: name 'plot_helper' is not defined
Related, how do I change where the plots are saved to?
That is....very odd...I have no clue why that is not finding plot_helper
as they're all running through the same method...
To change the plotting path, you can use the PlotHelper
class.
from sage_analysis.plot_helper import PlotHelper
plot_helper = PlotHelper(output_path="/path/to/output/")
Then you call generate_plots
with the plot_helper
kwarg: generate_plots(plot_helper=plot_helper)
.
Can you try with the custom PlotHelper
instance and see if you get the same error above for the SMF History?
Hi @jacobseiler and @manodeep , "plotting/example.py" giving me this following error:
Traceback (most recent call last):
File "example.py", line 17, in
Suman Chatterjee NCRA-TIFR
@physicistsam Thanks for the report! Can you please list the keys in the main file (i.e., the hdf5 file without the "_0")?
After running
sage-home/sage-model
, I am trying to generate the plots and I encountered this error:My changes to plotting/galaxy_properties.py are:
@jacobseiler Do you happen to know what is going on?