| 1 | package App::SeismicUnixGui::geopsy::gpviewdcreport; | ||
| 2 | use Moose; | ||
| 3 | our $VERSION = '0.0.1'; | ||
| 4 | |||
| 5 | =pod | ||
| 6 | |||
| 7 | =head1 DOCUMENTATION | ||
| 8 | |||
| 9 | =head2 SYNOPSIS | ||
| 10 | |||
| 11 | PROGRAM NAME: Gpviewdcreport | ||
| 12 | AUTHOR: Derek Goff | ||
| 13 | DATE: May 5 2015 | ||
| 14 | DESCRIPTION: A package to use geopsy's Gpviewdcreport function | ||
| 15 | to calculate view dispersion curves from inversion | ||
| 16 | reports | ||
| 17 | VERSION: 0.1 | ||
| 18 | |||
| 19 | =head2 Use | ||
| 20 | |||
| 21 | =head2 Notes | ||
| 22 | |||
| 23 | This Program derives from dinver in Geopsy | ||
| 24 | '_note' keeps track of actions for use in graphics | ||
| 25 | '_Step' keeps track of actions for execution in the system | ||
| 26 | |||
| 27 | =head2 Example | ||
| 28 | |||
| 29 | =head2 Gpviewdcreport Notes | ||
| 30 | |||
| 31 | Usage: gpviewdcreport [OPTIONS] [FILE]... | ||
| 32 | |||
| 33 | Display ground profiles, dispersion curves, ellipticity curves, autocorrelation curves or refraction | ||
| 34 | curves read from .report files. It is strictly equivalent to the 'view' options in dinver graphical | ||
| 35 | interface. If options '-m', '-n' or other related options are specified the initial dialog box is | ||
| 36 | skipped. | ||
| 37 | |||
| 38 | gpviewdcreport options: | ||
| 39 | -profile Plot ground profiles (default) | ||
| 40 | -dispersion Plot dispersion curves | ||
| 41 | -ellipticity Plot ellipticity curves | ||
| 42 | -autocorr Plot autocorrelation curves | ||
| 43 | -refraVp Plot refraction curves for Vp | ||
| 44 | -refraVs Plot refraction curves for Vs | ||
| 45 | -m <MISFIT> Maximum misfit to display | ||
| 46 | -target <TARGET> Set target shown above models read from .report files. | ||
| 47 | -e, -export <FILE> Export sheet contents to FILE. See 'figue -h' for more details. | ||
| 48 | -f, -format <FORMAT> Specify format for option '-export'. See 'figue -h' for more details. | ||
| 49 | -dpi <DPI> Forces resolution to DPI(dot per inch) in export file. See 'figue -h' for | ||
| 50 | more details. | ||
| 51 | |||
| 52 | Profile options: | ||
| 53 | -n <N> Number of profiles | ||
| 54 | |||
| 55 | Dispersion options: | ||
| 56 | -n <N> Number of modes | ||
| 57 | -s <SLOWNESS> Slowness type: Group or Phase | ||
| 58 | -p <POLARISATION> Polarisation: Rayleigh or Love | ||
| 59 | |||
| 60 | Ellipticity options: | ||
| 61 | -n <N> Number of modes | ||
| 62 | |||
| 63 | Autocorr options: | ||
| 64 | -n <N> Number of rigns | ||
| 65 | -p <POLARISATION> Polarisation: Vertical, Transverse or Radial | ||
| 66 | |||
| 67 | Refra options: | ||
| 68 | -n <N> Number of sources | ||
| 69 | |||
| 70 | Qt options: | ||
| 71 | -nograb Tells Qt that it must never grab the mouse or the keyboard | ||
| 72 | -dograb Running under a debugger can cause an implicit -nograb, use -dograb to | ||
| 73 | override | ||
| 74 | -sync Switches to synchronous mode for debugging | ||
| 75 | -style <style> Sets the application GUI style. Possible values are | ||
| 76 | motif | ||
| 77 | windows | ||
| 78 | platinum | ||
| 79 | If you compiled Qt with additional styles or have additional styles as | ||
| 80 | plugins these will be available to the -style command line option | ||
| 81 | -session <session> Restore the application from an earlier session | ||
| 82 | -reverse Sets the application's layout direction to right to left | ||
| 83 | -display <display> Sets the X display (default is $DISPLAY) | ||
| 84 | -geometry <geometry> Sets the client geometry of the first window that is shown | ||
| 85 | -fn, -font <font> Defines the application font. The font should be specified using an X logical | ||
| 86 | font description | ||
| 87 | -bg, -background <color> Sets the default background color and an application palette (light and dark | ||
| 88 | shades are calculated) | ||
| 89 | -fg, -foreground <color> Sets the default foreground color | ||
| 90 | -btn, -button <color> Sets the default button color | ||
| 91 | -name <name> Sets the application name | ||
| 92 | -title <title> Sets the application title | ||
| 93 | -visual TrueColor Forces the application to use a TrueColor visual on an 8-bit display | ||
| 94 | -ncols <count> Limits the number of colors allocated in the color cube on an 8-bit display, | ||
| 95 | if the application is using the QApplication::ManyColor color specification. | ||
| 96 | If count is 216 then a 6x6x6 color cube is used (i.e. 6 levels of red, 6 of | ||
| 97 | green, and 6 of blue); for other values, a cube approximately proportional to | ||
| 98 | a 2x3x1 cube is used | ||
| 99 | -cmap <count> Causes the application to install a private color map on an 8-bit display | ||
| 100 | -im <XIM server> Sets the input method server (equivalent to setting the XMODIFIERS | ||
| 101 | environment variable) | ||
| 102 | -noxim Disables the input method framework ("no X input method") | ||
| 103 | -inputstyle <inputstyle> Defines how the input is inserted into the given widget. Possible values are: | ||
| 104 | onTheSpot makes the input appear directly in the widget | ||
| 105 | offTheSpot | ||
| 106 | overTheSpot makes the input appear in a box floating over the widget | ||
| 107 | |||
| 108 | See also: | ||
| 109 | More information at http://www.geopsy.org | ||
| 110 | |||
| 111 | Authors: | ||
| 112 | Marc Wathelet | ||
| 113 | Marc Wathelet (LGIT, Grenoble, France) | ||
| 114 | |||
| 115 | =cut | ||
| 116 | |||
| 117 | my $Gpviewdcreport = { | ||
| 118 | _Step => '', | ||
| 119 | _note => '', | ||
| 120 | _profile => '', | ||
| 121 | _dispersion => '', | ||
| 122 | _maxmis => '', | ||
| 123 | _export => '', | ||
| 124 | _format => '', | ||
| 125 | _nprofile => '', | ||
| 126 | _nmodes => '', | ||
| 127 | _slowness => '', | ||
| 128 | _polarisation => '', | ||
| 129 | _target => '', | ||
| 130 | _dpi => '', | ||
| 131 | _file => '', | ||
| 132 | }; | ||
| 133 | |||
| 134 | =pod | ||
| 135 | |||
| 136 | =head1 Description of Subroutines | ||
| 137 | |||
| 138 | =head2 Subroutine clear | ||
| 139 | |||
| 140 | Sets all variable strings to '' (nothing) | ||
| 141 | |||
| 142 | =cut | ||
| 143 | |||
| 144 | sub clear { | ||
| 145 | $Gpviewdcreport->{_Step} = ''; | ||
| 146 | $Gpviewdcreport->{_note} = ''; | ||
| 147 | $Gpviewdcreport->{_profile} = ''; | ||
| 148 | $Gpviewdcreport->{_dispersion} = ''; | ||
| 149 | $Gpviewdcreport->{_maxmis} = ''; | ||
| 150 | $Gpviewdcreport->{_export} = ''; | ||
| 151 | $Gpviewdcreport->{_format} = ''; | ||
| 152 | $Gpviewdcreport->{_nprofile} = ''; | ||
| 153 | $Gpviewdcreport->{_nmodes} = ''; | ||
| 154 | $Gpviewdcreport->{_slowness} = ''; | ||
| 155 | $Gpviewdcreport->{_polarisation} = ''; | ||
| 156 | $Gpviewdcreport->{_target} = ''; | ||
| 157 | $Gpviewdcreport->{_dpi} = ''; | ||
| 158 | $Gpviewdcreport->{_file} = ''; | ||
| 159 | } | ||
| 160 | |||
| 161 | #### | ||
| 162 | |||
| 163 | =pod | ||
| 164 | |||
| 165 | =head2 Subroutine profile | ||
| 166 | |||
| 167 | Plot ground profiles (default) | ||
| 168 | |||
| 169 | =cut | ||
| 170 | |||
| 171 | sub profile { | ||
| 172 | my ( $sub, $profile ) = @_; | ||
| 173 | $Gpviewdcreport->{_profile} = $profile if defined($profile); | ||
| 174 | $Gpviewdcreport->{_note} = | ||
| 175 | $Gpviewdcreport->{_note} . ' -profile ' . $Gpviewdcreport->{_profile}; | ||
| 176 | $Gpviewdcreport->{_Step} = | ||
| 177 | $Gpviewdcreport->{_Step} . ' -profile ' . $Gpviewdcreport->{_profile}; | ||
| 178 | } | ||
| 179 | |||
| 180 | #### | ||
| 181 | |||
| 182 | =pod | ||
| 183 | |||
| 184 | =head2 Subroutine dispersion | ||
| 185 | |||
| 186 | Plot Dispersion curves | ||
| 187 | |||
| 188 | =cut | ||
| 189 | |||
| 190 | sub dispersion { | ||
| 191 | my ( $sub, $dispersion ) = @_; | ||
| 192 | $Gpviewdcreport->{_dispersion} = $dispersion if defined($dispersion); | ||
| 193 | $Gpviewdcreport->{_note} = | ||
| 194 | $Gpviewdcreport->{_note} | ||
| 195 | . ' -dispersion ' | ||
| 196 | . $Gpviewdcreport->{_dispersion}; | ||
| 197 | $Gpviewdcreport->{_Step} = | ||
| 198 | $Gpviewdcreport->{_Step} | ||
| 199 | . ' -dispersion ' | ||
| 200 | . $Gpviewdcreport->{_dispersion}; | ||
| 201 | } | ||
| 202 | |||
| 203 | #### | ||
| 204 | |||
| 205 | =pod | ||
| 206 | |||
| 207 | =head2 Subroutine maxmis | ||
| 208 | |||
| 209 | Maximum misfit to display | ||
| 210 | |||
| 211 | =cut | ||
| 212 | |||
| 213 | sub maxmis { | ||
| 214 | my ( $sub, $maxmis ) = @_; | ||
| 215 | $Gpviewdcreport->{_maxmis} = $maxmis if defined($maxmis); | ||
| 216 | $Gpviewdcreport->{_note} = | ||
| 217 | $Gpviewdcreport->{_note} . ' -m ' . $Gpviewdcreport->{_maxmis}; | ||
| 218 | $Gpviewdcreport->{_Step} = | ||
| 219 | $Gpviewdcreport->{_Step} . ' -m ' . $Gpviewdcreport->{_maxmis}; | ||
| 220 | } | ||
| 221 | |||
| 222 | #### | ||
| 223 | |||
| 224 | =pod | ||
| 225 | |||
| 226 | =head2 Subroutine export | ||
| 227 | |||
| 228 | Export sheet contents to <file> | ||
| 229 | |||
| 230 | =cut | ||
| 231 | |||
| 232 | sub export { | ||
| 233 | my ( $sub, $export ) = @_; | ||
| 234 | $Gpviewdcreport->{_export} = $export if defined($export); | ||
| 235 | $Gpviewdcreport->{_note} = | ||
| 236 | $Gpviewdcreport->{_note} . ' -export ' . $Gpviewdcreport->{_export}; | ||
| 237 | $Gpviewdcreport->{_Step} = | ||
| 238 | $Gpviewdcreport->{_Step} . ' -export ' . $Gpviewdcreport->{_export}; | ||
| 239 | } | ||
| 240 | |||
| 241 | #### | ||
| 242 | |||
| 243 | =pod | ||
| 244 | |||
| 245 | =head2 Subroutine format | ||
| 246 | |||
| 247 | Specify format for export <file> | ||
| 248 | Options: PAGE,LAYER,PDF,BMP,JPG,JPEG,PNG,SVG | ||
| 249 | See figue -h for more options | ||
| 250 | |||
| 251 | =cut | ||
| 252 | |||
| 253 | sub format { | ||
| 254 | my ( $sub, $format ) = @_; | ||
| 255 | $Gpviewdcreport->{_format} = $format if defined($format); | ||
| 256 | $Gpviewdcreport->{_note} = | ||
| 257 | $Gpviewdcreport->{_note} . ' -format ' . $Gpviewdcreport->{_format}; | ||
| 258 | $Gpviewdcreport->{_Step} = | ||
| 259 | $Gpviewdcreport->{_Step} . ' -format ' . $Gpviewdcreport->{_format}; | ||
| 260 | } | ||
| 261 | |||
| 262 | #### | ||
| 263 | |||
| 264 | =pod | ||
| 265 | |||
| 266 | =head2 Subroutine nprofile | ||
| 267 | |||
| 268 | Number of profiles to show from ground profiles (-profile) | ||
| 269 | |||
| 270 | =cut | ||
| 271 | |||
| 272 | sub nprofile { | ||
| 273 | my ( $sub, $nprofile ) = @_; | ||
| 274 | $Gpviewdcreport->{_nprofile} = $nprofile if defined($nprofile); | ||
| 275 | $Gpviewdcreport->{_note} = | ||
| 276 | $Gpviewdcreport->{_note} . ' -n ' . $Gpviewdcreport->{_nprofile}; | ||
| 277 | $Gpviewdcreport->{_Step} = | ||
| 278 | $Gpviewdcreport->{_Step} . ' -n ' . $Gpviewdcreport->{_nprofile}; | ||
| 279 | } | ||
| 280 | |||
| 281 | #### | ||
| 282 | |||
| 283 | =pod | ||
| 284 | |||
| 285 | =head2 Subroutine nmodes | ||
| 286 | |||
| 287 | Number of Modes for dispersion and ellipticity | ||
| 288 | |||
| 289 | =cut | ||
| 290 | |||
| 291 | sub nmodes { | ||
| 292 | my ( $sub, $nmodes ) = @_; | ||
| 293 | $Gpviewdcreport->{_nmodes} = $nmodes if defined($nmodes); | ||
| 294 | $Gpviewdcreport->{_note} = | ||
| 295 | $Gpviewdcreport->{_note} . ' -n ' . $Gpviewdcreport->{_nmodes}; | ||
| 296 | $Gpviewdcreport->{_Step} = | ||
| 297 | $Gpviewdcreport->{_Step} . ' -n ' . $Gpviewdcreport->{_nmodes}; | ||
| 298 | } | ||
| 299 | |||
| 300 | #### | ||
| 301 | |||
| 302 | =pod | ||
| 303 | |||
| 304 | =head2 Subroutine slowness | ||
| 305 | |||
| 306 | Slowness type: Group or Phase | ||
| 307 | |||
| 308 | =cut | ||
| 309 | |||
| 310 | sub slowness { | ||
| 311 | my ( $sub, $slowness ) = @_; | ||
| 312 | $Gpviewdcreport->{_slowness} = $slowness if defined($slowness); | ||
| 313 | $Gpviewdcreport->{_note} = | ||
| 314 | $Gpviewdcreport->{_note} . ' -s ' . $Gpviewdcreport->{_slowness}; | ||
| 315 | $Gpviewdcreport->{_Step} = | ||
| 316 | $Gpviewdcreport->{_Step} . ' -s ' . $Gpviewdcreport->{_slowness}; | ||
| 317 | } | ||
| 318 | |||
| 319 | #### | ||
| 320 | |||
| 321 | =pod | ||
| 322 | |||
| 323 | =head2 Subroutine polarisation | ||
| 324 | |||
| 325 | Polarisation: Rayleigh or Love | ||
| 326 | |||
| 327 | =cut | ||
| 328 | |||
| 329 | sub polarisation { | ||
| 330 | my ( $sub, $polarisation ) = @_; | ||
| 331 | $Gpviewdcreport->{_polarisation} = $polarisation | ||
| 332 | if defined($polarisation); | ||
| 333 | $Gpviewdcreport->{_note} = | ||
| 334 | $Gpviewdcreport->{_note} . ' -p ' . $Gpviewdcreport->{_polarisation}; | ||
| 335 | $Gpviewdcreport->{_Step} = | ||
| 336 | $Gpviewdcreport->{_Step} . ' -p ' . $Gpviewdcreport->{_polarisation}; | ||
| 337 | } | ||
| 338 | |||
| 339 | #### | ||
| 340 | |||
| 341 | =pod | ||
| 342 | |||
| 343 | =head2 Subroutine target | ||
| 344 | |||
| 345 | Set target shown above models read from .report file | ||
| 346 | |||
| 347 | =cut | ||
| 348 | |||
| 349 | sub target { | ||
| 350 | my ( $sub, $target ) = @_; | ||
| 351 | $Gpviewdcreport->{_target} = $target if defined($target); | ||
| 352 | $Gpviewdcreport->{_note} = | ||
| 353 | $Gpviewdcreport->{_note} . ' -target ' . $Gpviewdcreport->{_target}; | ||
| 354 | $Gpviewdcreport->{_Step} = | ||
| 355 | $Gpviewdcreport->{_Step} . ' -target ' . $Gpviewdcreport->{_target}; | ||
| 356 | } | ||
| 357 | |||
| 358 | #### | ||
| 359 | |||
| 360 | =pod | ||
| 361 | |||
| 362 | =head2 Subroutine dpi | ||
| 363 | |||
| 364 | Forces resolution of DPI (Dot per inch) in export file | ||
| 365 | |||
| 366 | =cut | ||
| 367 | |||
| 368 | sub dpi { | ||
| 369 | my ( $sub, $dpi ) = @_; | ||
| 370 | $Gpviewdcreport->{_dpi} = $dpi if defined($dpi); | ||
| 371 | $Gpviewdcreport->{_note} = | ||
| 372 | $Gpviewdcreport->{_note} . ' -dpi ' . $Gpviewdcreport->{_dpi}; | ||
| 373 | $Gpviewdcreport->{_Step} = | ||
| 374 | $Gpviewdcreport->{_Step} . ' -dpi ' . $Gpviewdcreport->{_dpi}; | ||
| 375 | } | ||
| 376 | |||
| 377 | #### | ||
| 378 | |||
| 379 | =pod | ||
| 380 | |||
| 381 | =head2 Subroutine file | ||
| 382 | |||
| 383 | Define Input file | ||
| 384 | |||
| 385 | =cut | ||
| 386 | |||
| 387 | sub file { | ||
| 388 | my ( $sub, $file ) = @_; | ||
| 389 | $Gpviewdcreport->{_file} = $file if defined($file); | ||
| 390 | $Gpviewdcreport->{_note} = | ||
| 391 | $Gpviewdcreport->{_note} . ' ' . $Gpviewdcreport->{_file}; | ||
| 392 | $Gpviewdcreport->{_Step} = | ||
| 393 | $Gpviewdcreport->{_Step} . ' ' . $Gpviewdcreport->{_file}; | ||
| 394 | } | ||
| 395 | |||
| 396 | #### | ||
| 397 | |||
| 398 | =pod | ||
| 399 | |||
| 400 | =head2 Subroutine Step | ||
| 401 | |||
| 402 | Keeps track of actions for execution in the system | ||
| 403 | |||
| 404 | =cut | ||
| 405 | |||
| 406 | sub Step { | ||
| 407 | $Gpviewdcreport->{_Step} = 'gpviewdcreport' . $Gpviewdcreport->{_Step}; | ||
| 408 | return $Gpviewdcreport->{_Step}; | ||
| 409 | } | ||
| 410 | |||
| 411 | #### | ||
| 412 | |||
| 413 | =pod | ||
| 414 | |||
| 415 | =head2 Subroutine note | ||
| 416 | |||
| 417 | Keeps track of actions for possible use in graphics | ||
| 418 | |||
| 419 | =cut | ||
| 420 | |||
| 421 | sub note { | ||
| 422 | $Gpviewdcreport->{_note} = $Gpviewdcreport->{_note}; | ||
| 423 | return $Gpviewdcreport->{_note}; | ||
| 424 | } | ||
| 425 | |||
| 426 | =pod | ||
| 427 | |||
| 428 | =head3 Warnings for programmers | ||
| 429 | |||
| 430 | packages must end with | ||
| 431 | 1; | ||
| 432 | |||
| 433 | =cut | ||
| 434 | |||
| 435 | 1; | ||
| 436 |