Use VHC

Usage

Run vhc issuing the command:

vhc path [arg1 [arg2 [...]]]

where path is the directory containing the data vhc should run on and where the output files are located.

The first argument arg1, if given, is interpreted as the name of the path subdirectory from which collect the data. The output files are saved under path. Any other argument is ignored by the default implementation of vhc, but is passed to the function implementing the drivers, to allow for custom behaviours.

Input files

The main and only file vhc depends on for running is the configuration file described in VHC configuration.

After loading the configuration file and setting up the logging system, vhc looks for two files in path:

v_recipe.txt
v_driver.txt

If any of them does not exist, they are created.

Recipe file: v_recipe.txt

The recipe file describe the type of files that vhc is going to analyse and consists in one single line. The line is read and the recipe is compared with the list of available recipes, provided in the configuration option recipes in the recipes section of file vhc_setting.cfg.

VHC provides the following recipes:

flat
arc
bias
hetdex_dithers  # not yet implemented

If the recipe file is not found, vhc looks for a file matching generic_virus_match and infer the corresponding name comparing it with the expected files names from recipe_match. If it doesn’t find a file or the file do not match set the recipe to unknown and abort.

Driver file: v_driver.txt

The driver file contains the list of checks (drivers) to execute. Each entry comes in the form of:

module:function

where module is a python module containing function, the function that implements the driver and that must have the following signature:

libvhc.function_signature(vcheck, path, argv, *args, **kwargs)[source]

Prototype of a function implementing a VHC driver.

Parameters:

vcheck : instance of VCheck

store the recipe name and the check currently executing

path : string

path provided to the vhc executable.

argv : list of strings

remaining of the command line

args : list

positional arguments. Not used when calling from vhc

kwargs : dictionary

keyword arguments. Not used when calling from vhc

The module is dynamically loaded and the function executed.

If the driver file is not found, a new one is created using a default set of drivers for the recipe at hand. The default drivers are defined in default_drivers.

Available drivers

  • common:
    • common:n_files (not yet implemented)
    • common:n_pixels
    • common:exptime
    • common:check_overscan
  • bias:
    • bias:compare
  • flat:
    • flat:saturation
    • flat:n_fibers
    • flat:min_flux
  • arc:
    • arc:find_peaks

For more details see Create and use a drivers for more details.

Output

vhc stores execution information and the results of the drivers in two text files and one html document.

Log files

vhc logs into two files:

  • v_results.txt: log all the errors and critical messages; it contains all the failed drivers as errors messages and exceptions, possibly with tracebacks, as critical messages.
  • log.txt: it contains all the log message starting from the libvhc.loggers.LOWER_LEVEL level.

The html recap file

For every vhc run, an html file recapping the drivers success of failure for every IFU is created.