Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1#!/usr/bin/env python 

2# encoding: utf-8 

3""" 

4*cache the atels image stamps* 

5 

6:Author: 

7 David Young 

8 

9:Date Created: 

10 January 12, 2021 

11""" 

12################# GLOBAL IMPORTS #################### 

13import sys 

14import os 

15os.environ['TERM'] = 'vt100' 

16from fundamentals import tools 

17from fundamentals.mysql import readquery 

18import requests 

19from requests.auth import HTTPBasicAuth 

20import codecs 

21from fundamentals import fmultiprocess 

22from fundamentals.mysql import writequery 

23from ..images import images as baseimages 

24 

25 

26class images(baseimages): 

27 """ 

28 *cacher for the atels image stamps* 

29 

30 **Key Arguments:** 

31 - ``log`` -- logger 

32 - ``settings`` -- the settings dictionary 

33 - ``dbConn`` -- the marshall database connection. 

34 

35 **Usage:** 

36 

37 To setup your logger, settings and database connections, please use the ``fundamentals`` package (`see tutorial here <http://fundamentals.readthedocs.io/en/latest/#tutorial>`_).  

38 

39 To initiate a images object, use the following: 

40 

41 .. code-block:: python  

42 

43 from marshallEngine.feeders.atels import images 

44 cacher = images( 

45 log=log, 

46 settings=settings, 

47 dbConn=dbConn 

48 ).cache(limit=1000)  

49 """ 

50 

51 def __init__( 

52 self, 

53 log, 

54 dbConn, 

55 settings=False 

56 ): 

57 self.log = log 

58 log.debug("instansiating a new 'images' object") 

59 self.settings = settings 

60 self.dbConn = dbConn 

61 self.settings[ 

62 "cache-directory"] + "/transients/" 

63 

64 self.dbSurveyNames = [ 

65 "atels", "atels"] 

66 

67 # SET THESE IMAGE FLAG COLUMNS FOR THE SURVEY 

68 # self.stampFlagColumns = { 

69 # "subtracted": "ps1_subtracted_stamp", 

70 # "target": "ps1_target_stamp", 

71 # "reference": "ps1_reference_stamp", 

72 # "triplet": None 

73 # } 

74 self.survey = "atels" 

75 

76 return None