<div dir="ltr"><div><div>Hi Daegene,<br><br></div>You need to import add_quantity from the halo analysis API:</div><div><br></div><div>    from yt.analysis_modules.halo_<wbr>analysis.api import add_quantity</div><div><br></div><div>Hope that helps,</div><div><br></div><div>Nathan<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 16, 2017 at 2:55 PM, Daegene Koh <span dir="ltr"><<a href="mailto:dkoh30@gatech.edu" target="_blank">dkoh30@gatech.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">Hi all,<div><br></div><div>I’m trying to add a new quantity to a halo catalog following the docs as such, </div><div><br></div><div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(51,187,200);background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures;color:#afad24"> 23 </span><span style="font-variant-ligatures:no-common-ligatures;color:#5230e1"><b>def</b></span><span style="font-variant-ligatures:no-common-ligatures;color:#000000"> </span><span style="font-variant-ligatures:no-common-ligatures">_total_mass</span><span style="font-variant-ligatures:no-common-ligatures;color:#000000">(halo):</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures;color:#afad24"> 24 </span><span style="font-variant-ligatures:no-common-ligatures">    gasmass, dmmass =  <a href="http://halo.data_object.quantities.to">halo.data_object.quantities.to</a><wbr>tal_mass()</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures;color:#afad24"> 25 </span><span style="font-variant-ligatures:no-common-ligatures">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#5230e1"><b>return</b></span><span style="font-variant-ligatures:no-common-ligatures"> gasmass+dmmass</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures;color:#afad24"> 26 </span><span style="font-variant-ligatures:no-common-ligatures">    </span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures;color:#afad24"> 27 </span><span style="font-variant-ligatures:no-common-ligatures">add_quantity(</span><span style="font-variant-ligatures:no-common-ligatures;color:#34bc26">'total_mass'</span><span style="font-variant-ligatures:no-common-ligatures">,_tot<wbr>al_mass)</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures;color:#afad24"> 28 </span><span style="font-variant-ligatures:no-common-ligatures">hc.add_quantity(</span><span style="font-variant-ligatures:no-common-ligatures;color:#34bc26">'total_mass’</span><span style="font-variant-ligatures:no-common-ligatures">)</span></div></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-family:Helvetica;font-size:12px">however, it seems at add_quantity is not defined. How do I go about doing this?</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-family:Helvetica;font-size:12px"><br></span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-family:Helvetica;font-size:12px">Cheers,</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-family:Helvetica;font-size:12px">DK</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-family:Helvetica;font-size:12px"><br></span></div></div><br>______________________________<wbr>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/lis<wbr>tinfo.cgi/yt-users-spacepope.<wbr>org</a><br>
<br></blockquote></div><br></div></div>