def __init__ (self, token, slice_type, channels, colors=None): """Setup the state for this cache request""" # set the arguments self.token = token self.slice_type = slice_type self.channels = channels self.colors = colors self.server = settings.SERVER self.dataset_name = getDatasetName(self.token, self.channels, self.colors, self.slice_type) # set the datasetname self.ds = NDDataset(self.dataset_name)
def __init__(self, token, slice_type, res, xvalue, yvalue, zvalue, tvalue, channels, colors=None): # load a cache self.db = CacheDB() # cutout a a tilesize region self.tilesize = settings.TILESIZE # setting the server name self.server = settings.SERVER # take the arguments self.token = token self.slice_type = slice_type self.res = res self.xvalue = xvalue self.yvalue = yvalue self.zvalue = zvalue self.tvalue = tvalue self.channels = channels self.colors = colors # set the datasetname and load the data set. If it does not exist in the database then one is fetched and created. self.ds = NDDataset(getDatasetName(self.token, self.channels, self.colors, self.slice_type)) self.getFileName() self.tkey = tilekey.tileKey(self.ds.getDatasetId(), self.res, self.xvalue, self.yvalue, self.zvalue, self.tvalue)