how to use geopsy-hv command line tools
Posted: Mon Jul 25, 2022 1:15 pm
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
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.
Thanks in advance! And i appreciate anyone who would provide any comments.
Bests, -Feng