Customization and Global Configuration

The configrc file

This package uses a configrc configuration file to customize certain properties. You can control a number of key features such as where your data will download to. This configuration file in a platform specific directory, which you can see the path for by running:

>>> import hermes_eea
>>> hermes_eea.print_config()  

To maintain your own customizations place a copy of the default file into the first path printed above. Do not edit the default file directly as every time you install or update, this file will be overwritten.

See below for the example config file.

Dynamic settings

You can also dynamically change the default settings in a Python script or interactively from the python shell. All of the settings are stored in a Python ConfigParser instance called sunpy.config, which is global to the package. Settings can be modified directly, for example:

import hermes_eea
hermes_eea.config.set('downloads', 'download_dir', '/home/user/Downloads')

A sample configrc file

(download)

;
; Configuration
;
; This is the default configuration file

;;;;;;;;;;;;;;;;;;;
; General Options ;
;;;;;;;;;;;;;;;;;;;
[general]

; Time Format to be used for displaying time in output (e.g. graphs)
; The default time format is based on ISO8601 (replacing the T with space)
; note that the extra '%'s are escape characters
time_format = %Y-%m-%d %H:%M:%S

;;;;;;;;;;;;;
; Downloads ;
;;;;;;;;;;;;;
[downloads]

; Location to save download data to. Path should be specified relative to the
; SunPy working directory.
; Default value: data/
download_dir = data