Page 1 of 1

gpprofile: mean profile

Posted: Tue Jul 07, 2009 7:36 am
by Hcadet
Hi,

Using gpprofile it is possible to compute a mean profile from a report file (right?), with a carefully choose file.report.
I would like to know how is it possible to also compute the standard deviation?

Thanks

regards,

Heloise

Posted: Thu Jul 09, 2009 11:54 am
by admin
Hi Heloise,

To produce ground models out of a report, with a misfit less or equal to 1:

Code: Select all

gpdcreport my_run.report -gm -m 1
Then, you can chain this output to gpprofile to extract Vs profiles, for instance:

Code: Select all

gpdcreport my_run.report -gm -m 1 | gprofile -vs
This output a 'ready to plot' curve. For statistic computation, this is not exactly what we want. Instead, I suggest to re-sample the profile, let's say every 1 meter down to 50 meters:

Code: Select all

gpdcreport my_run.report -gm -m 1 | gprofile -vs -resample -d 50 -n 50
Next we compute the statistics over this ensemble of profiles.

Code: Select all

gpdcreport my_run.report -gm -m 1 | gprofile -vs -resample -d 50 -n 50 | grep -v "#" | awk '{print $2,$1}' | gphistogram -y-min 150 -y-max 3500 -x-min 1 -x-max 50 -x-count 50
The grep and awk are mandatory to remove comment lines and to swap first and second columns. gphistogram constructs one histogram per x bin. Hence, if not swapping, you'll obtain one histogram for each velocity rather than for each depth.

Finally, you can extract the mean, median, mode,.. with its deviation thanks to option '-mean', '-median',...

Code: Select all

gpdcreport my_run.report -gm -m 1 | gprofile -vs -resample -d 50 -n 50 | grep -v "#" | awk '{print $2,$1}' | gphistogram -y-min 150 -y-max 3500 -x-min 1 -x-max 50 -x-count 50 -mean

Posted: Thu Jul 09, 2009 12:03 pm
by admin
With latest snapshots (<200907), you will get all value twice out of gpprofile -resample. The next snapshot will be soon available. Meanwhile you can filter out this double values, for instance with the following script:

Code: Select all

gpdcreport my_run.report -gm -m 1 | gprofile -vs -resample -d 50 -n 50 | grep -v "#" | awk 'BEGIN{d=-1}{if($2!=d){print $2,$1;d=$2}' | gphistogram -y-min 150 -y-max 3500 -x-min 1 -x-max 50 -x-count 50 -mean

Posted: Fri Jul 10, 2009 8:09 am
by Hcadet
Hey Marc!

Thanks a lot!

Heloise

Re: gpprofile: mean profile

Posted: Mon May 06, 2013 3:48 pm
by fpinto
Hy Marc,

I am a new user with Dinver and I have been trying to get the mean profile of my inversion.
I have followed the command lines that you indicate here, but i can't use the grep and awk.
I am using Ms-dos and the code works just fine until this part:
Code: Select all
gpdcreport my_run.report -gm -m 1 | gprofile -vs -resample -d 50 -n 50 | grep -v "#" | awk '{print $2,$1}' | gphistogram -y-min 150 -y-max 3500 -x-min 1 -x-max 50 -x-count 50
Should i use another command line instead of Ms-dos? Is Matlab a better one? Or is it a code problem?

Thank you for your time.
Francisco