Hi guys,<br><br>one more thing. I want to calculate the radiation pressure force, and when there is some then plot it with a log scale. However if I set:<br><br>def _ConvertAccel(data):<br>    return data.convert("Length") / (data.convert("Time"))**2.0<br>
def _RadiationAccelerationMagnitude(field, data):<br>    return ( (data["RadAccel1"])**2.0 + \<br>             (data["RadAccel2"])**2.0 + \<br>             (data["RadAccel3"])**2.0 )**(1.0/2.0)<br>
add_field("RadiationAccelerationMagnitude", function=_RadiationAccelerationMagnitude, <b>take_log=True</b>,convert_function=_ConvertAccel, units=r"\rm{cm}/\rm{s}^{2}")<br>def _RadiationForceMagnitude(field, data):<br>
    return ( data["RadiationAccelerationMagnitude"] * data["Density"] * data["CellVolume"])<br>add_field("RadiationForceMagnitude", function=_RadiationForceMagnitude, <b>take_log=True</b>, units=r"\rm{dynes}")<br clear="all">
<br><br>before the stars switch on when the radiation acceleration baryon fields are all 0.0 everywhere I get the following error:<br><br><br>Traceback (most recent call last):<br>  File "MultiPlotProj.py", line 65, in <module><br>
    s = pc.add_projection("RadiationForceMagnitude", ax, weight_field="Density", figure=fig, axes=axes[0][3], use_colorbar=False)<br>  File "/home/h-clark/YT/src/yt-hg/yt/visualization/plot_collection.py", line 742, in add_projection<br>
    size=fig_size, periodic=periodic))<br>  File "/home/h-clark/YT/src/yt-hg/yt/visualization/plot_types.py", line 310, in __init__<br>    self.__init_temp_image(use_colorbar)<br>  File "/home/h-clark/YT/src/yt-hg/yt/visualization/plot_types.py", line 347, in __init_temp_image<br>
    self.set_width(1,'unitary')<br>  File "/home/h-clark/YT/src/yt-hg/yt/visualization/plot_types.py", line 436, in set_width<br>    self._refresh_display_width()<br>  File "/home/h-clark/YT/src/yt-hg/yt/visualization/plot_types.py", line 454, in _refresh_display_width<br>
    self._redraw_image()<br>  File "/home/h-clark/YT/src/yt-hg/yt/visualization/plot_types.py", line 384, in _redraw_image<br>    newmin = na.nanmin(buff[bI])<br>  File "/home/h-clark/YT/lib/python2.6/site-packages/numpy/lib/function_base.py", line 1494, in nanmin<br>
    return _nanop(np.min, np.inf, a, axis)<br>  File "/home/h-clark/YT/lib/python2.6/site-packages/numpy/lib/function_base.py", line 1355, in _nanop<br>    res = op(y, axis=axis)<br>  File "/home/h-clark/YT/lib/python2.6/site-packages/numpy/core/fromnumeric.py", line 1829, in amin<br>
    return amin(axis, out)<br>ValueError: zero-size array to ufunc.reduce without identity<br><br><br>Is there a way to set it so I get a log scale when plotting projections that does not break when the fields are all zero?<br>
<br>Many thanks,<br><br>Libby<br><br><br><br>-- <br>Elizabeth Harper-Clark MA MSci<br>PhD Candidate, Canadian Institute for Theoretical Astrophysics, UofT<br>Sciences and Engineering Coordinator, Teaching Assistants' Training Program, UofT<br>
<br><a href="http://www.astro.utoronto.ca/%7Eh-clark" target="_blank">www.astro.utoronto.ca/~h-clark</a><br><a href="mailto:h-clark@cita.utoronto.ca" target="_blank">h-clark@cita.utoronto.ca</a><br>Astronomy office phone: +1-416-978-5759<br>