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

error when outputing convariace_topo.cov #31

Open
johnkiama opened this issue May 1, 2024 · 2 comments
Open

error when outputing convariace_topo.cov #31

johnkiama opened this issue May 1, 2024 · 2 comments

Comments

@johnkiama
Copy link

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'

@oaazeved
Copy link
Contributor

oaazeved commented May 2, 2024

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!

@kujaku11
Copy link
Contributor

kujaku11 commented May 3, 2024

@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
)

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

3 participants