Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
import wx | |
import datetime | |
import sys | |
import os | |
import zipfile,StringIO | |
import json | |
import csv | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mechanize | |
import cookielib | |
#Dealing with Unicode encoding.... | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf8') | |
#Emulate browser.... | |
br = mechanize.Browser() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
#THIS SEEMS TO WORK OK....REQUESTS.SESSION() SHOULD DEAL WITH THE COOKIES AND KEEP THE USER LOGGED BUT IT DOESN`T... | |
class SessionGoogle: | |
def __init__(self, url_login, url_auth, login, pwd): | |
self.ses = requests.session() | |
login_html = self.ses.get(url_login) | |
soup_login = BeautifulSoup(login_html.content).find('form').find_all('input') | |
my_dict = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import urllib2 | |
import urllib | |
import xml.etree.ElementTree | |
#UPDATE | |
address="http://epicollectserver.appspot.com/getMapXML?projectKey=ahZzfmVwaWNvbGxlY3RzZXJ2ZXItaHJkchQLEgdQcm9qZWN0GICAgO7L-YsKDA" | |
Remote_XML = urllib2.urlopen(address) | |
Local="Local_XML.xml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
import urllib2 | |
import sys | |
import numpy as np | |
from osgeo import gdal | |
GDAL_OPTS = ["COMPRESS=LZW","INTERLEAVE=PIXEL", "TILED=YES",\ | |
"SPARSE_OK=TRUE", "BIGTIFF=YES" ] | |
"""Taking 4 variables as an input (shapefile of our region of interest, basename of the ROI for Landsat image (e.g.LC8009061), year, first doy (day of year) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""by Alfonso Diz-Lois""" | |
def Binary_from_decimal(number,bitcount=None): | |
Binary=[] | |
while number>1: | |
if number%2==0: | |
Binary.insert(0,0) | |
if number%2==1: | |
Binary.insert(0,1) | |
number=number/2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" - Bhattacharyya distance, Euclidean distance, and Spectral angle calculator for multivariate samples - | |
It assumes that there are the same amount of non-valid values in every band. | |
Input files are multiband raster layers | |
Alfonso Diz-Lois <dizlois@gmail.com>""" | |
NewerOlder