1.4.3. Configuration of the librairy

1.4.3.1. What is my configuration?

Type from the shell:

$ vacum_config.py print

1.4.3.2. Where is my personnal configuration?

The general config file should be there: $HOME/.config/vacumm/vacumm.cfg.

This file may make reference to secondary files.

You can edit it online with vacumm.config.edit_user_conf_file():

>>> from vacumm.config import edit_config
>>> edit_user_conf_file()

In offline mode, use vacumm_edit_config.py script.

1.4.3.3. I am a developer and I want to create a configuration for my module

Suppose your module is called: vacumm.my.module (fichier vacumm/my/module.py).

  1. Create the configuration file config.cfg located in the same directory.

  2. Set your options in the vacumm.my.module section. Example:

    [vacumm.my.module]
    sst_max=34
    
  3. Check your configuration with the get_config_value() function:

    >>> from vacumm.config import get_config_value
    >>> get_config_value('vacumm.my.module', 'sst_max')
    

    ‘34’

1.4.3.4. I am not at IFREMER and I want for instance Etopo2

Since its svn-583 version, the library support the automatic download with your agreement, when it tries to access it the file.

If this is not the case, edit the your personal configuration file $HOME/.config/vacumm/vacumm.cfg to speficy the path to the secondary configuration file dedicated to gridded bathymetries. This file is obviously located at the same place of the main configuration file :: Si ce n’est pas le cas, éditer le fichier $HOME/.config/vacumm/vacumm.cfg For example:

[vacumm.bathy.bathy]
cfgfile_gridded=%(user_conf_dir)s/bathy.gridded.cfg

%(user_conf_dir)s refers to the $HOME/.config/vacumm directory. You can also put an explicit path.

Then change the path to the etopo2.nc file in bathy.gridded.cfg:

[etopo2]
file=/path/to/etopo2.nc