Package spectractor :: Module serve
[hide private]
[frames] | no frames]

Module serve

source code

Spectractor submodule containing functions for managing various files, journals, creating logs etc.


Author: Dmitry Nasonov

Classes [hide private]
  Walker
Directory walker: search files and dirs in args matching regexp.
  Logger
Extract information from FITS headers of given FITS files, create log
Functions [hide private]
 
filler(indct, key, val)
Fill dictionary which values are lists.
source code
 
fill_dctset(indct, key, val)
Fill dictionary which values are sets.
source code
 
backuper(file_pth, verbose=False)
Backup file if it is exist: move it with '-backup' postfix.
source code
 
rexper(regexp, path, reflag=None, splitnig=False)
Get parameters from file name using regexp.
source code
 
read_journal(j_pth) source code
 
mod_journal(journal, sn=10, rvc=True, rvcorr_dct=None, instr=None, lams=None, jd=None, verbose=False)
Exclude or correct items in journal depending on input parameters.
source code
 
clocker(val, divc=1.0)
Convert float value to tuple of (int h, int m, float s).
source code
Variables [hide private]
  __package__ = 'spectractor'
  data_dir = 'data'
  out_dir = 'out'
Function Details [hide private]

rexper(regexp, path, reflag=None, splitnig=False)

source code 

Get parameters from file name using regexp. Parameters are: int ID (for example, night number), flag. For now, regexp.findall must return 3 values! If not, return (None, None).

Parameters:
  • regexp - regular expression describing file name
  • path - path to file
  • reflag - tuple of two values. If not empty, flag containing in first value will be replaced to second one
  • splitnig - split ID to tuple of 'night' and spectrum number
Returns:
ID (night number): int or tuple of ints with splitnig, flag

mod_journal(journal, sn=10, rvc=True, rvcorr_dct=None, instr=None, lams=None, jd=None, verbose=False)

source code 

Exclude or correct items in journal depending on input parameters.

Parameters:
  • journal - dictionary with spectra main parameters
  • sn - limiting signal-to-noise ratio value: exclude all spectra with lower S/N
  • rvc - Set Va shift to zero. Useful for telluric line measurements
  • rvcorr_dct - Dictionary of heliocentric velocity corrections, defined, for example, by telluric lines measurements
  • instr - Select spectra obtained with given spectrograph
  • lams - Exclude all spectra, which no contain given vawelength
  • jd - Exclude all spectra, which obtained earlier, than given JYear value

clocker(val, divc=1.0)

source code 

Convert float value to tuple of (int h, int m, float s). Useful for coordinates and times.

Parameters:
  • divc - division coefficient for val