Page 1 of 1

how to use geopsy-hv command line tools

Posted: Mon Jul 25, 2022 1:15 pm
by marscfeng
Dear Marc,

I am trying to figure out if it’s possible to call geopsy-hv module in command line interface for some batch processing. But it turns out to be pretty challenging. I wonder if you can give me any hints. BTW, I am using geopsy-3.3 on MAC with intel core.

I found a code block from previous geopsy topic about geopsy-hv usage

```
(
cat <<END
FROM_TIME_TYPE=Absolute
TO_TIME_TYPE=Delta
TO_TIME_TEXT=1h
MINIMUM_FREQUENCY=1
MAXIMUM_FREQUENCY=20
WINDOW_LENGTH_TYPE=Exactly
WINDOW_MIN_LENGTH(s)=25
WINDOW_MAX_LENGTH(s)=25
WINDOW_MAX_COUNT=0
END
) > hv.param

FILE="STAT01.HH?.2022.034"
YEAR=${FILE:0-8:4}
DEBUT=$(echo ${FILE:0-3} | awk '{print ($1-1)*86400}' | gptime -i "seconds since ${YEAR}0101")
DEBUT_T=$(echo $DEBUT | gptime -i "yyyy-MM-dd hh:mm:ssz" -o time_t)

for START_T in $(echo $DEBUT_T | awk '{for(t=0; t<86400; t+=3600) print $1+t}'); do
START_TIME=$(echo $START_T | gptime -i time_t -o "yyyyMMddhhmmss")
echo $START_TIME
geopsy-hv ${FILE} -param hv.param -set FROM_TIME_TEXT=$START_TIME -o RESULTS_${STATION}
done
```
1. About import data format
Can you explain what’s the import data format for ‘geopsy-hv’ command? Is it still ASCII as GUI? When I try ‘geopsy-hv -h all’, I found it also need a ‘-db’ option, right? How should I generate a database without open GUI? what's the diffences between this database option and the input data file?

2. About parameter file
I also tried to generate a parameter example use "geopsy-hv -param-example" option, but the output example cannot be correctly loaded. For example, in order to process the example dataset ’Strong_peak’, I tried “geopsy-hv Strong_peak -param Strong_peak.log -o result.hv”. It generated an error:
“$geopsy-hv: error loading parameters from 'Strong_peak.log', see '-param-example’” I attached these files as below.
I also tried to make the parameter file as short as that on above code block, but no good happened.
So how should I generate a readable parameter file and prepare my command line to call geopsy-hv?

3. About “-load-windows” option
I guess this option can be used to some selective time windows HV estimation?

4. How to apply batch hv processing?
I think it should be able to use some for-loop to scan all stations and apply batch hv processing. 😂 But is there any higher order usage in geopsy-hv, for example, what's the ‘-group’ option, I don’t know what’s this option for.

Thanks in advance! And i appreciate anyone who would provide any comments.

Bests, -Feng

Re: how to use geopsy-hv command line tools

Posted: Mon Jul 25, 2022 2:00 pm
by admin
1. About import data format

You can provide a database file with option -db. This option must come also with -group to select which group inside the database to process.
Another technique is to provide signal files directly in the command line. This is expected to work correctly under 3.4. I'm unsure for 3.3.

2. About parameter file

I've just checked with 3.5, it works fine. It should be the same with 3.4. I suspect that in 3.3 this feature was not sufficiently polished.

3. About “-load-windows” option
Instead of generating the ensemble of windows from the input parameters, the list of time windows can be imported.

4. How to apply batch hv processing?

As mentioned above -group does not help for that purpose. Bash, Python or any scripting engine can help to process massive datasets.

Re: how to use geopsy-hv command line tools

Posted: Mon Jul 25, 2022 4:28 pm
by marscfeng
Many thanks for your reply. Two more questions.
1. It looks like 3.5 hasn't been released. I guess it will come out soon?
2. As for the database input, how can we generate the datebase without using geopsy interface?

-F

Re: how to use geopsy-hv command line tools

Posted: Tue Jul 26, 2022 6:55 am
by admin
I hope to release it next Fall.
A .gpy file is a tar.gz file which contains an XML file. You can unpack an existing .gpy file to get an example.