lib/App/SeismicUnixGui/geopsy/gpdcreport.pm untested

filter: Statementstmt 0.0% 0 / 66 Branchbran 0.0% 0 / 22 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 15 Podpod 0.0% 0 / 14 totaltotal 0.0% 0 / 117 CC 12 SCAR 16.8
CC
12
Cov
0%
maxmod
6.0
maxmis
6.0
best
6.0
CRAP 5.4
1 package App::SeismicUnixGui::geopsy::gpdcreport;
2 use Moose;
3 our $VERSION = '0.0.1';
4  
5 =pod
6  
7 =head1 DOCUMENTATION
8  
9 =head2 SYNOPSIS
10  
11 PROGRAM NAME: Gpdcreport
12 AUTHOR: Derek Goff
13 DATE: May 2 2015
14 DESCRIPTION: A package to use geopsy's gpdcreport function
15 to extract information from report files
16 VERSION: 0.1
17  
18 =head2 Use
19  
20 =head2 Notes
21  
22 This Program derives from dinver in Geopsy
23 '_note' keeps track of actions for use in graphics
24 '_Step' keeps track of actions for execution in the system
25  
26 =head2 Example
27  
28 =head2 Gpdcreport Notes
29  
30 Usage: gpdcreport [OPTIONS] [FILE] ...
31  
32 Read .report file produced by inversion and extract to stdout ground models, dispersion curves, spac curves...
33 (see options)
34  
35 Gpdcreport options:
36 -n <MAX> Maximum number of models to output (default = no maximum)
37 -m <MAX> Maximum misfit to output (default = 1e99)
38 -best <N> Output only the N models with the minimum misfit (supported only for current .report
39 format and without option '-index'.
40 -index Select models by index in file. Indexes are passed through stdin.
41 -pm Output parameters and misfit to stdout
42 -checksum Output the parameterization checksum to stdout
43 -count Output the number of models to stdout
44 -gm Output ground models to stdout (default)
45 -tgmVp Output Vp tilt ground models to stdout (used for refraction)
46 -tgmVs Output Vs tilt ground models to stdout (used for refraction)
47 -vp Output Vp profiles to stdout
48 -vs Output Vs profiles to stdout
49 -rho Output Density profiles to stdout
50 -pitch Output Pitch profiles to stdout
51 -pR <mode> Output mode Rayleigh Phase dispersion curves to stdout
52 -gR <mode> Output mode Rayleigh Group dispersion curves to stdout
53 -pL <mode> Output mode Love Phase dispersion curves to stdout
54 -gL <mode> Output mode Love Group dispersion curves to stdout
55 -e <mode> Output mode ellipticity curve to stdout
56 -aV <mode> Output mode vertical autocorrelation curve to stdout
57 -aR <mode> Output mode radial autocorrelation curve to stdout
58 -aT <mode> Output mode transverse autocorrelation curve to stdout
59 -refraVp <source> Output Vp travel time curve for source index to stdout
60 -refraVs <source> Output Vs travel time curve for source index to stdout
61 -ring <index> Add one ring to list of rings to output (default=nothing)
62 -o <FILE> Export selected models to FILE with the current binary format for .report files. This
63 option may be usefull to convert old .report files produced by na_viewer or first dinver
64 releases.
65 -compat <TYPE> Compatibility with previous versions of .report format. TYPE may take the following
66 values:
67 na_viewer old .report as output by the ancestor of dinver (before 2005).
68 beta first release of the new .report format (not yet support for implicit mode
69 guess specification). All releases from year 2006 and end of 2005.
70 current .report produced by current releases of dinver. All releases since
71 beginning of year 2007.Versioning implemented in this format should
72 guarantee the future support for this format.
73  
74 Generic options:
75 -h, -help [<SECTION>] Shows help. SECTION may be empty or: all, html, latex, generic, debug, examples,
76 gpdcreport
77 -version Shows version information
78 -app-version Shows short version information
79 -j, -jobs <N> Allows a maximum of N simulteneous jobs for parallel computations (default=8).
80  
81 Debug options:
82 -nobugreport Does not generate bug reports in case of error.
83 -reportbug Starts bug report dialog, information about bug is passed through stdin. This option is
84 used internally to report bugs if option -nobugreport is not specified.
85 -reportint Starts bug report dialog, information about interruption is passed through stdin. This
86 option is used internally to report interruptions if option -nobugreport is not
87 specified.
88  
89 Examples:
90  
91 gpdcreport run_01.report
92  
93 Output first 1000 ground models with a misfit less than 1.
94  
95 gpdcreport run_01.report | gpell -c
96  
97 Re-compute ellipticity curves for the same set of models.
98  
99 gpdcreport run_01.report | gpell -p
100  
101 Re-compute peak ellipticity frequencies for the same set of models.
102  
103 gpdcreport run_01.report -e 0
104  
105 Output ellipticity curves for the same set of models (if any stored).
106  
107 See also:
108 More information at http://www.geopsy.org
109  
110 Authors:
111 Marc Wathelet
112 Marc Wathelet (LGIT, Grenoble, France)
113 =cut
114  
115 my $Gpdcreport = {
116 _Step => '',
117 _note => '',
118 _maxmod => '',
119 _maxmis => '',
120 _best => '',
121 _index => '',
122 _pm => '',
123 _gm => '',
124 _vp => '',
125 _vs => '',
126 _pR => '',
127 _pL => '',
128 _file => '',
129 };
130  
131 =pod
132  
133 =head1 Description of Subroutines
134  
135 =head2 Subroutine clear
136
137 Sets all variable strings to '' (nothing)
138  
139 =cut
140  
141 sub clear {
142 $Gpdcreport->{_Step} = '';
143 $Gpdcreport->{_note} = '';
144 $Gpdcreport->{_maxmod} = '';
145 $Gpdcreport->{_maxmis} = '';
146 $Gpdcreport->{_best} = '';
147 $Gpdcreport->{_index} = '';
148 $Gpdcreport->{_pm} = '';
149 $Gpdcreport->{_gm} = '';
150 $Gpdcreport->{_vp} = '';
151 $Gpdcreport->{_vs} = '';
152 $Gpdcreport->{_pR} = '';
153 $Gpdcreport->{_pL} = '';
154 $Gpdcreport->{_file} = '';
155 }
156  
157 ####
158  
159 =pod
160  
161 =head2 Subroutine maxmod
162  
163 Maximum number of models to output
164 default = no maximum
165  
166 =cut
167  
168 sub maxmod {
169 my ( $sub, $maxmod ) = @_;
170 $Gpdcreport->{_maxmod} = $maxmod if defined($maxmod);
171 $Gpdcreport->{_note} =
172 $Gpdcreport->{_note} . ' -n ' . $Gpdcreport->{_maxmod};
173 $Gpdcreport->{_Step} =
174 $Gpdcreport->{_Step} . ' -n ' . $Gpdcreport->{_maxmod};
175 }
176  
177 ####
178  
179 =pod
180  
181 =head2 Subroutine maxmis
182  
183 Maximum misfit to output
184 default = 1e99
185  
186 =cut
187  
188 sub maxmis {
189 my ( $sub, $maxmis ) = @_;
190 $Gpdcreport->{_maxmis} = $maxmis if defined($maxmis);
191 $Gpdcreport->{_note} =
192 $Gpdcreport->{_note} . ' -m ' . $Gpdcreport->{_maxmis};
193 $Gpdcreport->{_Step} =
194 $Gpdcreport->{_Step} . ' -m ' . $Gpdcreport->{_maxmis};
195 }
196  
197 ####
198  
199 =pod
200  
201 =head2 Subroutine best
202  
203 Output only N models with minimum misfit
204  
205 =cut
206  
207 sub best {
208 my ( $sub, $best ) = @_;
209 $Gpdcreport->{_best} = $best if defined($best);
210 $Gpdcreport->{_note} =
211 $Gpdcreport->{_note} . ' -best ' . $Gpdcreport->{_best};
212 $Gpdcreport->{_Step} =
213 $Gpdcreport->{_Step} . ' -best ' . $Gpdcreport->{_best};
214 }
215  
216 ####
217  
218 =pod
219  
220 =head2 Subroutine index
221  
222 Select models by index in file
223 Indexes are passed through stdin
224  
225 =cut
226  
227 sub index {
228 my ( $sub, $index ) = @_;
229 $Gpdcreport->{_index} = $index if defined($index);
230 $Gpdcreport->{_note} =
231 $Gpdcreport->{_note} . ' -index ' . $Gpdcreport->{_index};
232 $Gpdcreport->{_Step} =
233 $Gpdcreport->{_Step} . ' -index ' . $Gpdcreport->{_index};
234 }
235  
236 ####
237  
238 =pod
239  
240 =head2 Subroutine pm
241  
242 Output parameters and misfit to stdout
243  
244 =cut
245  
246 sub pm {
247 my ( $sub, $pm ) = @_;
248 $Gpdcreport->{_pm} = $pm if defined($pm);
249 $Gpdcreport->{_note} =
250 $Gpdcreport->{_note} . ' -pm ' . $Gpdcreport->{_pm};
251 $Gpdcreport->{_Step} =
252 $Gpdcreport->{_Step} . ' -pm ' . $Gpdcreport->{_pm};
253 }
254  
255 ####
256  
257 =pod
258  
259 =head2 Subroutine gm
260  
261 Output ground models to stdout (default)
262  
263 =cut
264  
265 sub gm {
266 my ( $sub, $gm ) = @_;
267 $Gpdcreport->{_best} = $gm if defined($gm);
268 $Gpdcreport->{_note} =
269 $Gpdcreport->{_note} . ' -gm ' . $Gpdcreport->{_gm};
270 $Gpdcreport->{_Step} =
271 $Gpdcreport->{_Step} . ' -gm ' . $Gpdcreport->{_gm};
272 }
273  
274 ####
275  
276 =pod
277  
278 =head2 Subroutine vp
279  
280 Output Vp profiles to stdout
281  
282 =cut
283  
284 sub vp {
285 my ( $sub, $vp ) = @_;
286 $Gpdcreport->{_vp} = $vp if defined($vp);
287 $Gpdcreport->{_note} =
288 $Gpdcreport->{_note} . ' -vp ' . $Gpdcreport->{_vp};
289 $Gpdcreport->{_Step} =
290 $Gpdcreport->{_Step} . ' -vp ' . $Gpdcreport->{_vp};
291 }
292  
293 ####
294  
295 =pod
296  
297 =head2 Subroutine vs
298  
299 Output Vs profiles to stdout
300  
301 =cut
302  
303 sub vs {
304 my ( $sub, $vs ) = @_;
305 $Gpdcreport->{_vs} = $vs if defined($vs);
306 $Gpdcreport->{_note} =
307 $Gpdcreport->{_note} . ' -vs ' . $Gpdcreport->{_vs};
308 $Gpdcreport->{_Step} =
309 $Gpdcreport->{_Step} . ' -vs ' . $Gpdcreport->{_vs};
310 }
311  
312 ####
313  
314 =pod
315  
316 =head2 Subroutine pR
317  
318 Output mode Rayleigh Phase dispersion curves to stdout
319  
320 =cut
321  
322 sub pR {
323 my ( $sub, $pR ) = @_;
324 $Gpdcreport->{_pR} = $pR if defined($pR);
325 $Gpdcreport->{_note} =
326 $Gpdcreport->{_note} . ' -pR ' . $Gpdcreport->{_pR};
327 $Gpdcreport->{_Step} =
328 $Gpdcreport->{_Step} . ' -pR ' . $Gpdcreport->{_pR};
329 }
330  
331 ####
332  
333 =pod
334  
335 =head2 Subroutine pL
336  
337 Output mode Love hase dispersion curves to stdout
338  
339 =cut
340  
341 sub pL {
342 my ( $sub, $pL ) = @_;
343 $Gpdcreport->{_pL} = $pL if defined($pL);
344 $Gpdcreport->{_note} =
345 $Gpdcreport->{_note} . ' -pL ' . $Gpdcreport->{_pL};
346 $Gpdcreport->{_Step} =
347 $Gpdcreport->{_Step} . ' -pL ' . $Gpdcreport->{_pL};
348 }
349  
350 ####
351  
352 =pod
353  
354 =head2 Subroutine file
355  
356 Define Input file
357  
358 =cut
359  
360 sub file {
361 my ( $sub, $file ) = @_;
362 $Gpdcreport->{_file} = $file if defined($file);
363 $Gpdcreport->{_note} = $Gpdcreport->{_note} . ' ' . $Gpdcreport->{_file};
364 $Gpdcreport->{_Step} = $Gpdcreport->{_Step} . ' ' . $Gpdcreport->{_file};
365 }
366  
367 ####
368  
369 =pod
370  
371 =head2 Subroutine Step
372  
373 Keeps track of actions for execution in the system
374  
375 =cut
376  
377 sub Step {
378 $Gpdcreport->{_Step} = 'gpdcreport' . $Gpdcreport->{_Step};
379 return $Gpdcreport->{_Step};
380 }
381  
382 ####
383  
384 =pod
385  
386 =head2 Subroutine note
387  
388 Keeps track of actions for possible use in graphics
389  
390 =cut
391  
392 sub note {
393 $Gpdcreport->{_note} = $Gpdcreport->{_note};
394 return $Gpdcreport->{_note};
395 }
396  
397 =pod
398  
399 =head3 Warnings for programmers
400  
401 packages must end with
402 1;
403  
404 =cut
405  
406 1;