Closed enrico-serpelloni closed 2 years ago
Hi @enrico-serpelloni thanks for the message. And good to meet you - your nice work on vertical deformation in the Alps was something I read closely in grad school when I was coming up with possible new projects in Northern California.
Ah yes, it looks like I hard-coded the VISR weighting threshold and potentially other parameters for the purposes of my first project. That's a good suggestion. Thankfully, it should be simple - the config reader function doesn't need any changes; we just need to add the desired parameters the local config file and then unpack/use them in strain_visr.py.
Depending on your excitement about forks/PRs, do you want to actually make the changes on your own fork of the repo? That way you can make sure that it has all the parameters you're looking for. I actually think it could be done with only changing the strain_visr.py file -- "method_specific_dict" in line 32 is a dictionary that will take anything you placed in the [visr] part of your config, and then you can unpack it from there. If you do, I would love if you could contribute the changes on your fork back through a Pull Request. (My workflow is usually like "create personal Github fork - clone personal fork - make changes - test - commit to personal fork - make Github Pull Request - delete personal fork", but my collaborator Jeremy uses other ways too.)
I'm also very happy to make the changes myself; it should be simple and you can just use the updated repo when those are done.
What would be easiest for you?
Thanks! Kathryn
Hello @kmaterna. It would better for me if you can apply the changes (I am a beginner with GitHub and python). I was running Tape, Shen and GMT models independently on my data, before finding your code. I have been able to run Strain_2D with the example dataset (except that I am having an error in using GPSGRIDDER) and now I am trying with the Euro-Med velocity data. Thanks, Enrico
@enrico-serpelloni okay sounds good! I'll do it soon and let you know here when it's done. It's a slight rush before AGU right now but I will get to it within a few days. Thanks for the information!
@enrico-serpelloni ok I'm adding the parameters "weighting_threshold" and "uncertainty_threshold" to the config file. I'm not actually sure what uncertainty threshold does but I see it in one of my text files. I'm hard-coding "function=3" because we're always doing strain in this library, and I'm hard-coding the creeping fault parameters (number of creep faults = 0) for the moment because I've never used them before. Pull or clone again, and let me know if that works for you!
Hello @kmaterna. Sorry for the late replay. Yes, it works. Just remember to add in the "example_strain_config.txt" file the two additional raws:
weighting_threshold = 2 uncertainty_threshold = 0.05
I've run it on my velocity data and got the same results I had the same results I got running visr independently.
Instead, I am having problems with the gpsgridder option. It successfully computes the strain, so I guess it is a matter of strain-invariants computation or plotting:
Writing 2d outputs:
writing human-readable velfile in station-vel format, Output/gpsgridder/tempgps.txt
Computing strain invariants for 2d dataset.
Traceback (most recent call last):
File "/Users/enrico/opt/miniconda3/envs/Strain_2D/bin/strain_rate_compute.py", line 4, in
@enrico-serpelloni thank you for letting me know! After some digging, turns out we ran into a deprecation introduced in the xarray library several months ago. I reproduced the problem and then fixed it. Amazingly it was just a two-line fix. And thank you for the reminder about the example file. It should be fixed now, I hope.
@kmaterna, thanks for this great project.
Actually only a few parameters of the VISR model cam be defined in the driver file:
distance_weighting = gaussian spatial_weighting = voronoi min_max_inc_smooth = 10/200/1
Another important one, the "weighting threshold", is only defined in strain_visr.py. Is it possible to have all parameters set in the configuration file?
Best, Enrico