.. _obsinfo_command_line_tool: ======== obsinfo ======== Overview ============ **obsinfo** is the main command-line tool. It has several subcommands, which you can see by typing ``obsinfo -h``: ============================ ================================================== subcommand Description ============================ ================================================== ``version`` Print obsinfo version ``setup`` Set up obsinfo environment ``schema`` Validate an information file against its schema ``print`` Print out the obsinfo object created by a file ``plot`` Plot information in the given file ``xml`` Create a stationxml file from a subnetwork file ``table`` Create a subnetwork file from a subnetwork_table ``template`` Output an information file template ``configurations`` Print obsinfo information file configurations ``yasmine`` Create YASMINE commands to modify StationXML files ``yaml`` Convert a StationXML or RESP file to YAML ``ccfile`` Output clock correction files for input to msmod ============================ ================================================== For help on a given subcommand, type ``obsinfo {subcommand} -h`` Usage ================================ setup ----- The ``setup`` subcommand is used to set up your initial configuration (location of the "datapath" information files, creation of the logging directory), or to modify that configuration. schema, print, plot and xml --------------------------- The ``schema``, ``print`` and ``plot`` subcommands are useful for validating files before you create a StationXML file. You should run them in order: 1) ``schema``, which validates the file against its JSON Schema file 2) ``print``, which reads the information into obsinfo classes and then prints the class description string 3) ``plot``, to verify that the parameters you entered make sense. The ``xml`` subcommand creates StationXML files. table ------ The ``table`` subcommand allows you to easily specify a large number of stations, using a CSV table template and configurations --------------------------- The ``template`` and ``configurations`` subcommands are useful for creating new information files. ``template`` creates a commented file with all possible elements. ``configurations`` indicates all the specified configurations for a ``*_base`` file. yasmine, yaml and ccfile ------------------------- These subcommands help interact with other systems The ``yaml`` subcommand converts a StationXML or RESP file to YAML, to help you build an obsinfo instrumentation. The ``yasmine`` subcommand generates ``yasmine_cli`` commands from a subnetwork file, allowing users to add deployment specific information to an instrumentation's template StationXML file. The ``ccfile`` generates clock correction files that can be input to ``msmod`` v1.3+ in order to correct the instrument clock Running on multiple files ================================ The subcommands ``schema``, ``print``, ``plot``, ``xml`` and ``configurations`` process information files. All but ``xml`` can also work on entire directories of files. For example, to validate one file against schema, you would write: .. code-block:: console > obsinfo schema {NAME}.{type}.yaml To validate all of the information files in a directory against their schemas, use: .. code-block:: console > obsinfo schema {DIRECTORY_NAME} To validate all of the information files in a directory and its subdirectories, use: .. code-block:: console > obsinfo schema --drilldown {DIRECTORY_NAME} To validate all of the information files in the DATAPATH and its subdirectories, use: .. code-block:: console > obsinfo schema DATAPATH Subcommands ================================ ``version`` ------------------------------- Prints the version number ``setup`` ------------------------------- Creates an ``.obsinforc`` file that indicates where obsinfo should look for the information files (see :ref:`file_discovery`), and optionally creates a directory with example information files. The standard call is: .. code-block:: console > obsinfo setup -D DATABASE which will create a directory named `DATABASE/`, containing "starter" obsinfo files, in the current directory ``schema`` ------------------------------- Validates the specified information file against it's JSON schema. The standard calls are: .. code-block:: console > obsinfo schema {NAME}.{type}.yaml > obsinfo schema {DIRECTORY_NAME} > obsinfo schema --drilldown {DIRECTORY_NAME} > obsinfo schema DATAPATH ``print`` ------------------------------- Reads an information file into obsinfo and prints obsinfo's string representation. The standard calls are: .. code-block:: console > obsinfo print {NAME}.{type}.yaml > obsinfo print {DIRECTORY_NAME} > obsinfo print --drilldown {DIRECTORY_NAME} > obsinfo print DATAPATH ``plot`` ------------------------------- Plots a representation of the parameters in an information file. The plot type depends on the information file type: ============================================ ==================================================================== Information file type Plot type ============================================ ==================================================================== ``subnetwork`` Station map; Data time extent ``instrumentation_base`` Instrument responses for each channel ``datalogger``, ``preamplifier``, ``sensor`` Instrument response ``stages`` Instrument response ``filter`` Instrument response; Impulse response if ``FIR`` or ``Coefficients`` ============================================ ==================================================================== Other information file types cannot be plotted. The standard calls are: .. code-block:: console > obsinfo plot {NAME}.{type}.yaml > obsinfo plot {DIRECTORY_NAME} > obsinfo plot --drilldown {DIRECTORY_NAME} > obsinfo plot DATAPATH ``xml`` ------------------------------- Creates a StationXML from a subnetwork file. The standard call is: .. code-block:: console > obsinfo xml {NAME}.subnetwork.yaml .. _obsinfo_template: ``table`` ------------------------------- Create an **obsinfo** ``subnetwork`` file from a CSV table. See :ref:`subnetwork_table_files` ``template`` ------------------------------- Copies a template file to the specified directory. The standard call is: .. code-block:: console > obsinfo template {file_type} and file types are :ref:`datalogger_base_template`, :ref:`instrumentation_base_template`, :ref:`location_base_template`, :ref:`network_template`, :ref:`operator_template`, :ref:`person_template`, :ref:`preamplifier_base_template`, :ref:`sensor_base_template`, :ref:`stage_base_template`, :ref:`subnetwork_template`, :ref:`timing_base_template`, :ref:`ad_conversion_filter_template`, :ref:`fir_filter_template`, :ref:`analog_filter_template`, :ref:`coefficients_filter_template`, :ref:`digital_filter_template`, :ref:`poleszeros_filter_template`, and :ref:`response_list_filter_template` ``configurations`` ------------------------------- Plots all configurations for an information ``*_base`` file. The standard calls are: .. code-block:: console > obsinfo configurations {NAME}.{type}.yaml > obsinfo configurations {DIRECTORY_NAME} > obsinfo configurations --drilldown {DIRECTORY_NAME} > obsinfo configurations DATAPATH ``yasmine`` ------------------------------- Create yasmine_cli commands and values to modify an input, single-station StationXML file to contain the values for one (or each) station in a subnetwork file. For details, see :ref:`command_line_tool_yasmine` ``yaml`` ------------------------------- Convert a STATIONXML or RESP file to YAML files. This is used as a first step for creating an **obsinfo** instrumentation database from existing inventory files. ``ccfile`` ------------------------------- Create msmod-compatible clock correction files for each station in a ``subnetwork`` file.