source: SHX/trunk/SeismicHandler/commands/help.py @ 1066

Revision 1066, 2.6 KB checked in by klaus, 5 years ago (diff)

forgot to check in other timeit changes

Line 
1# -*- coding: utf-8 -*-
2
3#    This file is part of Seismic Handler eXtended (SHX). For terms of use and
4#    license information please see license.txt and visit
5#    http://www.seismic-handler.org/portal/wiki/Shx/LicenseTerms
6
7from SeismicHandler.basics.command import BaseCommand
8from SeismicHandler.core import Traces
9from SeismicHandler.modules.traces import Traces as BaseTraces, traces_from_list
10from SeismicHandler.basics import timeit
11import os
12
13firststeps = """
14First steps:
15------------
16
17# Open graphic window:
18    wdw/gc=x1h/main create xh1 0. 6.8 33.9 22.
19    # or
20    xopen;;
21
22# Read 10 min of data from arclink server (server see setup in
23# $HOME/.shx/shx.conf) and store metadata in local database
24    fetch gr.gra1. bh zne 7-aug-15_00:16 600 /storemeta
25    fetch gr.gra1.,gr.gra2.,gr.gra3. bh z 7-aug-15_00:16 600 /storemeta
26
27# Write first 3 traces to local Q file MYQFILE
28    write myqfile 1-3
29
30# Read data from local Q file MYQFILE
31    read myqfile all
32
33# Read 10 min of z-component data from all stations within area centered
34# at (51.0,10.0) and +- 2.0 degrees interval in lat and lon. Read the first
35# channel found in the list of 'bh,sh,hh,eh'. Store all data and metadata
36# locally.
37    fetch_area 51. 10. 2. bh,sh,hh,eh 7-aug-15_00:16:30 600 /comp=z /save /storemeta
38
39# Read a data file from a http server with automatic file format determination,
40# example file (SEISAN format):
41#     http://examples.obspy.org/2001-01-13-1742-24S.KONO__004
42@READO |http:|$SLASH|$SLASH|examples.obspy.org|$SLASH|2001-01-13-1742-24S.KONO__004| 2-4
43
44"""
45
46provides = {"help": "help"}
47class help(BaseCommand):
48    """
49    URI:http://www.seismic-handler.org/portal/wiki/ShDisplay
50    """
51    numberOfParameters = [1]
52    parameterQueries = [
53        {
54            "text": "command (empty input ok, shows first steps)",
55            "type": "str",
56            "question": False,
57        },
58    ]
59
60    def __init__(self, *args, **kwargs):
61        # unroll args & kwargs
62        BaseCommand.__init__(self, *args, **kwargs)
63
64    #@timeit
65    def run(self):
66        "Show help info."
67        cmd = self.parameters[0]
68
69        if cmd:
70            url = "https://www.seismic-handler.org/wiki/Sh%s" % cmd.capitalize()
71            shellcmd = "wget -O - %s | html2text" % url
72            os.system( shellcmd )
73            print
74            print "__________________________________________________________"
75            print
76            print "Tried to read text from site '%s'. " % url
77            print "Use your browser for better performance."
78            print "__________________________________________________________"
79            print
80        else:
81            print firststeps
Note: See TracBrowser for help on using the repository browser.