Thursday, December 6, 2007

plotting script for rfmig_cboot.f and rfmig_mcboot.f output WITH UNCERTAINTIES

click title to see Google Drive directory JParkCodes



# ./Plotj_cexp outr_cexp.grid outr1_cexp.grid outr2_cexp.grid outt_cexp.grid outt1_cexp.grid outt2_cexp.grid 0.15 KEG

#shell to plot RF wiggles from the "grid" files generated by
# rfmig_cboot.f or rfmig_mcboot.f
# Input - $1 - mean R+T $2 lower R+T $3 upper R+T $4 mean R-T $5 lower R-T $6 upper R-T $7 scale $8 TITLE

plotting script for rfmig_boot.f and rfmig_mboot.f output WITH UNCERTAINTIES

click title to see Google Drive directory JParkCodes


# ../Plotj_bexp outr_bexp.grid outr1_bexp.grid outr2_bexp.grid outt_bexp.grid outt1_bexp.grid outt2_bexp.grid 0.3 title

#shell to plot RF wiggles from the "grid" files generated by
# rfmig_cboot.f or rfmig_mcboot.f
# Input - $1 - mean R $2 lower R $3 upper R $4 mean T $5 lower T $6 upper T $7 scale $8 TITLE

plotting script for rfmig_cboot.f and rfmig_mcboot.f output

click title to see Google Drive directory JParkCodes

#../Plot_cexp outr_cexp.grid outt_cexp.grid 0.15 KEG

#shell to plot RF wiggles from the "grid" files generated by
# rfmig_cboot.f or rfmig_mcboot.f
#Input - $1 - file name $2 file name $3 - scale $4 TITLE

plotting script for rfmig_boot.f and rfmig_mboot.f output

click title to see Google Drive directory JParkCodes

#../Plot_bexp outr_bexp.grid outt_bexp.grid 0.15 KEG

#shell to plot RF wiggles from the "grid" files generated by
# rfmig_boot.f or rfmig_mboot.f
#Input - $1 - file name $2 file name $3 - scale $4 TITLE

Tuesday, December 4, 2007

rfmig_mcboot.f -- code to compute complex-valued RF harmonic expansion in back-azimuth, moving-window moveout correction

click title to see Google Drive directory JParkCodes

c computes moving-window moveout correction for MTC receiver functions
c applied in the frequency domain.
c requires a stacking model in the anirec format
c such a model may have anisotropy parameters,
c but migration code only uses the isotropic velocities.
c
c code computes frequency-domain stacks of receiver functions that follow a harmonic expansion in baz
c for both radial and transverse RFs there are constant terms and sin/cos terms for 2- and 4-lobed
c amplitude dependence. The constant term should be zero for the transverse RF.
c The 2-lobed terms govern dipping interface effects and tilted symmetry-axis ansotropy.
c The 4-lobed term is anisotropy with a horizontal axis
c The code regresses for the harmonic expansion, using combined radial/transverse stack
c bootstrap-resamples the data to estimate the
c uncertainty of the harmonic terms.
c
c output files are out[rt]_cexp.grid -- harmonic-expansions of the RFs, in time domain
c out[rt]1_cexp.grid -- harmonic-expansion RFs plus bootstrap uncertainty
c out[rt]2_cexp.grid -- harmonic-expansion RFs minus bootstrap uncertainty
c out[rt]_bbaz.grid -- harmonic-expansion RFs computed for ordered baz values
c
c has kluge to cheat the pre-event noise for synthetic records 3/12/00 JJP
c check to see if the kluge is commented out
c
c this version of the RF code reads a file of data filenames
c you have two choices: either read the time intervals in the filename file
c or read them in the sac header
c the data must be binary SAC format
c horizontals must be rotated to radial and transverse

nboot=0: compute simple regression, no bootstrap computation of variance.

rfmig_mboot.f -- code to compute RF harmonic expansion in back-azimuth, moving-window moveout correction

click title to see Google Drive directory JParkCodes

c program rfmig_mboot
c 10/12/04 JJP -- adapted from rfmigrate
c
c xf77 -o /park/backup/bin/rfmig_mboot rfmig_mboot.f /park/backup/Plotxy/plotlib.a /park/backup/Ritz/eislib.a /park/backup/Ritz/jlib.a
c xf77 -o /Users/jjpark/bin/rfmig_mboot rfmig_mboot.f /Users/jjpark/Plotxy/plotlib.a /Users/jjpark/Ritz/eislib.a /Users/jjpark/Ritz/jlib.a
c
c computes moving-window moveout correction for MTC receiver functions
c applied in the frequency domain.
c requires a stacking model in the anirec format
c such a model may have anisotropy parameters,
c but migration code only uses the isotropic velocities.
c
c nboot=0 -- only compute a single regression for RF harmonic expansion --> no bootstrap uncertainty estimate
c
c code computes frequency-domain stacks of receiver functions that follow a harmonic expansion in baz
c for both radial and transverse RFs there are constant terms and sin/cos terms for 2- and 4-lobed
c amplitude dependence. The constant term should be zero for the transverse RF.
c The 2-lobed terms govern dipping interface effects and tilted symmetry-axis ansotropy.
c The 4-lobed term is anisotropy with a horizontal axis
c The code regresses for the harmonic expansion, and bootstrap-resamples the data to estimate the
c uncertainty of the harmonic terms.
c
c output files are out[rt]_bexp.grid -- harmonic-expansions of the RFs, in time domain
c out[rt]1_bexp.grid -- harmonic-expansion RFs plus bootstrap uncertainty
c out[rt]2_bexp.grid -- harmonic-expansion RFs minus bootstrap uncertainty
c out[rt]_bbaz.grid -- harmonic-expansion RFs computed for ordered baz values
c
c has kluge to cheat the pre-event noise for synthetic records 3/12/00 JJP
c check to see if the kluge is commented out

Sunday, December 2, 2007

rfmig_cboot.f -- code to compute harmonic expansion of RFs with back-azimuth

click title to see Google Drive directory JParkCodes

c code computes frequency-domain stacks of receiver functions that follow a harmonic expansion in baz
c for both radial and transverse RFs there are constant terms and sin/cos terms for 2- and 4-lobed
c amplitude dependence. The constant term should be zero for the transverse RF.
c The 2-lobed terms govern dipping interface effects and tilted symmetry-axis ansotropy.
c The 4-lobed term is anisotropy with a horizontal axis
c The code regresses for the harmonic expansion, and bootstrap-resamples the data to estimate the
c uncertainty of the harmonic terms.
c
c output files are out[rt]_cexp.grid -- harmonic-expansions of the RFs, in time domain
c out[rt]1_cexp.grid -- harmonic-expansion RFs plus bootstrap uncertainty
c out[rt]2_cexp.grid -- harmonic-expansion RFs minus bootstrap uncertainty
c out[rt]_bbaz.grid -- harmonic-expansion RFs computed for ordered baz values
c
c migrates MTC receiver functions in the frequency domain.
c requires a stacking model in the anirec format
c such a model may have anisotropy parameters,
c but migration code only uses the isotropic velocities.

c the output of this program is a least-square regression of RFs in the freq
c domain, with complex-valued coefficients for the
c constant, cos(baz)R+sin(baz)T, cos(baz)R-sin(baz)T,
c cos(2*baz)R+sin(2*baz)T, cos(2*baz)R-sin(2*baz)T variations

Saturday, December 1, 2007

rfmig_boot.f -- code to estimate harmonic expansion of RFs in back azimuth

click title to see Google Drive directory JParkCodes

c code computes frequency-domain stacks of receiver functions that follow a harmonic expansion in baz
c for both radial and transverse RFs there are constant terms and sin/cos terms for 2- and 4-lobed
c amplitude dependence. The constant term should be zero for the transverse RF.
c The 2-lobed terms govern dipping interface effects and tilted symmetry-axis ansotropy.
c The 4-lobed term is anisotropy with a horizontal axis
c The code regresses for the harmonic expansion, and bootstrap-resamples the data to estimate the
c uncertainty of the harmonic terms. The posted version only
c
c output files are out[rt]_bexp.grid -- harmonic-expansions of the RFs, in time domain
c out[rt]1_bexp.grid -- harmonic-expansion RFs plus bootstrap uncertainty
c out[rt]2_bexp.grid -- harmonic-expansion RFs minus bootstrap uncertainty
c out[rt]_bbaz.grid -- harmonic-expansion RFs computed for ordered baz values
c
c migrates MTC receiver functions in the frequency domain.
c requires a stacking model in the anirec format (see previous posts on codes that apply
c a frequency-domain moveout correction for the variation of Ps delay time with epicentral distance.)
c such a model may have anisotropy parameters,
c but migration code only uses the isotropic velocities.
c
c has kluge to cheat the pre-event noise for synthetic records 3/12/00 JJP
c check to see if the kluge is commented out
c
c this version of the RF code reads a file of data filenames
c you have two choices: either read the time intervals in the filename file
c or read them in the sac header
c the data must be binary SAC format
c horizontals must be rotated to radial and transverse
c
c for start times in the file:
c the file is "in_recfunk" and has lines of the form:
c
c 1997.070.19.33.bh? <-- br="" code="" r="" replaces="" t="" with="" z="">c 57 52 <-- analysis="" br="" duration="" of="" sec="" start="" time="" window="">c 1997.076.08.15.bh?
c 62 62
c ...
c ...
c ...
c stop <-- 799="" br="" code="" data="" events="" finished="" is="" max="" tells="" that="">c
c
c for start times in the SAC header
c reads seismic record start times from the sac header
c will search the SAC header for specific markers of P phases
c T1 - P, Pdiff ahead(12)
c T2 - PKP,PKIKP ahead(13)
c T3 - PP ahead(14)
c T1=T2=T3=0 ==> use original A-marker ahead(9)
c
c code does NOT combine data with different sample rates
c data files limited to 99K pnts. To increase, see common block /datastuff/
c
c many intermediate quantities are plotted with PLOTIT as the code proceeds.
c other intermediate quantities can be plotted by uncommenting calls to PLOTIT

anirec_synth_circle.f -- make P-coda synthetics at evenly-spaced back azimuth and constant epicentral distance

click title to see Google Drive directory JParkCodes

c  anirec_synth_circle - anirec to compute synthetics for a specified model and
c  a specified station location from one seismic record read from in_recfunk
c  the code will take the station location  and generate a ring of 120 events that are 90 degrees
c  away, one for every 3 degrees back-azimuth.  To do this we generate a great circle path
c  with the station at the pole of the great circle
c  modified to accept SACfiles with start time info in the header, in A-marker (ahead(9))
c  because the timing information is not used, the value of A-marker is not important.
c  However, in the synthetics, the A-marker and the T1-marker variables in the header are set to 5.0 seconds
c  for easy analysis by recfunk codes that use the header information for timing.
c  the synthetic files are s_NNN.bh[zrt], where NNN is the back azimuth.
c  the code writes in_recpick_circle, a list of the filenames for recfunk_pick and other recfunk codes that
c  expect the start time in the SAC header

anirec_synth.f --- a code to compute synthetic P coda from a collection of SAC-format data

click title to see Google Drive directory JParkCodes

c anirec_synth - anirec to compute synthetics for a specified model and
c a specified collection of seismic records (read from in_recpick-format file of filenames)
c modified to accept SACfiles with start time info in the header, in A-marker (ahead(9))
c because the timing information is not used, the value of A-marker is not important.
c However, in the synthetics, the A-marker and the T1-marker (or T2) variables in the header are set to 5.0 seconds
c for easy analysis by recfunk codes that use the header information for timing.
c code divides between T1 (P) or T2 (PKP) markers based on epicentral distance, with 120 degrees the divide
c the synthetic files are s_filename.bh[zrt], where filename is the name of the datafile.
c the code writes in_recpick_synth, a list of the filenames for recfunk_pick and other recfunk codes that
c expect the start time in the SAC header
c

The goal of this code is to generate P-coda form a specified model to replicate the earthquake distribution of a real data set. This allows the analyst to test whether the oddities in an RF sweep are likely caused by an imperfect data distribution, or by a shortcoming of his/her model.
 
Link