error when outputing convariace_topo.cov
Thanks for the good work you are doing. I keep getting below error when outputting convariace_topo.cov in jupyter.
TypeError Traceback (most recent call last) Cell In[40], line 2 1 topo_covariance = Covariance(grid_dimensions=model_mesh.res_model.shape) ----> 2 topo_covariance.write_covariance_file( 3 Path().cwd().joinpath("modeling","musgraves_covariance_topo.cov"), 4 model_fn=model_mesh.model_fn, 5 )
TypeError: write_covariance_file() got an unexpected keyword argument 'model_fn'
Hi there!
model_fn isn't one of the input parameters to the Covariance.write_covariance_file() method; the inputs and their defaults are as follows:
cov_fn=None,
save_path=None,
fn_basename=None,
res_model=None,
sea_water=0.3,
air=1e12
If you're trying to define the covariance values based on a previously generated model mesh, you'll want to pass that model mesh object into the write method using res_model=model_mesh.res_model!
@oaazeved rad thanks for helping. @johnkiama like @oaazeved said modem_fn is no longer an input, use res_model from mtpy.modeling.StructuredGrid3D.
from mtpy.modeling import StructuredGrid3D
from mtpy.modeling.modem import Covariance
model = StructuredGrid3D()
model.from_modem(filename)
cov = Covariance()
cov.write_covariance_file(
cov_fn=covariance_file,
res_model=model.res_model
)