vtsuperdarn/davitpy — pull request #59 by asreimer (2014-08-05 22:50:28+00:00)
Title: Feature: Using fetchUtils for generalize file fetching in radDataTypes.py

This pull request will finally move away from institution specific file fetching in the `radDataRead.radDataOpen` method. Many things have been changed in regards to how file fetching works and what it depends on, however backwards compatibility with existing user scripts should be maintained.

The list of changes are:
1. Replaced institution specific file fetching code with generalized code using environment variables and fetchUtils
2. Exposed fetchUtils arguments as optional arguments so that the user may override environment variables if they so choose.
3. Added many environment variables to both profile.bash and profile.mac that the user may inform davitpy about their institution's filename format and directory structure.

__ENVIRONMENT VARIABLES__
`VTDB` was changed to `DB`
`DB` is used to specify the remote data server address
`DB_PORT` is used to specify the DB port
`DBREADUSER` is used to specify the DB user username
`DBREADPASS` is used to specify the DB user password
`DAVIT_REMOTE_DIRFORMAT` is used to specify the remote data directory structure
`DAVIT_REMOTE_FNAMEFMT` is used to specify the remote filename format
`DAVIT_REMOTE_TIMEINC` is used to specify the remote time increment between files
`DAVIT_LOCAL_DIRFORMAT` is used to specify the local data directory structure
`DAVIT_LOCAL_FNAMEFMT` is used to specify the local filename format
`DAVIT_LOCAL_TIMEINC` is used to specify the local time increment between files
`DAVIT_TMPDIR` is a directory used for davitpy temporary file cache

profile.bash and radDataRead.py documentation contains some examples of how to properly set the environment variables.

To test this code, simply run `python radDataTypes.py`. Please also test this code with any existing user scripts that you have to ensure that I have indeed maintained backward compatibility. Everything seems to work fine on my end.

Once this is finished, the next stop is sdDataRead and sdDataTypes.