Update

parent 17335915
...@@ -19,7 +19,7 @@ class APISentinel(object): ...@@ -19,7 +19,7 @@ class APISentinel(object):
>>> sentinel = APISentinel('asalazarg', 'geo135asg') >>> sentinel = APISentinel('asalazarg', 'geo135asg')
>>> dir="make" >>> dir="make"
>>> if not os.path.exists(dir): >>> if not os.path.exists(dir):
>>> os.mkdir(dir) ... os.mkdir(dir)
>>> products = sentinel.getProducts("POLYGON((-89.99450683593753 21.279137394108716,-89.13757324218751 21.2996106049456,-89.30236816406251 20.68418377935238,-90.0494384765625 20.715015145512098,-89.99450683593753 21.279137394108716))", ('20151219', date(2015,12,29)), {"platformname":"Sentinel-2"}) >>> products = sentinel.getProducts("POLYGON((-89.99450683593753 21.279137394108716,-89.13757324218751 21.2996106049456,-89.30236816406251 20.68418377935238,-90.0494384765625 20.715015145512098,-89.99450683593753 21.279137394108716))", ('20151219', date(2015,12,29)), {"platformname":"Sentinel-2"})
>>> print len(products) >>> print len(products)
3 3
......
...@@ -25,10 +25,10 @@ class Index(object): ...@@ -25,10 +25,10 @@ class Index(object):
>>> Ind="NBAI" >>> Ind="NBAI"
>>> Indeex = Index("60", Ind) >>> Indeex = Index("60", Ind)
>>> for image in list_files: >>> for image in list_files:
>>> file = dir + "/" + image ... file = dir + "/" + image
>>> print"Applying Index " + Ind + "... ", image ... print"Applying Index " + Ind + "... ", image
>>> product=Read.ReadFilesSentinel(file,2) ... product=Read.ReadFilesSentinel(file,2)
>>> Indeex.Index(product, file) ... Indeex.Index(product, file)
""" """
......
...@@ -12,11 +12,9 @@ Test Case ...@@ -12,11 +12,9 @@ Test Case
""" """
import os,sys import os,sys
#sys.path.append(os.path.join(os.path.expandvars("%userprofile%"),".snap\snap-python"))
from os.path import expanduser from os.path import expanduser
home = expanduser("~") home = expanduser("~")
a=os.path.join(os.path.expandvars(home),".snap/snap-python/") a=os.path.join(os.path.expandvars(home),".snap/snap-python/")
print"SNAPPY..",a
sys.path.append(a) sys.path.append(a)
import cv2 import cv2
import snappy,numpy import snappy,numpy
......
...@@ -7,11 +7,9 @@ Example: ...@@ -7,11 +7,9 @@ Example:
""" """
import os,sys import os,sys
#sys.path.append(os.path.join(os.path.expandvars("%userprofile%"),".snap\snap-python"))
from os.path import expanduser from os.path import expanduser
home = expanduser("~") home = expanduser("~")
a=os.path.join(os.path.expandvars(home),".snap/snap-python/") a=os.path.join(os.path.expandvars(home),".snap/snap-python/")
print"SNAPPY..",a
sys.path.append(a) sys.path.append(a)
import snappy import snappy
from snappy import HashMap,jpy,Product,ProductData,ProductIO,ProductUtils from snappy import HashMap,jpy,Product,ProductData,ProductIO,ProductUtils
...@@ -29,10 +27,10 @@ class Resampling(object): ...@@ -29,10 +27,10 @@ class Resampling(object):
>>> Read=readProduct(dir,platform) >>> Read=readProduct(dir,platform)
>>> Resam = Resampling("60") >>> Resam = Resampling("60")
>>> for image in list_files: >>> for image in list_files:
>>> file = dir + "/" + image ... file=dir+"/"+image
>>> print"Applying Resampling... ", image ... print"Applying Resampling... ", image
>>> product=Read.ReadFilesSentinel(file,1) ... product=Read.ReadFilesSentinel(file,1)
>>> Resam.Resample(product, file) ... Resam.Resample(product, file)
""" """
def __init__(self,ResolSize): def __init__(self,ResolSize):
......
...@@ -27,16 +27,16 @@ class SubSet(object): ...@@ -27,16 +27,16 @@ class SubSet(object):
>>> list_files=Files.findFilesSentinel(dir,platform,3) >>> list_files=Files.findFilesSentinel(dir,platform,3)
>>> print 'There is/are %d ' % len(list_files) + platform + ' file(s)' >>> print 'There is/are %d ' % len(list_files) + platform + ' file(s)'
>>> Read=readProduct(dir,platform) >>> Read=readProduct(dir,platform)
>>> widthX="552" >>> widthX="0"
>>> heigthX="0" >>> heigthX="0"
>>> widthY="1764" >>> widthY="588"
>>> heigthY="1080" >>> heigthY="636"
>>> SubSeet = SubSet("60", widthX, heigthX, widthY, heigthY) >>> SubSeet = SubSet("60", widthX, heigthX, widthY, heigthY)
>>> for image in list_files: >>> for image in list_files:
>>> file = dir + "/" + image ... file = dir + "/" + image
>>> print"Applying SubSet... ", image ... print"Applying SubSet... ", image
>>> product=Read.ReadFilesSentinel(file,2) ... product=Read.ReadFilesSentinel(file,2)
>>> SubSeet.subSet(product, file) ... SubSeet.subSet(product, file)
""" """
def __init__(self,ResolSize,widthX,heigthX,widthY,heigthY): def __init__(self,ResolSize,widthX,heigthX,widthY,heigthY):
......
...@@ -26,11 +26,11 @@ class readProduct(object): ...@@ -26,11 +26,11 @@ class readProduct(object):
>>> print 'There is/are %d ' % len(list_files) + platform + ' file(s)' >>> print 'There is/are %d ' % len(list_files) + platform + ' file(s)'
>>> Read=readProduct(dir,platform) >>> Read=readProduct(dir,platform)
>>> for image in list_files: >>> for image in list_files:
>>> file = dir + "/" + image ... file = dir + "/" + image
>>> print"Reading image... ", image ... print"Reading image... ", image
>>> product=Read.ReadFilesSentinel(file,1) ... product=Read.ReadFilesSentinel(file,1)
>>> band_names = product.getBandNames() ... band_names = product.getBandNames()
>>> print("Bands: %s" % (list(band_names))) ... print("Bands: %s" % (list(band_names)))
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment