Welcome to geomodelgrids Discussions! #130
Replies: 4 comments
-
Hi, I am working on a USGS project in developing shear wave velocity profile model. Thanks, |
Beta Was this translation helpful? Give feedback.
-
I am not sure how you are trying to use |
Beta Was this translation helpful? Give feedback.
-
Hi Brad,
Hope you are perfect.
I did all steps completely and the model works perfectly fine when I am using the terminal.
But my problem is that I need to run it for thousands of locations; thus, I tried to write a simple code in pyhon to automatically derive the information for the desired locations. This is my code attached:
import os
import pandas as pd
data=pd.read_excel("/home/hsalmanitehrani/Downloads/LatLon.xlsx", dtype='str')
data["Lat"] = data["Lat"].astype('float')
data["Lon"] = data["Lon"].astype('float')
fpath = "/home/hsalmanitehrani/geomodelgrids/geomodelgrids-1.0.0rc2-Linux_x86_64"
os.chdir(fpath)
os.system(". ./setup.sh")
fpath = "./src/tests/data"
os.chdir(fpath)
for i in range(len(data)):
a = os.system("geomodelgrids_borehole --models=USGS.h5 --location=%f,%f --max-depth=2000 --dz=1 --output=USGS/%s.out --values=Vs" %(data.Lat[i],data.Lon[i],str(data.Linux_name[i])))
if a!=0:
print(i,str(data.Linux_name[i]))
The problem is that when I run it, I get an error: "sh: 1: /geomodelgrids_borehole: not found", although in terminal, this line works well and I get response for a specific location.
Do you have any suggestions that help me solve this issue?
Thanks for your time and consideration.
Best,
Hesam
…________________________________
From: Brad Aagaard ***@***.***>
Sent: Saturday, April 22, 2023 1:47 PM
To: baagaard-usgs/geomodelgrids ***@***.***>
Cc: Hesam Salmani Tehrani ***@***.***>; Comment ***@***.***>
Subject: Re: [baagaard-usgs/geomodelgrids] Welcome to geomodelgrids Discussions! (Discussion #130)
I am not sure how you are trying to usegeomodelgrids_borehole with Spyder. geomodelgrids_borehole is a command line program that is normally run in a terminal or shell. If you downloaded the binary and unpacked the binary distribution, then you should be able to run the program in a terminal window. Make sure you run source setup.sh in the top-level directory as indicated in the instructions https://geomodelgrids.readthedocs.io/en/latest/getting-started/install.html#installing-the-binary-package before attempting to run the program.
—
Reply to this email directly, view it on GitHub<#130 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A3DANE5BHE2IVQGJHERX4V3XCQ7WZANCNFSM6AAAAAASV4GZBU>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
You need to setup the shell environment spawned by Python the same way that you do when you run I suggest using |
Beta Was this translation helpful? Give feedback.
-
👋 Welcome!
We’re using Discussions as a place to connect with other members of our community. We hope that you:
build together 💪.
To get started, comment below with an introduction of yourself and tell us about what you do with this community.
Beta Was this translation helpful? Give feedback.
All reactions