Page 1 of 1

Selection of thousand random profile

Posted: Fri Jul 26, 2019 3:22 pm
by nroy1deq
gpdcreport run_01.report -gm -n 1000 -m 1.0 | gpprofile -vs > 1000vs.txt

gpdcreport run_01.report -pR 0 -n 1000 -m 1.0 > 1000disp.txt

Will the above two commands provide 1000 random Vs profiles equal to or below a misfit of 1.0 and their corresponding 1000 dispersion curves????

Re: Selection of thousand random profile

Posted: Fri Aug 23, 2019 8:44 am
by admin
If there are less than 1000 models with a misfit below 1, you will get less than 1000 profiles.
It was a bit unclear in the help message from gpdcreport: I fixed it. With '-n 1000', only the first 1000 models will be out. Combined with '-m 1', only the first 1000 models with a misfit less than 1.

There are not randomly picked among all models with a misfit less than 1.

To pick models randomly, it is s bit more complex, at least I can see this method:

Code: Select all

# Get the list of index in .report where misfit is less than 1
gpdcreport your.report -m 1 -pm | awk '!/#/{print $1}' > index
# Pick randomly 1000 indexes in this list
for i in $(gprandom -n 1000 -min 1 -max $(cat index | wc -l)); do
  head -n $(echo $i | awk '{printf("%i\n",$0)}') index | tail -n 1
done > selected_index
# Extract the picks indexes from the report file
cat selected_index | gpdcreport your.report -index

Re: Selection of thousand random profile

Posted: Fri Sep 06, 2019 8:52 pm
by nroy1deq
How can I select specified number of profiles between a range of misfit. Say, I want to select 1000 profiles between a misfit range of 0.1 to 0.5. How can I do that ?