Coverage for frank/__init__.py: 93%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

14 statements  

1# Frankenstein: 1D disc brightness profile reconstruction from Fourier data 

2# using non-parametric Gaussian Processes 

3# 

4# Copyright (C) 2019-2020 R. Booth, J. Jennings, M. Tazzari 

5# 

6# This program is free software: you can redistribute it and/or modify 

7# it under the terms of the GNU General Public License as published by 

8# the Free Software Foundation, either version 3 of the License, or 

9# (at your option) any later version. 

10# 

11# This program is distributed in the hope that it will be useful, 

12# but WITHOUT ANY WARRANTY; without even the implied warranty of 

13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

14# GNU General Public License for more details. 

15# 

16# You should have received a copy of the GNU General Public License 

17# along with this program. If not, see <https://www.gnu.org/licenses/> 

18# 

19__version__ = "1.2.2" 

20 

21from frank import constants 

22from frank import geometry 

23from frank import hankel 

24from frank import io 

25from frank import radial_fitters 

26from frank import debris_fitters 

27from frank import utilities 

28 

29def enable_logging(log_file=None): 

30 """Turn on internal logging for Frankenstein 

31 

32 Parameters 

33 ---------- 

34 log_file : string, optional 

35 Output filename to which logging messages are written. 

36 If not provided, logs will only be printed to the screen 

37 """ 

38 import logging 

39 

40 if log_file is not None: 

41 handlers = [ logging.FileHandler(log_file, mode='w'), 

42 logging.StreamHandler() 

43 ] 

44 else: 

45 handlers = [ logging.StreamHandler() ] 

46 

47 logging.basicConfig(level=logging.INFO, 

48 format='%(message)s', 

49 handlers=handlers 

50 )