gempy
gempy copied to clipboard
Question about save solution to netCDF
What is your question? I want to save solution to netCDF for farther analysis in ArcGIS Pro. I found the solution_to_netcdf function in io.py and tried to use it after I installed subsurface.
import gempy as gp
load_model_path = '/Users/jinxuanchen/Documents/AGS_Project/modelsave/testsave'
loaded_model = gp.load_model(name='testsave', path=load_model_path)
gp.set_interpolator(loaded_model)
model_solutions = gp.compute_model(loaded_model, compute_mesh=True, to_subsurface=True)
from gempy.api_modules.io import solution_to_netcdf
saveparameter = {}
solution_to_netcdf(saveparameter,loaded_model,'test1','/Users/jinxuanchen/Documents/AGS_Project/modelsave/test')
I successfully export netCDF, but when I add it into ArcGIS Pro, a warning appeared and cannot be loaded.

I also tried to load the file in xarray, the result is as follows
So I'm not sure whether netCDF is exporting correctly, or if ArcGIS Pro has a problem supporting data in netCDF format.
From looking at the xarray, it seems allright. Does ArcGIS not load at all? Possibly, you can ignore the warnings? X Y Z seem to be populated and are not empty. You could check in the xarray, whether X Y Z have also NaN values there?
From looking at the xarray, it seems allright. Does ArcGIS not load at all? Possibly, you can ignore the warnings? X Y Z seem to be populated and are not empty. You could check in the xarray, whether X Y Z have also NaN values there?
I tried to adjust the parameters in the subsurface so that the _FillValue value is -9999 instead of NaN. Although the attribute '_FillValue' is NaN error is no longer reported, a new error has appeared. It seems that ArcGIS only supports {X,Y,Z ,T} or {T,Z,Y,X} order netCDF files, when using the solution_to_netcdf function, is there a parameter to adjust the order?
What is T in your order? The parameter value at positions xyz?
There is not a parameter for that in the gempy method. In the end, we use the xarray method to_netcdf
, so it might work best to adjust an order with xarray if possible.
@ooooohhhhhxxx is there still a problem here?
Closing due to inactivity, feel free to reopen if the issue still persists.