Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel dies during retrieving #29

Open
fujiisoup opened this issue Jun 29, 2020 · 1 comment
Open

Kernel dies during retrieving #29

fujiisoup opened this issue Jun 29, 2020 · 1 comment

Comments

@fujiisoup
Copy link

Hi.
Thank you for developing and maintaining this repo.
I've started using this but found that some examples are outdated and I couldn't find a proper usage.
With the script (see the bottom), I got a kernel shutdown.
When I run the script in Ipython, I got the following stack trace,

0: SOAP 1.2 fault: SOAP-ENV:Receiver [no subcode]
"System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Exception: JHTDB started using 1-based indexing from Sept 16. Please update your JHTDB library if you have not done so.
   at TurbulenceService.TurbulenceService.GetAnyCutoutWeb(String authToken, String dataset, String field, Int32 T, Int32 x_start, Int32 y_start, Int32 z_start, Int32 x_end, Int32 y_end, Int32 z_end, Int32 x_step, Int32 y_step, Int32 z_step, Int32 filter_width, String addr) in H:\Repos\Turbulence\Turbulence\WebSite\App_Code\WebService.cs:line 4860
   --- End of inner exception stack trace ---"
Detail: [no detail]

The script I use is as follows,

import numpy as np
from pyJHTDB import libJHTDB
from pyJHTDB.dbinfo import interpolation_code

auth_token  = "edu.jhu.pha.turbulence.testing-201311"  #Replace with your own token here
xstart, ystart, zstart = 1, 1, 1
xend, yend, zend = 8, 8, 8
xstep, ystep, zstep = 1, 1, 1
Filter_Width = 1
time_step = 1
field = 'u'
data_set = "isotropic1024coarse"

VarName="Velocity"
dim = 3
    
idx_x=np.arange(xstart, xend + 1, xstep)
idx_y=np.arange(ystart, yend + 1, ystep)
idx_z=np.arange(zstart, zend + 1, zstep)
nnx=np.size(idx_x)
nny=np.size(idx_y)
nnz=np.size(idx_z)

npoints=nnx*nny*nnz
split_no=int(np.ceil(npoints/(192000000/dim)))
result=np.zeros((nnz,nny,nnx,dim),dtype='float32')
tmp=np.array_split(np.arange(npoints).reshape(nnx,nny,nnz), split_no)

print(result.shape)

lJHTDB = libJHTDB()
lJHTDB.initialize()
lJHTDB.add_token(auth_token)

for t in range(split_no):
    xyzs0 = np.unravel_index(tmp[t][0,0,0], (nnx,nny,nnz))
    xyze0 = np.unravel_index(tmp[t][-1,-1,-1], (nnx,nny,nnz))
    xyzs1 = (idx_x[xyzs0[0]], idx_y[xyzs0[1]], idx_z[xyzs0[2]])
    xyze1 = (idx_x[xyze0[0]], idx_y[xyze0[1]], idx_z[xyze0[2]])
    
    temp = lJHTDB.getCutout(
        data_set=data_set, field=field,
        start=np.array([xyzs1[0], xyzs1[1], xyzs1[2]], dtype = np.int),
        # size=np.array([xyze1[0]-xyzs1[0]+1, xyze1[1]-xyzs1[1]+1, xyze1[2]-xyzs1[2]+1], dtype = np.int),
        step=np.array([xstep, ystep, zstep], dtype = np.int),
        filter_width=Filter_Width)
    
    result[xyzs0[2]:xyze0[2]+1, xyzs0[1]:xyze0[1]+1, xyzs0[0]:xyze0[0]+1,:] = temp
    
lJHTDB.finalize()
print(result.shape)

This is borrowed from DEMO_getCutout.ipynb, but some particular arguments, time and size are removed as it says they are (no longer) supported.

It would be appreciated if you could point me the proper usage.
Thank you in advance:)

@fujiisoup
Copy link
Author

Note: I ran this script both in sciserver and my local, but I got the same result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant