Skip to content

Commit

Permalink
Fix resolution of images to compensate for changed pynbody default
Browse files Browse the repository at this point in the history
  • Loading branch information
apontzen committed May 6, 2024
1 parent ebff150 commit 7e798b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tangos/properties/pynbody/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def calculate(self, particle_data, properties):

def _render_projected(self, f, size):
import pynbody.plot
im = pynbody.plot.sph.image(f, 'rho', size, units="Msol kpc^-2", noplot=True, restrict_depth=True)
im = pynbody.plot.sph.image(f, 'rho', size, units="Msol kpc^-2", noplot=True, restrict_depth=True,
resolution=500)
return im

def _render_gas(self, f, size):
Expand All @@ -45,6 +46,7 @@ def _render_stars(self, f, size):
import pynbody.plot
if len(f.st)>0:
return pynbody.plot.stars.render(f.st[pynbody.filt.HighPass('tform',0) & pynbody.filt.BandPass('z', -size / 2, size / 2)],
width=size, noplot=True, return_image=True, mag_range=(16,22))
width=size, noplot=True, return_image=True, mag_range=(16,22),
resolution=500)
else:
return None
1 change: 1 addition & 0 deletions tangos/scripts/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ def diff(options):
differ = db_diff.TangosDbDiff(options.uri1, options.uri2, ignore_keys=options.ignore_value_of)
if options.property_tolerance is not None:
for k, rtol, atol in options.property_tolerance:
if k == '.': k = None
differ.set_tolerance(k, float(rtol), float(atol))

if options.simulation:
Expand Down

0 comments on commit 7e798b6

Please sign in to comment.