Re: [yt-users] Problem in simple volume rendering (yt-users Digest, Vol 36, Issue 18)

Dear Matt, Thank you very much for your quick reply. 1. The balck_center I found is back_center = [-0.28306926 -0.1132277 -0.39629696] 2. The physical size I used is from -8.2605e11 cm to 8.2605e11 cm (same for x,y,z directions) The domain is correctly printing when running my yt script yt INFO 2011-02-24 13:08:20,186 Parameters: domain_left_edge = [ -8.26050000e+11 -8.26050000e+11 -8.26050000e+11] yt INFO 2011-02-24 13:08:20,186 Parameters: domain_right_edge = [ 8.26050000e+11 8.26050000e+11 8.26050000e+11] 3. I set the width = 1 as used in the example code. (all value are the same as the example code, except center, c=[0.,0.,0.] and the datafile is the Flash output file) Thank you very much for your kindly assistance. Best, Kuo-Chuan I have got some warning from yt, but I think that may not relate to my problem. The whole output are listed as bellow: [kpan2@taranaki yt-scripts]$ ./ShowPlots.py yt WARNING 2011-02-24 13:21:00,791 Setting 1.0 in code units to be 1.0 cm yt WARNING 2011-02-24 13:21:00,793 No time units. Setting 1.0 = 1 second. yt INFO 2011-02-24 13:21:00,794 Parameters: current_time = 5635.73778789 yt ERROR 2011-02-24 13:21:00,794 Missing domain_dimensions in parameter file definition! yt INFO 2011-02-24 13:21:00,794 Parameters: domain_left_edge = [ -8.26050000e+11 -8.26050000e+11 -8.26050000e+11] yt INFO 2011-02-24 13:21:00,794 Parameters: domain_right_edge = [ 8.26050000e+11 8.26050000e+11 8.26050000e+11] yt INFO 2011-02-24 13:21:00,795 Parameters: cosmological_simulation = 0.0 yt WARNING 2011-02-24 13:21:00,795 Setting 1.0 in code units to be 1.0 cm yt WARNING 2011-02-24 13:21:00,795 No time units. Setting 1.0 = 1 second. Warning: invalid value encountered in sqrt Warning: invalid value encountered in sqrt Adding gaussian at -5.8560788466 with width 0.02 and colors (0.2867691866508944, 0.015686274509803921, 0.031372549019607843, 0.01) Adding gaussian at -4.32198464433 with width 0.02 and colors (0.23702881439314105, 0.20784313725490194, 0.41568627450980389, 0.025118864315095794) Adding gaussian at -2.78789044206 with width 0.02 and colors (0.40392156862745099, 0.40392156862745099, 0.80784313725490198, 0.063095734448019331) Adding gaussian at -1.25379623979 with width 0.02 and colors (0.59607843137254901, 0.59607843137254901, 0.59115561118064242, 0.15848931924611143) Adding gaussian at 0.280297962486 with width 0.02 and colors (0.792156862745098, 0.792156862745098, 0.21568627450980413, 0.39810717055349731) Adding gaussian at 1.81439216476 with width 0.02 and colors (0.98431372549019602, 0.98431372549019602, 0.94080651128375881, 1.0) THIS MANY GRIDS! 0| | ETA: --:--:-- Partitioning 100% |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:00 KC>>> back_center = [ 0.21693074 0.3867723 0.10370304] KC>>> bricks = [] KC>>> LE = [] Traceback (most recent call last): File "./ShowPlots.py", line 161, in <module> test.plotVR() File "./ShowPlots.py", line 126, in plotVR vp.ray_cast() File "/home/kpan2/softwares/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/software_sampler.py", line 111, in ray_cast LE = na.array(LE) - self.back_center ValueError: shape mismatch: objects cannot be broadcast to a single shape Exception AttributeError: "'NoneType' object has no attribute 'chdir'" in <bound method ShowPlots.__del__ of <__main__.ShowPlots instance at 0x17bb3200>> ignored PS. (the lines with "KC>>>" are my debug outputs ) On Feb 24, 2011, at 1:11 PM, yt-users-request@lists.spacepope.org wrote:

Hi Kuo-Chuan,
3. I set the width = 1 as used in the example code.
I think this is your problem. Flash uses cgs units, and so you are trying to volume render a volume of width 1 cm. This is far tinier than a single cell, and so no data (NoneType) is returned to the render. Instead, try setting width = pf.domain_right_edge - pf.domain_left_edge, assuming your parameter file is called pf. This should set the width to be the whole domain. I hope this helps, Jeff

Hi Kuo-Chuan, You can also get the full domain by using the unit 'unitary' in the same way you would use other units. For example, 1.0/pf['unitary'] should get you the largest box side length, so it should be the whole domain. When I update the recipes and documentation next, I will be more clear that "1.0" refers to a particular method of describing the domain, and I will move it to using "unitary" everywhere instead of the implicit domain size. Let us know how it goes! Best, Matt On Thu, Feb 24, 2011 at 2:33 PM, j s oishi <jsoishi@gmail.com> wrote:

Dear Matt, Thank you so much for your help! Changing the width to pf.domain_right_edge -pf.domain_left_edge seems works now! but it is still calculating (> 2hrs). I thought width=1 refer to the whole domain. After the calculation finished, I will let you know whether it works or not. Thank you so much. Best, Kuo-Chuan On Feb 24, 2011, at 3:46 PM, Matthew Turk wrote:

Hi Kuo-Chuan, We have seen really long calculation times in the past. If you use the camera interface and specify: no_ghost=True when calling .camera( ... ) it should speed up the rendering time considerably. Try the camera interface, and give a shot at the no_ghost option, and see if that improves it? -Matt On Thu, Feb 24, 2011 at 5:05 PM, Kuo-Chuan Pan <kpan2@astro.illinois.edu> wrote:

Dear Matt, Thanks very much for your suggestion. Using the camera interface with no_ghost=True improve the calculation time to <5min for N=512! (9 level AMR with each block contains 8^3 zones) I found for my case, I followed the cooked http://yt.enzotools.org/doc/visualizing/volume_rendering.html#volume-renderi... there is a line: cam = vr.Camera(c, L, W, (N,N), tf) but I have to put pf in the Camera class, otherwise it will not work. cam = Camera(c, L, W, (N,N), tf, pf=pf, no_ghost=True) Not sure, that is a typo in the cookbook or not. Sincerely yours, Kuo-Chuan ================================== Kuo-Chuan Pan Graduate Student Department of Astronomy University of Illinois at Urbana-Champaign Email: astroodie[at]gmail.com kpan2[at]astro.uiuc.edu On Feb 24, 2011, at 4:10 PM, Matthew Turk wrote:

Hi Kuo-Chuan, Thanks for the note, and I'm glad it is much faster now. Sam Skillman, who implemented the no_ghost option (over my objection, which I freely confess was a mistake) has gone ahead and turned it on by default, but added a warning about it. If you end up with artifacts, turning on no_ghost should fix them. I also think the performance hit is worse for FLASH than for Enzo, so we don't see it quite as often. I've fixed the documentation as well, but not rebuilt/reuploaded the new docs yet. -Matt On Thu, Feb 24, 2011 at 6:05 PM, Kuo-Chuan Pan <kpan2@astro.illinois.edu> wrote:

Dear Matt and Sam, Thanks very much for your useful suggestion. Somehow no_ghost =False will take a much longer time in my data, but the image with no_ghost=True looks fine so far. Thank you, Kuo-Chuan On Feb 24, 2011, at 6:10 PM, Sam Skillman wrote:

Hi Kuo-Chuan,
3. I set the width = 1 as used in the example code.
I think this is your problem. Flash uses cgs units, and so you are trying to volume render a volume of width 1 cm. This is far tinier than a single cell, and so no data (NoneType) is returned to the render. Instead, try setting width = pf.domain_right_edge - pf.domain_left_edge, assuming your parameter file is called pf. This should set the width to be the whole domain. I hope this helps, Jeff

Hi Kuo-Chuan, You can also get the full domain by using the unit 'unitary' in the same way you would use other units. For example, 1.0/pf['unitary'] should get you the largest box side length, so it should be the whole domain. When I update the recipes and documentation next, I will be more clear that "1.0" refers to a particular method of describing the domain, and I will move it to using "unitary" everywhere instead of the implicit domain size. Let us know how it goes! Best, Matt On Thu, Feb 24, 2011 at 2:33 PM, j s oishi <jsoishi@gmail.com> wrote:

Dear Matt, Thank you so much for your help! Changing the width to pf.domain_right_edge -pf.domain_left_edge seems works now! but it is still calculating (> 2hrs). I thought width=1 refer to the whole domain. After the calculation finished, I will let you know whether it works or not. Thank you so much. Best, Kuo-Chuan On Feb 24, 2011, at 3:46 PM, Matthew Turk wrote:

Hi Kuo-Chuan, We have seen really long calculation times in the past. If you use the camera interface and specify: no_ghost=True when calling .camera( ... ) it should speed up the rendering time considerably. Try the camera interface, and give a shot at the no_ghost option, and see if that improves it? -Matt On Thu, Feb 24, 2011 at 5:05 PM, Kuo-Chuan Pan <kpan2@astro.illinois.edu> wrote:

Dear Matt, Thanks very much for your suggestion. Using the camera interface with no_ghost=True improve the calculation time to <5min for N=512! (9 level AMR with each block contains 8^3 zones) I found for my case, I followed the cooked http://yt.enzotools.org/doc/visualizing/volume_rendering.html#volume-renderi... there is a line: cam = vr.Camera(c, L, W, (N,N), tf) but I have to put pf in the Camera class, otherwise it will not work. cam = Camera(c, L, W, (N,N), tf, pf=pf, no_ghost=True) Not sure, that is a typo in the cookbook or not. Sincerely yours, Kuo-Chuan ================================== Kuo-Chuan Pan Graduate Student Department of Astronomy University of Illinois at Urbana-Champaign Email: astroodie[at]gmail.com kpan2[at]astro.uiuc.edu On Feb 24, 2011, at 4:10 PM, Matthew Turk wrote:

Hi Kuo-Chuan, Thanks for the note, and I'm glad it is much faster now. Sam Skillman, who implemented the no_ghost option (over my objection, which I freely confess was a mistake) has gone ahead and turned it on by default, but added a warning about it. If you end up with artifacts, turning on no_ghost should fix them. I also think the performance hit is worse for FLASH than for Enzo, so we don't see it quite as often. I've fixed the documentation as well, but not rebuilt/reuploaded the new docs yet. -Matt On Thu, Feb 24, 2011 at 6:05 PM, Kuo-Chuan Pan <kpan2@astro.illinois.edu> wrote:

Hi Kuo-Chuan, Matt, If you end up with artifacts, turning on no_ghost should fix them. Rather, setting no_ghost=False should fix the artifacts. As Matt said, it is now True by default. Sam

Dear Matt and Sam, Thanks very much for your useful suggestion. Somehow no_ghost =False will take a much longer time in my data, but the image with no_ghost=True looks fine so far. Thank you, Kuo-Chuan On Feb 24, 2011, at 6:10 PM, Sam Skillman wrote:
participants (5)
-
j s oishi
-
John ZuHone
-
Kuo-Chuan Pan
-
Matthew Turk
-
Sam Skillman