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/local/bin/python 

2# encoding: utf-8 

3""" 

4*cache the useradded image stamps* 

5 

6:Author: 

7 David Young 

8""" 

9import sys 

10import os 

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

12from fundamentals import tools 

13from fundamentals.mysql import readquery 

14import requests 

15from requests.auth import HTTPBasicAuth 

16import codecs 

17from fundamentals import fmultiprocess 

18from fundamentals.mysql import writequery 

19from ..images import images as baseimages 

20 

21 

22class images(baseimages): 

23 """ 

24 *cacher for the useradded image stamps* 

25 

26 **Key Arguments** 

27 

28 - ``log`` -- logger 

29 - ``settings`` -- the settings dictionary 

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

31 

32 

33 **Usage** 

34 

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

36 

37 To initiate a images object, use the following: 

38 

39 ```python 

40 from marshallEngine.feeders.useradded import images 

41 cacher = images( 

42 log=log, 

43 settings=settings, 

44 dbConn=dbConn 

45 ).cache(limit=1000)  

46 ``` 

47 

48 """ 

49 

50 def __init__( 

51 self, 

52 log, 

53 dbConn, 

54 settings=False 

55 ): 

56 self.log = log 

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

58 self.settings = settings 

59 self.dbConn = dbConn 

60 self.downloadDirectoryPath = settings[ 

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

62 

63 self.dbSurveyNames = [ 

64 "useradded", "useradded"] 

65 

66 # SET THESE IMAGE FLAG COLUMNS FOR THE SURVEY 

67 self.stampFlagColumns = { 

68 "subtracted": None, 

69 "target": "user_added_stamp", 

70 "reference": None, 

71 "triplet": None 

72 } 

73 self.survey = "useradded" 

74 

75 return None