<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Yuan,<div class=""><br class=""></div><div class="">Just to check, have you included the “ValidateSpatial" object when adding the field? See the definition of DivV field: <a href="http://yt-project.org/docs/2.6/analyzing/creating_derived_fields.html#some-more-complicated-examples" class="">http://yt-project.org/docs/2.6/analyzing/creating_derived_fields.html#some-more-complicated-examples</a></div><div class=""><br class=""></div><div class=""><div apple-content-edited="true" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Best wishes,</div><div class="">--</div><div class="">Suoqing JI</div><div class="">Ph.D Candidate</div><div class="">Department of Physics</div><div class="">University of California, Santa Barbara</div><div class=""><a href="http://web.physics.ucsb.edu/~suoqing" class="">http://web.physics.ucsb.edu/~suoqing</a></div></div></div></div></div></div></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Jul 19, 2015, at 2:52 PM, Yuan Li <<a href="mailto:yuan@astro.columbia.edu" class="">yuan@astro.columbia.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Dear all,<div class=""><br class=""></div><div class=""><span style="font-size:13px" class="">I am using yt2.6. I was trying to define a field of the temperature gradient like gradPressureX, but I got an error message:</span><br style="font-size:13px" class=""><span style="font-size:13px" class="">...</span><br style="font-size:13px" class=""><span style="font-size:13px" class="">new_field[1:-1,1:-1,1:-1]  = data["Temperature"][sl_right,</span><span style="font-size:13px" class="">1:-1,1:-1]/ds</span><br style="font-size:13px" class=""><span style="font-size:13px" class="">ValueError: could not broadcast input array from shape (62,62,64) into shape (62,62,62)</span><br style="font-size:13px" class=""><br style="font-size:13px" class=""><span style="font-size:13px" class="">I then tried to re-define gradPressureX by copying the original definition (</span><a href="http://yt-project.org/docs/2.6/reference/field_list.html#gradpressurex" target="_blank" class="">http://yt-project.org/docs/2.6/reference/field_list.html#gradpressurex</a>) <span style="font-size:13px" class="">and giving it a different name, and I got the same error. The original gradPressureX works fine.</span><span style="font-size:13px" class=""> </span></div><div class=""><br style="font-size:13px" class=""><span style="font-size:13px" class="">Is it because I did not load some specific module or something?</span><div style="font-size:13px" class=""><br class=""></div><div style="font-size:13px" class=""><br class=""></div><div style="font-size:13px" class="">Thank you!</div></div><div style="font-size:13px" class="">Yuan</div></div>
_______________________________________________<br class="">yt-users mailing list<br class=""><a href="mailto:yt-users@lists.spacepope.org" class="">yt-users@lists.spacepope.org</a><br class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br class=""></div></blockquote></div><br class=""></div></body></html>