config.py.default 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # -*- coding: utf-8 -*-
  2. DB = {'host': '', 'port': '', 'database': '', 'user': '', 'password': ''}
  3. LOG_CONFIG = {
  4. 'version': 1,
  5. 'disable_existing_loggers': False,
  6. 'formatters': {
  7. 'default_formatter': {
  8. 'format': '[%(asctime)s: %(module)s - %(levelname)s] %(message)s'
  9. }
  10. },
  11. 'handlers': {
  12. 'stream_handler': {
  13. 'class': 'logging.StreamHandler',
  14. 'formatter': 'default_formatter',
  15. },
  16. 'file_handler': {
  17. 'class': 'logging.FileHandler',
  18. 'formatter': 'default_formatter',
  19. 'mode': 'w',
  20. 'encoding': 'utf8',
  21. 'filename': 'getquakes.log'
  22. }
  23. },
  24. 'loggers': {
  25. 'gui_logger': {
  26. 'handlers': ['file_handler'],
  27. 'level': 'INFO',
  28. 'propagate': True
  29. }
  30. }
  31. }
  32. FILES_FILTERS = {'Bulletin': 'Bulletin text files (*.txt)',
  33. 'Catalog': 'Catalog excel files (*.xlsx)',
  34. 'NAS': 'NAS bulletin files (*.bltn)',
  35. 'ArcGIS': 'ArcGIS text files (*.GIS)'}
  36. QUAKE_HEADER_DESCRIBE = ['Origin time', 'Lat', 'Lon', 'Depth',
  37. 'Nsta', 'Region']
  38. AMNT_COLUMN_SYMBOLS = {'quake_hdr': (26, 9, 9, 9, 6, 6, 0),
  39. 'sta_hdr': (9, 9, 9, 9, 9, 26, 9, 9, 9, 0)}
  40. STATION_HEADER_DESCRIBE = ('Sta', 'Dist', 'Az', 'Ph', 'Entry', 'time', 'Amp',
  41. 'T', 'Mag', 'MagType')
  42. CATALOG_HEADER = ('Date', 'Origin time', 'Lat', 'Lon', 'Depth', 'Region', 'ML',
  43. 'MPSP', 'Stations')
  44. ArcGIS_HEADER = ('Date', 'Time', 'Lat', 'Lon', 'Magn', 'Type')
  45. MONTHS = ('January', 'February', 'March', 'April', 'May', 'June', 'July',
  46. 'August', 'September', 'October', 'November', 'December')
  47. MAGNITUDE_RANGES = {(0.0, 2.51): '1', (2.52, 3.51): '2',
  48. (3.52, 4.51): '3', (4.52, 11.0): '4'}
  49. # All params of quake we can get from the db.
  50. ALL_PARAMS = ('_id', 'origin_dt', 'lat', 'lon', 'depth', 'reg', 'sta',
  51. 'dist', 'az', 'phase', 'entry', 'phase_dt', 'ampl', 'per',
  52. 'ml', 'mpsp')
  53. # Params of quake that will be displayed in the table of GUI
  54. GUI_TABLE_PARAMS = ('_id', 'origin_dt', 'lat', 'lon', 'depth', 'sta', 'phase',
  55. 'phase_dt', 'ml', 'mpsp', 'reg')
  56. STA_RENAME = ['ADZ', 'ARH', 'KLM', 'PRG', 'SLV', 'TMC']