Is there a way to convert a xarray to numpy array? #5784
-
|
Hi!I am generating a code to work seismic data and it happens that the segysak library only works with xarray and I need to pass it to numpy array. I have tried with commands like to_numpy or passing dask dataframe to bring it to numpy array and nothing! HELP!These were the lines of code I used, the xarray is seisnc_vol: print("Original cube dimension:", original_cube.shape) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
what type does Can you post the output of |
Beta Was this translation helpful? Give feedback.
what type does
seisnc_volhave? If it's aDataArrayobject, the conversion should be as simple as accessingseisnc_vol.valuesor callingnp.asarray(seisnc_vol)(since you already triednp.array(seisnc_vol)I'm guessing it's not). If it's aDatasetobject, there are a few more steps involved.Can you post the output of
print(seisnc_vol)? That might make it easier to help you.