Coverage for marshallEngine/feeders/ztf/images.py : 0%

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 ZTF image stamps*
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
22class images(baseimages):
23 """
24 *cacher for the ZTF image stamps*
26 **Key Arguments**
28 - ``log`` -- logger
29 - ``settings`` -- the settings dictionary
30 - ``dbConn`` -- the marshall database connection.
33 **Usage**
35 To setup your logger, settings and database connections, please use the ``fundamentals`` package (`see tutorial here <http://fundamentals.readthedocs.io/en/latest/#tutorial>`_).
37 To initiate a images object, use the following:
39 ```python
40 from marshallEngine.feeders.ztf import images
41 cacher = images(
42 log=log,
43 settings=settings,
44 dbConn=dbConn
45 ).cache(limit=1000)
46 ```
48 """
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/"
63 self.dbSurveyNames = [
64 "ztf", "ZTF"]
66 # SET THESE IMAGE FLAG COLUMNS FOR THE SURVEY
67 self.stampFlagColumns = {
68 "subtracted": None,
69 "target": None,
70 "reference": None,
71 "triplet": "ztf_stamp"
72 }
73 self.survey = "ZTF"
75 return None