Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added logging capability #2

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Astrodude11
Copy link
Contributor

@Astrodude11 Astrodude11 commented May 23, 2019

Added the -debug command line argument which enables information logging to both the console and log file. Default behavior is to only save to log file.

Example:
python JetCurryMain.py KnotD_Radio.fits -debug

The above logs information to the console and creates the log file ./KnotD_Radio/KnotD_Radio.log. Here is a snippet of its contents:

2019-05-23 15:58:31,912 - INFO: Using filename: KnotD_Radio.fits
2019-05-23 15:58:31,913 - INFO: Output directory set to ./KnotD_Radio/
2019-05-23 15:58:31,914 - INFO: Upstream bound is: [29 20]
2019-05-23 15:58:31,915 - INFO: Downstream bound is: [81 16]
2019-05-23 15:58:31,916 - INFO: Created square root image of data:
2019-05-23 15:58:31,917 - INFO: [[0.3109157 0.32176653 0.29817274 ...

2019-05-23 15:58:31,917 - INFO: Number of sample points: 52
2019-05-23 15:58:31,948 - INFO: Successfully calculated the max intensities
2019-05-23 15:58:31,951 - INFO: Max intensity at point x:
2019-05-23 15:58:31,952 - INFO: [29. 30. 31. 32. 33. ...
2019-05-23 15:58:31,954 - INFO: Max intensity at point y:
2019-05-23 15:58:31,955 - INFO: [18. 18. 17. 17. 17. ...

2019-05-23 15:58:31,956 - INFO: Smoothed sample points calculated over the start/stop interval:
2019-05-23 15:58:31,958 - INFO: [29. 30.01960784 31.03921569 32.05882353 ...

2019-05-23 15:58:31,961 - INFO: Interpolated curve using spline fit:
2019-05-23 15:58:31,962 - INFO: [18. 17.97897257 16.98140131 17.00509345 ...

2019-05-23 15:59:36,891 - INFO: MCM1_Parallel passed
2019-05-23 16:01:07,609 - INFO: MCMC2_Parallel passed
2019-05-23 16:01:08,909 - INFO: Annealing1_Parallel passed
2019-05-23 16:01:09,523 - INFO: Annealing2_Parallel passed
2019-05-23 16:01:09,611 - INFO: Jet Curry successful for KnotD_Radio.fits

Astrodude11 added 8 commits May 23, 2019 14:11
Checks for missing required modules
Logs information to logfile and console
Always log to logfile and -debug logs to console and logfile.

Improved software design by moving check for required modules into seperate file.

Improved error handling.

Minor cosmetic changes such as variable names, etc.
Python 3 will throw a TypeError if nwalkers is a float. Int is safe for python 2 and python 3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant