# Path: spillway/models.py
# class UploadDir(object):
# class AbstractRasterStore(models.Model):
#     class Meta:
#     def __init__(self, path):
#     def __call__(self, instance, filename):
#     def __unicode__(self):
#     def clean_fields(self, *args, **kwargs):
#     def linear(self, limits=None, k=5):
#     def quantiles(self, k=5):
#     def save(self, *args, **kwargs):
#     def array(self, geom=None):
#     def raster(self):
#     def convert(self, format=None, geom=None):
# 
# Path: tests/models.py
# class RasterStore(AbstractRasterStore):
#     objects = RasterQuerySet.as_manager()


import io
import os
import operator
import tempfile
from django.utils.six.moves import reduce
from django.core.files.storage import default_storage
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db.models.fields.files import FieldFile
from django.test import SimpleTestCase, TestCase
from greenwich import raster
from PIL import Image
from spillway.models import upload_to
from .models import RasterStore




def create_image(multiband=False):
    tmpname = os.path.join(
        upload_to.path,
        os.path.basename(tempfile.mktemp(prefix='tmin_', suffix='.tif')))
    fp = default_storage.open(tmpname, 'w+b')

# Path: spillway/models.py
# class UploadDir(object):
# class AbstractRasterStore(models.Model):
#     class Meta:
#     def __init__(self, path):
#     def __call__(self, instance, filename):
#     def __unicode__(self):
#     def clean_fields(self, *args, **kwargs):
#     def linear(self, limits=None, k=5):
#     def quantiles(self, k=5):
#     def save(self, *args, **kwargs):
#     def array(self, geom=None):
#     def raster(self):
#     def convert(self, format=None, geom=None):
# 
# Path: tests/models.py
# class RasterStore(AbstractRasterStore):
#     objects = RasterQuerySet.as_manager()


# Path: tests/test_models.py
import io
import os
import operator
import tempfile
from django.utils.six.moves import reduce
from django.core.files.storage import default_storage
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db.models.fields.files import FieldFile
from django.test import SimpleTestCase, TestCase
from greenwich import raster
from PIL import Image
from spillway.models import upload_to
from .models import RasterStore





def create_image(multiband=False):
    tmpname = os.path.join(
        upload_to.path,
        os.path.basename(tempfile.mktemp(prefix='tmin_', suffix='.tif')))
    fp = default_storage.open(tmpname, 'w+b')

    shape = (5, 5)