marshallEngine.feeders.panstarrs.images module ∞
cache the panstarrs image stamps
- Author
David Young
-
class
images
(log, dbConn, settings=False)[source] ∞ Bases:
marshallEngine.feeders.images.images
cacher for the panstarrs image stamps
Key Arguments
log
– loggersettings
– the settings dictionarydbConn
– the marshall database connection.
Usage
To setup your logger, settings and database connections, please use the
fundamentals
package (see tutorial here).To initiate a images object, use the following:
from marshallEngine.feeders.panstarrs import images cacher = images( log=log, settings=settings, dbConn=dbConn ).cache(limit=1000)
-
_download
(transientBucketIds, subtractedUrls, targetUrls, referenceUrls, tripletUrls)[source] ∞ cache the images for the survey under their transientBucketId folders in the web-server cache
Key Arguments
transientBucketIds
– the list of transientBucketId for the transients needing images downloaded.subtractedUrls
– the list of subtracted image urls (same length as transientBucketIds list).targetUrls
– the list of target image urls (same length as transientBucketIds list).referenceUrls
– the list of reference image urls (same length as transientBucketIds list).tripletUrls
– the list of triplet image urls (same length as transientBucketIds list).
Return
subtractedStatus
– status of the subtracted image download (0 = fail, 1 = success, 2 = does not exist)targetStatus
– status of the target image download (0 = fail, 1 = success, 2 = does not exist)referenceStatus
– status of the reference image download (0 = fail, 1 = success, 2 = does not exist)tripletStatus
– status of the triplet image download (0 = fail, 1 = success, 2 = does not exist)
-
_list_images_needing_cached
(failedImage=False)[source] ∞ get lists of the transientBucketIds and images needing cached for those transients
Key Arguments
failedImage
– second pass attempt to download alternative image for transients
Return
transientBucketIds, subtractedUrls, targetUrls, referenceUrls, tripletUrls
– synced lists of transientBucketIds, subtracted-, target-, reference- and triplet-image urls. All lists are the same size.
-
_update_database
()[source] ∞ update the database to show which images have been cached on the server
-
cache
(limit=1000)[source] ∞ cache the image for the requested survey
Key Arguments
limit
– limit the number of transients in the list so not to piss-off survey owners by downloading everything in one go.
Usage
from marshallEngine.feeders.panstarrs import images cacher = images( log=log, settings=settings, dbConn=dbConn ).cache(limit=1000)