diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..7093930752e4234da1ca6825b8db3ac8a1174883 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.pyc +*.log* diff --git a/Archive.py b/Archive.py index a57e752d77d28bc54b75a0f3bb62a8a85a334a6f..b47b25969ae81126b94bf0954c18a0dd177ac59f 100644 --- a/Archive.py +++ b/Archive.py @@ -17,49 +17,50 @@ # You should have received a copy of the GNU General Public License # along with PHYMOBAT 3.0. If not, see <http://www.gnu.org/licenses/>. -import os, sys, glob, re, shutil, time -import math, subprocess, json, urllib2 +import os, sys, glob, re, time +import math, subprocess, json +import urllib.request import tarfile, zipfile +import requests try : import ogr except : - from osgeo import ogr + import osgeo.ogr as org -import UserDict import numpy as np -from lxml import etree -from collections import defaultdict +import lxml +from collections import defaultdict, UserDict +import Constantes, Satellites, Outils -from RasterSat_by_date import RasterSat_by_date +import RasterSat_by_date class Archive(): """ - Class to list, download and unpack Theia image archive because of a shapefile (box). - This shapefile get extent of the area. - - :param captor: Name of the satellite (ex: Landsat or SpotWorldHeritage ...). - - Name used to the url on website Theia Land - :type captor: str - :param list_year: Processing's year (string for one year) - :type list_year: list of str - :param box: Path of the study area - :type box: str - :param folder: Path of the source folder - :type folder: str - :param repertory: Name of the archive's folder - :type repertory: str + Class to list, download and unpack Theia image archive because of a shapefile (box). + This shapefile get extent of the area. + + :param captor: Name of the satellite (ex: Landsat or SpotWorldHeritage ...). + + Name used to the url on website Theia Land + :type captor: str + :param list_year: Processing's year (string for one year) + :type list_year: list of str + :param box: Path of the study area + :type box: str + :param folder: Path of the source folder + :type folder: str + :param repertory: Name of the archive's folder + :type repertory: str """ - def __init__(self, captor, list_year, box, folder, repertory, proxy_enabled): - """Create a new 'Archive' instance - + def __init__(self, captor, list_year, box, repertory, proxy_enabled): + """ + Create a new 'Archive' instance """ self._captor = captor self._list_year = list_year.split(";") self._box = box - self._folder = folder self._repertory = repertory self._proxy_enabled = proxy_enabled @@ -67,64 +68,54 @@ class Archive(): # 1. List of the website path archives # 2. List of the local path archives self.list_archive = [] - self.server = '' # Host - self.resto ='' - # Info from Theia-land website or Olivier Hagolle blog - if self._captor == 'SENTINEL2': - self.server = 'https://theia.cnes.fr/atdistrib' - self.resto = 'resto2' - self.token_type = 'text' - else: - self.server = 'https://theia-landsat.cnes.fr' - self.resto = 'resto' - self.token_type = 'json' + + self.logger = Outils.Log("Log", "archive") + + self.server = Satellites.SATELLITE[self._captor]["server"] + self.resto = Satellites.SATELLITE[self._captor]["resto"] + self.token_type = Satellites.SATELLITE[self._captor]["token_type"] + self.url = '' # str : complete website JSON database self.list_img = [] # List (dim 5) to get year, month, day, path of multispectral's images and path of cloud's images self.single_date = [] # date list without duplication - - def __str__(self) : - return 'Year\'s list : ', self._list_year - + def set_list_archive_to_try(self, few_list_archive): """ - Test function to download a few archives - - :param few_list_archive: [archive_download, out_archive] - - with : - - * archive_dowload : Archives downloaded - - * out_archive : Output archives path - - :type few_list_archive: list dimension 2 + Test function to download a few archives + + :param few_list_archive: [archive_download, out_archive] with : + + * archive_dowload : Archives downloaded + + * out_archive : Output archives path + + :type few_list_archive: list dimension 2 """ _few_list_archive = np.array(few_list_archive) # Verify list informations if _few_list_archive.ndim < 2: - print 'Few information in the list' + self.logger.info('Few information in the list') else: self.list_archive = few_list_archive def utm_to_latlng(self, zone, easting, northing, northernHemisphere=True): """ - Function to convert UTM to geographic coordinates - - :param zone: UTM zone - :type zone: int - :param easting: Coordinates UTM in x - :type easting: float - :param northing: Coordinates UTM in y - :type northing: float - :param northernHemisphere: North hemisphere or not - :type northernHemisphere: boolean - - :returns: tuple -- integer on the **longitude** and **latitude** - - Source : http://www.ibm.com/developerworks/java/library/j-coordconvert/index.html - + Function to convert UTM to geographic coordinates + + :param zone: UTM zone + :type zone: int + :param easting: Coordinates UTM in x + :type easting: float + :param northing: Coordinates UTM in y + :type northing: float + :param northernHemisphere: North hemisphere or not + :type northernHemisphere: boolean + + :returns: tuple -- integer on the **longitude** and **latitude** + + Source : http://www.ibm.com/developerworks/java/library/j-coordconvert/index.html """ if not northernHemisphere: @@ -179,18 +170,18 @@ class Archive(): def coord_box_dd(self): """ - Function to get area's coordinates of shapefile + Function to get area's coordinates of shapefile - :returns: str -- **area_coord_corner** : Area coordinates corner - - --> Left bottom on x, Left bottom on y, Right top on x, Right top on y - :Example: - - >>> import Archive - >>> test = Archive(captor, list_year, box, folder, repertory, proxy_enabled) - >>> coor_test = test.coord_box_dd() - >>> coor_test - '45.52, 2.25, 46.71, 3.27' + :returns: str -- **area_coord_corner** : Area coordinates corner + + --> Left bottom on x, Left bottom on y, Right top on x, Right top on y + :Example: + + >>> import Archive + >>> test = Archive(captor, list_year, box, folder, repertory, proxy_enabled) + >>> coor_test = test.coord_box_dd() + >>> coor_test + '45.52, 2.25, 46.71, 3.27' """ # Processus to convert the UTM shapefile in decimal degrees shapefile with ogr2ogr in command line @@ -208,7 +199,7 @@ class Archive(): data_source = driver.Open(utm_outfile, 0) if data_source is None: - print 'Could not open file' + self.logger.error('Could not open file') sys.exit(1) shp_ogr = data_source.GetLayer() @@ -230,56 +221,43 @@ class Archive(): def listing(self): """ - Function to list available archive on plateform Theia Land, and on the area - + Function to list available archive on plateform Theia Land, and on the area """ # Loop on the years - print "Images availables" + self.logger.info("Images availables") for year in self._list_year: first_date = year.split(',')[0] # Tricks to put whether a year or a date (year-month-day) try: end_date = year.split(',')[1] - print "=============== " + str(first_date) + " to " + str(end_date) + " ===============" - self.url = self.server + '/' + self.resto + '/api/collections/' + self._captor + '/search.json?lang=fr&_pretty=true&completionDate=' + str(end_date) + '&box=' + self.coord_box_dd() + '&maxRecord=500&startDate=' + str(first_date) - + self.logger.info("=============== {0} to {1} ===============".format(first_date, end_date)) + self.url = "{0}/{1}/api/collections/{2}/search.json?lang=fr&_pretty=true&completionDate={3}&box={4}&maxRecord=500&startDate={5}".format(self.server, self.resto, self._captor, end_date, self.coord_box_dd(), first_date) except IndexError: - print "=============== " + str(first_date) + " ===============" - self.url = self.server + '/' + self.resto + '/api/collections/' + self._captor + '/search.json?lang=fr&_pretty=true&q=' + str(year) + '&box=' + self.coord_box_dd() + '&maxRecord=500' + self.logger.info("=============== {0} ===============".format(first_date)) + self.url = "{0}/{1}/api/collections/{2}/search.json?lang=fr&_pretty=true&q={3}&box={4}&maxRecord=500".format(self.server, self.resto, self._captor, year, self.coord_box_dd()) - print self.url - # Link to connect in the database JSON of the Theia plateform -# self.url = r'https://theia.cnes.fr/resto/api/collections/' + self._captor + '/search.json?lang=fr&_pretty=true&q=' + str(year) + '&box=' + self.coord_box_dd() + '&maxRecord=500' - # Temporary link -# if self._captor == 'SENTINEL2': -# self.url = r'https://theia.cnes.fr/atdistrib/resto2/api/collections/' -# else: -# self.url = r'https://theia-landsat.cnes.fr/resto/api/collections/' - # Initialisation variable for a next page # There is a next page, next = 1 # There isn't next page, next = 0 - next_ = 1 - if not os.path.exists(self._folder + '/' + self._repertory): - os.mkdir(self._folder + '/' + self._repertory) + next_ = 1 # To know path to download images while next_ == 1: try : - request_headers = {"User-Agent": "Firefox/48.0"} - req = urllib2.Request(str(self.url), headers = request_headers) # Connexion in the database - data = urllib2.urlopen(req).read() # Read in the database - - new_data = re.sub("null", "'null'", data) # Remove "null" because Python don't like - new_data = re.sub("false", "False", new_data) # Remove "false" and replace by False (Python know False with a capital letter F) - + request_headers = {"User-Agent": "Magic-browser"} + req = urllib.request.Request(self.url, headers = request_headers) # Connexion in the database + data = urllib.request.urlopen(req).read() # Read in the database + + new_data = re.sub(b"null", b"'null'", data) # Remove "null" because Python don't like + new_data = re.sub(b"false", b"False", new_data) # Remove "false" and replace by False (Python know False with a capital letter F) + # Transform the data in dictionary data_Dict = defaultdict(list) - data_Dict = UserDict.UserDict(eval(new_data)) - + data_Dict = UserDict(eval(new_data)) + # Select archives to download for d in range(len(data_Dict['features'])): name_archive = data_Dict['features'][d]['properties']['productIdentifier'] @@ -287,91 +265,82 @@ class Archive(): link_archive = data_Dict['features'][d]['properties']['services']['download']['url'].replace("\\", "") url_archive = link_archive.replace(self.resto, "rocket/#") archive_download = url_archive.replace("/download", "") # Path to download - out_archive = self._folder + '/' + self._repertory + '/' + name_archive + '.tgz' # Name after download - self.list_archive.append([archive_download, out_archive, feature_id]) + out_archive = "{0}/{1}.tgz".format(self._repertory, name_archive)# Name after download + # if len(self.list_archive) == 0 : self.list_archive.append([archive_download, out_archive, feature_id]) + self.list_archive.append([archive_download, out_archive, feature_id]) # Verify if there is another page (next) if data_Dict['properties']['links'][len(data_Dict['properties']['links'])-1]['title'] == 'suivant': self.url = data_Dict['properties']['links'][len(data_Dict['properties']['links'])-1]['href'].replace("\\", "") else: next_ = 0 - except: - print "Error connexion or error variable !" + + except Exception as e: + self.logger.error("Error connexion or error variable : {0}".format(e)) sys.exit(1) - print "There is " + str(len(self.list_archive)) + " images to download !" + self.logger.info("{0} image(s) matched the criteria.".format(len(self.list_archive))) + + return len(self.list_archive) def download_auto(self, user_theia, password_theia): """ - Function to download images archive automatically on Theia land data center. - Source : https://github.com/olivierhagolle/theia_download - - :param user_theia: Username Theia Land data center - :type user_theia: str - :param password_theia: Password Theia Land data center - :type password_theia: str - + Function to download images archive automatically on Theia land data center. + Source : https://github.com/olivierhagolle/theia_download + + :param user_theia: Username Theia Land data center + :type user_theia: str + :param password_theia: Password Theia Land data center + :type password_theia: str """ - #===================== - # Proxy - #===================== - curl_proxy = "" - try: - if self._proxy_enabled.proxy != '': - curl_proxy = str("-x %s" % (self._proxy_enabled.proxy)) - if self._proxy_enabled.login_proxy != '' and self._proxy_enabled.password_proxy != '': - curl_proxy = curl_proxy + str(" --proxy-user %s:%s" % (self._proxy_enabled.login_proxy, self._proxy_enabled.password_proxy)) - except AttributeError: - pass - + #============================================================ # get a token to be allowed to bypass the authentification. # The token is only valid for two hours. If your connection is slow # or if you are downloading lots of products #============================================================= - if os.path.exists('token.json'): - os.remove('token.json') -# get_token='curl -k -s -X POST --data-urlencode "ident=%s" --data-urlencode "pass=%s" https://theia.cnes.fr/services/authenticate/>token.json'%(curl_proxy,user_theia, password_theia) - get_token='curl -k -s -X POST %s --data-urlencode "ident=%s" --data-urlencode "pass=%s" %s/services/authenticate/>token.json'%(curl_proxy, user_theia, password_theia, self.server) - os.system(get_token) - - with open('token.json') as data_file: - try: - if self.token_type == "json": - token_json = json.load(data_file) - token = token_json["access_token"] - elif self.token_type=="text": - token=data_file.readline() - except : - print "Authentification is probably wrong" - sys.exit(-1) + + proxyDict = { + "http" : "{0}".format(self._proxy_enabled.proxy), \ + "https" : "{0}".format(self._proxy_enabled.proxy), \ + "ftp" : "{0}".format(self._proxy_enabled.proxy) \ + } + + url = "{0}/services/authenticate/".format(self.server) + payload = {'ident' : "{0}".format(user_theia), 'pass' : "{0}".format(password_theia)} + + reponse = requests.post(url, data=payload, proxies=proxyDict) + + try: + token = reponse.json()["access_token"] + except Exception as e: + self.logger.error("Error during the identification request") + sys.exit(-1) #==================== # Download #==================== # Loop on list archive to download images + head = {"Authorization": "Bearer {0}".format(token)} for d in range(len(self.list_archive)): + # Download if not exist if not os.path.exists(self.list_archive[d][1]): - - print str(round(100*float(d)/len(self.list_archive),2)) + "%" # Print loading bar - print os.path.split(str(self.list_archive[d][1]))[1] + self.logger.info("Téléchargement : {0}".format(os.path.basename(self.list_archive[d][1]))) + url = "{0}/{1}/collections/{2}/{3}/download/?issuerId=theia".format(self.server, self.resto, self._captor, self.list_archive[d][2]) + reponse = requests.get(url, headers=head, proxies=proxyDict) -# get_product='curl -o %s -k -H "Authorization: Bearer %s" https://theia.cnes.fr/resto/collections/Landsat/%s/download/?issuerId=theia'%(curl_proxy,self.list_archive[d][1], token, self.list_archive[d][2]) - get_product='curl %s -o %s -k -H "Authorization: Bearer %s" %s/%s/collections/%s/%s/download/?issuerId=theia'%(curl_proxy, self.list_archive[d][1], token, self.server, self.resto, self._captor, self.list_archive[d][2]) - print get_product - os.system(get_product) - - os.remove('token.json') - print "100%" - print "END OF DOWNLOAD !" + with (open(self.list_archive[d][1], "wb")) as fichier : + fichier.write(reponse.content) + + self.logger.info("All images have been downloaded !") def decompress(self): """ - Function to unpack archives and store informations of the images (date, path, ...) + Function to unpack archives and store informations of the images (date, path, ...) """ - print "Unpack archives" + self.logger.info("Unpack archives") for annee in self._list_year: @@ -379,39 +348,33 @@ class Archive(): # Tricks to put whether a year or a date (year-month-day) try: end_date = annee.split(',')[1] - print "=============== " + str(first_date) + " to " + str(end_date) + " ===============" + self.logger.info("=============== {0} to {1} ===============".format(first_date, end_date)) except IndexError: - print "=============== " + str(first_date) + " ===============" + self.logger.info ("=============== {0} ===============".format(first_date)) - img_in_glob = [] - img_in_glob = glob.glob(str(self._folder) + '/'+ str(self._repertory) + '/*gz') + img_in_glob = sorted(glob.glob("{0}/*gz".format(self._repertory))) - if img_in_glob == []: - print "There isn't tgzfile in the folder" - sys.exit() + if not img_in_glob : + self.logger.error("There isn't tgzfile in the folder") + sys.exit(1) else: # Create a folder "Unpack" - folder_unpack = self._folder + '/' + self._repertory + '/Unpack' + folder_unpack = "{0}/Unpack".format(self._repertory) - if os.path.isdir(folder_unpack): - print('The folder already exists') - # shutil.rmtree(FolderOut) # Remove the folder that it contains if exists ... - else: - process_tocall = ['mkdir', folder_unpack] - subprocess.call(process_tocall) + if not os.path.isdir(folder_unpack): + os.mkdir(folder_unpack) for img in img_in_glob: - # Unpack the archives if they aren't again! if self._captor == 'Landsat': out_folder_unpack = folder_unpack + '/' + os.path.split(img)[1][:len(os.path.split(img)[1])-4] if not os.path.exists(out_folder_unpack): - print 'Unpack :'+os.path.split(img)[1] + self.logger.info('Unpack :'+os.path.split(img)[1]) tfile = tarfile.open(img, 'r:gz') tfile.extractall(str(folder_unpack)) # On xmlfile, extract dates, path of images, cloud's images - xmlfile = etree.parse(str(out_folder_unpack) + '/' + os.path.split(img)[1][:len(os.path.split(img)[1])-4] + '.xml') + xmlfile = lxml.etree.parse(str(out_folder_unpack) + '/' + os.path.split(img)[1][:len(os.path.split(img)[1])-4] + '.xml') # Date images # Exemple : '2015-09-27 10:41:25.956749' @@ -422,7 +385,7 @@ class Archive(): # Cloud images # Cloud's path not exists in xmlfile, then replace 'SAT' by 'NUA' ci = out_folder_unpack + '/' + xmlfile.xpath("/METADATA/FILES/MASK_SATURATION")[0].text.replace('_SAT', '_NUA') - + elif self._captor == 'SENTINEL2': tzip = zipfile.ZipFile(img) @@ -432,17 +395,17 @@ class Archive(): zip_folder = zip_img[0].split('/')[0] out_folder_unpack = folder_unpack + '/' + zip_folder - print 'Unpack :' + os.path.split(zip_folder)[1] + self.logger.info('Unpack :' + os.path.split(zip_folder)[1]) extraction_img = [] for e in extent_img: z_out = [f for f in zip_img if e in f][0] extraction_img.append(folder_unpack + '/' + str(z_out)) if not os.path.exists(folder_unpack + '/' + str(z_out)): - print('Extract :%s' %(z_out)) + self.logger.info('Extract :%s' %(z_out)) tzip.extract(str(z_out), str(folder_unpack)) # On xmlfile, extract dates, path of images, cloud's images - xmlfile = etree.parse(str(extraction_img[4])) + xmlfile = lxml.etree.parse(str(extraction_img[4])) # Date images di = xmlfile.xpath("/Muscate_Metadata_Document/Product_Characteristics/ACQUISITION_DATE")[0].text.split('T')[0].split('-') # Multispectral images @@ -450,19 +413,19 @@ class Archive(): if not os.path.exists(hi): # For Sentinel2 from Theia plateform, we need to make a stack layer for rasters # There is a function that make this in RasterSat_by_date class - stack_img = RasterSat_by_date('', '', [0]) + stack_img = RasterSat_by_date.RasterSat_by_date('', '', [0]) input_stack = extraction_img[:4] input_stack.insert(0,'-separate') stack_img.vrt_translate_gdal('vrt', input_stack, hi[:-4] + '.VRT') stack_img.vrt_translate_gdal('translate', hi[:-4] + '.VRT', hi) # Cloud images + ci = out_folder_unpack + '/' + xmlfile.xpath("/Muscate_Metadata_Document/Product_Organisation/Muscate_Product/Mask_List/Mask/Mask_File_List/MASK_FILE")[2].text - + self.list_img.append([di[0], di[1], di[2], str(hi), str(ci)]) # Create a list with dates without duplicates if not di in self.single_date: self.single_date.append(di) - - print "End of unpack archives" - + + self.logger.info("End of unpack archives.") \ No newline at end of file diff --git a/Constantes.py b/Constantes.py new file mode 100644 index 0000000000000000000000000000000000000000..35adb0d269297ea0ec45febb1785366270c5c7eb --- /dev/null +++ b/Constantes.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import logging + +NIVEAU_DEFAUT = logging.DEBUG + +SIMPLE_MODE = 0 +EXPERT_MODE = 1 + +MULTIPROCESSING_ENABLE = True +MULTIPROCESSING_DISABLE = False + +CLOUD_THRESHOLD = 0.4 + +EPSG_PHYMOBAT = 2154 diff --git a/Documentation/API.html b/Documentation/API.html deleted file mode 100644 index 0828e5db16d82857e27a0381a3ce8b2f3f5ef675..0000000000000000000000000000000000000000 --- a/Documentation/API.html +++ /dev/null @@ -1,811 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - -<html xmlns="http://www.w3.org/1999/xhtml" lang="fr"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Graphical User Interface package — documentation PHYMOBAT 3.0</title> - - <link rel="stylesheet" href="_static/classic.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: './', - VERSION: '3.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true, - SOURCELINK_SUFFIX: '.txt' - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/translations.js"></script> - <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> - <link rel="index" title="Index" href="genindex.html" /> - <link rel="search" title="Recherche" href="search.html" /> - <link rel="prev" title="CarHab Phy MOBA package" href="package.html" /> - </head> - <body role="document"> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="Index général" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Index des modules Python" - >modules</a> |</li> - <li class="right" > - <a href="package.html" title="CarHab Phy MOBA package" - accesskey="P">précédent</a> |</li> - <li class="nav-item nav-item-0"><a href="PHYMOBAT_documentation.html">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body" role="main"> - - <div class="section" id="graphical-user-interface-package"> -<h1>Graphical User Interface package<a class="headerlink" href="#graphical-user-interface-package" title="Lien permanent vers ce titre">¶</a></h1> -<p>The class diagram associated to the interface is this :</p> -<div class="figure align-center"> -<img alt="Class diagram Interface" src="_images/ChainedeTraitementCarHab_API_UML_v3.png" /> -</div> -<div class="section" id="module-PHYMOBAT"> -<span id="interface-command"></span><h2>Interface command<a class="headerlink" href="#module-PHYMOBAT" title="Lien permanent vers ce titre">¶</a></h2> -<p>Interface main, PHYMOBAT (FB PHYsionomiquedes Milieux Ouverts de Basse Altitude par Télédétection)</p> -<p>__name__ = “PHYMOBAT 3.0”</p> -<p>__license__ = “GPL”</p> -<p>__version__ = “3.0”</p> -<p>__author__ = “LAVENTURE Sylvio - UMR TETIS / IRSTEA”</p> -<p>__date__ = “Mars 2016”</p> -<dl class="class"> -<dt id="PHYMOBAT.MyPopup_about"> -<em class="property">class </em><code class="descclassname">PHYMOBAT.</code><code class="descname">MyPopup_about</code><span class="sig-paren">(</span><em>parent=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#MyPopup_about"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.MyPopup_about" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Popup to display “About PHYMOBAT”. In this windows, it prints informations on the processing, license -and version.</p> -<dl class="method"> -<dt id="PHYMOBAT.MyPopup_about.close_window"> -<code class="descname">close_window</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#MyPopup_about.close_window"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.MyPopup_about.close_window" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to close the “A propos PHYMOBAT”.</p> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="PHYMOBAT.MyPopup_proxy_window"> -<em class="property">class </em><code class="descclassname">PHYMOBAT.</code><code class="descname">MyPopup_proxy_window</code><span class="sig-paren">(</span><em>parent=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#MyPopup_proxy_window"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.MyPopup_proxy_window" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Popup to display a message to tell you if you fogotten to enter a raster or a sample.</p> -<dl class="method"> -<dt id="PHYMOBAT.MyPopup_proxy_window.close_window"> -<code class="descname">close_window</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#MyPopup_proxy_window.close_window"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.MyPopup_proxy_window.close_window" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to close the popup.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.MyPopup_proxy_window.id_proxy"> -<code class="descname">id_proxy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#MyPopup_proxy_window.id_proxy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.MyPopup_proxy_window.id_proxy" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to use input proxy id</p> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="PHYMOBAT.MyPopup_warming_forgetting"> -<em class="property">class </em><code class="descclassname">PHYMOBAT.</code><code class="descname">MyPopup_warming_forgetting</code><span class="sig-paren">(</span><em>parent=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#MyPopup_warming_forgetting"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.MyPopup_warming_forgetting" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Popup to display a message to tell you if you fogotten to enter a raster or a sample.</p> -<dl class="method"> -<dt id="PHYMOBAT.MyPopup_warming_forgetting.close_window"> -<code class="descname">close_window</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#MyPopup_warming_forgetting.close_window"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.MyPopup_warming_forgetting.close_window" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to close the popup.</p> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="PHYMOBAT.MyPopup_warming_study_area"> -<em class="property">class </em><code class="descclassname">PHYMOBAT.</code><code class="descname">MyPopup_warming_study_area</code><span class="sig-paren">(</span><em>parent=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#MyPopup_warming_study_area"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.MyPopup_warming_study_area" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Popup to display a message to say there isn’t declared study area file.</p> -<dl class="method"> -<dt id="PHYMOBAT.MyPopup_warming_study_area.close_window"> -<code class="descname">close_window</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#MyPopup_warming_study_area.close_window"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.MyPopup_warming_study_area.close_window" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to close the popup.</p> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="PHYMOBAT.PHYMOBAT"> -<em class="property">class </em><code class="descclassname">PHYMOBAT.</code><code class="descname">PHYMOBAT</code><span class="sig-paren">(</span><em>mode=0</em>, <em>parent=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Interface main class. It makes to link <code class="docutils literal"><span class="pre">ui_PHYMOBAT_tab</span></code> and <code class="docutils literal"><span class="pre">Processing</span></code>.</p> -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.about_PHYMOBA"> -<code class="descname">about_PHYMOBA</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.about_PHYMOBA"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.about_PHYMOBA" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to open a new window “About PHYMOBAT”</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.activate_level"> -<code class="descname">activate_level</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.activate_level"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.activate_level" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>To activate the first levels with seath method. This is in pushing on the decision tree radio button. -Else it activates the last level to random forest method.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.add_sample"> -<code class="descname">add_sample</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.add_sample"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.add_sample" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Add sample information and location to compute optimal threshold :</p> -<p>For the expert mode (mode=1) :</p> -<ul> -<li><p class="first">Append a sample name by line Edit. <em>This is a check box</em> <code class="docutils literal"><span class="pre">RPG</span></code>, <em>if the sample is RPG file. It launch the Rpg class. And append a other sample from Rpg class</em>.</p> -</li> -<li><p class="first">Append two existent sample field names by combobox. It will be the same.</p> -</li> -<li><p class="first">Append sample class names by line edit. One or more for every sample.</p> -</li> -<li><p class="first">Append number of polygons for every samples by line edit.</p> -</li> -<li><p class="first">Print in a plain text edit : sample name, two sample field names, sample class names and number of polygons.</p> -</li> -<li><dl class="first docutils"> -<dt><em>This check box</em> <code class="docutils literal"><span class="pre">Image</span> <span class="pre">echantillonee</span></code>, <em>image path for samples if the first processing image hasn’t been launched</em>.</dt> -<dd><div class="first last admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">This is for a image with one spectral band</p> -</div> -</dd> -</dl> -</li> -<li><p class="first">Clear all widget field at the end.</p> -</li> -</ul> -<p>For the simply mode (mode=0):</p> -<ul class="simple"> -<li>Append a sample name by a different line Edit (a line Edit for each sample).</li> -<li>Append sample class names, existing sample fields and number of polygons (a different line Edit for each sample)</li> -</ul> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.block_for_swh"> -<code class="descname">block_for_swh</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.block_for_swh"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.block_for_swh" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to block others function when SportWorldHeritage is selected in the comboxbox captor.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.clear_sample"> -<code class="descname">clear_sample</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.clear_sample"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.clear_sample" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to clear sample record. Clear in the interface and in the memory list.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.close_button"> -<code class="descname">close_button</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.close_button"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.close_button" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to close the interface.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.display_all_levels"> -<code class="descname">display_all_levels</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.display_all_levels"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.display_all_levels" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to display fieldnames option to launch complete classification</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.display_one_level"> -<code class="descname">display_one_level</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.display_one_level"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.display_one_level" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to display fieldnames option to classifier one level</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.display_two_levels"> -<code class="descname">display_two_levels</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.display_two_levels"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.display_two_levels" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to display fieldnames option to classifier two first levels</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.enter_sample_name"> -<code class="descname">enter_sample_name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.enter_sample_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.enter_sample_name" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Open a input browser box to select the sample shapefile path by line edit. With <a class="reference internal" href="#PHYMOBAT.PHYMOBAT.add_sample" title="PHYMOBAT.PHYMOBAT.add_sample"><code class="xref py py-func docutils literal"><span class="pre">add_sample()</span></code></a> conditions for the expert mode. -For the simply mode, this function is used for the RPG shapefile.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.enter_sample_name_hl"> -<code class="descname">enter_sample_name_hl</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.enter_sample_name_hl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.enter_sample_name_hl" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Open a input browser box to select the grass and wooden sample shapefile path by line edit. With <a class="reference internal" href="#PHYMOBAT.PHYMOBAT.add_sample" title="PHYMOBAT.PHYMOBAT.add_sample"><code class="xref py py-func docutils literal"><span class="pre">add_sample()</span></code></a> conditions -for the simply mode.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.enter_sample_name_ll"> -<code class="descname">enter_sample_name_ll</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.enter_sample_name_ll"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.enter_sample_name_ll" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Open a input browser box to select the wooden sample shapefile path by line edit. With <a class="reference internal" href="#PHYMOBAT.PHYMOBAT.add_sample" title="PHYMOBAT.PHYMOBAT.add_sample"><code class="xref py py-func docutils literal"><span class="pre">add_sample()</span></code></a> conditions for the simply mode.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.f_output_name_moba"> -<code class="descname">f_output_name_moba</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.f_output_name_moba"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.f_output_name_moba" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Set the output classification shapefile path by line edit.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.f_path_area"> -<code class="descname">f_path_area</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.f_path_area"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.f_path_area" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Open a input browser box to select the study area shapefile path by line edit.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.f_path_folder_dpt"> -<code class="descname">f_path_folder_dpt</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.f_path_folder_dpt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.f_path_folder_dpt" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Open a input browser box to select the main folder path by line edit.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.f_path_mnt"> -<code class="descname">f_path_mnt</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.f_path_mnt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.f_path_mnt" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Open a input browser box to select the MNT image path by line edit.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.f_path_ortho"> -<code class="descname">f_path_ortho</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.f_path_ortho"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.f_path_ortho" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Open a input browser box to select the VHRS image path by line edit.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.f_path_segm"> -<code class="descname">f_path_segm</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.f_path_segm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.f_path_segm" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Open a input browser box to select segmentation shapefile path path by line edit.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.f_proxy"> -<code class="descname">f_proxy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.f_proxy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.f_proxy" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to open a popup in order to enter proxy ID</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.field_display_1"> -<code class="descname">field_display_1</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.field_display_1"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.field_display_1" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to display fieldname class 1 in the other fieldname class 2 when text changed. -For the simply mode, this is RPG sample.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.field_display_2"> -<code class="descname">field_display_2</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.field_display_2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.field_display_2" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to display fieldname class 2 in the other fieldname class 2 when text changed. -For the simply mode, this is RPG sample.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.field_display_3"> -<code class="descname">field_display_3</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.field_display_3"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.field_display_3" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>For the grass/wooden sample, a function to display fieldname class 1 in the other fieldname class 2 when text changed.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.field_display_4"> -<code class="descname">field_display_4</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.field_display_4"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.field_display_4" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>For the grass/wooden sample, a function to display fieldname class 2 in the other fieldname class 2 when text changed.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.field_display_5"> -<code class="descname">field_display_5</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.field_display_5"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.field_display_5" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>For the wooden sample, a function to display fieldname class 1 in the other fieldname class 2 when text changed.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.field_display_6"> -<code class="descname">field_display_6</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.field_display_6"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.field_display_6" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>For the wooden sample, a function to display fieldname class 2 in the other fieldname class 2 when text changed.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.forget_raster_sample"> -<code class="descname">forget_raster_sample</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.forget_raster_sample"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.forget_raster_sample" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to open a new window ‘Alert’ because user forgotten to declare rasters or samples.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.forget_study_area"> -<code class="descname">forget_study_area</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.forget_study_area"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.forget_study_area" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to open a new window ‘Alert’ because user forgotten to declare study area.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.get_variable"> -<code class="descname">get_variable</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.get_variable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.get_variable" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Add a all system value like :</p> -<ul class="simple"> -<li>Main folder path by line edit</li> -<li>Satellite captor name by combo box</li> -<li>Classification year by line edit</li> -<li>Study area shapefile path by line edit</li> -<li>Connexion username and password by line edit</li> -<li>VHRS image path by line edit</li> -<li>MNT image path by line edit</li> -<li>Segmentation shapefile path path by line edit</li> -<li>Output classification shapefile path by line edit</li> -<li>Output shapefile field name by line edit and field type by combo box</li> -</ul> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.help_tools"> -<code class="descname">help_tools</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.help_tools"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.help_tools" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to open html help</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.img_sample_name"> -<code class="descname">img_sample_name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.img_sample_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.img_sample_name" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Open a input browser box to select the image for samples path by line edit. With <a class="reference internal" href="#PHYMOBAT.PHYMOBAT.add_sample" title="PHYMOBAT.PHYMOBAT.add_sample"><code class="xref py py-func docutils literal"><span class="pre">add_sample()</span></code></a> conditions.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.initUI"> -<code class="descname">initUI</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.initUI"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.initUI" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Get initial values from interface after a click button.</p> -<p>There is :</p> -<ul class="simple"> -<li><dl class="first docutils"> -<dt>Connect browser button to search a path</dt> -<dd><ul class="first last"> -<li>Main folder path</li> -<li>Study area shapefile path</li> -<li>VHRS image path</li> -<li>MNT image path</li> -<li>Segmentation shapefile path</li> -<li>Output classification shapefile path</li> -<li>Sample shapefile path</li> -<li>Image path for samples if the first processing image hasn’t been launched</li> -</ul> -</dd> -</dl> -</li> -<li>Connect button to add sample in the memory list</li> -<li>Connect button to clear sample record. Clear in the interface and in the memory list</li> -<li>Connect close|ok button</li> -<li>Connect menu bar tab (Open backup, save in a xml file, close, help, About PHYMOBAT, mode)</li> -<li>Initialize backup variable</li> -</ul> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.mode_expert"> -<code class="descname">mode_expert</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.mode_expert"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.mode_expert" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to open a new window in expert mode “PHYMOBATe”</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.mode_simpli"> -<code class="descname">mode_simpli</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.mode_simpli"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.mode_simpli" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to open a new window in simple mode “PHYMOBATs”</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.ok_button"> -<code class="descname">ok_button</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.ok_button"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.ok_button" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to launch the processing. This function take account :</p> -<ul class="simple"> -<li>The <code class="docutils literal"><span class="pre">Multi-processing</span></code> check box if the processing has launched with multi process. By default, this is checked. It need a computer with minimum 12Go memory.</li> -<li>Append a few system value with <a class="reference internal" href="#PHYMOBAT.PHYMOBAT.get_variable" title="PHYMOBAT.PHYMOBAT.get_variable"><code class="xref py py-func docutils literal"><span class="pre">get_variable()</span></code></a>.</li> -<li><dl class="first docutils"> -<dt>There are 3 principal check boxes :</dt> -<dd><ul class="first last"> -<li>to get number download available images</li> -<li>for downloading and processing on theia platform</li> -<li>to compute optimal threshold.</li> -<li>to compute slope raster</li> -<li>for classification processing.</li> -</ul> -</dd> -</dl> -</li> -</ul> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.open_backup"> -<code class="descname">open_backup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.open_backup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.open_backup" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to load input text in every fields. The input file must be a XML file.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.save_backup"> -<code class="descname">save_backup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.save_backup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.save_backup" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to save input text in every fields. The output file must be a XML file.</p> -</dd></dl> - -<dl class="method"> -<dt id="PHYMOBAT.PHYMOBAT.set_variable"> -<code class="descname">set_variable</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/PHYMOBAT.html#PHYMOBAT.set_variable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PHYMOBAT.PHYMOBAT.set_variable" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Print number of available image from Theia’s GeoJSON .</p> -</dd></dl> - -</dd></dl> - -<dl class="function"> -<dt id="PHYMOBAT.bin"> -<code class="descclassname">PHYMOBAT.</code><code class="descname">bin</code><span class="sig-paren">(</span><em>QTextStream</em><span class="sig-paren">)</span> → QTextStream<a class="headerlink" href="#PHYMOBAT.bin" title="Lien permanent vers cette définition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="PHYMOBAT.hex"> -<code class="descclassname">PHYMOBAT.</code><code class="descname">hex</code><span class="sig-paren">(</span><em>QTextStream</em><span class="sig-paren">)</span> → QTextStream<a class="headerlink" href="#PHYMOBAT.hex" title="Lien permanent vers cette définition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="PHYMOBAT.oct"> -<code class="descclassname">PHYMOBAT.</code><code class="descname">oct</code><span class="sig-paren">(</span><em>QTextStream</em><span class="sig-paren">)</span> → QTextStream<a class="headerlink" href="#PHYMOBAT.oct" title="Lien permanent vers cette définition">¶</a></dt> -<dd></dd></dl> - -</div> -<div class="section" id="module-Processing"> -<span id="control-processing"></span><h2>Control processing<a class="headerlink" href="#module-Processing" title="Lien permanent vers ce titre">¶</a></h2> -<dl class="class"> -<dt id="Processing.Processing"> -<em class="property">class </em><code class="descclassname">Processing.</code><code class="descname">Processing</code><a class="reference internal" href="_modules/Processing.html#Processing"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Processing.Processing" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Main processing. This class launch the others system classes. It take into account -CarHab classification method MOBA.</p> -<dl class="docutils"> -<dt>This way is broken down into 3 parts :</dt> -<dd><ul class="first last simple"> -<li>Image Processing (Search, download and processing)</li> -<li>Vector Processing (Optimal threshold, Sample processing)</li> -<li>Classification</li> -<li>Validation</li> -</ul> -</dd> -</dl> -<p><strong>Main parameters</strong></p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>captor_project</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Satellite captor name</li> -<li><strong>classif_year</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Classification year</li> -<li><strong>nb_avalaible_images</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#int" title="(disponible dans Python v2.7)"><em>int</em></a>) – Number download available images</li> -<li><strong>path_folder_dpt</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Main folder path</li> -<li><strong>folder_archive</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Archive downloaded folder path</li> -<li><strong>folder_processing</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Processing folder name. By default : ‘Traitement’</li> -<li><strong>path_area</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Study area shapefile</li> -<li><strong>path_ortho</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – VHRS image path</li> -<li><strong>path_mnt</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – MNT image path</li> -<li><strong>path_segm</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Segmentation shapefile</li> -</ul> -</td> -</tr> -</tbody> -</table> -<p><strong>Id information to download on theia platform</strong></p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>user</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Connexion Username</li> -<li><strong>password</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Connexion Password</li> -</ul> -</td> -</tr> -</tbody> -</table> -<p><strong>Output parameters</strong></p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>output_name_moba</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Output classification shapefile</li> -<li><strong>out_fieldname_carto</strong> (<em>list of str</em>) – Output shapefile field name</li> -<li><strong>out_fieldtype_carto</strong> (<em>list of str</em><em> (</em><em>eval ogr pointer</em><em>)</em><em></em>) – Output shapefile field type</li> -</ul> -</td> -</tr> -</tbody> -</table> -<p><strong>Sample parameters</strong></p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>fieldname_args</strong> (<em>list of str</em>) – Sample field names 2 by 2</li> -<li><strong>class_args</strong> (<em>list of str</em>) – Sample class names 2 by 2</li> -<li><strong>sample_name</strong> (<em>list of str</em>) – List of sample name (path)</li> -<li><strong>list_nb_sample</strong> (<em>list of int</em>) – Number of polygons for every sample</li> -</ul> -</td> -</tr> -</tbody> -</table> -<p><strong>Multi-processing parameters</strong></p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><strong>mp</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#int" title="(disponible dans Python v2.7)"><em>int</em></a>) – <p>Boolean variable -> 0 or 1.</p> -<ul class="simple"> -<li>0 means, not multi-processing</li> -<li>1 means, launch process with multi-processing</li> -</ul> -</td> -</tr> -</tbody> -</table> -<dl class="method"> -<dt id="Processing.Processing.i_classifier_rf"> -<code class="descname">i_classifier_rf</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Processing.html#Processing.i_classifier_rf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Processing.Processing.i_classifier_rf" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Interface function to launch random forest classification with a input segmentation <a class="reference internal" href="package.html#Segmentation.Segmentation" title="Segmentation.Segmentation"><code class="xref py py-func docutils literal"><span class="pre">Segmentation.Segmentation()</span></code></a>.</p> -<p>This function use the sklearn module to build the best of decision tree to extract classes. -The optimal threshold are stored by class <strong>rf</strong> variable in <a class="reference internal" href="#Processing.Processing.i_sample_rf" title="Processing.Processing.i_sample_rf"><code class="xref py py-func docutils literal"><span class="pre">Processing.i_sample_rf()</span></code></a>. Then it computes zonal statistics by polygons -for every images in multi-processing (if <strong>mp</strong> = 1).</p> -</dd></dl> - -<dl class="method"> -<dt id="Processing.Processing.i_classifier_s"> -<code class="descname">i_classifier_s</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Processing.html#Processing.i_classifier_s"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Processing.Processing.i_classifier_s" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Interface function to launch decision tree classification with a input segmentation <a class="reference internal" href="package.html#Segmentation.Segmentation" title="Segmentation.Segmentation"><code class="xref py py-func docutils literal"><span class="pre">Segmentation.Segmentation()</span></code></a>.</p> -<p>This function store optimal threshold by class <strong>Segmentation.out_threshold</strong>. Then it computes zonal statistics by polygons -for every images in multi-processing (if <strong>mp</strong> = 1).</p> -</dd></dl> - -<dl class="method"> -<dt id="Processing.Processing.i_download"> -<code class="descname">i_download</code><span class="sig-paren">(</span><em>dd</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Processing.html#Processing.i_download"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Processing.Processing.i_download" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Interface function to download archives on the website Theia Land. This function extract -the number of downloadable image with <a class="reference internal" href="package.html#Archive.Archive.listing" title="Archive.Archive.listing"><code class="xref py py-func docutils literal"><span class="pre">Archive.Archive.listing()</span></code></a>.</p> -<p>Then, this function download <code class="xref py py-func docutils literal"><span class="pre">Archive.Archive.download()</span></code> and unzip <a class="reference internal" href="package.html#Archive.Archive.decompress" title="Archive.Archive.decompress"><code class="xref py py-func docutils literal"><span class="pre">Archive.Archive.decompress()</span></code></a> images -in the archive folder (<strong>folder_archive</strong>).</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><strong>dd</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#int" title="(disponible dans Python v2.7)"><em>int</em></a>) – <p>Boolean variable to launch download images -> 0 or 1.</p> -<ul class="simple"> -<li>0 means, not downloading</li> -<li>1 means, launch downloading</li> -</ul> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="Processing.Processing.i_glob"> -<code class="descname">i_glob</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Processing.html#Processing.i_glob"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Processing.Processing.i_glob" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to load existing images to launch the processing. -It need to archives. Then, to select processing images, select archives</p> -</dd></dl> - -<dl class="method"> -<dt id="Processing.Processing.i_images_processing"> -<code class="descname">i_images_processing</code><span class="sig-paren">(</span><em>vs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Processing.html#Processing.i_images_processing"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Processing.Processing.i_images_processing" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Interface function to launch processing VHRS images <a class="reference internal" href="#Processing.Processing.i_vhrs" title="Processing.Processing.i_vhrs"><code class="xref py py-func docutils literal"><span class="pre">i_vhrs()</span></code></a> and satellite images <a class="reference internal" href="#Processing.Processing.i_img_sat" title="Processing.Processing.i_img_sat"><code class="xref py py-func docutils literal"><span class="pre">i_img_sat()</span></code></a> in multi-processing.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><strong>vs</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#int" title="(disponible dans Python v2.7)"><em>int</em></a>) – <p>Boolean variable to launch processing because of interface checkbox -> 0 or 1.</p> -<ul class="simple"> -<li>0 means, not texture processing</li> -<li>1 means, launch texture processing</li> -</ul> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="Processing.Processing.i_img_sat"> -<code class="descname">i_img_sat</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Processing.html#Processing.i_img_sat"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Processing.Processing.i_img_sat" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Interface function to processing satellite images:</p> -<blockquote> -<div><p>1. Clip archive images and modify Archive class to integrate clip image path. -With <code class="xref py py-func docutils literal"><span class="pre">Toolbox.clip_raster()</span></code> in <code class="docutils literal"><span class="pre">Toolbox</span></code> module.</p> -<p>2. Search cloud’s percentage <a class="reference internal" href="package.html#RasterSat_by_date.RasterSat_by_date.pourc_cloud" title="RasterSat_by_date.RasterSat_by_date.pourc_cloud"><code class="xref py py-func docutils literal"><span class="pre">RasterSat_by_date.RasterSat_by_date.pourc_cloud()</span></code></a>, select -image and compute ndvi index <a class="reference internal" href="package.html#RasterSat_by_date.RasterSat_by_date.calcul_ndvi" title="RasterSat_by_date.RasterSat_by_date.calcul_ndvi"><code class="xref py py-func docutils literal"><span class="pre">RasterSat_by_date.RasterSat_by_date.calcul_ndvi()</span></code></a>. If cloud’s percentage is -greater than 40%, then not select and compute ndvi index.</p> -<p>3. Compute temporal stats on ndvi index [min, max, std, min-max]. With <code class="xref py py-func docutils literal"><span class="pre">Toolbox.calc_serie_stats()</span></code> -in <code class="docutils literal"><span class="pre">Toolbox</span></code> module.</p> -<ol class="arabic simple" start="4"> -<li>Create stats ndvi raster and stats cloud raster.</li> -</ol> -<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">RasterSat_by_date</span> -<span class="gp">>>> </span><span class="n">stats_test</span> <span class="o">=</span> <span class="n">RasterSat_by_date</span><span class="p">(</span><span class="n">class_archive</span><span class="p">,</span> <span class="n">big_folder</span><span class="p">,</span> <span class="n">one_date</span><span class="p">)</span> -<span class="gp">>>> </span><span class="n">stats_test</span><span class="o">.</span><span class="n">complete_raster</span><span class="p">(</span><span class="n">stats_test</span><span class="o">.</span><span class="n">create_raster</span><span class="p">(</span><span class="n">in_raster</span><span class="p">,</span> <span class="n">stats_data</span><span class="p">,</span> <span class="n">in_ds</span><span class="p">),</span> <span class="n">stats_data</span><span class="p">)</span> -</pre></div> -</div> -</div></blockquote> -</dd></dl> - -<dl class="method"> -<dt id="Processing.Processing.i_rpg"> -<code class="descname">i_rpg</code><span class="sig-paren">(</span><em>path_rpg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Processing.html#Processing.i_rpg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Processing.Processing.i_rpg" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Interface function to extract mono rpg crops.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><strong>path_rpg</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Input RPG shapefile.</td> -</tr> -<tr class="field-even field"><th class="field-name">Retourne:</th><td class="field-body">str – variable <strong>Rpg.vector_used</strong>, output no duplicated crops shapefile (path).</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="Processing.Processing.i_sample"> -<code class="descname">i_sample</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Processing.html#Processing.i_sample"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Processing.Processing.i_sample" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Interface function to compute threshold with various sample. It also extract a list of validation layer (shapefile) -to compute the precision of the next classification <a class="reference internal" href="#Processing.Processing.i_validate" title="Processing.Processing.i_validate"><code class="xref py py-func docutils literal"><span class="pre">i_validate()</span></code></a>.</p> -<p>It create samples 2 by 2 with kwargs field names and class <a class="reference internal" href="package.html#Sample.Sample.create_sample" title="Sample.Sample.create_sample"><code class="xref py py-func docutils literal"><span class="pre">Sample.Sample.create_sample()</span></code></a>. -Then, it compute zonal statistics by polygons <code class="xref py py-func docutils literal"><span class="pre">Vector.Sample.zonal_stats()</span></code>.</p> -<p>With zonal statistics computed, a optimal threshold is determined <a class="reference internal" href="package.html#Seath.Seath.separability_and_threshold" title="Seath.Seath.separability_and_threshold"><code class="xref py py-func docutils literal"><span class="pre">Seath.Seath.separability_and_threshold()</span></code></a> that -will print in a text file .lg in the main folder.</p> -<div class="admonition warning"> -<p class="first admonition-title">Avertissement</p> -<p class="last"><a class="reference internal" href="package.html#Seath.Seath.separability_and_threshold" title="Seath.Seath.separability_and_threshold"><code class="xref py py-func docutils literal"><span class="pre">Seath.Seath.separability_and_threshold()</span></code></a> does not always allow to discriminate optimal threshold. -Then, this function will be launch at least ten time until it reaches a optimal threshold.</p> -</div> -</dd></dl> - -<dl class="method"> -<dt id="Processing.Processing.i_sample_rf"> -<code class="descname">i_sample_rf</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Processing.html#Processing.i_sample_rf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Processing.Processing.i_sample_rf" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>This function build a random forest trees like model to create a final classification. -All of This using the method described in the <a class="reference internal" href="#Processing.Processing.i_validate" title="Processing.Processing.i_validate"><code class="xref py py-func docutils literal"><span class="pre">i_validate()</span></code></a> function and because -of sklearn module.</p> -</dd></dl> - -<dl class="method"> -<dt id="Processing.Processing.i_slope"> -<code class="descname">i_slope</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Processing.html#Processing.i_slope"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Processing.Processing.i_slope" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Interface function to processing slope raster. From a MNT, and with a command line gdal, -this function compute slope in degrees <a class="reference internal" href="package.html#Slope.Slope" title="Slope.Slope"><code class="xref py py-func docutils literal"><span class="pre">Slope.Slope()</span></code></a>.</p> -</dd></dl> - -<dl class="method"> -<dt id="Processing.Processing.i_tree_direction"> -<code class="descname">i_tree_direction</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Processing.html#Processing.i_tree_direction"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Processing.Processing.i_tree_direction" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Interface function to can extract one level or two levels of the final classification</p> -</dd></dl> - -<dl class="method"> -<dt id="Processing.Processing.i_validate"> -<code class="descname">i_validate</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Processing.html#Processing.i_validate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Processing.Processing.i_validate" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Interface to validate a classification. It going to rasterize the validation shapefile and the -classification shapefile with <code class="xref py py-func docutils literal"><span class="pre">layer_rasterization()</span></code>. Next, to compare pixel by pixel, the classification -quality to built a confusion matrix in a csv file.</p> -</dd></dl> - -<dl class="method"> -<dt id="Processing.Processing.i_vhrs"> -<code class="descname">i_vhrs</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Processing.html#Processing.i_vhrs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Processing.Processing.i_vhrs" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Interface function to processing VHRS images. It create two OTB texture images <a class="reference internal" href="package.html#Vhrs.Vhrs" title="Vhrs.Vhrs"><code class="xref py py-func docutils literal"><span class="pre">Vhrs.Vhrs()</span></code></a> : SFS Texture and Haralick Texture</p> -</dd></dl> - -</dd></dl> - -</div> -<div class="section" id="module-ui_PHYMOBATs_tab"> -<span id="interface-element"></span><h2>Interface element<a class="headerlink" href="#module-ui_PHYMOBATs_tab" title="Lien permanent vers ce titre">¶</a></h2> -<dl class="class"> -<dt id="ui_PHYMOBATs_tab.Ui_PHYMOBAT"> -<em class="property">class </em><code class="descclassname">ui_PHYMOBATs_tab.</code><code class="descname">Ui_PHYMOBAT</code><a class="reference internal" href="_modules/ui_PHYMOBATs_tab.html#Ui_PHYMOBAT"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ui_PHYMOBATs_tab.Ui_PHYMOBAT" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Class to display “Simplify PHYMOBAT windowâ€.</p> -</dd></dl> - -<span class="target" id="module-ui_PHYMOBATe_tab"></span><dl class="class"> -<dt id="ui_PHYMOBATe_tab.Ui_PHYMOBAT"> -<em class="property">class </em><code class="descclassname">ui_PHYMOBATe_tab.</code><code class="descname">Ui_PHYMOBAT</code><a class="reference internal" href="_modules/ui_PHYMOBATe_tab.html#Ui_PHYMOBAT"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ui_PHYMOBATe_tab.Ui_PHYMOBAT" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Class to display “Expert PHYMOBAT windowâ€.</p> -</dd></dl> - -</div> -<div class="section" id="module-ui_A_propos_PHYMOBAT_window"> -<span id="popup-about-and-warming"></span><h2>Popup about and warming<a class="headerlink" href="#module-ui_A_propos_PHYMOBAT_window" title="Lien permanent vers ce titre">¶</a></h2> -<dl class="class"> -<dt id="ui_A_propos_PHYMOBAT_window.Ui_About"> -<em class="property">class </em><code class="descclassname">ui_A_propos_PHYMOBAT_window.</code><code class="descname">Ui_About</code><a class="reference internal" href="_modules/ui_A_propos_PHYMOBAT_window.html#Ui_About"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ui_A_propos_PHYMOBAT_window.Ui_About" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Class to display “About PHYMOBAT”. In this windows, it prints informations on the processing, license -and version.</p> -</dd></dl> - -<span class="target" id="module-ui_Warming_study_area"></span><dl class="class"> -<dt id="ui_Warming_study_area.Ui_Warming_study_area"> -<em class="property">class </em><code class="descclassname">ui_Warming_study_area.</code><code class="descname">Ui_Warming_study_area</code><a class="reference internal" href="_modules/ui_Warming_study_area.html#Ui_Warming_study_area"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ui_Warming_study_area.Ui_Warming_study_area" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Class to display a message to say there isn’t declared study area file.</p> -</dd></dl> - -<span class="target" id="module-ui_Warming_forgetting"></span><dl class="class"> -<dt id="ui_Warming_forgetting.Ui_Warming_forgetting"> -<em class="property">class </em><code class="descclassname">ui_Warming_forgetting.</code><code class="descname">Ui_Warming_forgetting</code><a class="reference internal" href="_modules/ui_Warming_forgetting.html#Ui_Warming_forgetting"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ui_Warming_forgetting.Ui_Warming_forgetting" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Class to display a message to tell you if you fogotten to enter a raster or a sample.</p> -</dd></dl> - -<span class="target" id="module-ui_Proxy_window"></span><dl class="class"> -<dt id="ui_Proxy_window.Ui_Proxy_window"> -<em class="property">class </em><code class="descclassname">ui_Proxy_window.</code><code class="descname">Ui_Proxy_window</code><a class="reference internal" href="_modules/ui_Proxy_window.html#Ui_Proxy_window"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#ui_Proxy_window.Ui_Proxy_window" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Class to display “Proxy windowâ€. In this windows, there is 3 lines edit to fill (proxy server, login and password).</p> -</dd></dl> - -</div> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> - <div class="sphinxsidebarwrapper"> - <h3><a href="PHYMOBAT_documentation.html">Table des Matières</a></h3> - <ul> -<li><a class="reference internal" href="#">Graphical User Interface package</a><ul> -<li><a class="reference internal" href="#module-PHYMOBAT">Interface command</a></li> -<li><a class="reference internal" href="#module-Processing">Control processing</a></li> -<li><a class="reference internal" href="#module-ui_PHYMOBATs_tab">Interface element</a></li> -<li><a class="reference internal" href="#module-ui_A_propos_PHYMOBAT_window">Popup about and warming</a></li> -</ul> -</li> -</ul> - - <h4>Sujet précédent</h4> - <p class="topless"><a href="package.html" - title="Chapitre précédent">CarHab Phy MOBA package</a></p> - <div role="note" aria-label="source link"> - <h3>Cette page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/API.rst.txt" - rel="nofollow">Montrer le code source</a></li> - </ul> - </div> -<div id="searchbox" style="display: none" role="search"> - <h3>Recherche rapide</h3> - <form class="search" action="search.html" method="get"> - <div><input type="text" name="q" /></div> - <div><input type="submit" value="Go" /></div> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="Index général" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Index des modules Python" - >modules</a> |</li> - <li class="right" > - <a href="package.html" title="CarHab Phy MOBA package" - >précédent</a> |</li> - <li class="nav-item nav-item-0"><a href="PHYMOBAT_documentation.html">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - <div class="footer" role="contentinfo"> - © Copyright 2017, LAVENTURE Sylvio (UMR TETIS/IRSTEA). - Créé avec <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.3. - </div> - </body> -</html> \ No newline at end of file diff --git a/Documentation/Makefile b/Documentation/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..d5df55b72f9779d1a87b3cf28318c4b2face5eb0 --- /dev/null +++ b/Documentation/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = Phymobat +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/Documentation/PHYMOBAT_documentation.html b/Documentation/PHYMOBAT_documentation.html deleted file mode 100644 index c3b2845e2f253f49354a2907d1c46176598aa241..0000000000000000000000000000000000000000 --- a/Documentation/PHYMOBAT_documentation.html +++ /dev/null @@ -1,155 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - -<html xmlns="http://www.w3.org/1999/xhtml" lang="fr"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Documentation de PHYMOBAT — documentation PHYMOBAT 3.0</title> - - <link rel="stylesheet" href="_static/classic.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: './', - VERSION: '3.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true, - SOURCELINK_SUFFIX: '.txt' - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/translations.js"></script> - <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> - <link rel="index" title="Index" href="genindex.html" /> - <link rel="search" title="Recherche" href="search.html" /> - <link rel="next" title="Installation" href="install.html" /> - </head> - <body role="document"> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="Index général" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Index des modules Python" - >modules</a> |</li> - <li class="right" > - <a href="install.html" title="Installation" - accesskey="N">suivant</a> |</li> - <li class="nav-item nav-item-0"><a href="#">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body" role="main"> - - <div class="section" id="documentation-de-phymobat"> -<h1>Documentation de PHYMOBAT<a class="headerlink" href="#documentation-de-phymobat" title="Lien permanent vers ce titre">¶</a></h1> -<p>Chaîne de traintement du Fond blanc PHYsionomique des Milieux Ouverts de Basse Altitude par Télédétection (PHYMOBAT).</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Outil compatible sur linux.</p> -</div> -<p>Contents:</p> -<div class="toctree-wrapper compound"> -<ul> -<li class="toctree-l1"><a class="reference internal" href="install.html">Installation</a><ul> -<li class="toctree-l2"><a class="reference internal" href="install.html#installation-sig-open-source">Installation SIG open source</a></li> -<li class="toctree-l2"><a class="reference internal" href="install.html#modules-python">Modules python</a></li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="methode_tuto.html">Processus utilisées et tutoriels API</a><ul> -<li class="toctree-l2"><a class="reference internal" href="methode_tuto.html#processus-algorithmiques-utilisees">Processus algorithmiques utilisées</a></li> -<li class="toctree-l2"><a class="reference internal" href="methode_tuto.html#tutoriels-interface">Tutoriels interface</a></li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="package.html">CarHab Phy MOBA package</a><ul> -<li class="toctree-l2"><a class="reference internal" href="package.html#image-processing">Image processing</a></li> -<li class="toctree-l2"><a class="reference internal" href="package.html#vector-processing">Vector processing</a></li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="API.html">Graphical User Interface package</a><ul> -<li class="toctree-l2"><a class="reference internal" href="API.html#module-PHYMOBAT">Interface command</a></li> -<li class="toctree-l2"><a class="reference internal" href="API.html#module-Processing">Control processing</a></li> -<li class="toctree-l2"><a class="reference internal" href="API.html#module-ui_PHYMOBATs_tab">Interface element</a></li> -<li class="toctree-l2"><a class="reference internal" href="API.html#module-ui_A_propos_PHYMOBAT_window">Popup about and warming</a></li> -</ul> -</li> -</ul> -</div> -</div> -<div class="section" id="indices-and-tables"> -<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Lien permanent vers ce titre">¶</a></h1> -<ul class="simple"> -<li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li> -<li><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Index du module</span></a></li> -<li><a class="reference internal" href="search.html"><span class="std std-ref">Page de recherche</span></a></li> -</ul> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> - <div class="sphinxsidebarwrapper"> - <h3><a href="#">Table des Matières</a></h3> - <ul> -<li><a class="reference internal" href="#">Documentation de PHYMOBAT</a></li> -<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li> -</ul> - - <h4>Sujet suivant</h4> - <p class="topless"><a href="install.html" - title="Chapitre suivant">Installation</a></p> - <div role="note" aria-label="source link"> - <h3>Cette page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/PHYMOBAT_documentation.rst.txt" - rel="nofollow">Montrer le code source</a></li> - </ul> - </div> -<div id="searchbox" style="display: none" role="search"> - <h3>Recherche rapide</h3> - <form class="search" action="search.html" method="get"> - <div><input type="text" name="q" /></div> - <div><input type="submit" value="Go" /></div> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="Index général" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Index des modules Python" - >modules</a> |</li> - <li class="right" > - <a href="install.html" title="Installation" - >suivant</a> |</li> - <li class="nav-item nav-item-0"><a href="#">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - <div class="footer" role="contentinfo"> - © Copyright 2017, LAVENTURE Sylvio (UMR TETIS/IRSTEA). - Créé avec <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.3. - </div> - </body> -</html> \ No newline at end of file diff --git a/Documentation/_build/doctrees/_sources/API.doctree b/Documentation/_build/doctrees/_sources/API.doctree new file mode 100644 index 0000000000000000000000000000000000000000..3b40cf5aeb1c0ee39471b2b530cb0443c47615a3 Binary files /dev/null and b/Documentation/_build/doctrees/_sources/API.doctree differ diff --git a/Documentation/_build/doctrees/_sources/install.doctree b/Documentation/_build/doctrees/_sources/install.doctree new file mode 100644 index 0000000000000000000000000000000000000000..46ae9135189d3cf4fbff989bff5d05844cfa743e Binary files /dev/null and b/Documentation/_build/doctrees/_sources/install.doctree differ diff --git a/Documentation/_build/doctrees/_sources/methode_tuto.doctree b/Documentation/_build/doctrees/_sources/methode_tuto.doctree new file mode 100644 index 0000000000000000000000000000000000000000..23ff1972d34d6836b11c1bacaa8801f98ca1b305 Binary files /dev/null and b/Documentation/_build/doctrees/_sources/methode_tuto.doctree differ diff --git a/Documentation/_build/doctrees/_sources/package.doctree b/Documentation/_build/doctrees/_sources/package.doctree new file mode 100644 index 0000000000000000000000000000000000000000..3f82970ab22dc40e3eadf642f109bc2027ff2b9a Binary files /dev/null and b/Documentation/_build/doctrees/_sources/package.doctree differ diff --git a/Documentation/_build/doctrees/environment.pickle b/Documentation/_build/doctrees/environment.pickle new file mode 100644 index 0000000000000000000000000000000000000000..301a6afe84b75185d8c53b8ad217734d046401dd Binary files /dev/null and b/Documentation/_build/doctrees/environment.pickle differ diff --git a/Documentation/_build/doctrees/index.doctree b/Documentation/_build/doctrees/index.doctree new file mode 100644 index 0000000000000000000000000000000000000000..d2e096e7a874d771f2ddc696e6c5b49ffb6018dc Binary files /dev/null and b/Documentation/_build/doctrees/index.doctree differ diff --git a/Documentation/_build/latex/API.png b/Documentation/_build/latex/API.png new file mode 100644 index 0000000000000000000000000000000000000000..5391780208d7a193efe2d1098e82182310909d83 Binary files /dev/null and b/Documentation/_build/latex/API.png differ diff --git a/Documentation/_build/latex/API_0.png b/Documentation/_build/latex/API_0.png new file mode 100644 index 0000000000000000000000000000000000000000..bec4430f0874df226bb535c6832c777e48f4b765 Binary files /dev/null and b/Documentation/_build/latex/API_0.png differ diff --git a/Documentation/_build/latex/API_01.png b/Documentation/_build/latex/API_01.png new file mode 100644 index 0000000000000000000000000000000000000000..245d5c8a46312097f3e0cc51fcc0f38e348d09a4 Binary files /dev/null and b/Documentation/_build/latex/API_01.png differ diff --git a/Documentation/_build/latex/API_20.png b/Documentation/_build/latex/API_20.png new file mode 100644 index 0000000000000000000000000000000000000000..6acc98bf81a439acc420a06f7d76399434e61f4e Binary files /dev/null and b/Documentation/_build/latex/API_20.png differ diff --git a/Documentation/_build/latex/API_class.png b/Documentation/_build/latex/API_class.png new file mode 100644 index 0000000000000000000000000000000000000000..0d4460277f7ead3f657076e0b8a5fdfa92d6da7b Binary files /dev/null and b/Documentation/_build/latex/API_class.png differ diff --git a/Documentation/_build/latex/API_class_10.png b/Documentation/_build/latex/API_class_10.png new file mode 100644 index 0000000000000000000000000000000000000000..36d733ece82eca05c7bf66a2617dad8af8c2067d Binary files /dev/null and b/Documentation/_build/latex/API_class_10.png differ diff --git a/Documentation/_build/latex/API_class_11.png b/Documentation/_build/latex/API_class_11.png new file mode 100644 index 0000000000000000000000000000000000000000..826fe8070a07bee3c2ade5d6b8d3d7b6a4bf444c Binary files /dev/null and b/Documentation/_build/latex/API_class_11.png differ diff --git a/Documentation/_build/latex/API_class_12.png b/Documentation/_build/latex/API_class_12.png new file mode 100644 index 0000000000000000000000000000000000000000..a5d4542571ef0ccf75b84a0fa35dd2ee3df29424 Binary files /dev/null and b/Documentation/_build/latex/API_class_12.png differ diff --git a/Documentation/_build/latex/API_threshold.png b/Documentation/_build/latex/API_threshold.png new file mode 100644 index 0000000000000000000000000000000000000000..a61df626c7934bea5e77c0d9452601b439549d97 Binary files /dev/null and b/Documentation/_build/latex/API_threshold.png differ diff --git a/Documentation/_build/latex/API_threshold_1.png b/Documentation/_build/latex/API_threshold_1.png new file mode 100644 index 0000000000000000000000000000000000000000..c633404b50e64571f3963ecf621462d6580891e9 Binary files /dev/null and b/Documentation/_build/latex/API_threshold_1.png differ diff --git a/Documentation/_build/latex/API_threshold_2.png b/Documentation/_build/latex/API_threshold_2.png new file mode 100644 index 0000000000000000000000000000000000000000..4cdda817c107ba2d59bf9119bd2aed810a3cbe1b Binary files /dev/null and b/Documentation/_build/latex/API_threshold_2.png differ diff --git a/Documentation/_build/latex/API_threshold_ajout.png b/Documentation/_build/latex/API_threshold_ajout.png new file mode 100644 index 0000000000000000000000000000000000000000..817a24d404bd6deae1e4190d98ecb4563f0bd690 Binary files /dev/null and b/Documentation/_build/latex/API_threshold_ajout.png differ diff --git a/Documentation/_build/latex/APIs_0.png b/Documentation/_build/latex/APIs_0.png new file mode 100644 index 0000000000000000000000000000000000000000..02fb21ed9a0bf5851b94052a777061e2e0bd0481 Binary files /dev/null and b/Documentation/_build/latex/APIs_0.png differ diff --git a/Documentation/_build/latex/APIs_01.png b/Documentation/_build/latex/APIs_01.png new file mode 100644 index 0000000000000000000000000000000000000000..e627c5155e17ba907745c24c6b327f59bb9e9d69 Binary files /dev/null and b/Documentation/_build/latex/APIs_01.png differ diff --git a/Documentation/_build/latex/ChaineTraitementCarHab.png b/Documentation/_build/latex/ChaineTraitementCarHab.png new file mode 100644 index 0000000000000000000000000000000000000000..0ec72e99388a4cd5a02fe3b0265d9b10232aa89a Binary files /dev/null and b/Documentation/_build/latex/ChaineTraitementCarHab.png differ diff --git a/Documentation/_build/latex/ChainedeTraitementCarHab_API_UML_v3.png b/Documentation/_build/latex/ChainedeTraitementCarHab_API_UML_v3.png new file mode 100644 index 0000000000000000000000000000000000000000..e96ec9fab391b1f3202ee50ddb7c4d3e5a1b1168 Binary files /dev/null and b/Documentation/_build/latex/ChainedeTraitementCarHab_API_UML_v3.png differ diff --git a/Documentation/_build/latex/ChainedeTraitementCarHab_UML_v2.png b/Documentation/_build/latex/ChainedeTraitementCarHab_UML_v2.png new file mode 100644 index 0000000000000000000000000000000000000000..ce060b726505ec7a239d63f590867a4a791a87d8 Binary files /dev/null and b/Documentation/_build/latex/ChainedeTraitementCarHab_UML_v2.png differ diff --git a/Documentation/_build/latex/Makefile b/Documentation/_build/latex/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..c561680ad7527ea0d93e7a2f38501733513802fa --- /dev/null +++ b/Documentation/_build/latex/Makefile @@ -0,0 +1,68 @@ +# Makefile for Sphinx LaTeX output + +ALLDOCS = $(basename $(wildcard *.tex)) +ALLPDF = $(addsuffix .pdf,$(ALLDOCS)) +ALLDVI = $(addsuffix .dvi,$(ALLDOCS)) +ALLXDV = +ALLPS = $(addsuffix .ps,$(ALLDOCS)) +ALLIMGS = $(wildcard *.png *.gif *.jpg *.jpeg) + +# Prefix for archive names +ARCHIVEPREFIX = +# Additional LaTeX options (passed via variables in latexmkrc/latexmkjarc file) +export LATEXOPTS = +# Additional latexmk options +LATEXMKOPTS = +# format: pdf or dvi (used only by archive targets) +FMT = pdf + +LATEX = latexmk -dvi +PDFLATEX = latexmk -pdf -dvi- -ps- + + +%.png %.gif %.jpg %.jpeg: FORCE_MAKE + extractbb '$@' + +%.dvi: %.tex FORCE_MAKE + $(LATEX) $(LATEXMKOPTS) '$<' + +%.ps: %.dvi + dvips '$<' + +%.pdf: %.tex FORCE_MAKE + $(PDFLATEX) $(LATEXMKOPTS) '$<' + +all: $(ALLPDF) + +all-dvi: $(ALLDVI) + +all-ps: $(ALLPS) + +all-pdf: $(ALLPDF) + +zip: all-$(FMT) + mkdir $(ARCHIVEPREFIX)docs-$(FMT) + cp $(ALLPDF) $(ARCHIVEPREFIX)docs-$(FMT) + zip -q -r -9 $(ARCHIVEPREFIX)docs-$(FMT).zip $(ARCHIVEPREFIX)docs-$(FMT) + rm -r $(ARCHIVEPREFIX)docs-$(FMT) + +tar: all-$(FMT) + mkdir $(ARCHIVEPREFIX)docs-$(FMT) + cp $(ALLPDF) $(ARCHIVEPREFIX)docs-$(FMT) + tar cf $(ARCHIVEPREFIX)docs-$(FMT).tar $(ARCHIVEPREFIX)docs-$(FMT) + rm -r $(ARCHIVEPREFIX)docs-$(FMT) + +gz: tar + gzip -9 < $(ARCHIVEPREFIX)docs-$(FMT).tar > $(ARCHIVEPREFIX)docs-$(FMT).tar.gz + +bz2: tar + bzip2 -9 -k $(ARCHIVEPREFIX)docs-$(FMT).tar + +xz: tar + xz -9 -k $(ARCHIVEPREFIX)docs-$(FMT).tar + +clean: + rm -f *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla *.ps *.tar *.tar.gz *.tar.bz2 *.tar.xz $(ALLPDF) $(ALLDVI) $(ALLXDV) *.fls *.fdb_latexmk + +.PHONY: all all-pdf all-dvi all-ps clean zip tar gz bz2 xz +.PHONY: FORCE_MAKE \ No newline at end of file diff --git a/Documentation/_build/latex/Phymobat.aux b/Documentation/_build/latex/Phymobat.aux new file mode 100644 index 0000000000000000000000000000000000000000..d85688db01d20eb32a31a17f5734840705fcf8eb --- /dev/null +++ b/Documentation/_build/latex/Phymobat.aux @@ -0,0 +1,235 @@ +\relax +\providecommand\hyper@newdestlabel[2]{} +\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} +\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined +\global\let\oldcontentsline\contentsline +\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} +\global\let\oldnewlabel\newlabel +\gdef\newlabel#1#2{\newlabelxx{#1}#2} +\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} +\AtEndDocument{\ifx\hyper@anchor\@undefined +\let\contentsline\oldcontentsline +\let\newlabel\oldnewlabel +\fi} +\fi} +\global\let\hyper@last\relax +\gdef\HyperFirstAtBeginDocument#1{#1} +\providecommand\HyField@AuxAddToFields[1]{} +\providecommand\HyField@AuxAddToCoFields[2]{} +\newlabel{index::doc}{{}{1}{}{section*.2}{}} +\@writefile{toc}{\contentsline {chapter}{\numberline {1}Installation}{3}{chapter.1}} +\@writefile{lof}{\addvspace {10\p@ }} +\@writefile{lot}{\addvspace {10\p@ }} +\newlabel{_sources/install:installation}{{1}{3}{Installation}{chapter.1}{}} +\newlabel{_sources/install::doc}{{1}{3}{Installation}{chapter.1}{}} +\@writefile{toc}{\contentsline {section}{\numberline {1.1}T\IeC {\'e}l\IeC {\'e}chargement Phymobat}{3}{section.1.1}} +\newlabel{_sources/install:telechargement-phymobat}{{1.1}{3}{Téléchargement Phymobat}{section.1.1}{}} +\@writefile{toc}{\contentsline {section}{\numberline {1.2}Installation SIG open source}{3}{section.1.2}} +\newlabel{_sources/install:installation-sig-open-source}{{1.2}{3}{Installation SIG open source}{section.1.2}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {1.2.1}GDAL}{3}{subsection.1.2.1}} +\newlabel{_sources/install:gdal}{{1.2.1}{3}{GDAL}{subsection.1.2.1}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {1.2.2}Orfeo ToolBox (OTB)}{4}{subsection.1.2.2}} +\newlabel{_sources/install:orfeo-toolbox-otb}{{1.2.2}{4}{Orfeo ToolBox (OTB)}{subsection.1.2.2}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {1.2.3}CURL}{4}{subsection.1.2.3}} +\newlabel{_sources/install:curl}{{1.2.3}{4}{CURL}{subsection.1.2.3}{}} +\@writefile{toc}{\contentsline {section}{\numberline {1.3}Installation des modules python}{4}{section.1.3}} +\newlabel{_sources/install:installation-des-modules-python}{{1.3}{4}{Installation des modules python}{section.1.3}{}} +\@writefile{toc}{\contentsline {chapter}{\numberline {2}Processus utilis\IeC {\'e}es et tutoriels API}{7}{chapter.2}} +\@writefile{lof}{\addvspace {10\p@ }} +\@writefile{lot}{\addvspace {10\p@ }} +\newlabel{_sources/methode_tuto:processus-utilisees-et-tutoriels-api}{{2}{7}{Processus utilisées et tutoriels API}{chapter.2}{}} +\newlabel{_sources/methode_tuto::doc}{{2}{7}{Processus utilisées et tutoriels API}{chapter.2}{}} +\@writefile{toc}{\contentsline {section}{\numberline {2.1}Processus algorithmiques utilis\IeC {\'e}es}{9}{section.2.1}} +\newlabel{_sources/methode_tuto:processus-algorithmiques-utilisees}{{2.1}{9}{Processus algorithmiques utilisées}{section.2.1}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {2.1.1}Traitement des images}{9}{subsection.2.1.1}} +\newlabel{_sources/methode_tuto:traitement-des-images}{{2.1.1}{9}{Traitement des images}{subsection.2.1.1}{}} +\@writefile{toc}{\contentsline {subsubsection}{1. Listing et t\IeC {\'e}l\IeC {\'e}chargements des images sur la plate-forme Theia}{10}{subsubsection*.3}} +\newlabel{_sources/methode_tuto:listing-et-telechargements-des-images-sur-la-plate-forme-theia}{{2.1.1}{10}{1. Listing et téléchargements des images sur la plate-forme Theia}{subsubsection*.3}{}} +\@writefile{toc}{\contentsline {subsubsection}{2. Traitements des images t\IeC {\'e}l\IeC {\'e}charg\IeC {\'e}es}{11}{subsubsection*.4}} +\newlabel{_sources/methode_tuto:traitements-des-images-telechargees}{{2.1.1}{11}{2. Traitements des images téléchargées}{subsubsection*.4}{}} +\@writefile{toc}{\contentsline {subsubsection}{3. Traitements des images THRS}{12}{subsubsection*.5}} +\newlabel{_sources/methode_tuto:traitements-des-images-thrs}{{2.1.1}{12}{3. Traitements des images THRS}{subsubsection*.5}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {2.1.2}Traitements des \IeC {\'e}chantillons}{14}{subsection.2.1.2}} +\newlabel{_sources/methode_tuto:traitements-des-echantillons}{{2.1.2}{14}{Traitements des échantillons}{subsection.2.1.2}{}} +\@writefile{toc}{\contentsline {subsubsection}{1. Mod\IeC {\`e}le Seath}{14}{subsubsection*.6}} +\newlabel{_sources/methode_tuto:modele-seath}{{2.1.2}{14}{1. Modèle Seath}{subsubsection*.6}{}} +\@writefile{toc}{\contentsline {subsubsection}{2. Mold\IeC {\`e}le Random Forest (RF)}{14}{subsubsection*.7}} +\newlabel{_sources/methode_tuto:moldele-random-forest-rf}{{2.1.2}{14}{2. Moldèle Random Forest (RF)}{subsubsection*.7}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {2.1.3}Traitements de classification}{15}{subsection.2.1.3}} +\newlabel{_sources/methode_tuto:traitements-de-classification}{{2.1.3}{15}{Traitements de classification}{subsection.2.1.3}{}} +\@writefile{toc}{\contentsline {section}{\numberline {2.2}Tutoriels interface}{16}{section.2.2}} +\newlabel{_sources/methode_tuto:tutoriels-interface}{{2.2}{16}{Tutoriels interface}{section.2.2}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {2.2.1}Interface Simplifi\IeC {\'e}e}{16}{subsection.2.2.1}} +\newlabel{_sources/methode_tuto:interface-simplifiee}{{2.2.1}{16}{Interface Simplifiée}{subsection.2.2.1}{}} +\@writefile{toc}{\contentsline {subsubsection}{Exemple sur un jeu de donn\IeC {\'e}es test}{18}{subsubsection*.8}} +\newlabel{_sources/methode_tuto:exemple-sur-un-jeu-de-donnees-test}{{2.2.1}{18}{Exemple sur un jeu de données test}{subsubsection*.8}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {2.2.2}Interface experte}{19}{subsection.2.2.2}} +\newlabel{_sources/methode_tuto:interface-experte}{{2.2.2}{19}{Interface experte}{subsection.2.2.2}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {2.2.3}Interface du traitement des images}{19}{subsection.2.2.3}} +\newlabel{_sources/methode_tuto:interface-du-traitement-des-images}{{2.2.3}{19}{Interface du traitement des images}{subsection.2.2.3}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {2.2.4}Interface du traitement des \IeC {\'e}chantillons}{23}{subsection.2.2.4}} +\newlabel{_sources/methode_tuto:interface-du-traitement-des-echantillons}{{2.2.4}{23}{Interface du traitement des échantillons}{subsection.2.2.4}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {2.2.5}Interface du traitement de classification}{25}{subsection.2.2.5}} +\newlabel{_sources/methode_tuto:interface-du-traitement-de-classification}{{2.2.5}{25}{Interface du traitement de classification}{subsection.2.2.5}{}} +\@writefile{toc}{\contentsline {chapter}{\numberline {3}CarHab Phy MOBA package}{35}{chapter.3}} +\@writefile{lof}{\addvspace {10\p@ }} +\@writefile{lot}{\addvspace {10\p@ }} +\newlabel{_sources/package:carhab-phy-moba-package}{{3}{35}{CarHab Phy MOBA package}{chapter.3}{}} +\newlabel{_sources/package::doc}{{3}{35}{CarHab Phy MOBA package}{chapter.3}{}} +\@writefile{toc}{\contentsline {section}{\numberline {3.1}Image processing}{35}{section.3.1}} +\newlabel{_sources/package:image-processing}{{3.1}{35}{Image processing}{section.3.1}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.1}Archive}{35}{subsection.3.1.1}} +\newlabel{_sources/package:module-Archive}{{3.1.1}{35}{Archive}{subsection.3.1.1}{}} +\newlabel{_sources/package:archive}{{3.1.1}{35}{Archive}{subsection.3.1.1}{}} +\newlabel{_sources/package:Archive.Archive}{{3.1.1}{35}{Archive}{section*.9}{}} +\newlabel{_sources/package:Archive.Archive.coord_box_dd}{{3.1.1}{36}{Archive}{section*.10}{}} +\newlabel{_sources/package:Archive.Archive.decompress}{{3.1.1}{36}{Archive}{section*.11}{}} +\newlabel{_sources/package:Archive.Archive.download_auto}{{3.1.1}{36}{Archive}{section*.12}{}} +\newlabel{_sources/package:Archive.Archive.listing}{{3.1.1}{36}{Archive}{section*.13}{}} +\newlabel{_sources/package:Archive.Archive.set_list_archive_to_try}{{3.1.1}{36}{Archive}{section*.14}{}} +\newlabel{_sources/package:Archive.Archive.utm_to_latlng}{{3.1.1}{36}{Archive}{section*.15}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.2}Landsat image processing}{37}{subsection.3.1.2}} +\newlabel{_sources/package:module-RasterSat_by_date}{{3.1.2}{37}{Landsat image processing}{subsection.3.1.2}{}} +\newlabel{_sources/package:landsat-image-processing}{{3.1.2}{37}{Landsat image processing}{subsection.3.1.2}{}} +\newlabel{_sources/package:RasterSat_by_date.RasterSat_by_date}{{3.1.2}{37}{Landsat image processing}{section*.16}{}} +\newlabel{_sources/package:RasterSat_by_date.RasterSat_by_date.calcul_ndvi}{{3.1.2}{37}{Landsat image processing}{section*.17}{}} +\newlabel{_sources/package:RasterSat_by_date.RasterSat_by_date.group_by_date}{{3.1.2}{37}{Landsat image processing}{section*.18}{}} +\newlabel{_sources/package:RasterSat_by_date.RasterSat_by_date.mosaic_by_date}{{3.1.2}{37}{Landsat image processing}{section*.19}{}} +\newlabel{_sources/package:RasterSat_by_date.RasterSat_by_date.pourc_cloud}{{3.1.2}{37}{Landsat image processing}{section*.20}{}} +\newlabel{_sources/package:RasterSat_by_date.RasterSat_by_date.raster_data}{{3.1.2}{37}{Landsat image processing}{section*.21}{}} +\newlabel{_sources/package:RasterSat_by_date.RasterSat_by_date.vrt_translate_gdal}{{3.1.2}{38}{Landsat image processing}{section*.22}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.3}Texture index processing}{38}{subsection.3.1.3}} +\newlabel{_sources/package:module-Vhrs}{{3.1.3}{38}{Texture index processing}{subsection.3.1.3}{}} +\newlabel{_sources/package:texture-index-processing}{{3.1.3}{38}{Texture index processing}{subsection.3.1.3}{}} +\newlabel{_sources/package:Vhrs.Vhrs}{{3.1.3}{38}{Texture index processing}{section*.23}{}} +\newlabel{_sources/package:Vhrs.Vhrs.haralick_texture_extraction}{{3.1.3}{38}{Texture index processing}{section*.24}{}} +\newlabel{_sources/package:Vhrs.Vhrs.sfs_texture_extraction}{{3.1.3}{39}{Texture index processing}{section*.25}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.4}Slope processing}{39}{subsection.3.1.4}} +\newlabel{_sources/package:module-Slope}{{3.1.4}{39}{Slope processing}{subsection.3.1.4}{}} +\newlabel{_sources/package:slope-processing}{{3.1.4}{39}{Slope processing}{subsection.3.1.4}{}} +\newlabel{_sources/package:Slope.Slope}{{3.1.4}{39}{Slope processing}{section*.26}{}} +\newlabel{_sources/package:Slope.Slope.extract_slope}{{3.1.4}{39}{Slope processing}{section*.27}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.1.5}Toolbox}{39}{subsection.3.1.5}} +\newlabel{_sources/package:module-Toolbox}{{3.1.5}{39}{Toolbox}{subsection.3.1.5}{}} +\newlabel{_sources/package:toolbox}{{3.1.5}{39}{Toolbox}{subsection.3.1.5}{}} +\newlabel{_sources/package:Toolbox.Toolbox}{{3.1.5}{39}{Toolbox}{section*.28}{}} +\newlabel{_sources/package:Toolbox.Toolbox.calc_serie_stats}{{3.1.5}{40}{Toolbox}{section*.29}{}} +\newlabel{_sources/package:Toolbox.Toolbox.check_proj}{{3.1.5}{40}{Toolbox}{section*.30}{}} +\newlabel{_sources/package:Toolbox.Toolbox.clip_raster}{{3.1.5}{40}{Toolbox}{section*.31}{}} +\@writefile{toc}{\contentsline {section}{\numberline {3.2}Vector processing}{40}{section.3.2}} +\newlabel{_sources/package:vector-processing}{{3.2}{40}{Vector processing}{section.3.2}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.2.1}Super vector}{40}{subsection.3.2.1}} +\newlabel{_sources/package:module-Vector}{{3.2.1}{40}{Super vector}{subsection.3.2.1}{}} +\newlabel{_sources/package:super-vector}{{3.2.1}{40}{Super vector}{subsection.3.2.1}{}} +\newlabel{_sources/package:Vector.Vector}{{3.2.1}{40}{Super vector}{section*.32}{}} +\newlabel{_sources/package:Vector.Vector.clip_vector}{{3.2.1}{40}{Super vector}{section*.33}{}} +\newlabel{_sources/package:Vector.Vector.close_data}{{3.2.1}{40}{Super vector}{section*.34}{}} +\newlabel{_sources/package:Vector.Vector.layer_rasterization}{{3.2.1}{40}{Super vector}{section*.35}{}} +\newlabel{_sources/package:Vector.Vector.vector_data}{{3.2.1}{41}{Super vector}{section*.36}{}} +\newlabel{_sources/package:Vector.Vector.zonal_stats}{{3.2.1}{41}{Super vector}{section*.37}{}} +\newlabel{_sources/package:Vector.Vector.zonal_stats_pp}{{3.2.1}{41}{Super vector}{section*.38}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.2.2}Sample}{41}{subsection.3.2.2}} +\newlabel{_sources/package:module-Sample}{{3.2.2}{41}{Sample}{subsection.3.2.2}{}} +\newlabel{_sources/package:sample}{{3.2.2}{41}{Sample}{subsection.3.2.2}{}} +\newlabel{_sources/package:Sample.Sample}{{3.2.2}{41}{Sample}{section*.39}{}} +\newlabel{_sources/package:Sample.Sample.create_sample}{{3.2.2}{41}{Sample}{section*.40}{}} +\newlabel{_sources/package:Sample.Sample.fill_sample}{{3.2.2}{41}{Sample}{section*.41}{}} +\newlabel{_sources/package:Sample.Sample.select_random_sample}{{3.2.2}{41}{Sample}{section*.42}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.2.3}RPG}{42}{subsection.3.2.3}} +\newlabel{_sources/package:module-Rpg}{{3.2.3}{42}{RPG}{subsection.3.2.3}{}} +\newlabel{_sources/package:rpg}{{3.2.3}{42}{RPG}{subsection.3.2.3}{}} +\newlabel{_sources/package:Rpg.Rpg}{{3.2.3}{42}{RPG}{section*.43}{}} +\newlabel{_sources/package:Rpg.Rpg.create_new_rpg_files}{{3.2.3}{42}{RPG}{section*.44}{}} +\newlabel{_sources/package:Rpg.Rpg.mono_rpg}{{3.2.3}{42}{RPG}{section*.45}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.2.4}Separability and threshold index}{42}{subsection.3.2.4}} +\newlabel{_sources/package:module-Seath}{{3.2.4}{42}{Separability and threshold index}{subsection.3.2.4}{}} +\newlabel{_sources/package:separability-and-threshold-index}{{3.2.4}{42}{Separability and threshold index}{subsection.3.2.4}{}} +\newlabel{_sources/package:Seath.Seath}{{3.2.4}{42}{Separability and threshold index}{section*.46}{}} +\newlabel{_sources/package:Seath.Seath.separability_and_threshold}{{3.2.4}{42}{Separability and threshold index}{section*.47}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.2.5}Classification}{43}{subsection.3.2.5}} +\newlabel{_sources/package:module-Segmentation}{{3.2.5}{43}{Classification}{subsection.3.2.5}{}} +\newlabel{_sources/package:classification}{{3.2.5}{43}{Classification}{subsection.3.2.5}{}} +\newlabel{_sources/package:Segmentation.Segmentation}{{3.2.5}{43}{Classification}{section*.48}{}} +\newlabel{_sources/package:Segmentation.Segmentation.append_scale}{{3.2.5}{43}{Classification}{section*.49}{}} +\newlabel{_sources/package:Segmentation.Segmentation.compute_biomass_density}{{3.2.5}{43}{Classification}{section*.50}{}} +\newlabel{_sources/package:Segmentation.Segmentation.create_cartography}{{3.2.5}{43}{Classification}{section*.51}{}} +\newlabel{_sources/package:Segmentation.Segmentation.decision_tree}{{3.2.5}{44}{Classification}{section*.52}{}} +\@writefile{toc}{\contentsline {chapter}{\numberline {4}Graphical User Interface package}{45}{chapter.4}} +\@writefile{lof}{\addvspace {10\p@ }} +\@writefile{lot}{\addvspace {10\p@ }} +\newlabel{_sources/API:graphical-user-interface-package}{{4}{45}{Graphical User Interface package}{chapter.4}{}} +\newlabel{_sources/API::doc}{{4}{45}{Graphical User Interface package}{chapter.4}{}} +\@writefile{toc}{\contentsline {section}{\numberline {4.1}Interface command}{46}{section.4.1}} +\newlabel{_sources/API:module-PHYMOBAT}{{4.1}{46}{Interface command}{section.4.1}{}} +\newlabel{_sources/API:interface-command}{{4.1}{46}{Interface command}{section.4.1}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT}{{4.1}{46}{Interface command}{section*.53}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.about_PHYMOBA}{{4.1}{46}{Interface command}{section*.54}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.activate_level}{{4.1}{46}{Interface command}{section*.55}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.add_sample}{{4.1}{46}{Interface command}{section*.56}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.block_for_swh}{{4.1}{46}{Interface command}{section*.57}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.change_mode}{{4.1}{46}{Interface command}{section*.58}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.clear_sample}{{4.1}{46}{Interface command}{section*.59}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.close_button}{{4.1}{46}{Interface command}{section*.60}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.display_all_levels}{{4.1}{47}{Interface command}{section*.61}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.display_one_level}{{4.1}{47}{Interface command}{section*.62}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.display_two_levels}{{4.1}{47}{Interface command}{section*.63}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.enter_sample_name}{{4.1}{47}{Interface command}{section*.64}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.enter_sample_name_hl}{{4.1}{47}{Interface command}{section*.65}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.enter_sample_name_ll}{{4.1}{47}{Interface command}{section*.66}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.f_output_name_moba}{{4.1}{47}{Interface command}{section*.67}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.f_path_area}{{4.1}{47}{Interface command}{section*.68}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.f_path_folder_dpt}{{4.1}{47}{Interface command}{section*.69}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.f_path_mnt}{{4.1}{47}{Interface command}{section*.70}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.f_path_ortho}{{4.1}{47}{Interface command}{section*.71}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.f_path_segm}{{4.1}{47}{Interface command}{section*.72}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.f_proxy}{{4.1}{47}{Interface command}{section*.73}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.field_display_1}{{4.1}{47}{Interface command}{section*.74}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.field_display_2}{{4.1}{47}{Interface command}{section*.75}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.field_display_3}{{4.1}{47}{Interface command}{section*.76}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.field_display_4}{{4.1}{47}{Interface command}{section*.77}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.field_display_5}{{4.1}{47}{Interface command}{section*.78}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.field_display_6}{{4.1}{48}{Interface command}{section*.79}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.forget_raster_sample}{{4.1}{48}{Interface command}{section*.80}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.forget_study_area}{{4.1}{48}{Interface command}{section*.81}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.get_variable}{{4.1}{48}{Interface command}{section*.82}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.help_tools}{{4.1}{48}{Interface command}{section*.83}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.img_sample_name}{{4.1}{48}{Interface command}{section*.84}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.initUI}{{4.1}{48}{Interface command}{section*.85}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.ok_button}{{4.1}{49}{Interface command}{section*.86}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.open_backup}{{4.1}{49}{Interface command}{section*.87}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.save_backup}{{4.1}{49}{Interface command}{section*.88}{}} +\newlabel{_sources/API:PHYMOBAT.PHYMOBAT.set_variable}{{4.1}{49}{Interface command}{section*.89}{}} +\@writefile{toc}{\contentsline {section}{\numberline {4.2}Control processing}{49}{section.4.2}} +\newlabel{_sources/API:module-Processing}{{4.2}{49}{Control processing}{section.4.2}{}} +\newlabel{_sources/API:control-processing}{{4.2}{49}{Control processing}{section.4.2}{}} +\newlabel{_sources/API:Processing.Processing}{{4.2}{49}{Control processing}{section*.90}{}} +\newlabel{_sources/API:Processing.Processing.i_classifier_rf}{{4.2}{50}{Control processing}{section*.91}{}} +\newlabel{_sources/API:Processing.Processing.i_classifier_s}{{4.2}{50}{Control processing}{section*.92}{}} +\newlabel{_sources/API:Processing.Processing.i_download}{{4.2}{50}{Control processing}{section*.93}{}} +\newlabel{_sources/API:Processing.Processing.i_images_processing}{{4.2}{50}{Control processing}{section*.94}{}} +\newlabel{_sources/API:Processing.Processing.i_img_sat}{{4.2}{50}{Control processing}{section*.95}{}} +\newlabel{_sources/API:Processing.Processing.i_rpg}{{4.2}{51}{Control processing}{section*.96}{}} +\newlabel{_sources/API:Processing.Processing.i_sample}{{4.2}{51}{Control processing}{section*.97}{}} +\newlabel{_sources/API:Processing.Processing.i_sample_rf}{{4.2}{51}{Control processing}{section*.98}{}} +\newlabel{_sources/API:Processing.Processing.i_slope}{{4.2}{51}{Control processing}{section*.99}{}} +\newlabel{_sources/API:Processing.Processing.i_tree_direction}{{4.2}{51}{Control processing}{section*.100}{}} +\newlabel{_sources/API:Processing.Processing.i_validate}{{4.2}{51}{Control processing}{section*.101}{}} +\newlabel{_sources/API:Processing.Processing.i_vhrs}{{4.2}{51}{Control processing}{section*.102}{}} +\@writefile{toc}{\contentsline {section}{\numberline {4.3}Interface element}{52}{section.4.3}} +\newlabel{_sources/API:module-ui_PHYMOBATs_tab}{{4.3}{52}{Interface element}{section.4.3}{}} +\newlabel{_sources/API:interface-element}{{4.3}{52}{Interface element}{section.4.3}{}} +\newlabel{_sources/API:ui_PHYMOBATs_tab.Ui_PHYMOBAT}{{4.3}{52}{Interface element}{section*.103}{}} +\newlabel{_sources/API:module-ui_PHYMOBATe_tab}{{4.3}{52}{Interface element}{section*.104}{}} +\newlabel{_sources/API:ui_PHYMOBATe_tab.Ui_PHYMOBAT}{{4.3}{52}{Interface element}{section*.105}{}} +\@writefile{toc}{\contentsline {section}{\numberline {4.4}Popup about and warming}{52}{section.4.4}} +\newlabel{_sources/API:module-ui_A_propos_PHYMOBAT_window}{{4.4}{52}{Popup about and warming}{section.4.4}{}} +\newlabel{_sources/API:popup-about-and-warming}{{4.4}{52}{Popup about and warming}{section.4.4}{}} +\newlabel{_sources/API:ui_A_propos_PHYMOBAT_window.Ui_About}{{4.4}{52}{Popup about and warming}{section*.106}{}} +\newlabel{_sources/API:module-ui_Warming_study_area}{{4.4}{52}{Popup about and warming}{section*.107}{}} +\newlabel{_sources/API:ui_Warming_study_area.Ui_Warming_study_area}{{4.4}{52}{Popup about and warming}{section*.108}{}} +\newlabel{_sources/API:module-ui_Warming_forgetting}{{4.4}{52}{Popup about and warming}{section*.109}{}} +\newlabel{_sources/API:ui_Warming_forgetting.Ui_Warming_forgetting}{{4.4}{52}{Popup about and warming}{section*.110}{}} +\newlabel{_sources/API:module-ui_Proxy_window}{{4.4}{52}{Popup about and warming}{section*.111}{}} +\newlabel{_sources/API:ui_Proxy_window.Ui_Proxy_window}{{4.4}{52}{Popup about and warming}{section*.112}{}} +\@writefile{toc}{\contentsline {chapter}{Index des modules Python}{53}{section*.113}} +\@writefile{toc}{\contentsline {chapter}{Index}{55}{section*.114}} diff --git a/Documentation/_build/latex/Phymobat.fdb_latexmk b/Documentation/_build/latex/Phymobat.fdb_latexmk new file mode 100644 index 0000000000000000000000000000000000000000..9b65745bfe5e2b83e6ff2819b79f2adc3281ba32 --- /dev/null +++ b/Documentation/_build/latex/Phymobat.fdb_latexmk @@ -0,0 +1,203 @@ +# Fdb version 3 +["makeindex Phymobat.idx"] 1536938912 "Phymobat.idx" "Phymobat.ind" "Phymobat" 1537359813 + "Phymobat.idx" 1536939074 9141 533bf29341d81978f295bb2b715cfe00 "" + (generated) + "Phymobat.ind" + "Phymobat.ilg" +["pdflatex"] 1537359813 "Phymobat.tex" "Phymobat.pdf" "Phymobat" 1537359813 + "/etc/texmf/web2c/texmf.cnf" 1532595933 475 c0e671620eb5563b2130f56340a5fde8 "" + "/usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc" 1480098666 4850 80dc9bab7f31fb78a000ccfed0e27cab "" + "/usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map" 1511824771 3332 103109f5612ad95229751940c61aada0 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrb8r.tfm" 1480098688 1292 3059476c50a24578715759f22652f3d0 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrb8t.tfm" 1480098688 1384 87406e4336af44af883a035f17f319d9 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrr8c.tfm" 1480098688 1268 8bd405dc5751cfed76cb6fb2db78cb50 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrr8r.tfm" 1480098688 1292 bd42be2f344128bff6d35d98474adfe3 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrr8t.tfm" 1480098688 1384 4632f5e54900a7dadbb83f555bc61e56 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrro8c.tfm" 1480098688 1344 dab2eee300fafcab19064bcc62d66daa "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrro8r.tfm" 1480098688 1544 4fb84cf2931ec523c2c6a08d939088ba "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrro8t.tfm" 1480098688 1596 04a657f277f0401ba37d66e716627ac4 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb8r.tfm" 1480098688 4484 b828043cbd581d289d955903c1339981 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb8t.tfm" 1480098688 6628 34c39492c0adc454c1c199922bba8363 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvbo8r.tfm" 1480098688 4736 423eba67d4e9420ec9df4a8def143b08 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvbo8t.tfm" 1480098688 6880 fe6c7967f27585f6fa9876f3af14edd2 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvr8r.tfm" 1480098688 4712 9ef4d7d106579d4b136e1529e1a4533c "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvr8t.tfm" 1480098688 7040 b2bd27e2bfe6f6948cbc3239cae7444f "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmb8r.tfm" 1480098689 4524 6bce29db5bc272ba5f332261583fee9c "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmb8t.tfm" 1480098689 6880 f19b8995b61c334d78fc734065f6b4d4 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmbi8r.tfm" 1480098689 4480 10409ed8bab5aea9ec9a78028b763919 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmbi8t.tfm" 1480098689 6784 37b32cc10800b5afa030d935c393695a "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr8c.tfm" 1480098689 1352 fa28a7e6d323c65ce7d13d5342ff6be2 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr8r.tfm" 1480098689 4408 25b74d011a4c66b7f212c0cc3c90061b "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr8t.tfm" 1480098689 6672 e3ab9e37e925f3045c9005e6d1473d56 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmri8r.tfm" 1480098689 4640 532ca3305aad10cc01d769f3f91f1029 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmri8t.tfm" 1480098689 6944 94c55ad86e6ea2826f78ba2240d50df9 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/jknappen/ec/ecrm1000.tfm" 1480098696 3584 adb004a0c8e7c46ee66cad73671f37b4 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex7.tfm" 1480098698 1004 54797486969f23fa377b128694d548df "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam10.tfm" 1480098698 916 f87d7c45f9c908e672703b83b72241a3 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam5.tfm" 1480098698 924 9904cf1d39e9767e7a3622f2a125a565 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam7.tfm" 1480098698 928 2dc8d444221b7a635bb58038579b861a "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm10.tfm" 1480098698 908 2921f8a10601f252058503cc6570e581 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm5.tfm" 1480098698 940 75ac932a52f80982a9f8ea75d03a34cf "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm7.tfm" 1480098698 940 228d6584342e91276bf566bcf9716b83 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmex10.tfm" 1480098701 992 662f679a0b3d2d53c1b94050fdaa3f50 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi12.tfm" 1480098701 1524 4414a8315f39513458b80dfc63bff03a "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm" 1480098701 1288 655e228510b4c2a1abe905c368440826 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr17.tfm" 1480098701 1292 296a67155bdbfc32aa9c636f21e91433 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm" 1480098701 1124 6c73e740cf17375f03eec0ee63599741 "" + "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi5.pfb" 1480098733 37912 77d683123f92148345f3fc36a38d9ab1 "" + "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb" 1480098733 32569 5e5ddc8df908dea60932f3c484a54c0d "" + "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy5.pfb" 1480098733 32915 7bf7720c61a5b3a7ff25b0964421c9b6 "" + "/usr/share/texlive/texmf-dist/fonts/type1/urw/courier/ucrb8a.pfb" 1480098746 50493 4ed1f7e9eba8f1f3e1ec25195460190d "" + "/usr/share/texlive/texmf-dist/fonts/type1/urw/courier/ucrr8a.pfb" 1480098746 45758 19968a0990191524e34e1994d4a31cb6 "" + "/usr/share/texlive/texmf-dist/fonts/type1/urw/courier/ucrro8a.pfb" 1480098746 44404 ea3d9c0311883914133975dd62a9185c "" + "/usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvb8a.pfb" 1480098746 35941 f27169cc74234d5bd5e4cca5abafaabb "" + "/usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvbo8a.pfb" 1480098746 39013 b244066151b1e3e718f9b8e88a5ff23b "" + "/usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvr8a.pfb" 1480098746 44648 23115b2a545ebfe2c526c3ca99db8b95 "" + "/usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmb8a.pfb" 1480098746 44729 811d6c62865936705a31c797a1d5dada "" + "/usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmbi8a.pfb" 1480098746 44656 0cbca70e0534538582128f6b54593cca "" + "/usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmr8a.pfb" 1480098746 46026 6dab18b61c907687b520c72847215a68 "" + "/usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmri8a.pfb" 1480098746 45458 a3faba884469519614ca56ba5f6b1de1 "" + "/usr/share/texlive/texmf-dist/fonts/vf/adobe/courier/pcrb8t.vf" 1480098757 2184 5d20c8b00cd914e50251116c274e2d0b "" + "/usr/share/texlive/texmf-dist/fonts/vf/adobe/courier/pcrr8c.vf" 1480098757 3552 6a7911d0b338a7c32cbfc3a9e985ccca "" + "/usr/share/texlive/texmf-dist/fonts/vf/adobe/courier/pcrr8t.vf" 1480098757 2184 8475af1b9cfa983db5f46f5ed4b8f9f7 "" + "/usr/share/texlive/texmf-dist/fonts/vf/adobe/courier/pcrro8c.vf" 1480098757 3560 a297982f0907d62e9886d9e2666bf30b "" + "/usr/share/texlive/texmf-dist/fonts/vf/adobe/courier/pcrro8t.vf" 1480098757 2280 d7cd083c724c9449e1d12731253966f7 "" + "/usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvb8t.vf" 1480098757 2340 0efed6a948c3c37d870e4e7ddb85c7c3 "" + "/usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvbo8t.vf" 1480098757 2344 88834f8322177295b0266ecc4b0754c3 "" + "/usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvr8t.vf" 1480098757 2344 44ff28c9ef2fc97180cd884f900fee71 "" + "/usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmb8t.vf" 1480098758 2340 df9c920cc5688ebbf16a93f45ce7bdd3 "" + "/usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmbi8t.vf" 1480098758 2324 51908dae6e03953a90119973962f0e4d "" + "/usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmr8c.vf" 1480098758 3556 8a9a6dcbcd146ef985683f677f4758a6 "" + "/usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmr8t.vf" 1480098758 2348 91706c542228501c410c266421fbe30c "" + "/usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmri8t.vf" 1480098758 2328 6cd7df782b09b29cfc4d93e55b6b9a59 "" + "/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii" 1480098806 71627 94eb9990bed73c364d7f53f960cc8c5b "" + "/usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty" 1518644053 15861 065fe343082d0cd2428cf984d6b2ef66 "" + "/usr/share/texlive/texmf-dist/tex/generic/babel/switch.def" 1518644053 12523 d80bc74bf5e02fe4304443a6de8d01be "" + "/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty" 1480098815 1458 43ab4710dc82f3edeabecd0d099626b2 "" + "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty" 1480098815 7612 729a8cc22a1ee0029997c7f74717ae05 "" + "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty" 1480098815 8237 3b62ef1f7e2c23a328c814b3893bc11f "" + "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty" 1517006633 185082 6c11d4e30ed78e2a12957b7e77030856 "" + "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty" 1480098815 70864 bcd5b216757bd619ae692a151d90085d "" + "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty" 1480098815 7324 2310d1247db0114eb4726807c8837a0e "" + "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty" 1490564930 1251 d170e11a3246c3392bc7f59595af42cb "" + "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty" 1480098815 6797 90b7f83b0ad46826bc16058b1e3d48df "" + "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty" 1480098815 8253 473e0e41f9adadb1977e8631b8f72ea6 "" + "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty" 1480098815 14040 ac8866aac45982ac84021584b0abb252 "" + "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty" 1480098815 18425 5b3c0c59d76fac78978b5558e83c1f36 "" + "/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty" 1480098820 5949 3f3fd50a8cc94c3d4cbf4fc66cd3df1c "" + "/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty" 1480098820 13829 94730e64147574077f8ecfea9bb69af4 "" + "/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd" 1480098820 961 6518c6525a34feb5e8250ffa91731cff "" + "/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd" 1480098820 961 d02606146ba5601b5645f987c92e6193 "" + "/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty" 1480098820 2210 5c54ab129b848a5071554186d0168766 "" + "/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty" 1480098820 4160 c115536cf8d4ff25aa8c1c9bc4ecb79a "" + "/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty" 1504905757 84352 897a476d96a0681047a5b0f91178a3d2 "" + "/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty" 1480098820 4115 318a66090112f3aa3f415aeb6fe8540f "" + "/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty" 1480098820 2431 fe3078ec12fc30287f568596f8e0b948 "" + "/usr/share/texlive/texmf-dist/tex/latex/base/alltt.sty" 1480098821 3140 977eaf314c97ac67b8675753fb15f67f "" + "/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty" 1492297155 4571 13977df0eda144b93597fc709035ad1f "" + "/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty" 1480098821 4732 d63eda807ac82cca2ca8488efd31a966 "" + "/usr/share/texlive/texmf-dist/tex/latex/base/makeidx.sty" 1480098821 1940 c559b92ca91f1b2a0e60d836d4973f41 "" + "/usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu" 1487721667 2004 ac51aeac484f08c01026120d62677eca "" + "/usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu" 1487721667 3181 1cb3e9ad01f4a01127b2ffd821bfeec7 "" + "/usr/share/texlive/texmf-dist/tex/latex/base/report.cls" 1480098821 22880 e7be6f7dd8c05d5108bf3a7d8cabe59a "" + "/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo" 1480098821 8292 e897c12e1e886ce77fe26afc5d470886 "" + "/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.def" 1492297155 10006 a90ba4035cf778f32f424e297d92e235 "" + "/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu" 1487721667 11255 9d97362866549d3d3c994b5f28d1b9b5 "" + "/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty" 1492297155 16154 f2c73e20ca771d534a8516c62c6b0eae "" + "/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd" 1480098821 2217 d274654bda1292013bdf48d5f720a495 "" + "/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.def" 1480098821 7767 aa88823823f5e767d79ea1166ab1ae74 "" + "/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.dfu" 1487721667 4919 76510afd60e8282294f944c2f9f5103b "" + "/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def" 1487721667 7784 325a2a09984cb5c4ff230f9867145ad3 "" + "/usr/share/texlive/texmf-dist/tex/latex/capt-of/capt-of.sty" 1480098823 1311 063f8536a047a2d9cb1803321f793f37 "" + "/usr/share/texlive/texmf-dist/tex/latex/carlisle/remreset.sty" 1480098823 1096 6a75275ca00e32428c6f059d2f618ea7 "" + "/usr/share/texlive/texmf-dist/tex/latex/cmap/cmap.sty" 1480098825 2883 427a7f7cb58418a0394dbd85c80668f6 "" + "/usr/share/texlive/texmf-dist/tex/latex/cmap/ot1.cmap" 1480098825 1207 4e0d96772f0d338847cbfb4eca683c81 "" + "/usr/share/texlive/texmf-dist/tex/latex/cmap/t1.cmap" 1480098825 1938 beaa4a8467aa0074076e0e19f2992e29 "" + "/usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty" 1498861448 10663 d7fcc0dc4f35e8998b8cfeef8407d37d "" + "/usr/share/texlive/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty" 1480098827 45360 a0833d32f1b541964596b02870342d5a "" + "/usr/share/texlive/texmf-dist/tex/latex/float/float.sty" 1480098828 6749 16d2656a1984957e674b149555f1ea1d "" + "/usr/share/texlive/texmf-dist/tex/latex/fncychap/fncychap.sty" 1480098828 19488 fdd52eb173b3197d748e1ec25acb042f "" + "/usr/share/texlive/texmf-dist/tex/latex/framed/framed.sty" 1480098829 22449 7ec15c16d0d66790f28e90343c5434a3 "" + "/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty" 1480098829 40502 e003406220954b0716679d7928aedd8a "" + "/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg" 1480098830 1213 620bba36b25224fa9b7e1ccb4ecb76fd "" + "/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg" 1480098830 1224 978390e9c2234eab29404bc21b268d1e "" + "/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def" 1515537368 17334 520b9b85ad8a2a48eda3f643e27a5179 "" + "/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty" 1498427532 15275 7d676729b1bedd3e7f3c6717affb366c "" + "/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty" 1498427532 9066 649f2ccf62888e3d8c3e57256b70b8e1 "" + "/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty" 1480098830 2594 d18d5e19aa8239cf867fa670c556d2e9 "" + "/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty" 1480098830 3980 0a268fbfda01e381fa95821ab13b6aee "" + "/usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def" 1518041854 51699 9069fc983fff0db91d59a15af144ad62 "" + "/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty" 1518041854 234088 2c849389d62d41c593d9f5176c4116ab "" + "/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty" 1480098831 12949 81e4e808884a8f0e276b69410e234656 "" + "/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def" 1518041854 14098 4e70bf396c7c265bd8b0e5cab3fd3d4d "" + "/usr/share/texlive/texmf-dist/tex/latex/hyperref/puenc.def" 1518041854 122411 10b605a58a28bbe5d61db37da4a85beb "" + "/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg" 1480098833 678 4792914a8f45be57bb98413425e4c7af "" + "/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg" 1480098833 235 6031e5765137be07eed51a510b2b8fb7 "" + "/usr/share/texlive/texmf-dist/tex/latex/mmap/oml.cmap" 1480098835 1866 c1c12138091b4a8edd4a24a940e6f792 "" + "/usr/share/texlive/texmf-dist/tex/latex/mmap/oms.cmap" 1480098835 2370 3b1f71b14b974f07cef532db09ae9ee0 "" + "/usr/share/texlive/texmf-dist/tex/latex/mmap/omx.cmap" 1480098835 3001 252c8ca42b06a22cb1a11c0e47790c6e "" + "/usr/share/texlive/texmf-dist/tex/latex/needspace/needspace.sty" 1480098835 852 0e34dbb72efc69fa07602405ad95585e "" + "/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty" 1480098836 3834 4363110eb0ef1eb2b71c8fcbcdb6c357 "" + "/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty" 1480098836 12095 5337833c991d80788a43d3ce26bd1c46 "" + "/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty" 1480098836 7075 2fe3d848bba95f139de11ded085e74aa "" + "/usr/share/texlive/texmf-dist/tex/latex/oberdiek/hypcap.sty" 1480098836 3720 63669daeb0b67d5fbec899824e2f1491 "" + "/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty" 1480098836 22417 1d9df1eb66848aa31b18a593099cf45c "" + "/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty" 1480098836 9581 023642318cef9f4677efe364de1e2a27 "" + "/usr/share/texlive/texmf-dist/tex/latex/parskip/parskip.sty" 1480098836 2763 02a40cc5a32805c41d919cfbdba7e99a "" + "/usr/share/texlive/texmf-dist/tex/latex/psnfss/t1pcr.fd" 1480098837 798 d5895e9edc628f2be019beb2c0ec66df "" + "/usr/share/texlive/texmf-dist/tex/latex/psnfss/t1phv.fd" 1480098837 1488 9a55ac1cde6b4798a7f56844bb75a553 "" + "/usr/share/texlive/texmf-dist/tex/latex/psnfss/t1ptm.fd" 1480098837 774 61d7da1e9f9e74989b196d147e623736 "" + "/usr/share/texlive/texmf-dist/tex/latex/psnfss/times.sty" 1480098837 857 6c716f26c5eadfb81029fcd6ce2d45e6 "" + "/usr/share/texlive/texmf-dist/tex/latex/psnfss/ts1pcr.fd" 1480098837 643 92c451bb86386a4e36a174603ddb5a13 "" + "/usr/share/texlive/texmf-dist/tex/latex/psnfss/ts1ptm.fd" 1480098837 619 96f56dc5d1ef1fe1121f1cfeec70ee0c "" + "/usr/share/texlive/texmf-dist/tex/latex/tabulary/tabulary.sty" 1480098840 13791 8c83287d79183c3bf58fd70871e8a70b "" + "/usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty" 1480098841 37387 afa86533e532701faf233f3f592c61e0 "" + "/usr/share/texlive/texmf-dist/tex/latex/tools/array.sty" 1485129666 12396 d41f82b039f900e95f351e54ae740f31 "" + "/usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty" 1480098841 12083 80916157594a8e4354985aaefae4f367 "" + "/usr/share/texlive/texmf-dist/tex/latex/upquote/upquote.sty" 1480098842 1048 517e01cde97c1c0baf72e69d43aa5a2e "" + "/usr/share/texlive/texmf-dist/tex/latex/url/url.sty" 1480098842 12796 8edb7d69a20b857904dd0ea757c14ec9 "" + "/usr/share/texlive/texmf-dist/tex/latex/varwidth/varwidth.sty" 1480098842 10894 d359a13923460b2a73d4312d613554c8 "" + "/usr/share/texlive/texmf-dist/tex/latex/wrapfig/wrapfig.sty" 1480098843 26220 3701aebf80ccdef248c0c20dd062fea9 "" + "/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty" 1480098843 55589 34128738f682d033422ca125f82e5d62 "" + "/usr/share/texlive/texmf-dist/web2c/texmf.cnf" 1520210507 32485 c64754543d8ac501bea6e75e209ea521 "" + "/usr/share/texmf/web2c/texmf.cnf" 1520210507 32485 c64754543d8ac501bea6e75e209ea521 "" + "/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map" 1532595942 127853 b41f58aff49fe1af38af8d065f49d51c "" + "/var/lib/texmf/web2c/pdftex/pdflatex.fmt" 1532595943 859996 8c94eee6606aa630db5562da5c97f574 "" + "API.png" 1531317514 90603 4c89bb31bbc3d1dc02b9f51b8c9b17dc "" + "API_0.png" 1531317514 64843 5ca35d2ef731cfb993277fd681c2f43e "" + "API_01.png" 1531317514 31045 ca420b9e92e91d263a8dbef03ceb7558 "" + "API_20.png" 1531317514 74045 df899fca99f865bbad43068bd73537c0 "" + "API_class.png" 1531317514 67292 d8b5c3bb136d036cac0375d7cbc6eb92 "" + "API_class_10.png" 1531317514 79566 bf254e9c2d5e9cb521a673efc49b68fb "" + "API_class_11.png" 1531317514 79838 feefc93e89571251088a6600e1c11352 "" + "API_class_12.png" 1531317514 80875 3ef346f7495318c77342654e570d4fcd "" + "API_threshold.png" 1531317514 66854 b7d737265ad04e6c8bafc94b5c290b10 "" + "API_threshold_1.png" 1531317514 81853 4cef6a6929b31248cda55389b5d8e678 "" + "API_threshold_2.png" 1531317514 72060 d765b26fa23b2fb349475dae1e88cfdc "" + "API_threshold_ajout.png" 1531317514 75975 4c3c5c6d8afb5172e9349282bee9b3fb "" + "APIs_0.png" 1531317514 125183 e63cb5ba05572f77a6a9e37458463432 "" + "APIs_01.png" 1531317514 174841 f75d8b749d5106f314e942790e2dbdb6 "" + "ChaineTraitementCarHab.png" 1531317514 98385 8e1c3d2d05de67d95291b053346e11af "" + "ChainedeTraitementCarHab_API_UML_v3.png" 1531317514 20436 3b417453836deca277e97272d7822dbf "" + "ChainedeTraitementCarHab_UML_v2.png" 1531317514 36830 0aac89b25079690005ba4de8880896f7 "" + "Phymobat.aux" 1536939074 22772 ef64bb77cae45961a27d7be0d1c179db "" + "Phymobat.ind" 1536938912 9459 f44b5c2d1404abe8555e996c151a8046 "makeindex Phymobat.idx" + "Phymobat.out" 1536939074 6266 d28396ba7ef018ceecc70e0082cbc748 "" + "Phymobat.tex" 1537359813 139298 d475eda0360d0540bb184d25b330e8d0 "" + "Phymobat.toc" 1536939074 3879 9a7c67ef758d8fd3cf6c1418a83c2656 "" + "arbreDecision_cut.png" 1531317514 33986 69dc0b0a8bc9f13664ccc31fc5a5c848 "" + "footnotehyper-sphinx.sty" 1536763510 8886 0562fcad2b7e25f93331edc6fc422c87 "" + "phytomasse.png" 1531317514 50311 12ec190285fddc7eeb2e955afb418e70 "" + "spectral_cloud.png" 1531317514 416960 9b772cac625a62a4bc8c059658dfc6f3 "" + "sphinx.sty" 1536763510 68662 158e7929147502e48ab2fdf26a101dfd "" + "sphinxhighlight.sty" 1537359813 8137 38a433148fcb7611515a989ff1750dd5 "" + "sphinxmanual.cls" 1536763510 3589 0b0aac49c6f36925cf5f9d524a75a978 "" + "sphinxmulticell.sty" 1536763510 14618 0defbdc8536ad2e67f1eac6a1431bc55 "" + "temporal_cloud.png" 1531317514 31800 e32b0dff0a7a67ccfae90195af45db2f "" + (generated) + "Phymobat.toc" + "Phymobat.pdf" + "Phymobat.idx" + "Phymobat.out" + "Phymobat.log" + "Phymobat.aux" diff --git a/Documentation/_build/latex/Phymobat.fls b/Documentation/_build/latex/Phymobat.fls new file mode 100644 index 0000000000000000000000000000000000000000..56ed7d7a5ffdc4ee86d5ab0534406b8104333694 --- /dev/null +++ b/Documentation/_build/latex/Phymobat.fls @@ -0,0 +1,428 @@ +PWD /media/commandre/8ce2dd88-1425-4161-a3c1-47f566c0285a/PHYMOBAT_2018/Documentation/_build/latex +INPUT /etc/texmf/web2c/texmf.cnf +INPUT /usr/share/texmf/web2c/texmf.cnf +INPUT /usr/share/texlive/texmf-dist/web2c/texmf.cnf +INPUT /var/lib/texmf/web2c/pdftex/pdflatex.fmt +INPUT Phymobat.tex +OUTPUT Phymobat.log +INPUT sphinxmanual.cls +INPUT sphinxmanual.cls +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/report.cls +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/report.cls +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/size10.clo +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/size10.clo +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/utf8.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/utf8.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu +INPUT /usr/share/texlive/texmf-dist/tex/latex/cmap/cmap.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/cmap/cmap.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/t1enc.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/t1enc.def +INPUT /usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/jknappen/ec/ecrm1000.tfm +INPUT /usr/share/texlive/texmf-dist/tex/latex/cmap/t1.cmap +OUTPUT Phymobat.pdf +INPUT /usr/share/texlive/texmf-dist/tex/latex/cmap/t1.cmap +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/babel/switch.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/psnfss/times.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/psnfss/times.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/fncychap/fncychap.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/fncychap/fncychap.sty +INPUT sphinx.sty +INPUT sphinx.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.dfu +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.dfu +INPUT /usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/tabulary/tabulary.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/tabulary/tabulary.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/tools/array.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/tools/array.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/varwidth/varwidth.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/varwidth/varwidth.sty +INPUT sphinxmulticell.sty +INPUT sphinxmulticell.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/makeidx.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/makeidx.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/framed/framed.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/framed/framed.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg +INPUT /usr/share/texlive/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty +INPUT footnotehyper-sphinx.sty +INPUT footnotehyper-sphinx.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/float/float.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/float/float.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/wrapfig/wrapfig.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/wrapfig/wrapfig.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/parskip/parskip.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/parskip/parskip.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/alltt.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/alltt.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/upquote/upquote.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/upquote/upquote.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/capt-of/capt-of.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/capt-of/capt-of.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/needspace/needspace.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/needspace/needspace.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/carlisle/remreset.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/carlisle/remreset.sty +INPUT sphinxhighlight.sty +INPUT sphinxhighlight.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg +INPUT /usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/puenc.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/puenc.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/url/url.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/url/url.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/hypcap.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/hypcap.sty +OUTPUT Phymobat.idx +INPUT Phymobat.aux +INPUT Phymobat.aux +OUTPUT Phymobat.aux +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd +INPUT /usr/share/texlive/texmf-dist/tex/latex/psnfss/t1ptm.fd +INPUT /usr/share/texlive/texmf-dist/tex/latex/psnfss/t1ptm.fd +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr8t.tfm +INPUT /usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii +INPUT /usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii +INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg +INPUT /usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty +INPUT Phymobat.out +INPUT Phymobat.out +INPUT Phymobat.out +INPUT Phymobat.out +INPUT ./Phymobat.out +INPUT ./Phymobat.out +OUTPUT Phymobat.out +INPUT /usr/share/texlive/texmf-dist/tex/latex/psnfss/t1phv.fd +INPUT /usr/share/texlive/texmf-dist/tex/latex/psnfss/t1phv.fd +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvr8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvbo8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvbo8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr17.tfm +INPUT /usr/share/texlive/texmf-dist/tex/latex/cmap/ot1.cmap +INPUT /usr/share/texlive/texmf-dist/tex/latex/cmap/ot1.cmap +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi12.tfm +INPUT /usr/share/texlive/texmf-dist/tex/latex/mmap/oml.cmap +INPUT /usr/share/texlive/texmf-dist/tex/latex/mmap/oml.cmap +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi12.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm +INPUT /usr/share/texlive/texmf-dist/tex/latex/mmap/oms.cmap +INPUT /usr/share/texlive/texmf-dist/tex/latex/mmap/oms.cmap +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmex10.tfm +INPUT /usr/share/texlive/texmf-dist/tex/latex/mmap/omx.cmap +INPUT /usr/share/texlive/texmf-dist/tex/latex/mmap/omx.cmap +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmex10.tfm +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam10.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam10.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam10.tfm +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd +INPUT /usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm10.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm10.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm10.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvb8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb8r.tfm +INPUT /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvbo8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvbo8r.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvb8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb8r.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvb8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb8r.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvr8t.tfm +INPUT Phymobat.toc +INPUT Phymobat.toc +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmb8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex7.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex7.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam7.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam5.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm7.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm5.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvr8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvr8r.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmb8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmb8r.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmr8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr8r.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvb8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb8r.tfm +OUTPUT Phymobat.toc +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvr8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb8t.tfm +INPUT /usr/share/texlive/texmf-dist/tex/latex/psnfss/t1pcr.fd +INPUT /usr/share/texlive/texmf-dist/tex/latex/psnfss/t1pcr.fd +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrr8t.tfm +INPUT /usr/share/texlive/texmf-dist/tex/latex/psnfss/ts1ptm.fd +INPUT /usr/share/texlive/texmf-dist/tex/latex/psnfss/ts1ptm.fd +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr8c.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrr8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrr8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvr8t.tfm +INPUT /usr/share/texlive/texmf-dist/tex/latex/psnfss/ts1pcr.fd +INPUT /usr/share/texlive/texmf-dist/tex/latex/psnfss/ts1pcr.fd +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrr8c.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvr8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvr8r.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvb8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb8r.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/courier/pcrr8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrr8r.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmr8c.vf +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/courier/pcrr8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrr8r.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/courier/pcrr8c.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrb8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/courier/pcrb8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrb8r.tfm +INPUT arbreDecision_cut.png +INPUT ./arbreDecision_cut.png +INPUT ./arbreDecision_cut.png +INPUT arbreDecision_cut.png +INPUT ./arbreDecision_cut.png +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmri8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmri8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmri8r.tfm +INPUT ChaineTraitementCarHab.png +INPUT ./ChaineTraitementCarHab.png +INPUT ./ChaineTraitementCarHab.png +INPUT ChaineTraitementCarHab.png +INPUT ./ChaineTraitementCarHab.png +INPUT spectral_cloud.png +INPUT ./spectral_cloud.png +INPUT ./spectral_cloud.png +INPUT spectral_cloud.png +INPUT ./spectral_cloud.png +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrro8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrro8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/courier/pcrro8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrro8r.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/courier/pcrro8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrro8r.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmr8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr8r.tfm +INPUT temporal_cloud.png +INPUT ./temporal_cloud.png +INPUT ./temporal_cloud.png +INPUT temporal_cloud.png +INPUT ./temporal_cloud.png +INPUT phytomasse.png +INPUT ./phytomasse.png +INPUT ./phytomasse.png +INPUT phytomasse.png +INPUT ./phytomasse.png +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrro8c.tfm +INPUT APIs_0.png +INPUT ./APIs_0.png +INPUT ./APIs_0.png +INPUT APIs_0.png +INPUT ./APIs_0.png +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/courier/pcrro8c.vf +INPUT APIs_01.png +INPUT ./APIs_01.png +INPUT ./APIs_01.png +INPUT APIs_01.png +INPUT ./APIs_01.png +INPUT API_0.png +INPUT ./API_0.png +INPUT ./API_0.png +INPUT API_0.png +INPUT ./API_0.png +INPUT API.png +INPUT ./API.png +INPUT ./API.png +INPUT API.png +INPUT ./API.png +INPUT API_01.png +INPUT ./API_01.png +INPUT ./API_01.png +INPUT API_01.png +INPUT ./API_01.png +INPUT API_20.png +INPUT ./API_20.png +INPUT ./API_20.png +INPUT API_20.png +INPUT ./API_20.png +INPUT API_threshold.png +INPUT ./API_threshold.png +INPUT ./API_threshold.png +INPUT API_threshold.png +INPUT ./API_threshold.png +INPUT API_threshold_ajout.png +INPUT ./API_threshold_ajout.png +INPUT ./API_threshold_ajout.png +INPUT API_threshold_ajout.png +INPUT ./API_threshold_ajout.png +INPUT API_threshold_1.png +INPUT ./API_threshold_1.png +INPUT ./API_threshold_1.png +INPUT API_threshold_1.png +INPUT ./API_threshold_1.png +INPUT API_threshold_2.png +INPUT ./API_threshold_2.png +INPUT ./API_threshold_2.png +INPUT API_threshold_2.png +INPUT ./API_threshold_2.png +INPUT API_class.png +INPUT ./API_class.png +INPUT ./API_class.png +INPUT API_class.png +INPUT ./API_class.png +INPUT API_class_10.png +INPUT ./API_class_10.png +INPUT ./API_class_10.png +INPUT API_class_10.png +INPUT ./API_class_10.png +INPUT API_class_11.png +INPUT ./API_class_11.png +INPUT ./API_class_11.png +INPUT API_class_11.png +INPUT ./API_class_11.png +INPUT API_class_12.png +INPUT ./API_class_12.png +INPUT ./API_class_12.png +INPUT API_class_12.png +INPUT ./API_class_12.png +INPUT ChainedeTraitementCarHab_UML_v2.png +INPUT ./ChainedeTraitementCarHab_UML_v2.png +INPUT ./ChainedeTraitementCarHab_UML_v2.png +INPUT ChainedeTraitementCarHab_UML_v2.png +INPUT ./ChainedeTraitementCarHab_UML_v2.png +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrb8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/courier/pcrb8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/courier/pcrb8r.tfm +INPUT ChainedeTraitementCarHab_API_UML_v3.png +INPUT ./ChainedeTraitementCarHab_API_UML_v3.png +INPUT ./ChainedeTraitementCarHab_API_UML_v3.png +INPUT ChainedeTraitementCarHab_API_UML_v3.png +INPUT ./ChainedeTraitementCarHab_API_UML_v3.png +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmbi8t.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmbi8t.vf +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmbi8r.tfm +INPUT Phymobat.ind +INPUT Phymobat.ind +INPUT Phymobat.aux +INPUT ./Phymobat.out +INPUT ./Phymobat.out +INPUT /usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc +INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi5.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy5.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/urw/courier/ucrb8a.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/urw/courier/ucrr8a.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/urw/courier/ucrro8a.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvb8a.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvbo8a.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvr8a.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmb8a.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmbi8a.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmr8a.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmri8a.pfb diff --git a/Documentation/_build/latex/Phymobat.idx b/Documentation/_build/latex/Phymobat.idx new file mode 100644 index 0000000000000000000000000000000000000000..dc5bc7c0c888a8ae043cbce445b8d18aad70ed3c --- /dev/null +++ b/Documentation/_build/latex/Phymobat.idx @@ -0,0 +1,118 @@ +\indexentry{Archive (module)|hyperpage}{35} +\indexentry{Archive (classe dans Archive)|hyperpage}{35} +\indexentry{coord\_box\_dd() (m\IeC {\'e}thode Archive.Archive)|hyperpage}{36} +\indexentry{decompress() (m\IeC {\'e}thode Archive.Archive)|hyperpage}{36} +\indexentry{download\_auto() (m\IeC {\'e}thode Archive.Archive)|hyperpage}{36} +\indexentry{listing() (m\IeC {\'e}thode Archive.Archive)|hyperpage}{36} +\indexentry{set\_list\_archive\_to\_try() (m\IeC {\'e}thode Archive.Archive)|hyperpage}{36} +\indexentry{utm\_to\_latlng() (m\IeC {\'e}thode Archive.Archive)|hyperpage}{36} +\indexentry{RasterSat\_by\_date (module)|hyperpage}{37} +\indexentry{RasterSat\_by\_date (classe dans RasterSat\_by\_date)|hyperpage}{37} +\indexentry{calcul\_ndvi() (m\IeC {\'e}thode RasterSat\_by\_date.RasterSat\_by\_date)|hyperpage}{37} +\indexentry{group\_by\_date() (m\IeC {\'e}thode RasterSat\_by\_date.RasterSat\_by\_date)|hyperpage}{37} +\indexentry{mosaic\_by\_date() (m\IeC {\'e}thode RasterSat\_by\_date.RasterSat\_by\_date)|hyperpage}{37} +\indexentry{pourc\_cloud() (m\IeC {\'e}thode RasterSat\_by\_date.RasterSat\_by\_date)|hyperpage}{37} +\indexentry{raster\_data() (m\IeC {\'e}thode RasterSat\_by\_date.RasterSat\_by\_date)|hyperpage}{37} +\indexentry{vrt\_translate\_gdal() (m\IeC {\'e}thode RasterSat\_by\_date.RasterSat\_by\_date)|hyperpage}{38} +\indexentry{Vhrs (module)|hyperpage}{38} +\indexentry{Vhrs (classe dans Vhrs)|hyperpage}{38} +\indexentry{haralick\_texture\_extraction() (m\IeC {\'e}thode Vhrs.Vhrs)|hyperpage}{38} +\indexentry{sfs\_texture\_extraction() (m\IeC {\'e}thode Vhrs.Vhrs)|hyperpage}{39} +\indexentry{Slope (module)|hyperpage}{39} +\indexentry{Slope (classe dans Slope)|hyperpage}{39} +\indexentry{extract\_slope() (m\IeC {\'e}thode Slope.Slope)|hyperpage}{39} +\indexentry{Toolbox (module)|hyperpage}{39} +\indexentry{Toolbox (classe dans Toolbox)|hyperpage}{39} +\indexentry{calc\_serie\_stats() (m\IeC {\'e}thode Toolbox.Toolbox)|hyperpage}{40} +\indexentry{check\_proj() (m\IeC {\'e}thode Toolbox.Toolbox)|hyperpage}{40} +\indexentry{clip\_raster() (m\IeC {\'e}thode Toolbox.Toolbox)|hyperpage}{40} +\indexentry{Vector (module)|hyperpage}{40} +\indexentry{Vector (classe dans Vector)|hyperpage}{40} +\indexentry{clip\_vector() (m\IeC {\'e}thode Vector.Vector)|hyperpage}{40} +\indexentry{close\_data() (m\IeC {\'e}thode Vector.Vector)|hyperpage}{40} +\indexentry{layer\_rasterization() (m\IeC {\'e}thode Vector.Vector)|hyperpage}{40} +\indexentry{vector\_data() (m\IeC {\'e}thode Vector.Vector)|hyperpage}{41} +\indexentry{zonal\_stats() (m\IeC {\'e}thode Vector.Vector)|hyperpage}{41} +\indexentry{zonal\_stats\_pp() (m\IeC {\'e}thode Vector.Vector)|hyperpage}{41} +\indexentry{Sample (module)|hyperpage}{41} +\indexentry{Sample (classe dans Sample)|hyperpage}{41} +\indexentry{create\_sample() (m\IeC {\'e}thode Sample.Sample)|hyperpage}{41} +\indexentry{fill\_sample() (m\IeC {\'e}thode Sample.Sample)|hyperpage}{41} +\indexentry{select\_random\_sample() (m\IeC {\'e}thode Sample.Sample)|hyperpage}{41} +\indexentry{Rpg (module)|hyperpage}{42} +\indexentry{Rpg (classe dans Rpg)|hyperpage}{42} +\indexentry{create\_new\_rpg\_files() (m\IeC {\'e}thode Rpg.Rpg)|hyperpage}{42} +\indexentry{mono\_rpg() (m\IeC {\'e}thode Rpg.Rpg)|hyperpage}{42} +\indexentry{Seath (module)|hyperpage}{42} +\indexentry{Seath (classe dans Seath)|hyperpage}{42} +\indexentry{separability\_and\_threshold() (m\IeC {\'e}thode Seath.Seath)|hyperpage}{42} +\indexentry{Segmentation (module)|hyperpage}{43} +\indexentry{Segmentation (classe dans Segmentation)|hyperpage}{43} +\indexentry{append\_scale() (m\IeC {\'e}thode Segmentation.Segmentation)|hyperpage}{43} +\indexentry{compute\_biomass\_density() (m\IeC {\'e}thode Segmentation.Segmentation)|hyperpage}{43} +\indexentry{create\_cartography() (m\IeC {\'e}thode Segmentation.Segmentation)|hyperpage}{43} +\indexentry{decision\_tree() (m\IeC {\'e}thode Segmentation.Segmentation)|hyperpage}{44} +\indexentry{PHYMOBAT (module)|hyperpage}{46} +\indexentry{PHYMOBAT (classe dans PHYMOBAT)|hyperpage}{46} +\indexentry{about\_PHYMOBA() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{46} +\indexentry{activate\_level() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{46} +\indexentry{add\_sample() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{46} +\indexentry{block\_for\_swh() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{46} +\indexentry{change\_mode() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{46} +\indexentry{clear\_sample() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{46} +\indexentry{close\_button() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{46} +\indexentry{display\_all\_levels() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{display\_one\_level() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{display\_two\_levels() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{enter\_sample\_name() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{enter\_sample\_name\_hl() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{enter\_sample\_name\_ll() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{f\_output\_name\_moba() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{f\_path\_area() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{f\_path\_folder\_dpt() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{f\_path\_mnt() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{f\_path\_ortho() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{f\_path\_segm() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{f\_proxy() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{field\_display\_1() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{field\_display\_2() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{field\_display\_3() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{field\_display\_4() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{field\_display\_5() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{47} +\indexentry{field\_display\_6() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{48} +\indexentry{forget\_raster\_sample() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{48} +\indexentry{forget\_study\_area() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{48} +\indexentry{get\_variable() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{48} +\indexentry{help\_tools() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{48} +\indexentry{img\_sample\_name() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{48} +\indexentry{initUI() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{48} +\indexentry{ok\_button() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{49} +\indexentry{open\_backup() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{49} +\indexentry{save\_backup() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{49} +\indexentry{set\_variable() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT)|hyperpage}{49} +\indexentry{Processing (module)|hyperpage}{49} +\indexentry{Processing (classe dans Processing)|hyperpage}{49} +\indexentry{i\_classifier\_rf() (m\IeC {\'e}thode Processing.Processing)|hyperpage}{50} +\indexentry{i\_classifier\_s() (m\IeC {\'e}thode Processing.Processing)|hyperpage}{50} +\indexentry{i\_download() (m\IeC {\'e}thode Processing.Processing)|hyperpage}{50} +\indexentry{i\_images\_processing() (m\IeC {\'e}thode Processing.Processing)|hyperpage}{50} +\indexentry{i\_img\_sat() (m\IeC {\'e}thode Processing.Processing)|hyperpage}{50} +\indexentry{i\_rpg() (m\IeC {\'e}thode Processing.Processing)|hyperpage}{51} +\indexentry{i\_sample() (m\IeC {\'e}thode Processing.Processing)|hyperpage}{51} +\indexentry{i\_sample\_rf() (m\IeC {\'e}thode Processing.Processing)|hyperpage}{51} +\indexentry{i\_slope() (m\IeC {\'e}thode Processing.Processing)|hyperpage}{51} +\indexentry{i\_tree\_direction() (m\IeC {\'e}thode Processing.Processing)|hyperpage}{51} +\indexentry{i\_validate() (m\IeC {\'e}thode Processing.Processing)|hyperpage}{51} +\indexentry{i\_vhrs() (m\IeC {\'e}thode Processing.Processing)|hyperpage}{51} +\indexentry{ui\_PHYMOBATs\_tab (module)|hyperpage}{52} +\indexentry{Ui\_PHYMOBAT (classe dans ui\_PHYMOBATs\_tab)|hyperpage}{52} +\indexentry{ui\_PHYMOBATe\_tab (module)|hyperpage}{52} +\indexentry{Ui\_PHYMOBAT (classe dans ui\_PHYMOBATe\_tab)|hyperpage}{52} +\indexentry{ui\_A\_propos\_PHYMOBAT\_window (module)|hyperpage}{52} +\indexentry{Ui\_About (classe dans ui\_A\_propos\_PHYMOBAT\_window)|hyperpage}{52} +\indexentry{ui\_Warming\_study\_area (module)|hyperpage}{52} +\indexentry{Ui\_Warming\_study\_area (classe dans ui\_Warming\_study\_area)|hyperpage}{52} +\indexentry{ui\_Warming\_forgetting (module)|hyperpage}{52} +\indexentry{Ui\_Warming\_forgetting (classe dans ui\_Warming\_forgetting)|hyperpage}{52} +\indexentry{ui\_Proxy\_window (module)|hyperpage}{52} +\indexentry{Ui\_Proxy\_window (classe dans ui\_Proxy\_window)|hyperpage}{52} diff --git a/Documentation/_build/latex/Phymobat.ilg b/Documentation/_build/latex/Phymobat.ilg new file mode 100644 index 0000000000000000000000000000000000000000..d9a4824bfdc035fbc4eaf3bb647605628915a491 --- /dev/null +++ b/Documentation/_build/latex/Phymobat.ilg @@ -0,0 +1,7 @@ +This is makeindex, version 2.15 [TeX Live 2017] (kpathsea + Thai support). +Scanning style file ./python.ist.......done (7 attributes redefined, 0 ignored). +Scanning input file Phymobat.idx....done (120 entries accepted, 0 rejected). +Sorting entries....done (959 comparisons). +Generating output file Phymobat.ind....done (185 lines written, 0 warnings). +Output written in Phymobat.ind. +Transcript written in Phymobat.ilg. diff --git a/Documentation/_build/latex/Phymobat.ind b/Documentation/_build/latex/Phymobat.ind new file mode 100644 index 0000000000000000000000000000000000000000..0a04984078b1cf891527a13fc322ddac2ed796ca --- /dev/null +++ b/Documentation/_build/latex/Phymobat.ind @@ -0,0 +1,185 @@ +\begin{sphinxtheindex} +\def\bigletter#1{{\Large\sffamily#1}\nopagebreak\vspace{1mm}} + + \bigletter A + \item about\_PHYMOBA() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{46} + \item activate\_level() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{46} + \item add\_sample() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{46} + \item append\_scale() (m\IeC {\'e}thode Segmentation.Segmentation), \hyperpage{44} + \item Archive (classe dans Archive), \hyperpage{35} + \item Archive (module), \hyperpage{35} + + \indexspace + \bigletter B + \item block\_for\_swh() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{46} + + \indexspace + \bigletter C + \item calc\_serie\_stats() (m\IeC {\'e}thode Toolbox.Toolbox), \hyperpage{40} + \item calcul\_ndvi() (m\IeC {\'e}thode RasterSat\_by\_date.RasterSat\_by\_date), \hyperpage{37} + \item change\_mode() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{46} + \item check\_proj() (m\IeC {\'e}thode Toolbox.Toolbox), \hyperpage{40} + \item clear\_sample() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{46} + \item clip\_raster() (m\IeC {\'e}thode Toolbox.Toolbox), \hyperpage{40} + \item clip\_vector() (m\IeC {\'e}thode Vector.Vector), \hyperpage{41} + \item close\_button() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{46} + \item close\_data() (m\IeC {\'e}thode Vector.Vector), \hyperpage{41} + \item complete\_raster() (m\IeC {\'e}thode RasterSat\_by\_date.RasterSat\_by\_date), + \hyperpage{37} + \item compute\_biomass\_density() (m\IeC {\'e}thode Segmentation.Segmentation), \hyperpage{44} + \item coord\_box\_dd() (m\IeC {\'e}thode Archive.Archive), \hyperpage{36} + \item create\_cartography() (m\IeC {\'e}thode Segmentation.Segmentation), \hyperpage{44} + \item create\_empty\_raster() (m\IeC {\'e}thode RasterSat\_by\_date.RasterSat\_by\_date), + \hyperpage{37} + \item create\_new\_rpg\_files() (m\IeC {\'e}thode Rpg.Rpg), \hyperpage{42} + \item create\_sample() (m\IeC {\'e}thode Sample.Sample), \hyperpage{42} + + \indexspace + \bigletter D + \item decision\_tree() (m\IeC {\'e}thode Segmentation.Segmentation), \hyperpage{44} + \item decompress() (m\IeC {\'e}thode Archive.Archive), \hyperpage{36} + \item display\_all\_levels() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item display\_one\_level() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item display\_two\_levels() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item download\_auto() (m\IeC {\'e}thode Archive.Archive), \hyperpage{36} + + \indexspace + \bigletter E + \item enter\_sample\_name() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item enter\_sample\_name\_hl() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item enter\_sample\_name\_ll() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item extract\_slope() (m\IeC {\'e}thode Slope.Slope), \hyperpage{40} + + \indexspace + \bigletter F + \item f\_output\_name\_moba() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item f\_path\_area() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item f\_path\_folder\_dpt() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item f\_path\_mnt() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item f\_path\_ortho() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item f\_path\_segm() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item f\_proxy() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item field\_display\_1() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item field\_display\_2() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item field\_display\_3() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item field\_display\_4() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item field\_display\_5() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{47} + \item field\_display\_6() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{48} + \item fill\_sample() (m\IeC {\'e}thode Sample.Sample), \hyperpage{42} + \item forget\_raster\_sample() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{48} + \item forget\_study\_area() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{48} + + \indexspace + \bigletter G + \item get\_variable() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{48} + \item group\_by\_date() (m\IeC {\'e}thode RasterSat\_by\_date.RasterSat\_by\_date), + \hyperpage{37} + + \indexspace + \bigletter H + \item haralick\_texture\_extraction() (m\IeC {\'e}thode Vhrs.Vhrs), \hyperpage{38} + \item help\_tools() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{48} + + \indexspace + \bigletter I + \item i\_classifier\_rf() (m\IeC {\'e}thode Processing.Processing), \hyperpage{50} + \item i\_classifier\_s() (m\IeC {\'e}thode Processing.Processing), \hyperpage{50} + \item i\_download() (m\IeC {\'e}thode Processing.Processing), \hyperpage{50} + \item i\_images\_processing() (m\IeC {\'e}thode Processing.Processing), \hyperpage{50} + \item i\_img\_sat() (m\IeC {\'e}thode Processing.Processing), \hyperpage{50} + \item i\_rpg() (m\IeC {\'e}thode Processing.Processing), \hyperpage{51} + \item i\_sample() (m\IeC {\'e}thode Processing.Processing), \hyperpage{51} + \item i\_sample\_rf() (m\IeC {\'e}thode Processing.Processing), \hyperpage{51} + \item i\_slope() (m\IeC {\'e}thode Processing.Processing), \hyperpage{51} + \item i\_tree\_direction() (m\IeC {\'e}thode Processing.Processing), \hyperpage{51} + \item i\_validate() (m\IeC {\'e}thode Processing.Processing), \hyperpage{51} + \item i\_vhrs() (m\IeC {\'e}thode Processing.Processing), \hyperpage{51} + \item img\_sample\_name() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{48} + \item initUI() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{48} + + \indexspace + \bigletter L + \item layer\_rasterization() (m\IeC {\'e}thode Vector.Vector), \hyperpage{41} + \item listing() (m\IeC {\'e}thode Archive.Archive), \hyperpage{36} + + \indexspace + \bigletter M + \item mono\_rpg() (m\IeC {\'e}thode Rpg.Rpg), \hyperpage{42} + \item mosaic\_by\_date() (m\IeC {\'e}thode RasterSat\_by\_date.RasterSat\_by\_date), + \hyperpage{37} + + \indexspace + \bigletter O + \item ok\_button() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{49} + \item open\_backup() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{49} + + \indexspace + \bigletter P + \item PHYMOBAT (classe dans PHYMOBAT), \hyperpage{46} + \item PHYMOBAT (module), \hyperpage{46} + \item pourc\_cloud() (m\IeC {\'e}thode RasterSat\_by\_date.RasterSat\_by\_date), \hyperpage{38} + \item Processing (classe dans Processing), \hyperpage{49} + \item Processing (module), \hyperpage{49} + + \indexspace + \bigletter R + \item raster\_data() (m\IeC {\'e}thode RasterSat\_by\_date.RasterSat\_by\_date), \hyperpage{38} + \item RasterSat\_by\_date (classe dans RasterSat\_by\_date), \hyperpage{37} + \item RasterSat\_by\_date (module), \hyperpage{37} + \item Rpg (classe dans Rpg), \hyperpage{42} + \item Rpg (module), \hyperpage{42} + + \indexspace + \bigletter S + \item Sample (classe dans Sample), \hyperpage{41} + \item Sample (module), \hyperpage{41} + \item save\_backup() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{49} + \item Seath (classe dans Seath), \hyperpage{43} + \item Seath (module), \hyperpage{43} + \item Segmentation (classe dans Segmentation), \hyperpage{43} + \item Segmentation (module), \hyperpage{43} + \item select\_random\_sample() (m\IeC {\'e}thode Sample.Sample), \hyperpage{42} + \item separability\_and\_threshold() (m\IeC {\'e}thode Seath.Seath), \hyperpage{43} + \item set\_list\_archive\_to\_try() (m\IeC {\'e}thode Archive.Archive), \hyperpage{36} + \item set\_variable() (m\IeC {\'e}thode PHYMOBAT.PHYMOBAT), \hyperpage{49} + \item sfs\_texture\_extraction() (m\IeC {\'e}thode Vhrs.Vhrs), \hyperpage{39} + \item Slope (classe dans Slope), \hyperpage{40} + \item Slope (module), \hyperpage{40} + + \indexspace + \bigletter T + \item Toolbox (classe dans Toolbox), \hyperpage{40} + \item Toolbox (module), \hyperpage{40} + + \indexspace + \bigletter U + \item ui\_A\_propos\_PHYMOBAT\_window (module), \hyperpage{52} + \item Ui\_About (classe dans ui\_A\_propos\_PHYMOBAT\_window), \hyperpage{52} + \item Ui\_PHYMOBAT (classe dans ui\_PHYMOBATe\_tab), \hyperpage{52} + \item Ui\_PHYMOBAT (classe dans ui\_PHYMOBATs\_tab), \hyperpage{52} + \item ui\_PHYMOBATe\_tab (module), \hyperpage{52} + \item ui\_PHYMOBATs\_tab (module), \hyperpage{52} + \item Ui\_Proxy\_window (classe dans ui\_Proxy\_window), \hyperpage{52} + \item ui\_Proxy\_window (module), \hyperpage{52} + \item Ui\_Warming\_forgetting (classe dans ui\_Warming\_forgetting), \hyperpage{52} + \item ui\_Warming\_forgetting (module), \hyperpage{52} + \item Ui\_Warming\_study\_area (classe dans ui\_Warming\_study\_area), \hyperpage{52} + \item ui\_Warming\_study\_area (module), \hyperpage{52} + \item utm\_to\_latlng() (m\IeC {\'e}thode Archive.Archive), \hyperpage{36} + + \indexspace + \bigletter V + \item Vector (classe dans Vector), \hyperpage{40} + \item Vector (module), \hyperpage{40} + \item vector\_data() (m\IeC {\'e}thode Vector.Vector), \hyperpage{41} + \item Vhrs (classe dans Vhrs), \hyperpage{38} + \item Vhrs (module), \hyperpage{38} + \item vrt\_translate\_gdal() (m\IeC {\'e}thode RasterSat\_by\_date.RasterSat\_by\_date), + \hyperpage{38} + + \indexspace + \bigletter Z + \item zonal\_stats() (m\IeC {\'e}thode Vector.Vector), \hyperpage{41} + \item zonal\_stats\_pp() (m\IeC {\'e}thode Vector.Vector), \hyperpage{41} + +\end{sphinxtheindex} diff --git a/Documentation/_build/latex/Phymobat.out b/Documentation/_build/latex/Phymobat.out new file mode 100644 index 0000000000000000000000000000000000000000..286e8837a505e1d4c0f949146a1407765111d26a --- /dev/null +++ b/Documentation/_build/latex/Phymobat.out @@ -0,0 +1,38 @@ +\BOOKMARK [0][-]{chapter.1}{\376\377\000I\000n\000s\000t\000a\000l\000l\000a\000t\000i\000o\000n}{}% 1 +\BOOKMARK [1][-]{section.1.1}{\376\377\000T\000\351\000l\000\351\000c\000h\000a\000r\000g\000e\000m\000e\000n\000t\000\040\000P\000h\000y\000m\000o\000b\000a\000t}{chapter.1}% 2 +\BOOKMARK [1][-]{section.1.2}{\376\377\000I\000n\000s\000t\000a\000l\000l\000a\000t\000i\000o\000n\000\040\000S\000I\000G\000\040\000o\000p\000e\000n\000\040\000s\000o\000u\000r\000c\000e}{chapter.1}% 3 +\BOOKMARK [2][-]{subsection.1.2.1}{\376\377\000G\000D\000A\000L}{section.1.2}% 4 +\BOOKMARK [2][-]{subsection.1.2.2}{\376\377\000O\000r\000f\000e\000o\000\040\000T\000o\000o\000l\000B\000o\000x\000\040\000\050\000O\000T\000B\000\051}{section.1.2}% 5 +\BOOKMARK [2][-]{subsection.1.2.3}{\376\377\000C\000U\000R\000L}{section.1.2}% 6 +\BOOKMARK [1][-]{section.1.3}{\376\377\000I\000n\000s\000t\000a\000l\000l\000a\000t\000i\000o\000n\000\040\000d\000e\000s\000\040\000m\000o\000d\000u\000l\000e\000s\000\040\000p\000y\000t\000h\000o\000n}{chapter.1}% 7 +\BOOKMARK [0][-]{chapter.2}{\376\377\000P\000r\000o\000c\000e\000s\000s\000u\000s\000\040\000u\000t\000i\000l\000i\000s\000\351\000e\000s\000\040\000e\000t\000\040\000t\000u\000t\000o\000r\000i\000e\000l\000s\000\040\000A\000P\000I}{}% 8 +\BOOKMARK [1][-]{section.2.1}{\376\377\000P\000r\000o\000c\000e\000s\000s\000u\000s\000\040\000a\000l\000g\000o\000r\000i\000t\000h\000m\000i\000q\000u\000e\000s\000\040\000u\000t\000i\000l\000i\000s\000\351\000e\000s}{chapter.2}% 9 +\BOOKMARK [2][-]{subsection.2.1.1}{\376\377\000T\000r\000a\000i\000t\000e\000m\000e\000n\000t\000\040\000d\000e\000s\000\040\000i\000m\000a\000g\000e\000s}{section.2.1}% 10 +\BOOKMARK [2][-]{subsection.2.1.2}{\376\377\000T\000r\000a\000i\000t\000e\000m\000e\000n\000t\000s\000\040\000d\000e\000s\000\040\000\351\000c\000h\000a\000n\000t\000i\000l\000l\000o\000n\000s}{section.2.1}% 11 +\BOOKMARK [2][-]{subsection.2.1.3}{\376\377\000T\000r\000a\000i\000t\000e\000m\000e\000n\000t\000s\000\040\000d\000e\000\040\000c\000l\000a\000s\000s\000i\000f\000i\000c\000a\000t\000i\000o\000n}{section.2.1}% 12 +\BOOKMARK [1][-]{section.2.2}{\376\377\000T\000u\000t\000o\000r\000i\000e\000l\000s\000\040\000i\000n\000t\000e\000r\000f\000a\000c\000e}{chapter.2}% 13 +\BOOKMARK [2][-]{subsection.2.2.1}{\376\377\000I\000n\000t\000e\000r\000f\000a\000c\000e\000\040\000S\000i\000m\000p\000l\000i\000f\000i\000\351\000e}{section.2.2}% 14 +\BOOKMARK [2][-]{subsection.2.2.2}{\376\377\000I\000n\000t\000e\000r\000f\000a\000c\000e\000\040\000e\000x\000p\000e\000r\000t\000e}{section.2.2}% 15 +\BOOKMARK [2][-]{subsection.2.2.3}{\376\377\000I\000n\000t\000e\000r\000f\000a\000c\000e\000\040\000d\000u\000\040\000t\000r\000a\000i\000t\000e\000m\000e\000n\000t\000\040\000d\000e\000s\000\040\000i\000m\000a\000g\000e\000s}{section.2.2}% 16 +\BOOKMARK [2][-]{subsection.2.2.4}{\376\377\000I\000n\000t\000e\000r\000f\000a\000c\000e\000\040\000d\000u\000\040\000t\000r\000a\000i\000t\000e\000m\000e\000n\000t\000\040\000d\000e\000s\000\040\000\351\000c\000h\000a\000n\000t\000i\000l\000l\000o\000n\000s}{section.2.2}% 17 +\BOOKMARK [2][-]{subsection.2.2.5}{\376\377\000I\000n\000t\000e\000r\000f\000a\000c\000e\000\040\000d\000u\000\040\000t\000r\000a\000i\000t\000e\000m\000e\000n\000t\000\040\000d\000e\000\040\000c\000l\000a\000s\000s\000i\000f\000i\000c\000a\000t\000i\000o\000n}{section.2.2}% 18 +\BOOKMARK [0][-]{chapter.3}{\376\377\000C\000a\000r\000H\000a\000b\000\040\000P\000h\000y\000\040\000M\000O\000B\000A\000\040\000p\000a\000c\000k\000a\000g\000e}{}% 19 +\BOOKMARK [1][-]{section.3.1}{\376\377\000I\000m\000a\000g\000e\000\040\000p\000r\000o\000c\000e\000s\000s\000i\000n\000g}{chapter.3}% 20 +\BOOKMARK [2][-]{subsection.3.1.1}{\376\377\000A\000r\000c\000h\000i\000v\000e}{section.3.1}% 21 +\BOOKMARK [2][-]{subsection.3.1.2}{\376\377\000L\000a\000n\000d\000s\000a\000t\000\040\000i\000m\000a\000g\000e\000\040\000p\000r\000o\000c\000e\000s\000s\000i\000n\000g}{section.3.1}% 22 +\BOOKMARK [2][-]{subsection.3.1.3}{\376\377\000T\000e\000x\000t\000u\000r\000e\000\040\000i\000n\000d\000e\000x\000\040\000p\000r\000o\000c\000e\000s\000s\000i\000n\000g}{section.3.1}% 23 +\BOOKMARK [2][-]{subsection.3.1.4}{\376\377\000S\000l\000o\000p\000e\000\040\000p\000r\000o\000c\000e\000s\000s\000i\000n\000g}{section.3.1}% 24 +\BOOKMARK [2][-]{subsection.3.1.5}{\376\377\000T\000o\000o\000l\000b\000o\000x}{section.3.1}% 25 +\BOOKMARK [1][-]{section.3.2}{\376\377\000V\000e\000c\000t\000o\000r\000\040\000p\000r\000o\000c\000e\000s\000s\000i\000n\000g}{chapter.3}% 26 +\BOOKMARK [2][-]{subsection.3.2.1}{\376\377\000S\000u\000p\000e\000r\000\040\000v\000e\000c\000t\000o\000r}{section.3.2}% 27 +\BOOKMARK [2][-]{subsection.3.2.2}{\376\377\000S\000a\000m\000p\000l\000e}{section.3.2}% 28 +\BOOKMARK [2][-]{subsection.3.2.3}{\376\377\000R\000P\000G}{section.3.2}% 29 +\BOOKMARK [2][-]{subsection.3.2.4}{\376\377\000S\000e\000p\000a\000r\000a\000b\000i\000l\000i\000t\000y\000\040\000a\000n\000d\000\040\000t\000h\000r\000e\000s\000h\000o\000l\000d\000\040\000i\000n\000d\000e\000x}{section.3.2}% 30 +\BOOKMARK [2][-]{subsection.3.2.5}{\376\377\000C\000l\000a\000s\000s\000i\000f\000i\000c\000a\000t\000i\000o\000n}{section.3.2}% 31 +\BOOKMARK [0][-]{chapter.4}{\376\377\000G\000r\000a\000p\000h\000i\000c\000a\000l\000\040\000U\000s\000e\000r\000\040\000I\000n\000t\000e\000r\000f\000a\000c\000e\000\040\000p\000a\000c\000k\000a\000g\000e}{}% 32 +\BOOKMARK [1][-]{section.4.1}{\376\377\000I\000n\000t\000e\000r\000f\000a\000c\000e\000\040\000c\000o\000m\000m\000a\000n\000d}{chapter.4}% 33 +\BOOKMARK [1][-]{section.4.2}{\376\377\000C\000o\000n\000t\000r\000o\000l\000\040\000p\000r\000o\000c\000e\000s\000s\000i\000n\000g}{chapter.4}% 34 +\BOOKMARK [1][-]{section.4.3}{\376\377\000I\000n\000t\000e\000r\000f\000a\000c\000e\000\040\000e\000l\000e\000m\000e\000n\000t}{chapter.4}% 35 +\BOOKMARK [1][-]{section.4.4}{\376\377\000P\000o\000p\000u\000p\000\040\000a\000b\000o\000u\000t\000\040\000a\000n\000d\000\040\000w\000a\000r\000m\000i\000n\000g}{chapter.4}% 36 +\BOOKMARK [0][-]{section*.113}{\376\377\000I\000n\000d\000e\000x\000\040\000d\000e\000s\000\040\000m\000o\000d\000u\000l\000e\000s\000\040\000P\000y\000t\000h\000o\000n}{}% 37 +\BOOKMARK [0][-]{section*.114}{\376\377\000I\000n\000d\000e\000x}{}% 38 diff --git a/Documentation/_build/latex/Phymobat.pdf b/Documentation/_build/latex/Phymobat.pdf new file mode 100644 index 0000000000000000000000000000000000000000..869445596508a6f0a859bf2226901751b1ee6a10 Binary files /dev/null and b/Documentation/_build/latex/Phymobat.pdf differ diff --git a/Documentation/_build/latex/Phymobat.tex b/Documentation/_build/latex/Phymobat.tex new file mode 100644 index 0000000000000000000000000000000000000000..2e61ef81a9d923b80db6128a5edee6fd50677a91 --- /dev/null +++ b/Documentation/_build/latex/Phymobat.tex @@ -0,0 +1,2793 @@ +%% Generated by Sphinx. +\def\sphinxdocclass{report} +\documentclass[letterpaper,10pt,french]{sphinxmanual} +\ifdefined\pdfpxdimen + \let\sphinxpxdimen\pdfpxdimen\else\newdimen\sphinxpxdimen +\fi \sphinxpxdimen=.75bp\relax + +\PassOptionsToPackage{warn}{textcomp} +\usepackage[utf8]{inputenc} +\ifdefined\DeclareUnicodeCharacter + \ifdefined\DeclareUnicodeCharacterAsOptional + \DeclareUnicodeCharacter{"00A0}{\nobreakspace} + \DeclareUnicodeCharacter{"2500}{\sphinxunichar{2500}} + \DeclareUnicodeCharacter{"2502}{\sphinxunichar{2502}} + \DeclareUnicodeCharacter{"2514}{\sphinxunichar{2514}} + \DeclareUnicodeCharacter{"251C}{\sphinxunichar{251C}} + \DeclareUnicodeCharacter{"2572}{\textbackslash} + \else + \DeclareUnicodeCharacter{00A0}{\nobreakspace} + \DeclareUnicodeCharacter{2500}{\sphinxunichar{2500}} + \DeclareUnicodeCharacter{2502}{\sphinxunichar{2502}} + \DeclareUnicodeCharacter{2514}{\sphinxunichar{2514}} + \DeclareUnicodeCharacter{251C}{\sphinxunichar{251C}} + \DeclareUnicodeCharacter{2572}{\textbackslash} + \fi +\fi +\usepackage{cmap} +\usepackage[T1]{fontenc} +\usepackage{amsmath,amssymb,amstext} +\usepackage{babel} +\usepackage{times} +\usepackage[Sonny]{fncychap} +\ChNameVar{\Large\normalfont\sffamily} +\ChTitleVar{\Large\normalfont\sffamily} +\usepackage{sphinx} + +\usepackage{geometry} + +% Include hyperref last. +\usepackage{hyperref} +% Fix anchor placement for figures with captions. +\usepackage{hypcap}% it must be loaded after hyperref. +% Set up styles of URL: it should be placed after hyperref. +\urlstyle{same} + +\addto\captionsfrench{\renewcommand{\figurename}{Fig.}} +\addto\captionsfrench{\renewcommand{\tablename}{Tableau}} +\addto\captionsfrench{\renewcommand{\literalblockname}{Code source}} + +\addto\captionsfrench{\renewcommand{\literalblockcontinuedname}{suite de la page précédente}} +\addto\captionsfrench{\renewcommand{\literalblockcontinuesname}{suite sur la page suivante}} + +\addto\extrasfrench{\def\pageautorefname{page}} + +\setcounter{tocdepth}{2} + + + +\title{Phymobat Documentation} +\date{sept. 19, 2018} +\release{2.2} +\author{COMMANDRÉ Benjamin} +\newcommand{\sphinxlogo}{\vbox{}} +\renewcommand{\releasename}{Version} +\makeindex + +\begin{document} +\ifdefined\shorthandoff + \ifnum\catcode`\=\string=\active\shorthandoff{=}\fi + \ifnum\catcode`\"=\active\shorthandoff{"}\fi +\fi +\maketitle +\sphinxtableofcontents +\phantomsection\label{\detokenize{index::doc}} + + +Chaîne de traintement du Fond blanc PHYsionomique des Milieux Ouverts de Basse Altitude par Télédétection (PHYMOBAT). + +\begin{sphinxadmonition}{note}{Note:} +Outil développé sur Linux-Ubuntu 18.04. +\end{sphinxadmonition} + + +\chapter{Installation} +\label{\detokenize{_sources/install:installation}}\label{\detokenize{_sources/install::doc}} + +\section{Téléchargement Phymobat} +\label{\detokenize{_sources/install:telechargement-phymobat}} +Le programme Phymobat peut être cloné à partir du Gitlab Irstea à l’adresse suivante : \sphinxurl{https://gitlab.irstea.fr/benjamin.commandre/PHYMOBAT\_2018.git} + +La branche courante est \sphinxcode{\sphinxupquote{develop}} + + +\section{Installation SIG open source} +\label{\detokenize{_sources/install:installation-sig-open-source}} +La chaîne de traitement est construite sous divers outils open-source, comme \sphinxcode{\sphinxupquote{GDAL}} et \sphinxcode{\sphinxupquote{OGR}}. La démarche à suivre pour installer ces outils est indiquée ci-dessous uniquement sous Linux. +\begin{itemize} +\item {} +Ajouter le dépôt ubuntugis-unstable + +\end{itemize} + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYGZdl{} sudo add\PYGZhy{}apt\PYGZhy{}repository ppa:ubuntugis/ubuntugis\PYGZhy{}unstable +\PYGZdl{} sudo apt\PYGZhy{}get update +\end{sphinxVerbatim} + + +\subsection{GDAL} +\label{\detokenize{_sources/install:gdal}} +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYGZdl{} sudo apt\PYGZhy{}get install gdal\PYGZhy{}bin +\end{sphinxVerbatim} + +Pour vérifier que GDAL est bien installé, taper : + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYGZdl{} gdalinfo +\end{sphinxVerbatim} + +Il est bien installé, si vous avez l’aide de gdalinfo qui s’affiche (Idem pour OGR) : + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +Usage: gdalinfo \PYG{o}{[}\PYGZhy{}\PYGZhy{}help\PYGZhy{}general\PYG{o}{]} \PYG{o}{[}\PYGZhy{}mm\PYG{o}{]} \PYG{o}{[}\PYGZhy{}stats\PYG{o}{]} \PYG{o}{[}\PYGZhy{}hist\PYG{o}{]} \PYG{o}{[}\PYGZhy{}nogcp\PYG{o}{]} \PYG{o}{[}\PYGZhy{}nomd\PYG{o}{]} + \PYG{o}{[}\PYGZhy{}norat\PYG{o}{]} \PYG{o}{[}\PYGZhy{}noct\PYG{o}{]} \PYG{o}{[}\PYGZhy{}nofl\PYG{o}{]} \PYG{o}{[}\PYGZhy{}checksum\PYG{o}{]} \PYG{o}{[}\PYGZhy{}proj4\PYG{o}{]} + \PYG{o}{[}\PYGZhy{}listmdd\PYG{o}{]} \PYG{o}{[}\PYGZhy{}mdd domain\PYG{p}{\textbar{}}\PYG{l+s+sb}{{}`}all\PYG{l+s+sb}{{}`}\PYG{o}{]}* + \PYG{o}{[}\PYGZhy{}sd subdataset\PYG{o}{]} datasetname + +FAILURE: No datasource specified. +\end{sphinxVerbatim} + + +\subsection{Orfeo ToolBox (OTB)} +\label{\detokenize{_sources/install:orfeo-toolbox-otb}} +Commencer par installer les dépendances requises avec la commande suivante : + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYGZdl{} sudo aptitude install make cmake\PYGZhy{}curses\PYGZhy{}gui build\PYGZhy{}essential libtool automake git libbz2\PYGZhy{}dev python\PYGZhy{}dev libboost\PYGZhy{}dev libboost\PYGZhy{}filesystem\PYGZhy{}dev libboost\PYGZhy{}serialization\PYGZhy{}dev libboost\PYGZhy{}system\PYGZhy{}dev zlib1g\PYGZhy{}dev libcurl4\PYGZhy{}gnutls\PYGZhy{}dev swig +\end{sphinxVerbatim} + +Cloner la dernière version d’OTB présente sur le git à l’url : \sphinxurl{https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb}, par exemple : + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYGZdl{} git clone https://gitlab.orfeo\PYGZhy{}toolbox.org/orfeotoolbox/otb.git +\end{sphinxVerbatim} + +Suivez les instructions du manuel d’utilisation d’OTB, \sphinxurl{https://www.orfeo-toolbox.org/packages/OTBSoftwareGuide.pdf}, pour compiler en mode « SuperBuild ». + +Cloner le module SimpleExtractionTools à l’url: \sphinxurl{https://gitlab.irstea.fr/benjamin.commandre/SimpleExtractionToolsPhymobat} dans le répertoire \sphinxcode{\sphinxupquote{OTB/Module/Remote}} puis compilez et installez-le. + + +\subsection{CURL} +\label{\detokenize{_sources/install:curl}} +Vérifier que le package CURL est installé, sur certaines versions de Ubuntu il ne l’est pas : + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYGZdl{} apt\PYGZhy{}cache search curl + +i A curl \PYGZhy{} outil en ligne de commande pour transférer des données avec une syntaxe URL +p curl:i386 \PYGZhy{} outil en ligne de commande pour transférer des données avec une syntaxe URL +p curlftpfs \PYGZhy{} Système de fichiers pour accéder à des hôtes FTP, basé sur FUSE et cURL +\end{sphinxVerbatim} + +S’il ne l’est pas : + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYGZdl{} sudo apt\PYGZhy{}get install curl +\end{sphinxVerbatim} + + +\section{Installation des modules python} +\label{\detokenize{_sources/install:installation-des-modules-python}} +La version de Python utilisée est la 3.6.5 + +Installer les deux modules Python \sphinxcode{\sphinxupquote{gdal}}, \sphinxcode{\sphinxupquote{scikit-learn}}, \sphinxcode{\sphinxupquote{Shapely}}, \sphinxcode{\sphinxupquote{numpy}}, \sphinxcode{\sphinxupquote{lxml}} et \sphinxcode{\sphinxupquote{pyQt5}} depuis le dépôt du système de la façon suivante : + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYGZdl{} sudo aptitude install pythonÂ3\PYGZhy{}gdal pythonÂ3\PYGZhy{}sklearn python3\PYGZhy{}shapely python3\PYGZhy{}numpy python3\PYGZhy{}lxml libqt5 pyqt5\PYGZhy{}dev\PYGZhy{}tools +\end{sphinxVerbatim} + +Pour vérifier si les modules sont bien installé ou dèjà installé, il suffit de taper dans la console Python (Par exemple pour le module gdal): + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{osgeo} \PYG{k}{import} \PYG{n}{gdal} +\PYG{g+go}{\PYGZgt{}\PYGZgt{}\PYGZgt{}} +\end{sphinxVerbatim} + +Si ils ne sont pas encore installé vous aurez ces réponses. Dans ce cas il faudra les installer (voir section ci-dessus) : + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{osgeo} \PYG{k}{import} \PYG{n}{gdal} +\PYG{g+go}{ImportError: cannot import name gdal} +\end{sphinxVerbatim} + +Ou + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{osgeo} \PYG{k}{import} \PYG{n}{gdal} +\PYG{g+go}{ImportError: No module named gdal} +\end{sphinxVerbatim} + + +\chapter{Processus utilisées et tutoriels API} +\label{\detokenize{_sources/methode_tuto:processus-utilisees-et-tutoriels-api}}\label{\detokenize{_sources/methode_tuto::doc}} +Cette chaîne de traitement répond à un objectif du programme CarHab (Cartographie des Habitats naturels) à savoir : réaliser pour les milieux ouverts de basse altitude (MOBA) un « fond blanc physionomique », c’est-à -dire d’une carte physionomique de ces milieux à l’aide des techniques de télédétection. + +Pour cela, une méthode de classification orientée-objet selon une approche experte a été developpée. Le détail des étapes pour aboutir aux classifications du fond blanc +physionomique est donné selon l’arbre de décision ci-dessous. + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{arbreDecision_cut}.png} +\end{figure} + +La première étape consiste à discriminer les végétations (semi-)naturelles des végétations culturales et éboulis. Pour ce faire, les données de télédétection multi-temporelles Landsat8 ou Sentinel2(+PHYMOBAT 3.0) sont utilisées. L’analyse de traitement d’image s’appuie sur l’hypothèse forte selon laquelle les cultures annuelles comprennent une étape de labour et se retrouvent donc au moins une fois en sol nu dans l’année. Cette analyse a pour objectif de calculer l’indice du minimum de NDVI sur la série temporelle équivalente à l’étape de labour (ie à une végétation non-naturelle et aux éboulis). + +Le deuxième niveau se décompose en deux parties. Dans un premier temps, le modèle numérique de terrain est utilisé pour distinguer les éboulis (\textgreater{}30\% en pente) des surfaces agricoles (+PHYMOBAT 1.1). Dans la seconde partie de cette étape, la télédétection permet de caractériser la végétation naturelle en termes de structure et de densité c’est-à -dire du point de vue physionomique. Cette analyse se fait par l’utilisation d’images de très hautes résolutions (ici les orthophotographies BD ORTHO © IRC). Il s’agit de distinguer les surfaces herbacées des végétations ligneuses basses à l’aide de l’indice de texture SFS’SD (Structural Feature Set Standard Deviation). + +Pour le niveau suivante, les végétations ligneuses basses sont déclinées en deux niveaux de densités : mixtes (ouverts) et denses. Ils sont également caractérisés par leur structure et leur densité. La distinction entre ces deux classes se fait en calculant cette fois-çi l’indice d’Haralick, IDM (inverse Inverse Difference). + +Une dernière phase consiste à extraire de l’information sur la production chlorophyllienne des zones herbacées. Cette étape utilise les séries temporelles. Elle se base sur le calcul de l’indice du maximum de NDVI dans l’année. + +(Pour plus de renseignements, voir « Rapport méthodologique pour la cartographie physionomique des milieux ouverts de basse altitude par télédétection » - \sphinxstyleemphasis{Samuel Alleaume 2014}). + +Une autre méthode avec un temps de calcul plus longue a été implémentée pour extraire la carte de végétation physionomique. Il s’agit de la méthode Random Forest (+PHYMOBAT 2.0). Elle permet de discriminer les mêmes classes sur un plus grand jeu de donneés. + + +\section{Processus algorithmiques utilisées} +\label{\detokenize{_sources/methode_tuto:processus-algorithmiques-utilisees}} +Le Processus utilisé se décompose en trois parties : +\begin{itemize} +\item {} +Traitements des images + +\item {} +Traitements des échantillons + +\item {} +Traitements de classification + +\end{itemize} + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{ChaineTraitementCarHab}.png} +\end{figure} + + +\subsection{Traitement des images} +\label{\detokenize{_sources/methode_tuto:traitement-des-images}} +Deux types d’images sont utilisés dans cette chaîne de traitement : les orthophotographies © de l’IGN en IRC (infra-rouge fausse couleur) et les images gratuites issues de la plate-forme \sphinxhref{https://www.theia-land.fr/fr}{Theia} : +\begin{itemize} +\item {} +\sphinxstylestrong{Landsat 8 OLI} (Operational Land Imager). En orbitre depuis 2013, ces images ont une résolution spatiale de 30 mètres et 9 bandes spectrales (aérosols, bleu, vert, rouge, proche infra-rouge, moyen infra-rouge 1 et 2, panchromatique-15m, cirrus). + +\item {} +\sphinxstylestrong{Sentinel 2A}. En orbitre depuis Juin 2015, ces images ont 13 bandes spectrales et différentes résolutions spatiales 10, 20 et 30 mètres en fonction de ces mêmes bandes. PHYMOBAT 3.0 utilise que les bandes à 10 mètres soit le bleu, vert, rouge et proche infra-rouge. + +\end{itemize} + +A ces images, est joint un raster de détection des nuages, figure ci-dessous b (masque des nuages), utilisé pour sélection les images dans le processus. + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{spectral_cloud}.png} +\end{figure} + +Le traitement des images se décompose quant à lui en trois parties : +\begin{enumerate} +\item {} +Listing et téléchargement des images sur la plate-forme Theia + +\item {} +Traitement des images téléchargées + +\item {} +Traitement des images très haute résolution spatiales (calcul des indices de textures) + +\end{enumerate} + + +\subsubsection{1. Listing et téléchargements des images sur la plate-forme Theia} +\label{\detokenize{_sources/methode_tuto:listing-et-telechargements-des-images-sur-la-plate-forme-theia}} +Le listing des images disponibles se fait à travers une base de données GeoJSON via une API serveur pour Landsat8 (resp. Sentinel2): \sphinxurl{https://landsat-theia.cnes.fr/resto/api/collections/Landsat/search.json?lang=fr\&\_pretty=true\&q=2013\&box=4.5,43.16,5.8,43.5\&maxRecord=500} (resp. \sphinxurl{https://theia.cnes.fr/resto/api/collections/Landsat/search.json?lang=fr\&\_pretty=true\&completionDate=2015-12-31\&box=4.5,43.16,5.8,43.5\&maxRecord=500\&startDate=2015-01-01}). + +\sphinxstyleemphasis{Avec q=2013 : Année des images disponibles} +\begin{quote} + +\sphinxstyleemphasis{startDate=2015-01-01 : Date de début de la période choisie des images disponibles} + +\sphinxstyleemphasis{completionDate=2015-12-31 : Date de fin de la période choisie des images disponibles} + +\sphinxstyleemphasis{box=4.5,43.16,5.8,43.5 : Zone d’emprise en degrés décimaux} +\end{quote} + +La fonction {\hyperref[\detokenize{_sources/package:Archive.Archive.listing}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Archive.Archive.listing()}}}}} utilise cette base. Elle remplace dans l’exemple « 2013 » par la période ou l’année entrée par un utilisateur. Ensuite, à l’aide du shapefile de la zone d’étude, la fonction convertie les coordonnées des extrémités du fichier vecteur en degrés décimaux pour les inclure dans l’url ci-dessus (\sphinxstyleemphasis{box =}). + +A l’issue du listing, le nom et l’identifiant des images sont stockés dans une liste. Le nom de l’image est utilisé pour nommer l’image après téléchargement et l’identifiant est utilisé pour le téléchargement {\hyperref[\detokenize{_sources/package:Archive.Archive.download_auto}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Archive.Archive.download\_auto()}}}}} (+PHYMOBAT 1.1). Une bouton \sphinxstylestrong{Proxy} a été ajouté à PHYMOBAT 3.0: + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{c+c1}{\PYGZsh{}\PYGZsh{} Source : https://github.com/olivierhagolle/theia\PYGZus{}download} +\PYG{c+c1}{\PYGZsh{} Authentification} +\PYG{n}{get\PYGZus{}token}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{curl \PYGZhy{}k \PYGZhy{}s \PYGZhy{}X POST }\PYG{l+s+si}{\PYGZpc{}s}\PYG{l+s+s1}{ \PYGZhy{}\PYGZhy{}data\PYGZhy{}urlencode }\PYG{l+s+s1}{\PYGZdq{}}\PYG{l+s+s1}{ident=}\PYG{l+s+si}{\PYGZpc{}s}\PYG{l+s+s1}{\PYGZdq{}}\PYG{l+s+s1}{ \PYGZhy{}\PYGZhy{}data\PYGZhy{}urlencode }\PYG{l+s+s1}{\PYGZdq{}}\PYG{l+s+s1}{pass=}\PYG{l+s+si}{\PYGZpc{}s}\PYG{l+s+s1}{\PYGZdq{}}\PYG{l+s+s1}{ }\PYG{l+s+si}{\PYGZpc{}s}\PYG{l+s+s1}{/services/authenticate/\PYGZgt{}token.json}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{\PYGZpc{}}\PYG{p}{(}\PYG{n}{curl\PYGZus{}proxy}\PYG{p}{,} \PYG{n}{user\PYGZus{}theia}\PYG{p}{,} \PYG{n}{password\PYGZus{}theia}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{server}\PYG{p}{)} +\PYG{n}{os}\PYG{o}{.}\PYG{n}{system}\PYG{p}{(}\PYG{n}{get\PYGZus{}token}\PYG{p}{)} +\PYG{c+c1}{\PYGZsh{} .} +\PYG{c+c1}{\PYGZsh{} .} +\PYG{c+c1}{\PYGZsh{} .} +\PYG{c+c1}{\PYGZsh{} Téléchargement \PYGZhy{}\PYGZgt{} loop ... d in range(...)} +\PYG{n}{get\PYGZus{}product}\PYG{o}{=}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{curl }\PYG{l+s+si}{\PYGZpc{}s}\PYG{l+s+s1}{ \PYGZhy{}o }\PYG{l+s+si}{\PYGZpc{}s}\PYG{l+s+s1}{ \PYGZhy{}k \PYGZhy{}H }\PYG{l+s+s1}{\PYGZdq{}}\PYG{l+s+s1}{Authorization: Bearer }\PYG{l+s+si}{\PYGZpc{}s}\PYG{l+s+s1}{\PYGZdq{}}\PYG{l+s+s1}{ }\PYG{l+s+si}{\PYGZpc{}s}\PYG{l+s+s1}{/}\PYG{l+s+si}{\PYGZpc{}s}\PYG{l+s+s1}{/collections/}\PYG{l+s+si}{\PYGZpc{}s}\PYG{l+s+s1}{/}\PYG{l+s+si}{\PYGZpc{}s}\PYG{l+s+s1}{/download/?issuerId=theia}\PYG{l+s+s1}{\PYGZsq{}}\PYG{o}{\PYGZpc{}}\PYG{p}{(}\PYG{n}{curl\PYGZus{}proxy}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{list\PYGZus{}archive}\PYG{p}{[}\PYG{n}{d}\PYG{p}{]}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{p}{,} \PYG{n}{token}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{server}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{resto}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{\PYGZus{}captor}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{list\PYGZus{}archive}\PYG{p}{[}\PYG{n}{d}\PYG{p}{]}\PYG{p}{[}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{)} +\PYG{n}{os}\PYG{o}{.}\PYG{n}{system}\PYG{p}{(}\PYG{n}{get\PYGZus{}product}\PYG{p}{)} +\end{sphinxVerbatim} + +A la fin du téléchargement des images, {\hyperref[\detokenize{_sources/package:Archive.Archive.decompress}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Archive.Archive.decompress()}}}}} va décompresser les archives Landsat 8 grâce au module \sphinxcode{\sphinxupquote{tarfile}}. +Pour les Sentinel 2A, les archives seront extraits à l’aide du module \sphinxcode{\sphinxupquote{zipfile}} en sélectionnant que les bandes à 10m. En effet, les rasters Sentinel 2A sont fournis avec des bandes séparées qu’il faut « stacker ». + + +\subsubsection{2. Traitements des images téléchargées} +\label{\detokenize{_sources/methode_tuto:traitements-des-images-telechargees}} +Toutes les images décompréssées (images spectrales à 9 bandes pour L8 (à 4 bandes pour S2A) et masque de nuages) sont découpées \sphinxcode{\sphinxupquote{Toolbox.clip\_raster()}} en fonction de la zone d’étude. Le découpage est éffectué en ligne de commande grâce au module python \sphinxcode{\sphinxupquote{subprocess}} : + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYGZdl{} gdalwarp \PYGZhy{}dstnodata \PYGZhy{}10000 \PYGZhy{}q \PYGZhy{}cutline study\PYGZus{}area.shp \PYGZhy{}crop\PYGZus{}to\PYGZus{}cutline \PYGZhy{}of GTiff raster.TIF Clip\PYGZus{}raster.TIF +\end{sphinxVerbatim} + +Ensuite une sélection des images est éffectuée en fonction de la couverture nuageuse dans la zone d’étude. Pour cela, le processus regroupe {\hyperref[\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date.group_by_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RasterSat\_by\_date.RasterSat\_by\_date.group\_by\_date()}}}}} et mosaïque d’abord les rasters par date {\hyperref[\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date.mosaic_by_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RasterSat\_by\_date.RasterSat\_by\_date.mosaic\_by\_date()}}}}}. + +Le mosaïquage est réalisé en ligne de commande {\hyperref[\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date.vrt_translate_gdal}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RasterSat\_by\_date.RasterSat\_by\_date.vrt\_translate\_gdal()}}}}} en utilisant le format virtuel de \sphinxtitleref{gdal}, \sphinxstyleemphasis{VRT (Virtual Dataset)} : + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYGZdl{} gdalbuildvrt \PYGZhy{}srcnodata \PYGZhy{}10000 dst\PYGZus{}data.VRT raster1.TIF raster2.TIF +Input file size is \PYG{l+m}{286}, \PYG{l+m}{467} +\PYG{l+m}{0}...10...20...30...40...50...60...70...80...90...100 \PYGZhy{} \PYG{k}{done}. +\PYGZdl{} +\PYGZdl{} gdal\PYGZus{}translate \PYGZhy{}a\PYGZus{}nodata \PYGZhy{}10000 dst\PYGZus{}data.TIF dst\PYGZus{}data.VRT +Input file size is \PYG{l+m}{286}, \PYG{l+m}{467} +\PYG{l+m}{0}...10...20...30...40...50...60...70...80...90...100 \PYGZhy{} \PYG{k}{done}. +\end{sphinxVerbatim} + +La selection est faite dans {\hyperref[\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date.pourc_cloud}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RasterSat\_by\_date.RasterSat\_by\_date.pourc\_cloud()}}}}}. Elle renvoie le pourcentage de couverture claire \sphinxstylestrong{cl} par mosaïque de la façon suivante : +\begin{itemize} +\item {} +Extrait l’étendue de l’image en matrice : + +\end{itemize} + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{n}{mask\PYGZus{}spec} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{in1d}\PYG{p}{(}\PYG{n}{data\PYGZus{}spec}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{10000}\PYG{p}{,} \PYG{n}{math}\PYG{o}{.}\PYG{n}{isnan}\PYG{p}{]}\PYG{p}{,} \PYG{n}{invert}\PYG{o}{=}\PYG{n+nb+bp}{True}\PYG{p}{)} +\end{sphinxVerbatim} +\begin{itemize} +\item {} +Extrait les pixels correspondant aux nuages : + +\end{itemize} + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{n}{mask\PYGZus{}cloud} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{in1d}\PYG{p}{(}\PYG{n}{data\PYGZus{}cloud}\PYG{p}{,} \PYG{l+m+mi}{0}\PYG{p}{)} +\end{sphinxVerbatim} +\begin{itemize} +\item {} +Détermine les pixels de nuages par rapport à l’emprise de l’image : + +\end{itemize} + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{n}{cloud} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{choose}\PYG{p}{(}\PYG{n}{mask\PYGZus{}cloud}\PYG{p}{,} \PYG{p}{(}\PYG{n+nb+bp}{False}\PYG{p}{,} \PYG{n}{mask\PYGZus{}spec}\PYG{p}{)}\PYG{p}{)} +\end{sphinxVerbatim} +\begin{itemize} +\item {} +Détermine la somme de pixels en nuages et le pourcentage dans la zone d’emprise : + +\end{itemize} + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{n}{dist} \PYG{o}{=} \PYG{n}{np}\PYG{o}{.}\PYG{n}{sum}\PYG{p}{(}\PYG{n}{cloud}\PYG{p}{)} +\PYG{n}{nb0} \PYG{o}{=} \PYG{n+nb}{float}\PYG{p}{(}\PYG{n}{dist}\PYG{p}{)}\PYG{o}{/}\PYG{p}{(}\PYG{n}{np}\PYG{o}{.}\PYG{n}{sum}\PYG{p}{(}\PYG{n}{mask\PYGZus{}spec}\PYG{p}{)}\PYG{p}{)} +\end{sphinxVerbatim} + +Par défaut, le pourcentage de couverture nuageuse maximum accepté est de 40\%. + +Toutes les mosaïques ayant plus de 60\% de pixels clair, passeront par les fonctions {\hyperref[\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date.calcul_ndvi}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RasterSat\_by\_date.RasterSat\_by\_date.calcul\_ndvi()}}}}} (calcul de NDVI), \sphinxcode{\sphinxupquote{Toolbox.calc\_serie\_stats()}} (calcul de minimum, maximum de ndvi et temporalité nuageuse) et \sphinxcode{\sphinxupquote{RasterSat\_by\_date.RasterSat\_by\_date.create\_raster()}}. Cette dernière fonction crée cinq rasters : minimum ndvi, maximum ndvi, std ndvi (écart-type), MaxMin ndvi (max ndvi - min ndvi) et un dernier raster qui correspond au nombre d’image utilisé par pixel clair (exemple sur l’image ci-dessous). + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{temporal_cloud}.png} +\end{figure} + + +\subsubsection{3. Traitements des images THRS} +\label{\detokenize{_sources/methode_tuto:traitements-des-images-thrs}} +Le traitement des images THRS est éffectué pour déterminer les ligneux et différents types de ligneux. Ligneux sont caractérisés par leur texture vis-à -vis des herbacés, et de leur type. Ces caractéristiques sont extraits à l’aide d’indices de textures issus de lâ€\sphinxcode{\sphinxupquote{OTB}} via {\hyperref[\detokenize{_sources/package:Vhrs.Vhrs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Vhrs.Vhrs()}}}}}. + +Deux indices ont été sélectionnés pour discriminer les classes par rapport aux ligneux : +\begin{itemize} +\item {} +SFS’SD des indices de textures de Structural Feature Set Standard Deviation (Herbacés / Ligneux) + +\end{itemize} + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYGZdl{} otbcli\PYGZus{}SFSTextureExtraction \PYGZhy{}in raster.tif \PYGZhy{}channel \PYG{l+m}{2} \PYGZhy{}parameters.spethre \PYG{l+m}{50}.0 \PYGZhy{}parameters.spathre \PYG{l+m}{100} \PYGZhy{}out out\PYGZus{}sfs.tif +\end{sphinxVerbatim} +\begin{itemize} +\item {} +Inverse Difference Moment des indices d’Haralick (Ligneux mixtes / Ligneux denses) + +\end{itemize} + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYGZdl{} otbcli\PYGZus{}HaralickTextureExtraction \PYGZhy{}in raster.tif \PYGZhy{}channel \PYG{l+m}{2} \PYGZhy{}parameters.xrad \PYG{l+m}{3} \PYGZhy{}parameters.yrad \PYG{l+m}{3} \PYGZhy{}texture simple \PYGZhy{}out out\PYGZus{}haralick.tif +\end{sphinxVerbatim} + +Pour extraire deux indices, il faut lancer les deux commandes ci-dessus qui calculent malgré tout 14 indices. Par conséquent, les traitements deviennent très long. Pour réduire ce temps de calcul, la chaîne de traitement utilise le \sphinxcode{\sphinxupquote{multiprocessing}}. Il permet de lancer tous les traitements en même temps. + +Le code Python associé au \sphinxcode{\sphinxupquote{multiprocessing}} est le suivant : + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{from} \PYG{n+nn}{multiprocessing} \PYG{k}{import} \PYG{n}{Process} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{p\PYGZus{}sfs} \PYG{o}{=} \PYG{n}{Process}\PYG{p}{(}\PYG{n}{target}\PYG{o}{=}\PYG{n}{sfs\PYGZus{}function}\PYG{p}{)} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{p\PYGZus{}har} \PYG{o}{=} \PYG{n}{Process}\PYG{p}{(}\PYG{n}{target}\PYG{o}{=}\PYG{n}{haralick\PYGZus{}function}\PYG{p}{)} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{c+c1}{\PYGZsh{} Lancement des traitements} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{p\PYGZus{}sfs}\PYG{o}{.}\PYG{n}{start}\PYG{p}{(}\PYG{p}{)} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{p\PYGZus{}har}\PYG{o}{.}\PYG{n}{start}\PYG{p}{(}\PYG{p}{)} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{c+c1}{\PYGZsh{} Attente de la fin des calculs} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{p\PYGZus{}sfs}\PYG{o}{.}\PYG{n}{join}\PYG{p}{(}\PYG{p}{)} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{p\PYGZus{}har}\PYG{o}{.}\PYG{n}{join}\PYG{p}{(}\PYG{p}{)} +\end{sphinxVerbatim} + +\begin{sphinxadmonition}{warning}{Avertissement:} +Pour utiliser le \sphinxcode{\sphinxupquote{multiprocessing}}, il faut une machine avec minimum 12Go de mémoire vive. Sinon les traitements seront plus long que sans l’utilisation du \sphinxcode{\sphinxupquote{multiprocessing}}! +\end{sphinxadmonition} + +\begin{sphinxadmonition}{note}{Note:} +L’image THRS utilisée est l’orthophotographie © IGN. A la base c’est un maillage de plusieurs images carrées de 5km de coté. Ces images sont en 8bit à 50cm de résolution spatiale et au format compréssé ECW (Enhanced Compression Wavelet). En dehors de la chaîne de traitement, un mosaïquage de ces images sur la zone d’étude doit être construit. Cette mosaïque doit être ré-échantillonnée à 2m car différentes études ont montré que l’image à 50cm apportait la même information. De plus, il y a un gagne-temps non négligeable sur les calculs pour une image de plus basse résolution. +\end{sphinxadmonition} + + +\subsection{Traitements des échantillons} +\label{\detokenize{_sources/methode_tuto:traitements-des-echantillons}} +Il faut trois paires d’échantillons pour compléter l’arbre de décision défini plus haut. Un échantillon pour séparer : \sphinxstylestrong{Cultures / Végétation semi-naturelle}, \sphinxstylestrong{Herbacées / Ligneux} et \sphinxstylestrong{Ligneux mixtes / Ligneux denses}. + +Les traitements des échantillons {\hyperref[\detokenize{_sources/API:Processing.Processing.i_sample}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Processing.Processing.i\_sample()}}}}} est le même pour les trois, soit : +\begin{itemize} +\item {} +En partant du principe que tous les échantillons soit dans un même shapefile, il faut indiquer le nom de la classe et le champ où il se trouve. + +\end{itemize} + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{kwargs}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{fieldname}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{fieldname\PYGZus{}args}\PYG{p}{[}\PYG{n}{sple}\PYG{p}{]} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{kwargs}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{class}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{class\PYGZus{}args}\PYG{p}{[}\PYG{n}{sple}\PYG{p}{]} +\end{sphinxVerbatim} +\begin{itemize} +\item {} +Créer un shapefile par échantillon {\hyperref[\detokenize{_sources/package:Sample.Sample.create_sample}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Sample.Sample.create\_sample()}}}}} de calibration et de validation puis réaliser une statistique zonale par polygone {\hyperref[\detokenize{_sources/package:Vector.Vector.zonal_stats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Vector.Vector.zonal\_stats()}}}}}. + +\end{itemize} + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{sample\PYGZus{}rd}\PYG{p}{[}\PYG{n}{sple}\PYG{p}{]} \PYG{o}{=} \PYG{n}{Sample}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{sample\PYGZus{}name}\PYG{p}{[}\PYG{n}{sple}\PYG{o}{/}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{path\PYGZus{}area}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{list\PYGZus{}nb\PYGZus{}sample}\PYG{p}{[}\PYG{n}{sple}\PYG{o}{/}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{)} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{sample\PYGZus{}rd}\PYG{p}{[}\PYG{n}{sple}\PYG{p}{]}\PYG{o}{.}\PYG{n}{create\PYGZus{}sample}\PYG{p}{(}\PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{sample\PYGZus{}rd}\PYG{p}{[}\PYG{n}{sple}\PYG{p}{]}\PYG{o}{.}\PYG{n}{zonal\PYGZus{}stats}\PYG{p}{(}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{raster\PYGZus{}path}\PYG{p}{[}\PYG{n}{sple}\PYG{o}{/}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{list\PYGZus{}band\PYGZus{}outraster}\PYG{p}{[}\PYG{n}{sple}\PYG{o}{/}\PYG{l+m+mi}{2}\PYG{p}{]}\PYG{p}{)}\PYG{p}{)} +\end{sphinxVerbatim} + +La création du shapefile est fait sur un certain nombre de polygone (chiffre indiqué par l’utilisateur) tiré aléatoirement. +\begin{itemize} +\item {} +Et Extrait le modèle de distinction + +\end{itemize} + + +\subsubsection{1. Modèle Seath} +\label{\detokenize{_sources/methode_tuto:modele-seath}} +A l’aide des valeurs déterminer par {\hyperref[\detokenize{_sources/package:Vector.Vector.zonal_stats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Vector.Vector.zonal\_stats()}}}}}, la fonction {\hyperref[\detokenize{_sources/package:Seath.Seath.separability_and_threshold}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Seath.Seath.separability\_and\_threshold()}}}}} détermine le seuil optimal (\sphinxstyleemphasis{SEaTH\textendash{}A new tool for automated feature extraction in the context of object-based image analysis S. Nussbaum et al.}) pour discriminer les classes deux à deux issues de l’arbre de décision. + +Pour l’instant, l’utilisation du RPG (Régistre Parcellaire Graphique) est insdispensable comme échantillon de \sphinxstylestrong{Cultures}. Or le RPG possède des polygones poly-culturaux. +Il se pourrait qu’un polygone renseigné soit ainsi blé, maïs et une prairie permanente. Par conséquent, ce polygones injecterait une erreur dans le calcul du seuil optimal puisque le polygone est un mélange de végétation non naturelle et semi-naturelle. Dans ce cas, {\hyperref[\detokenize{_sources/package:Rpg.Rpg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Rpg.Rpg()}}}}} a été mis en place pour créer des échantillons mono-culturaux de cultures et de prairies permanentes. + + +\subsubsection{2. Moldèle Random Forest (RF)} +\label{\detokenize{_sources/methode_tuto:moldele-random-forest-rf}} +Le RF quant à lui stocke toutes les bandes de textures contrairement à la l’utilisation méthode Seath dite experte. Cette méthode a été mise en place à l’aide du module Python \sphinxcode{\sphinxupquote{sklearn}} avec un export des indices les plus significatifs et de l’arbre de décision généré : + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{c+c1}{\PYGZsh{} Build a forest of trees from the samples} +\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rf} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rf}\PYG{o}{.}\PYG{n}{fit}\PYG{p}{(}\PYG{n}{X\PYGZus{}rf}\PYG{p}{,} \PYG{n}{y\PYGZus{}rf}\PYG{p}{)} + +\PYG{c+c1}{\PYGZsh{} Print in a file feature important} +\PYG{n}{importance} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rf}\PYG{o}{.}\PYG{n}{feature\PYGZus{}importances\PYGZus{}} +\PYG{n}{importance} \PYG{o}{=} \PYG{p}{[}\PYG{p}{(}\PYG{n}{importance}\PYG{p}{[}\PYG{n}{x}\PYG{p}{]}\PYG{p}{,}\PYG{n}{x}\PYG{o}{+}\PYG{l+m+mi}{1}\PYG{p}{)} \PYG{k}{for} \PYG{n}{x} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{importance}\PYG{p}{)}\PYG{p}{)}\PYG{p}{]} +\PYG{n}{importance}\PYG{o}{.}\PYG{n}{sort}\PYG{p}{(}\PYG{p}{)} + +\PYG{n}{file\PYGZus{}feat\PYGZus{}import} \PYG{o}{=} \PYG{n}{os}\PYG{o}{.}\PYG{n}{path}\PYG{o}{.}\PYG{n}{dirname}\PYG{p}{(}\PYG{n+nb}{str}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{raster\PYGZus{}path}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)}\PYG{p}{)} \PYG{o}{+} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{/Feature\PYGZus{}important\PYGZus{}RF.ft}\PYG{l+s+s1}{\PYGZsq{}} +\PYG{k}{if} \PYG{n}{os}\PYG{o}{.}\PYG{n}{path}\PYG{o}{.}\PYG{n}{exists}\PYG{p}{(}\PYG{n}{file\PYGZus{}feat\PYGZus{}import}\PYG{p}{)}\PYG{p}{:} + \PYG{n}{os}\PYG{o}{.}\PYG{n}{remove}\PYG{p}{(}\PYG{n}{file\PYGZus{}feat\PYGZus{}import}\PYG{p}{)} +\PYG{n}{f\PYGZus{}out} \PYG{o}{=} \PYG{n+nb}{open}\PYG{p}{(}\PYG{n}{file\PYGZus{}feat\PYGZus{}import}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{wb}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{)} +\PYG{n}{f\PYGZus{}out}\PYG{o}{.}\PYG{n}{write}\PYG{p}{(}\PYG{n+nb}{str}\PYG{p}{(}\PYG{n}{importance}\PYG{p}{)}\PYG{p}{)} +\PYG{c+c1}{\PYGZsh{} Close the output file} +\PYG{n}{f\PYGZus{}out}\PYG{o}{.}\PYG{n}{close}\PYG{p}{(}\PYG{p}{)} + +\PYG{c+c1}{\PYGZsh{} Print in a file decision tree} +\PYG{n}{file\PYGZus{}decisiontree} \PYG{o}{=} \PYG{n}{os}\PYG{o}{.}\PYG{n}{path}\PYG{o}{.}\PYG{n}{dirname}\PYG{p}{(}\PYG{n+nb}{str}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{raster\PYGZus{}path}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{)}\PYG{p}{)} \PYG{o}{+} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{/Decision\PYGZus{}tree.dot}\PYG{l+s+s1}{\PYGZsq{}} +\PYG{k}{if} \PYG{n}{os}\PYG{o}{.}\PYG{n}{path}\PYG{o}{.}\PYG{n}{exists}\PYG{p}{(}\PYG{n}{file\PYGZus{}decisiontree}\PYG{p}{)}\PYG{p}{:} + \PYG{n}{os}\PYG{o}{.}\PYG{n}{remove}\PYG{p}{(}\PYG{n}{file\PYGZus{}decisiontree}\PYG{p}{)} + +\PYG{n}{tree\PYGZus{}in\PYGZus{}forest} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{rf}\PYG{o}{.}\PYG{n}{estimators\PYGZus{}}\PYG{p}{[}\PYG{l+m+mi}{499}\PYG{p}{]} +\PYG{k}{with} \PYG{n+nb}{open}\PYG{p}{(}\PYG{n}{file\PYGZus{}decisiontree}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{w}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)} \PYG{k}{as} \PYG{n}{my\PYGZus{}file}\PYG{p}{:} + \PYG{n}{my\PYGZus{}file} \PYG{o}{=} \PYG{n}{tree}\PYG{o}{.}\PYG{n}{export\PYGZus{}graphviz}\PYG{p}{(}\PYG{n}{tree\PYGZus{}in\PYGZus{}forest}\PYG{p}{,} \PYG{n}{out\PYGZus{}file} \PYG{o}{=} \PYG{n}{my\PYGZus{}file}\PYG{p}{)} +\end{sphinxVerbatim} + +Le temps de calcul de ce modèle est plus long car le traitement de {\hyperref[\detokenize{_sources/package:Vector.Vector.zonal_stats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Vector.Vector.zonal\_stats()}}}}} se fait sur 17 images. Par contre, il a l’avantage d’être plus précis. + + +\subsection{Traitements de classification} +\label{\detokenize{_sources/methode_tuto:traitements-de-classification}} +La classification est réalisée sur la segmentation issue de la l’orthophotographie © IGN. A chaque polygone, est affecté une valeur moyenne {\hyperref[\detokenize{_sources/package:Vector.Vector.zonal_stats}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Vector.Vector.zonal\_stats()}}}}} par image. Les statistiques zonales sur les rasters à THRS sont très long (Plus long pour la méthode RF). Le \sphinxcode{\sphinxupquote{multiprocessing}} est, une nouvelle fois, utilisé par ici pour accélérer le gain de temps de calcul. + +{\hyperref[\detokenize{_sources/package:Segmentation.Segmentation.compute_biomass_density}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Segmentation.Segmentation.compute\_biomass\_density()}}}}} extrait la distribution de la densité de ligneux et de phytomasse. + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{phytomasse}.png} +\end{figure} + +{\hyperref[\detokenize{_sources/package:Segmentation.Segmentation.decision_tree}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Segmentation.Segmentation.decision\_tree()}}}}} (resp. \sphinxcode{\sphinxupquote{rf.predict()}}) classe les polygones en fonction des seuils optimaux pré-déterminés {\hyperref[\detokenize{_sources/package:Seath.Seath.separability_and_threshold}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Seath.Seath.separability\_and\_threshold()}}}}} (resp. {\hyperref[\detokenize{_sources/API:Processing.Processing.i_sample_rf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Processing.Processing.i\_sample\_rf()}}}}}) et des valeurs zonales par raster. + +{\hyperref[\detokenize{_sources/package:Segmentation.Segmentation.create_cartography}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Segmentation.Segmentation.create\_cartography()}}}}} va créer le shapefile final qui représentera le \sphinxstylestrong{FB physionomique MOBA}. + +\begin{sphinxadmonition}{note}{Note:} +Le document final contient une colonne RPG qui correspond à la donnée du RPG (îlots de culture) pour un polygone de la segmentation inclut à 85\%. +\end{sphinxadmonition} + +{\hyperref[\detokenize{_sources/API:Processing.Processing.i_classifier_rf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Processing.Processing.i\_classifier\_rf()}}}}} + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{c+c1}{\PYGZsh{} Rasterize RPG shapefile to complete the final shapefile} +\PYG{n}{opt} \PYG{o}{=} \PYG{p}{\PYGZob{}}\PYG{p}{\PYGZcb{}} +\PYG{n}{opt}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Remove}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{1} +\PYG{n}{rpg\PYGZus{}tif} \PYG{o}{=} \PYG{n}{Vector}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{sample\PYGZus{}name}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{p}{,} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{path\PYGZus{}area}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{opt}\PYG{p}{)} +\PYG{c+c1}{\PYGZsh{} if not os.path.exists(str(rpg\PYGZus{}tif.vector\PYGZus{}used[:\PYGZhy{}3]+\PYGZsq{}TIF\PYGZsq{})):} +\PYG{n}{kwargs}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{choice\PYGZus{}nb\PYGZus{}b}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} \PYG{o}{=} \PYG{l+m+mi}{1} +\PYG{n}{out\PYGZus{}carto}\PYG{o}{.}\PYG{n}{stats\PYGZus{}rpg\PYGZus{}tif} \PYG{o}{=} \PYG{n}{out\PYGZus{}carto}\PYG{o}{.}\PYG{n}{zonal\PYGZus{}stats\PYGZus{}pp}\PYG{p}{(}\PYG{n}{rpg\PYGZus{}tif}\PYG{o}{.}\PYG{n}{layer\PYGZus{}rasterization}\PYG{p}{(}\PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{path\PYGZus{}ortho}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{CODE\PYGZus{}GROUP}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{,} \PYG{o}{*}\PYG{o}{*}\PYG{n}{kwargs}\PYG{p}{)}\PYG{p}{)} +\end{sphinxVerbatim} + +{\hyperref[\detokenize{_sources/package:Segmentation.Segmentation.create_cartography}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Segmentation.Segmentation.create\_cartography()}}}}} + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{k}{if} \PYG{n}{pourc\PYGZus{}inter} \PYG{o}{\PYGZgt{}}\PYG{o}{=} \PYG{l+m+mi}{85}\PYG{p}{:} + \PYG{n}{recouv\PYGZus{}crops\PYGZus{}RPG} \PYG{o}{=} \PYG{n+nb+bp}{self}\PYG{o}{.}\PYG{n}{stats\PYGZus{}rpg\PYGZus{}tif}\PYG{p}{[}\PYG{n}{in\PYGZus{}feature}\PYG{o}{.}\PYG{n}{GetFID}\PYG{p}{(}\PYG{p}{)}\PYG{p}{]}\PYG{p}{[}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+s1}{Maj\PYGZus{}count}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{]} +\end{sphinxVerbatim} + + +\section{Tutoriels interface} +\label{\detokenize{_sources/methode_tuto:tutoriels-interface}} +Il existe 2 interfaces : une interface simplifiée et une interface experte. + +\sphinxstylestrong{L’interface simplifiée} {\hyperref[\detokenize{_sources/API:ui_PHYMOBATs_tab.Ui_PHYMOBAT}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ui\_PHYMOBATs\_tab.Ui\_PHYMOBAT()}}}}} comme son nom l’indique est assez simple, elle est représentée sur une fenêtre et est très limitée au niveau des choix à faire (selection des types d’images, méthode de classification, choix des champs pour la classification finale, etc …) + +\sphinxstylestrong{L’interface experte} {\hyperref[\detokenize{_sources/API:ui_PHYMOBATe_tab.Ui_PHYMOBAT}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ui\_PHYMOBATe\_tab.Ui\_PHYMOBAT()}}}}} est plus complexe. Elle est composée de 3 sous-onglets qui permettent de dissocier les traitements (pré-traitements images, traitements vecteur et classification) mais également de choisir les méthodes de classification et le types d’images à utiliser. + +Le passage d’une interface à une autre se fait à travers le sur-onglet Mode (référence 1 sur la figure ci-dessous). +Il y a 3 sur-onglets : Menu, Aide et Mode +\begin{itemize} +\item {} +\sphinxstylestrong{Menu} : cet onglet est composé quant à lui de 3 fonctions (Ouvrir, Sauver, Quitter). +Les fonctions \sphinxcode{\sphinxupquote{Ouvrir}} {\hyperref[\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.open_backup}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PHYMOBAT.PHYMOBAT.open\_backup()}}}}} et \sphinxcode{\sphinxupquote{Sauver}} {\hyperref[\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.save_backup}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PHYMOBAT.PHYMOBAT.save\_backup()}}}}}. sont utilisées pour charger ou sauvegarder dans un fichier .xml les paramètres entrés dans chaque case de l’application. +La fonction \sphinxtitleref{Quitter} {\hyperref[\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.close_button}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PHYMOBAT.PHYMOBAT.close\_button()}}}}}, ferme l’application. + +\item {} +\sphinxstylestrong{Aide} : \sphinxcode{\sphinxupquote{Aide de PHYMOBAT}} et \sphinxcode{\sphinxupquote{A propos de PHYMOBAT}}. +La fonction \sphinxcode{\sphinxupquote{Aide de PHYMOBAT}} {\hyperref[\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.help_tools}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{PHYMOBAT.PHYMOBAT.help\_tools()}}}}} ouvre une page HTML décrivant les méthodes de télédétection et les scripts utilisés (Pas à jour). +La fonction \sphinxcode{\sphinxupquote{A propos de PHYMOBAT}} \sphinxcode{\sphinxupquote{PHYMOBAT.MyPopup\_about()}} rappelle l’objectif de l’application et la licence utilisée. + +\item {} +\sphinxstylestrong{Mode} : \sphinxcode{\sphinxupquote{Mode Simplifié}} \sphinxcode{\sphinxupquote{PHYMOBAT.PHYMOBAT.mode\_simpli()}} et \sphinxcode{\sphinxupquote{Mode Expert}} \sphinxcode{\sphinxupquote{PHYMOBAT.PHYMOBAT.mode\_expert()}}. +Ces deux modes sont basés sur le même algorithme. Par conséquent, bien paramétrés, le résultat de la carte finale est le même. + +\end{itemize} + + +\subsection{Interface Simplifiée} +\label{\detokenize{_sources/methode_tuto:interface-simplifiee}} +C’est l’interface par défaut. Elle s’ouverte en tapant dans la console : + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYGZdl{} python3 PHYMOBAT.py +\end{sphinxVerbatim} + +Elle est présenté sous cette forme : + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{APIs_0}.png} +\end{figure} + +1 - Sur-onglets : \sphinxstylestrong{Menu}, \sphinxstylestrong{Aide} et \sphinxstylestrong{Mode} + +2 - \sphinxstylestrong{Chemin du dossier principal} : Chemin d’accès au dossier où sont stockées toutes les données en entrée mais également toutes les données en sortie de l’application. + +3 - \sphinxstylestrong{Période ou année des images} : Intervalles de dates des images à télécharger et à traiter. + +L’intervalle doit être sous cette forme \sphinxstyleemphasis{AAAA-MM-DD,AAAA-MM-DD} où A -\textgreater{} Année (2015), M -\textgreater{} Mois (05) et D -\textgreater{} Jour (25). +Pour plusieurs intervalles, par exemple deux (Séparer par un point virgule) : \sphinxstyleemphasis{AAAA-MM-DD,AAAA-MM-DD;AAAA-MM-DD,AAAA-MM-DD}. +Pour une année complète : \sphinxstyleemphasis{AAAA} + +4 - \sphinxstylestrong{Emprise de la zone} : Chemin d’accès au shapefile correspondant à la zone d’emprise sur laquelle le traitement sera lancé. + +5 - \sphinxstylestrong{Identifiant Theia} : Pour télécharger les images Landsat8 sur la plateforme Theia, il faut d’abord s’inscrire sur le site : \sphinxurl{https://theia-landsat.cnes.fr/rocket/\#/home}. Puis entrer le nom d’utilisateur et le mot de passe enregistré sur Theia-land dans l’application. Il y a également un bouton \sphinxcode{\sphinxupquote{Proxy}} {\hyperref[\detokenize{_sources/API:ui_Proxy_window.Ui_Proxy_window}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{ui\_Proxy\_window.Ui\_Proxy\_window()}}}}} qui permet de rentrer les informations concernant un eventuel \sphinxstylestrong{Proxy}. + +\begin{sphinxadmonition}{note}{Note:} +Dès que les images ont été téléchargées, l’outil ne les téléchargeront pas à nouveau. +\end{sphinxadmonition} + +6 - \sphinxstylestrong{BD Alti} (Facultatif) : Chemin d’accès à la BD Alti. Calcul de pentes (+PHYMOBAT 1.1) {\hyperref[\detokenize{_sources/package:Slope.Slope}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Slope.Slope()}}}}}. + +7 - \sphinxstylestrong{Images THRS} : Chemin d’accès à l’orthographie IRC à 2m de résolution spatiale en GeoTiff. Les orthographies IRC sont distribuées par l’IGN par tuile, en ECW et à 50cm de résolution spatiale. Par conséquent, en utilisant les outils de GDAL (gdalbuildvrt, gdal\_translate, gdalwarp), il faut fusionner toutes les tuiles , convertir la mosaïque finale en TIF et la dégrader à 2m de résolution spatiale (\sphinxurl{https://github.com/SylvioL/MosaiqueIRC.git}). + +8 - \sphinxstylestrong{Segmentation} : Chemin d’accès au shapefile correspondant à la segmentation IGN. + +9 - \sphinxstylestrong{Echantillons RPG} : Chemin d’accès au shapefile correspondant aux surfaces des îlots culturaux du RPG. Ces polygones représentent les échantillons de la végétation non naturelle (Cultures) et semi naturelle (Prairies permanentes). + +10 - \sphinxstylestrong{Champs} : Le nom des champs où sont stockées les classes correspondantes aux grandes classes de la végétation\(\rightarrow\) Non naturelle / Semi-naturelle. + +11 - \sphinxstylestrong{Classes} : Les classes Non naturelles (1, 2, 3, 4, … etc) et la classe semi naturelle (18). + +12 - \sphinxstylestrong{Nbre de polygones} : Nombre d’échantillons à extraire du shapefile surfaces RPG pour lancer l’entraînement du classifieur et valider la classification. + +13 - \sphinxstylestrong{Echantillons Herbacés / Ligneux} : Chemin d’accès au shapefile où sont stockés les échantillons d’herbacés et de ligneux. +Même utilisation que pour les références 9, 10, 11, il faut entrer le nom des champs où sont les classes, écrire les classes et le nombres de polygones à utiliser. + +14 - \sphinxstylestrong{Echantillons Ligneux denses} / Ligneux mixtes : Chemin d’accès au shapefile où sont stockés les échantillons de ligneux. +Même utilisation que pour les références 9, 10, 11, il faut entrer le nom des champs où sont les classes, écrire les classes et le nombres de polygones à utiliser. + +15 - \sphinxstylestrong{Fichier de sortie} : Chemin où sera stocké le résultat final (shapefile) en sortie de PHYMOBAT. + +16 - Lancement des traitements (OK), ou fermer l’application (Close). + +17 - \sphinxstylestrong{Multi-proccessing} : Sélectionné par défaut. Il permet d’accélérer le calcul des traitements en utilisant plusieurs processeurs. A décocher \sphinxstylestrong{si la machine ne possède pas minimum 12Go de mémoire vive}. + + +\subsubsection{Exemple sur un jeu de données test} +\label{\detokenize{_sources/methode_tuto:exemple-sur-un-jeu-de-donnees-test}} +\begin{sphinxadmonition}{note}{Note:} +Jeu de données test à demander à \sphinxhref{mailto:samuel.alleaume@irstea.fr}{samuel.alleaume@irstea.fr} +\end{sphinxadmonition} + +L’image ci-dessous indique ce qu’il faut mettre dans chaque champs de l’application pour un jeu de données test bien précis. Il suffit juste de remplacer “/media/laventure/DATA/EclipseFolder/CarHab\_v2/Cher18\_small\_zone\_test†par l’arborescence où se trouve le jeu de données test sur votre machine. + +Bien entendu il faut, comme indiqué dans la référence 5, avoir vos propres identifiants Theia (Utilisateur et mot de passe). + +Pour les classes de cultures (Non-naturelles) du RPG qui ne sont pas bien visible sur l’image : 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 20, 21, 24 + +Tous ces éléments sont également enregistrés dans le fichier « Save\_test.xml » du dossier « data\_test ». + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{APIs_01}.png} +\end{figure} + + +\subsection{Interface experte} +\label{\detokenize{_sources/methode_tuto:interface-experte}} +Pour ouvrir l’interface experte : Sur-onglet \sphinxstyleemphasis{Mode \textgreater{} Mode expert} + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{API_0}.png} +\end{figure} + +Cette interface est composé de trois onglets : +\begin{itemize} +\item {} +Traitement des images + +\item {} +Traitement des échantillons + +\item {} +Traitement de classification + +\end{itemize} + +Chaque onglet représente les parties du processus algorithmique décrit plus haut. + +\begin{sphinxadmonition}{note}{Note:} +Les traitements sont lancés en appuyant sur le bouton « OK » et si au moins une « check box » associée à chaque onglets et fonction est cochée. Si aucune « check box » n’est cochée, aucun traitement ne sera lancé. +\end{sphinxadmonition} + +Cette présentation d’API se compose suivant les trois onglets. + + +\subsection{Interface du traitement des images} +\label{\detokenize{_sources/methode_tuto:interface-du-traitement-des-images}} +\begin{sphinxadmonition}{note}{Note:} +Cet onglet est indépendant des autres onglets. +\end{sphinxadmonition} + +Les références en rouge sur les images suivantes sont les mêmes que celles qui ont été présentées sur l’interface simplifiée. + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{API}.png} +\end{figure} + +Au numéro 18, le choix du \sphinxstylestrong{capteur des images à télécharger} (Landsat, Sentinel 2 et Spot Word Heritage) + +Dans cet onglet il y a cinq traitements qui peuvent être lancés : +\begin{enumerate} +\setcounter{enumi}{18} +\item {} +\sphinxstylestrong{Images disponibles} : Cherche le nombre d’images disponibles sur la plate-forme Theia et l’inscrit à la palce du zéro en face. + +\item {} +\sphinxstylestrong{Télécharger} : Télécharge les images à partir de la plate-forme Theia. Pour cela, il faut obligatoirement remplir dans les lignes d’édition en-dessous correspondant aux identifiants Theia (Utilisateur et mot de passe). + +\item {} +\sphinxstylestrong{Traitement des images} : Traitement des images satellites (mosaïque des images, calculs des indices spectraux, …) + +\end{enumerate} + +\begin{sphinxadmonition}{note}{Note:} +Pour \sphinxstylestrong{BD Alti} et \sphinxstylestrong{Image THRS} : Pour que le traitement soit réalisé, il faut absolument que ces cases soient cochées. +\end{sphinxadmonition} + +\begin{sphinxadmonition}{warning}{Avertissement:} +Avant de lancer un traitement, il faut absolument renseigner toutes les premières lignes d’édition et sélectionner un \sphinxstyleemphasis{capteur}. +\end{sphinxadmonition} + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{API_01}.png} +\end{figure} + + +\subsection{Interface du traitement des échantillons} +\label{\detokenize{_sources/methode_tuto:interface-du-traitement-des-echantillons}} +\begin{sphinxadmonition}{note}{Note:} +Cet onglet peut être indépendant des autres onglets. Il faut cocher la « check box » \sphinxstylestrong{Image échantillonnée} (22) pour signaler au processus que les traitements du premier onglet n’ont pas été lancés. Ainsi renseigner le raster associé aux échantillons dans la ligne d’édition en-dessous. +\end{sphinxadmonition} + +\begin{sphinxadmonition}{note}{Note:} +Même si cet onglet peut être indépendant des autres onglets, il faut malgré tout renseigner lâ€\sphinxstylestrong{emprise de la zone} du premier onglet « Traitement des images ». +\end{sphinxadmonition} + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{API_20}.png} +\end{figure} + +Dans cet onglet il y a trois « check box » dont deux correspondent à des fonctions de traitement : +\begin{enumerate} +\setcounter{enumi}{22} +\item {} +\sphinxstylestrong{RPG} : Création du shapefile RPG mono-cultural {\hyperref[\detokenize{_sources/API:Processing.Processing.i_vhrs}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Processing.Processing.i\_vhrs()}}}}}. + +\end{enumerate} + +\begin{sphinxadmonition}{note}{Note:} +Ce traitement est lancé en appuyant sur le bouton « Ajouter ». +\end{sphinxadmonition} +\begin{enumerate} +\setcounter{enumi}{23} +\item {} +\sphinxstylestrong{Déterminer les seuils optimaux} : Calcul des seuils optimaux par paire de classes {\hyperref[\detokenize{_sources/package:Seath.Seath.separability_and_threshold}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Seath.Seath.separability\_and\_threshold()}}}}}. Ce traitement est activé en appuyant sur « OK ». + +\end{enumerate} + +Cette dernière fonction est l’objectif principal de cet onglet. Il faut ajouter à la chaîne de traitement, les échantillons associés aux paires de classes. Les deux exemples suivants montrent la démarche à suivre pour remplir les champs associés aux échantillons. + +\sphinxstylestrong{Exemple pour la classe 1}, Végétation non naturelle (cultures) / Semi-naturelle : + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{API_threshold}.png} +\end{figure} + +L’échantillon est un fichier RPG, il faut cocher la case RPG et entrer le nom du fichier, les classes à extraire (si il y en a plusieurs, les séparer d’une virgule), les champs associés aux classes et le nombre de polygones à extraire. + +En appuyant sur « Ajouter », une vérification des données entrées peut être éffectuée comme indiqué ci-dessous : + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{API_threshold_ajout}.png} +\end{figure} + +\sphinxstylestrong{Exemple pour la classe 2}, Herbacés / Ligneux : + +Ce fichier n’est pas un fichier RPG, la case RPG reste décoché. + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{API_threshold_1}.png} +\end{figure} + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{API_threshold_2}.png} +\end{figure} + +Le bouton \sphinxstylestrong{Effacer}, efface toutes les informations entrées par l’utilisateur. + + +\subsection{Interface du traitement de classification} +\label{\detokenize{_sources/methode_tuto:interface-du-traitement-de-classification}} +\begin{sphinxadmonition}{note}{Note:} +Cet onglet est dépendant des deux autres. Au préalable, il faut obligatoirement lancer tous les traitements précédents. +\end{sphinxadmonition} + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{API_class}.png} +\end{figure} + +Le seul traitement qui sera lancé dans cet onglet est le processus de classification {\hyperref[\detokenize{_sources/API:Processing.Processing.i_classifier_s}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Processing.Processing.i\_classifier\_s()}}}}} ou {\hyperref[\detokenize{_sources/API:Processing.Processing.i_classifier_rf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Processing.Processing.i\_classifier\_rf()}}}}}. + +Un fichier shapefile sera crée à l’emplacement indiqué par l’utilisateur, \sphinxstylestrong{fichier de sortie (15)}. Il dépend du shapefile en entrée issue de la \sphinxstylestrong{segmentation (8)} IGN. + +Il y a un choix entre deux \sphinxstylestrong{méthodes de classification (25)} : Random Forest (Plus long en calcul) et Seath. + +\begin{sphinxadmonition}{note}{Note:} +Avec la méthode du Random Forest, la classification se fait directement sur les trois niveaux contrairement à la méthode Seath qui peut se faire sur un, deux ou trois niveaux de classe. +\end{sphinxadmonition} + +Pour activer les niveaux d’extraction, il faut cocher les cases associées. L’utilisateur peut personnaliser les champs des entités de sortie comme ceci : + +26-1 - \sphinxstylestrong{Pour extraire que le premier niveau (Seath)} + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{API_class_10}.png} +\end{figure} + +26-2 - \sphinxstylestrong{Pour extraire les deux premiers niveaux (Seath)} + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{API_class_11}.png} +\end{figure} + +26-3 - \sphinxstylestrong{Pour extraire tous les niveaux (RF et Seath)} + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{API_class_12}.png} +\end{figure} + +Où : +\begin{itemize} +\item {} +ID : Identifiant unique + +\item {} +AREA : Superficie du polygone en ha + +\item {} +NIVEAU\_1 : Non végétation semi-naturelle / Semi-naturelle + +\item {} +NIVEAU\_2 : Eboulis / Agriculture \textbar{} Herbacés / Ligneux + +\item {} +NIVEAU\_3 : Lingeux denses / mixtes et Phytomasse faible / moyenne / forte + +\item {} +POURC : Densité de ligneux et de phytomasse + +\end{itemize} + +Les listes déroulantes indiquent la nature des champs, il y a deux choix : +\begin{itemize} +\item {} +String = Chaîne de caractères + +\item {} +Real = Chiffre réel + +\end{itemize} + + +\chapter{CarHab Phy MOBA package} +\label{\detokenize{_sources/package:carhab-phy-moba-package}}\label{\detokenize{_sources/package::doc}} +The class diagram associated to the processing is this : + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{ChainedeTraitementCarHab_UML_v2}.png} +\end{figure} + + +\section{Image processing} +\label{\detokenize{_sources/package:image-processing}} + +\subsection{Archive} +\label{\detokenize{_sources/package:module-Archive}}\label{\detokenize{_sources/package:archive}}\index{Archive (module)}\index{Archive (classe dans Archive)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Archive.Archive}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{Archive.}}\sphinxbfcode{\sphinxupquote{Archive}}}{\emph{captor}, \emph{list\_year}, \emph{box}, \emph{repertory}, \emph{proxy\_enabled}}{} +Class to list, download and unpack Theia image archive because of a shapefile (box). +This shapefile get extent of the area. +\begin{quote}\begin{description} +\item[{Paramètres}] \leavevmode\begin{itemize} +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{captor}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} +Name of the satellite (ex: Landsat or SpotWorldHeritage …). + +Name used to the url on website Theia Land + + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{list\_year}} (\sphinxstyleliteralemphasis{\sphinxupquote{list of str}}) \textendash{} Processing’s year (string for one year) + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{box}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Path of the study area + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{folder}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Path of the source folder + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{repertory}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Name of the archive’s folder + +\end{itemize} + +\end{description}\end{quote} +\index{coord\_box\_dd() (méthode Archive.Archive)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Archive.Archive.coord_box_dd}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{coord\_box\_dd}}}{}{} +Function to get area’s coordinates of shapefile +\begin{quote}\begin{description} +\item[{Renvoie}] \leavevmode + +str \textendash{} \sphinxstylestrong{area\_coord\_corner} : Area coordinates corner + +\textendash{}\textgreater{} Left bottom on x, Left bottom on y, Right top on x, Right top on y + + +\item[{Example}] \leavevmode +\end{description}\end{quote} + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{Archive} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{test} \PYG{o}{=} \PYG{n}{Archive}\PYG{p}{(}\PYG{n}{captor}\PYG{p}{,} \PYG{n}{list\PYGZus{}year}\PYG{p}{,} \PYG{n}{box}\PYG{p}{,} \PYG{n}{folder}\PYG{p}{,} \PYG{n}{repertory}\PYG{p}{,} \PYG{n}{proxy\PYGZus{}enabled}\PYG{p}{)} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{coor\PYGZus{}test} \PYG{o}{=} \PYG{n}{test}\PYG{o}{.}\PYG{n}{coord\PYGZus{}box\PYGZus{}dd}\PYG{p}{(}\PYG{p}{)} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{coor\PYGZus{}test} +\PYG{g+go}{\PYGZsq{}45.52, 2.25, 46.71, 3.27\PYGZsq{}} +\end{sphinxVerbatim} + +\end{fulllineitems} + +\index{decompress() (méthode Archive.Archive)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Archive.Archive.decompress}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{decompress}}}{}{} +Function to unpack archives and store informations of the images (date, path, …) + +\end{fulllineitems} + +\index{download\_auto() (méthode Archive.Archive)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Archive.Archive.download_auto}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{download\_auto}}}{\emph{user\_theia}, \emph{password\_theia}}{} +Function to download images archive automatically on Theia land data center. +Source : \sphinxurl{https://github.com/olivierhagolle/theia\_download} +\begin{quote}\begin{description} +\item[{Paramètres}] \leavevmode\begin{itemize} +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{user\_theia}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Username Theia Land data center + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{password\_theia}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Password Theia Land data center + +\end{itemize} + +\end{description}\end{quote} + +\end{fulllineitems} + +\index{listing() (méthode Archive.Archive)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Archive.Archive.listing}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{listing}}}{}{} +Function to list available archive on plateform Theia Land, and on the area + +\end{fulllineitems} + +\index{set\_list\_archive\_to\_try() (méthode Archive.Archive)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Archive.Archive.set_list_archive_to_try}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_list\_archive\_to\_try}}}{\emph{few\_list\_archive}}{} +Test function to download a few archives +\begin{quote}\begin{description} +\item[{Paramètres}] \leavevmode +\sphinxstyleliteralstrong{\sphinxupquote{few\_list\_archive}} (\sphinxstyleliteralemphasis{\sphinxupquote{list dimension 2}}) \textendash{} +{[}archive\_download, out\_archive{]} with : +\begin{itemize} +\item {} +archive\_dowload : Archives downloaded + +\item {} +out\_archive : Output archives path + +\end{itemize} + + +\end{description}\end{quote} + +\end{fulllineitems} + +\index{utm\_to\_latlng() (méthode Archive.Archive)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Archive.Archive.utm_to_latlng}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{utm\_to\_latlng}}}{\emph{zone}, \emph{easting}, \emph{northing}, \emph{northernHemisphere=True}}{} +Function to convert UTM to geographic coordinates +\begin{quote}\begin{description} +\item[{Paramètres}] \leavevmode\begin{itemize} +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{zone}} (\sphinxhref{https://docs.python.org/3/library/functions.html\#int}{\sphinxstyleliteralemphasis{\sphinxupquote{int}}}) \textendash{} UTM zone + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{easting}} (\sphinxhref{https://docs.python.org/3/library/functions.html\#float}{\sphinxstyleliteralemphasis{\sphinxupquote{float}}}) \textendash{} Coordinates UTM in x + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{northing}} (\sphinxhref{https://docs.python.org/3/library/functions.html\#float}{\sphinxstyleliteralemphasis{\sphinxupquote{float}}}) \textendash{} Coordinates UTM in y + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{northernHemisphere}} (\sphinxstyleliteralemphasis{\sphinxupquote{boolean}}) \textendash{} North hemisphere or not + +\end{itemize} + +\item[{Renvoie}] \leavevmode +tuple \textendash{} integer on the \sphinxstylestrong{longitude} and \sphinxstylestrong{latitude} + +\end{description}\end{quote} + +Source : \sphinxurl{http://www.ibm.com/developerworks/java/library/j-coordconvert/index.html} + +\end{fulllineitems} + + +\end{fulllineitems} + + + +\subsection{Landsat image processing} +\label{\detokenize{_sources/package:module-RasterSat_by_date}}\label{\detokenize{_sources/package:landsat-image-processing}}\index{RasterSat\_by\_date (module)}\index{RasterSat\_by\_date (classe dans RasterSat\_by\_date)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{RasterSat\_by\_date.}}\sphinxbfcode{\sphinxupquote{RasterSat\_by\_date}}}{\emph{class\_archive}, \emph{big\_folder}}{} +Satellite image processing’s class. +This class include several processes to group images by date, mosaic images by date, +extract images information, compute ndvi, compute cloud pourcent and create new rasters. + +@param class\_archive: Archive class name with every information on downloaded images +@type class\_archive: class + +@param big\_folder: Image processing folder +@type big\_folder: str +\begin{description} +\item[{@param one\_date: {[}year, month, day{]} …}] \leavevmode +This variable is modified in the function {\hyperref[\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date.mosaic_by_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mosaic\_by\_date()}}}}}. +To append mosaic image path, mosaic cloud image path, cloud pixel value table, +\begin{quote} + +mosaic ndvi image path and ndvi pixel value table. +\end{quote} + +\end{description} + +@type one\_date: list of str +\begin{description} +\item[{@param choice\_nb\_b: A option to choice output image number of band :}] \leavevmode +func: \sphinxtitleref{layer\_rasterization} in Vector’s class. +If this option is 0, it take input band. By default 0. + +\end{description} + +@type choice\_nb\_b: int +\index{calcul\_ndvi() (méthode RasterSat\_by\_date.RasterSat\_by\_date)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date.calcul_ndvi}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{calcul\_ndvi}}}{}{}~\begin{description} +\item[{Function to compute NDVI index for a Landsat image with OTB BandMathX}] \leavevmode\begin{itemize} +\item {} \begin{description} +\item[{OTB help :}] \leavevmode\begin{itemize} +\item {} +il : Images list : data and cloud + +\item {} +exp : Expression for ndvi : (PIR-R)/(PIR+R) + +\item {} +out : Feature Output Image + +\end{itemize} + +\end{description} + +\end{itemize} + +\end{description} + +\end{fulllineitems} + +\index{group\_by\_date() (méthode RasterSat\_by\_date.RasterSat\_by\_date)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date.group_by_date}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{group\_by\_date}}}{\emph{d\_uni}}{} +Function to extract images on a single date + +@param d\_uni: {[}year, month, day{]} +@type d\_uni: list of str + +@returns: list of str \textendash{} variable \sphinxstylestrong{group} = {[}year, month, day, multispectral image path, cloud image path{]} + +\end{fulllineitems} + +\index{mosaic\_by\_date() (méthode RasterSat\_by\_date.RasterSat\_by\_date)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date.mosaic_by_date}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{mosaic\_by\_date}}}{\emph{date}}{} +Function to merge images of the same date in a image group : func:\sphinxtitleref{group\_by\_date}. + +\end{fulllineitems} + +\index{pourc\_cloud() (méthode RasterSat\_by\_date.RasterSat\_by\_date)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date.pourc_cloud}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{pourc\_cloud}}}{}{}~\begin{description} +\item[{Return clear pixel percentage on the image self.cloudiness\_pourcentage{[}0{]}}] \leavevmode +because of a cloud image cloudiness\_pourcentage{[}1{]}. + +\end{description} +\begin{quote}\begin{description} +\item[{Renvoie}] \leavevmode +float \textendash{} variable \sphinxstylestrong{nb0}, clear pixel percentage. + +\item[{Example}] \leavevmode +\end{description}\end{quote} + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{RasterSat\PYGZus{}by\PYGZus{}date} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{Landsat\PYGZus{}test} \PYG{o}{=} \PYG{n}{RasterSat\PYGZus{}by\PYGZus{}date}\PYG{p}{(}\PYG{n}{class\PYGZus{}archive}\PYG{p}{,} \PYG{n}{big\PYGZus{}folder}\PYG{p}{,} \PYG{n}{one\PYGZus{}date}\PYG{p}{)} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{nb0\PYGZus{}test} \PYG{o}{=} \PYG{n}{Landsat\PYGZus{}test}\PYG{o}{.}\PYG{n}{pourc\PYGZus{}cloud}\PYG{p}{(}\PYG{n}{Landsat\PYGZus{}test}\PYG{o}{.}\PYG{n}{\PYGZus{}one\PYGZus{}date}\PYG{p}{[}\PYG{l+m+mi}{3}\PYG{p}{]}\PYG{p}{,} \PYG{n}{Landsat\PYGZus{}test}\PYG{o}{.}\PYG{n}{\PYGZus{}one\PYGZus{}date}\PYG{p}{[}\PYG{l+m+mi}{4}\PYG{p}{]}\PYG{p}{)} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{nb0\PYGZus{}test} +\PYG{g+go}{98} +\end{sphinxVerbatim} + +\end{fulllineitems} + +\index{raster\_data() (méthode RasterSat\_by\_date.RasterSat\_by\_date)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date.raster_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{raster\_data}}}{\emph{img}}{} +Function to extract raster information. +Return table of pixel values and raster information like +\begin{quote} + +line number, pixel size, … (gdal pointer) +\end{quote} + +@param img : Raster path +@type img : str + +@returns : numpy.array \textendash{} variable \sphinxstylestrong{data}, Pixel value matrix of a raster. +\begin{quote} + +gdal pointer \textendash{} variable \sphinxstylestrong{\_in\_ds}, Raster information. +\end{quote} + +\end{fulllineitems} + +\index{vrt\_translate\_gdal() (méthode RasterSat\_by\_date.RasterSat\_by\_date)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date.vrt_translate_gdal}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{vrt\_translate\_gdal}}}{\emph{vrt\_translate}, \emph{src\_data}, \emph{dst\_data}}{} +Function to launch gdal tools in command line. With \sphinxcode{\sphinxupquote{gdalbuildvrt}} and \sphinxcode{\sphinxupquote{gdal\_translate}}. +This function is used {\hyperref[\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date.mosaic_by_date}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mosaic\_by\_date()}}}}} to mosaic image by date. + +@param vrt\_translate: \sphinxcode{\sphinxupquote{vrt}} or \sphinxcode{\sphinxupquote{translate}} +@type vrt\_translate: str + +@param src\_data: Data source. Several data for vrt process and one data (vrt data) for gdal\_translate +@type src\_data: list (process \sphinxcode{\sphinxupquote{vrt}}) or str (process \sphinxcode{\sphinxupquote{translate}}) + +@param dst\_data: Output path +@type dst\_data: str + +\end{fulllineitems} + + +\end{fulllineitems} + + + +\subsection{Texture index processing} +\label{\detokenize{_sources/package:module-Vhrs}}\label{\detokenize{_sources/package:texture-index-processing}}\index{Vhrs (module)}\index{Vhrs (classe dans Vhrs)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Vhrs.Vhrs}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{Vhrs.}}\sphinxbfcode{\sphinxupquote{Vhrs}}}{\emph{imag}, \emph{mp}}{} +Class to compute Haralick and SFS textures with OTB + +@param imag: The input image path to compute texture image +@type imag: str + +@param out\_sfs/out\_haralick: Output path +@type out\_sfs/out\_haralick: str +\begin{description} +\item[{@param mp: Boolean variable -\textgreater{} 0 or 1.}] \leavevmode\begin{itemize} +\item {} +0 means, not multi-processing + +\item {} +1 means, launch process with multi-processing + +\end{itemize} + +\end{description} + +@type mp: int +\index{haralick\_texture\_extraction() (méthode Vhrs.Vhrs)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Vhrs.Vhrs.haralick_texture_extraction}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{haralick\_texture\_extraction}}}{\emph{texture\_choice}}{}~\begin{description} +\item[{Function to compute OTB Haralick texture image}] \leavevmode\begin{itemize} +\item {} \begin{description} +\item[{OTB help :}] \leavevmode\begin{itemize} +\item {} +in : Input Image + +\item {} +channel : Selected Channel + +\item {} \begin{description} +\item[{Texture feature parameters}] \leavevmode{[}This group of parameters allows to define texture parameters.{]}\begin{itemize} +\item {} +X Radius : X Radius + +\item {} +Y Radius : Y Radius + +\item {} +X Offset : X Offset + +\item {} +Y Offset : Y Offset + +\end{itemize} + +\end{description} + +\item {} +Image Minimum : Image Minimum + +\item {} +Image Maximum : Image Maximum + +\item {} +Histogram number of bin : Histogram number of bin + +\item {} \begin{description} +\item[{Texture Set Selection Choice of The Texture Set Available choices are :}] \leavevmode\begin{itemize} +\item {} +Simple Haralick Texture Features: This group of parameters defines the 8 local Haralick texture feature output image. The image channels are: Energy, Entropy, Correlation, Inverse Difference Moment, Inertia, Cluster Shade, Cluster Prominence and Haralick Correlation + +\item {} +Advanced Texture Features: This group of parameters defines the 9 advanced texture feature output image. The image channels are: Mean, Variance, Sum Average, Sum Variance, Sum Entropy, Difference of Entropies, Difference of Variances, IC1 and IC2 + +\item {} +Higher Order Texture Features: This group of parameters defines the 11 higher order texture feature output image. The image channels are: Short Run Emphasis, Long Run Emphasis, Grey-Level Nonuniformity, Run Length Nonuniformity, Run Percentage, Low Grey-Level Run Emphasis, High Grey-Level Run Emphasis, Short Run Low Grey-Level Emphasis, Short Run High Grey-Level Emphasis, Long Run Low Grey-Level Emphasis and Long Run High Grey-Level Emphasis + +\end{itemize} + +\end{description} + +\item {} +out : Feature Output Image + +\end{itemize} + +\end{description} + +\end{itemize} + +Source : \sphinxurl{http://otbcb.readthedocs.org/en/latest/Applications/app\_HaralickTextureExtraction.html} + +\end{description} + +@param texture\_choice: Order texture choice -\textgreater{} Simple / Advanced / Higher +@type texture\_choice: str + +\end{fulllineitems} + +\index{sfs\_texture\_extraction() (méthode Vhrs.Vhrs)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Vhrs.Vhrs.sfs_texture_extraction}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{sfs\_texture\_extraction}}}{}{}~\begin{description} +\item[{Function to compute OTB SFS texture image }] \leavevmode\begin{itemize} +\item {} \begin{description} +\item[{OTB help :}] \leavevmode\begin{itemize} +\item {} +in : Input Image + +\item {} +channel : Selected Channel + +\item {} \begin{description} +\item[{parameters}] \leavevmode{[}Texture feature parameters. This group of parameters allows to define SFS texture parameters. The available texture features are SFS’Length, SFS’Width, SFS’PSI, SFS’W-Mean, SFS’Ratio and SFS’SD. They are provided in this exact order in the output image.{]}\begin{itemize} +\item {} +parameters.spethre : Spectral Threshold + +\item {} +parameters.spathre : Spatial Threshold + +\item {} +parameters.nbdir : Number of Direction + +\item {} +parameters.alpha : Alpha + +\item {} +parameters.maxcons : Ratio Maximum Consideration Number + +\end{itemize} + +\end{description} + +\item {} +out : Feature Output Image + +\end{itemize} + +\end{description} + +\end{itemize} + +\end{description} + +\end{fulllineitems} + + +\end{fulllineitems} + + + +\subsection{Slope processing} +\label{\detokenize{_sources/package:module-Slope}}\label{\detokenize{_sources/package:slope-processing}}\index{Slope (module)}\index{Slope (classe dans Slope)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Slope.Slope}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{Slope.}}\sphinxbfcode{\sphinxupquote{Slope}}}{\emph{mnt}}{} +Class to compute a slope raster +\begin{quote}\begin{description} +\item[{Paramètres}] \leavevmode\begin{itemize} +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{mnt}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Digital Elevation Model (DEM) path + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{out\_mnt}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} slope raster path + +\end{itemize} + +\end{description}\end{quote} +\index{extract\_slope() (méthode Slope.Slope)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Slope.Slope.extract_slope}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{extract\_slope}}}{}{} +Function to compute slope in GDAL command line. + +\end{fulllineitems} + + +\end{fulllineitems} + + + +\subsection{Toolbox} +\label{\detokenize{_sources/package:module-Toolbox}}\label{\detokenize{_sources/package:toolbox}}\index{Toolbox (module)}\index{Toolbox (classe dans Toolbox)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Toolbox.Toolbox}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{Toolbox.}}\sphinxbfcode{\sphinxupquote{Toolbox}}} +Class used to grouped small tools to cut raster or compute statistics on a raster. +\begin{quote}\begin{description} +\item[{Paramètres}] \leavevmode\begin{itemize} +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{imag}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Input image (path) + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{vect}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Extent shapefile (path) + +\end{itemize} + +\end{description}\end{quote} +\index{calc\_serie\_stats() (méthode Toolbox.Toolbox)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Toolbox.Toolbox.calc_serie_stats}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{calc\_serie\_stats}}}{\emph{table}, \emph{stats\_name}, \emph{output\_folder}}{} +Function to compute stats on temporal cloud and ndvi spectral table +Ndvi stats : min max + +@param table: Spectral data, cloud raster and ndvi raster +@type table: numpy.ndarray + +@returns: list of numpy.ndarray \textendash{} variable \sphinxstylestrong{account\_stats}, list of temporal NDVI stats. +\begin{quote} + +numpy.ndarray \textendash{} variable \sphinxstylestrong{account\_cloud}, pixel number clear on the area. +\end{quote} + +\end{fulllineitems} + +\index{check\_proj() (méthode Toolbox.Toolbox)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Toolbox.Toolbox.check_proj}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{check\_proj}}}{}{} +Function to check if raster’s projection is RFG93. +For the moment, PHYMOBAT works with one projection only Lambert 93 EPSG:2154 + +\end{fulllineitems} + +\index{clip\_raster() (méthode Toolbox.Toolbox)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Toolbox.Toolbox.clip_raster}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clip\_raster}}}{\emph{**kwargs}}{} +Function to clip a raster with a vector. +The raster created will be in the same folder than the input raster. +With a prefix “{\color{red}\bfseries{}Clip\_}â€. +\begin{quote}\begin{description} +\item[{Kwargs}] \leavevmode +\sphinxstylestrong{rm\_rast} (int) - 0 (by default) or 1. Variable to remove the output raster. 0 to keep and 1 to remove. + +\item[{Renvoie}] \leavevmode +str \textendash{} variable \sphinxstylestrong{outclip}, output raster clip (path). + +\end{description}\end{quote} + +\end{fulllineitems} + + +\end{fulllineitems} + + + +\section{Vector processing} +\label{\detokenize{_sources/package:vector-processing}} + +\subsection{Super vector} +\label{\detokenize{_sources/package:module-Vector}}\label{\detokenize{_sources/package:super-vector}}\index{Vector (module)}\index{Vector (classe dans Vector)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Vector.Vector}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{Vector.}}\sphinxbfcode{\sphinxupquote{Vector}}}{\emph{used}, \emph{cut}, \emph{**opt}}{} +Vector class to extract a area, vector data and zonal statistic + +@param vector\_used: Input/Output shapefile to clip (path) +@type vector\_used: str + +@param vector\_cut: Area shapefile (path) +@type vector\_cut: str + +@param vector\_name: Name of the shapefile +@type vector\_name: str + +@param vector\_folder: Name of the folder containing the shapefile +@type vector\_name: str + +@param data\_source: Input shapefile information +@type data\_source: ogr pointer + +@param stats\_dict: Stats results +@type stats\_dict: dict + +@param remove\_shp: Remove shapefile or not. 0 : don’t remove, 1 : remove +@type remove\_shp: int + +@opt: \sphinxstylestrong{Remove} (int) - For the remove\_shp variable +\index{clip\_vector() (méthode Vector.Vector)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Vector.Vector.clip_vector}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clip\_vector}}}{\emph{output\_folder}}{} +Function to clip a vector with a vector + +\end{fulllineitems} + +\index{close\_data() (méthode Vector.Vector)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Vector.Vector.close_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{close\_data}}}{}{} +Function to remove allocate memory + +\end{fulllineitems} + +\index{layer\_rasterization() (méthode Vector.Vector)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Vector.Vector.layer_rasterization}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{layer\_rasterization}}}{\emph{raster\_head}, \emph{attribute\_r}, \emph{**kwargs}}{} +Function to rasterize a vector using OTB. + +@param raster\_head: Raster path that will look like the final raster of the rasterization +@type raster\_head: str + +@param attribute\_r: Field name of the shapefile that contains class names +@type attribute\_r: str + +@kwargs: \sphinxstylestrong{choice\_nb\_b} (int) - Output image number of band. If you choice 1, take first band. If you choice 2, take two first band etc… +@returns: str \textendash{} \sphinxstylestrong{valid\_raster} : output raster path from the rasterization + +\end{fulllineitems} + +\index{vector\_data() (méthode Vector.Vector)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Vector.Vector.vector_data}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{vector\_data}}}{}{} +Function to extract vector layer information + +\end{fulllineitems} + +\index{zonal\_stats() (méthode Vector.Vector)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Vector.Vector.zonal_stats}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{zonal\_stats}}}{\emph{liste\_chemin}}{} +Function to compute the mean in every polygons on a list images with otb + +:param liste\_chemin : List input image path +:type liste\_chemin: list(string) + +\end{fulllineitems} + +\index{zonal\_stats\_pp() (méthode Vector.Vector)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Vector.Vector.zonal_stats_pp}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{zonal\_stats\_pp}}}{\emph{inraster}}{} +A zonal statistics ++ to dertermine pxl percent in every polygon +\begin{quote}\begin{description} +\item[{Paramètres}] \leavevmode +\sphinxstyleliteralstrong{\sphinxupquote{inraster}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Input image path + +\item[{Renvoie}] \leavevmode +dict \textendash{} \sphinxstylestrong{p\_stats} : dictionnary with pxl percent in every polygon. Mainly “Maj\_count†(Majority Value) and “Maj\_count\_perc†(Majority Percent) + +\end{description}\end{quote} + +\end{fulllineitems} + + +\end{fulllineitems} + + + +\subsection{Sample} +\label{\detokenize{_sources/package:module-Sample}}\label{\detokenize{_sources/package:sample}}\index{Sample (module)}\index{Sample (classe dans Sample)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Sample.Sample}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{Sample.}}\sphinxbfcode{\sphinxupquote{Sample}}}{\emph{used}, \emph{cut}, \emph{nb\_sample}, \emph{**opt}}{} +Vector class inherits the super vector class properties. +This class create training sample. + +@param vector\_used: Input/Output shapefile to clip (path) +@type vector\_used: str + +@param vector\_cut: Area shapefile (path) +@type vector\_cut: str + +@param nb\_sample: Number of polygons for every sample +@type nb\_sample: int + +@param vector\_val: Output shapefile to validate the futur classification +@type vector\_val: str + +@opt: Refer to the Vector class +\index{create\_sample() (méthode Sample.Sample)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Sample.Sample.create_sample}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_sample}}}{\emph{**kwargs}}{} +Function to create a sample shapefile of a specific class +\begin{quote}\begin{description} +\item[{Kwargs}] \leavevmode +\sphinxstylestrong{fieldname} (list of str) - Fieldname in the input shapefile (if the user want select polygons of the class names specific) + +\end{description}\end{quote} + +\sphinxstylestrong{class} (list of str) - class names in the input shapefile (with fieldname index). +Can use one or several classes like this \textendash{}\textgreater{} example : {[}classname1, classname2, …{]} + +\end{fulllineitems} + +\index{fill\_sample() (méthode Sample.Sample)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Sample.Sample.fill_sample}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{fill\_sample}}}{\emph{output\_sample}, \emph{polygon}, \emph{**opt}}{} +Function to fill and create the output sample shapefile. +This function is used in {\hyperref[\detokenize{_sources/package:Sample.Sample.create_sample}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{create\_sample()}}}}} to create samples polygons +and validated polygons (to the take out the precision of the classification). + +@param output\_sample: Path of the output shapefile +@type output\_sample: str +\begin{description} +\item[{@param polygon: Identity of the selected random polygons.}] \leavevmode +If this variable = 0, the processing will take all polygons + +\end{description} + +@type polygon: list or int + +@opt: \sphinxstylestrong{add\_fieldname} (int) - Variable to kown if add a field. By default non (0), if it have to add (1) +\begin{quote} + +\sphinxstylestrong{fieldname} (str) - Fieldname to add in the input shapefile + +\sphinxstylestrong{class} (int) - class names in integer to add in the input shapefile +\end{quote} + +\end{fulllineitems} + +\index{select\_random\_sample() (méthode Sample.Sample)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Sample.Sample.select_random_sample}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{select\_random\_sample}}}{\emph{kw\_field}, \emph{kw\_classes}}{}~\begin{description} +\item[{Function to select id with class name specific only.}] \leavevmode +This function is used in {\hyperref[\detokenize{_sources/package:Sample.Sample.create_sample}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{create\_sample()}}}}} + +\end{description} + +@param kw\_field: Field name in the input shapefile +@type kw\_field: str + +@param kw\_classes: Class names in the input shapefile like this \textendash{}\textgreater{} “classname1, classname2†+@type kw\_classes: str + +@returns: list \textendash{} variable \sphinxstylestrong{select\_id}, List of id with a class name specific. + +\end{fulllineitems} + + +\end{fulllineitems} + + + +\subsection{RPG} +\label{\detokenize{_sources/package:module-Rpg}}\label{\detokenize{_sources/package:rpg}}\index{Rpg (module)}\index{Rpg (classe dans Rpg)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Rpg.Rpg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{Rpg.}}\sphinxbfcode{\sphinxupquote{Rpg}}}{\emph{used}, \emph{cut}}{} +Vector class inherits the super vector class properties. +This class create a new RPG shapefile with mono-crops. +It needs a basic RPG shapefile and a basic RPG CSV file \sphinxstyleemphasis{(…-GROUPES-CULTURE…)} in {\hyperref[\detokenize{_sources/package:Rpg.Rpg.mono_rpg}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{mono\_rpg()}}}}}. + +@param vector\_used: Input/Output shapefile to clip (path) +@type vector\_used: str + +@param vector\_cut: Area shapefile (path) +@type vector\_cut: str + +@param rm\_dupli: Rpg table with no duplicated crops group +@type rm\_dupli: dict + +@param head\_in\_read: List of rgp header +@type head\_in\_read: list of str + +@param min\_size: Minimum size to extract a rpg polygons +@type min\_size: float +\index{create\_new\_rpg\_files() (méthode Rpg.Rpg)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Rpg.Rpg.create_new_rpg_files}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_new\_rpg\_files}}}{}{} +Function to create new rpg shapefile with \sphinxstylestrong{rm\_dpli} variable. The output shapefile +will be create in the same folder than the input shapefile with prefix \sphinxstyleemphasis{MONO\_}. + +\end{fulllineitems} + +\index{mono\_rpg() (méthode Rpg.Rpg)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Rpg.Rpg.mono_rpg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{mono\_rpg}}}{\emph{path\_rpg}}{} +Function to extract no duplicated crops. + +\end{fulllineitems} + + +\end{fulllineitems} + + + +\subsection{Separability and threshold index} +\label{\detokenize{_sources/package:module-Seath}}\label{\detokenize{_sources/package:separability-and-threshold-index}}\index{Seath (module)}\index{Seath (classe dans Seath)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Seath.Seath}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{Seath.}}\sphinxbfcode{\sphinxupquote{Seath}}} +Get the optimal threshold and Bhattacharyya distance for a separability between two classes + +Source article : SEaTH\textendash{}A new tool for automated feature extraction in the context of object-based image analysis S. Nussbaum et al. + +Source Info : Kenji Ose (IRSTEA) et Nathalie St-Geours (IRSTEA) +\begin{quote}\begin{description} +\item[{Paramètres}] \leavevmode\begin{itemize} +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{value\_1}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#list}{\sphinxstyleliteralemphasis{\sphinxupquote{list}}}) \textendash{} List of index mean by polygons (sample 1) + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{value\_2}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#list}{\sphinxstyleliteralemphasis{\sphinxupquote{list}}}) \textendash{} List of index mean by polygons (sample 2) + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{threshold}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Optimal threshold under this form \sphinxstyleemphasis{\textgreater{}0.56} + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{J}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#list}{\sphinxstyleliteralemphasis{\sphinxupquote{list}}}) \textendash{} Jeffries-Matusita distance (measure separability between 2 classes on a 0 to 2 scale) + +\end{itemize} + +\item[{Example}] \leavevmode +\end{description}\end{quote} + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{Seath} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{a} \PYG{o}{=} \PYG{n}{Seath}\PYG{p}{(}\PYG{p}{)} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{a}\PYG{o}{.}\PYG{n}{value\PYGZus{}1} \PYG{o}{=} \PYG{n}{b}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]}\PYG{o}{.}\PYG{n}{stats\PYGZus{}dict} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{a}\PYG{o}{.}\PYG{n}{value\PYGZus{}2} \PYG{o}{=} \PYG{n}{b}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]}\PYG{o}{.}\PYG{n}{stats\PYGZus{}dict} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{a}\PYG{o}{.}\PYG{n}{separability\PYGZus{}and\PYGZus{}threshold}\PYG{p}{(}\PYG{p}{)} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{a}\PYG{o}{.}\PYG{n}{threshold}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} +\PYG{g+go}{\PYGZsq{}\PYGZgt{}0.56\PYGZsq{}} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{a}\PYG{o}{.}\PYG{n}{J}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} +\PYG{g+go}{1.86523428} +\end{sphinxVerbatim} +\index{separability\_and\_threshold() (méthode Seath.Seath)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Seath.Seath.separability_and_threshold}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{separability\_and\_threshold}}}{\emph{**kwargs}}{} +Function to extract the optimal threshold for a separability between two classes +\begin{quote}\begin{description} +\item[{Kwargs}] \leavevmode +\sphinxstylestrong{index} (str) - The processing will prints the string + +\end{description}\end{quote} + +\end{fulllineitems} + + +\end{fulllineitems} + + + +\subsection{Classification} +\label{\detokenize{_sources/package:module-Segmentation}}\label{\detokenize{_sources/package:classification}}\index{Segmentation (module)}\index{Segmentation (classe dans Segmentation)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Segmentation.Segmentation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{Segmentation.}}\sphinxbfcode{\sphinxupquote{Segmentation}}}{\emph{used}, \emph{cut}}{} +Vector class inherits the super vector class properties. This class create the final shapefile : Cartography +on a input segmentation by decision tree. +\begin{description} +\item[{The output classname are (\sphinxstylestrong{out\_class\_name} variable):}] \leavevmode\begin{itemize} +\item {} +Vegetation non naturelle + +\item {} +Vegetation semi-naturelle + +\item {} +Herbacees + +\item {} +Ligneux + +\item {} +Ligneux mixtes + +\item {} +Ligneux denses + +\item {} +Forte phytomasse + +\item {} +Moyenne phytomasse + +\item {} +Faible phytomasse + +\end{itemize} + +\end{description} + +@param vector\_used: Input/Output shapefile to clip (path) +@type vector\_used: str + +@param vector\_cut: Area shapefile (path) +@type vector\_cut: str + +@param output\_file: Output shapefile cartography. This path is the same than the segmentation path. +@type output\_file: str + +@param out\_class\_name: List of output class name +@type out\_class\_name: list of str + +@param out\_threshold: List of output threshold +@type out\_threshold: list of str + +@param {\color{red}\bfseries{}max\_}…: Biomass and density (IDM, SFS index) maximum +@type {\color{red}\bfseries{}max\_}…: float + +@param class\_tab\_final: Final decision tree table +@type class\_tab\_final: dict +\begin{description} +\item[{@param stats\_rpg\_tif: Dictionnary with pxl percent in every polygon of class RPG.}] \leavevmode +Mainly “Maj\_count†(Majority Value) and “Maj\_count\_perc†(Majority Percent) + +\end{description} + +@type stats\_rpg\_tif: dict +\index{append\_scale() (méthode Segmentation.Segmentation)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Segmentation.Segmentation.append_scale}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{append\_scale}}}{\emph{select\_class}, \emph{form}}{} +Function to complete the “class\_tab\_final†list with density and biomass information. +This list will be used to build the final shapefile. + +@param select\_class: Class name to add degree +@type select\_class: str + +@param form: Formula to add degree +@type form: str + +\end{fulllineitems} + +\index{compute\_biomass\_density() (méthode Segmentation.Segmentation)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Segmentation.Segmentation.compute_biomass_density}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{compute\_biomass\_density}}}{\emph{method='SEATH'}}{} +Function to compute the biomass and density distribution. +It returns threshold of biomass level. + +@param method: Classification method used. It can set “SEATH†(by default) or “RF†+@type method: str + +\end{fulllineitems} + +\index{create\_cartography() (méthode Segmentation.Segmentation)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Segmentation.Segmentation.create_cartography}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{create\_cartography}}}{\emph{out\_fieldnames}, \emph{out\_fieldtype}}{} +Function to create a output shapefile. In this output file, +there is the final cartography. With output defined field names +and field type in the main process. +\begin{quote}\begin{description} +\item[{Paramètres}] \leavevmode\begin{itemize} +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{out\_fieldnames}} (\sphinxstyleliteralemphasis{\sphinxupquote{list of str}}) \textendash{} List of output field names + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{out\_fieldtype}} (\sphinxstyleliteralemphasis{\sphinxupquote{list of str}}) \textendash{} List of outpu field type + +\end{itemize} + +\end{description}\end{quote} + +\end{fulllineitems} + +\index{decision\_tree() (méthode Segmentation.Segmentation)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/package:Segmentation.Segmentation.decision_tree}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{decision\_tree}}}{\emph{combin\_tree}}{} +Function to build the decision tree. Taking account output threshold and input +class name. + +@param combin\_tree: Decision tree combination +@type combin\_tree: list of number class name + +\end{fulllineitems} + + +\end{fulllineitems} + + + +\chapter{Graphical User Interface package} +\label{\detokenize{_sources/API:graphical-user-interface-package}}\label{\detokenize{_sources/API::doc}} +The class diagram associated to the interface is this : + +\begin{figure}[htbp] +\centering + +\noindent\sphinxincludegraphics{{ChainedeTraitementCarHab_API_UML_v3}.png} +\end{figure} + + +\section{Interface command} +\label{\detokenize{_sources/API:module-PHYMOBAT}}\label{\detokenize{_sources/API:interface-command}}\index{PHYMOBAT (module)} +Interface main, PHYMOBAT (FB PHYsionomiquedes Milieux Ouverts de Basse Altitude par Télédétection) + +\_\_name\_\_ = « PHYMOBAT 3.0 » + +\_\_license\_\_ = « GPL » + +\_\_version\_\_ = « 3.0 » + +\_\_author\_\_ = « LAVENTURE Sylvio - UMR TETIS / IRSTEA » + +\_\_date\_\_ = « Mars 2016 » +\index{PHYMOBAT (classe dans PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{PHYMOBAT.}}\sphinxbfcode{\sphinxupquote{PHYMOBAT}}}{\emph{mode=0}, \emph{parent=None}}{} +Interface main class. It makes to link \sphinxcode{\sphinxupquote{ui\_PHYMOBAT\_tab}} and \sphinxcode{\sphinxupquote{Processing}}. +\index{about\_PHYMOBA() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.about_PHYMOBA}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{about\_PHYMOBA}}}{}{} +Function to open a new window « About PHYMOBAT » + +\end{fulllineitems} + +\index{activate\_level() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.activate_level}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{activate\_level}}}{}{} +To activate the first levels with seath method. This is in pushing on the decision tree radio button. +Else it activates the last level to random forest method. + +\end{fulllineitems} + +\index{add\_sample() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.add_sample}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_sample}}}{}{} +Add sample information and location to compute optimal threshold : + +For the expert mode (mode=1) : +\begin{itemize} +\item {} +Append a sample name by line Edit. \sphinxstyleemphasis{This is a check box} \sphinxcode{\sphinxupquote{RPG}}, \sphinxstyleemphasis{if the sample is RPG file. It launch the Rpg class. And append a other sample from Rpg class}. + +\item {} +Append two existent sample field names by combobox. It will be the same. + +\item {} +Append sample class names by line edit. One or more for every sample. + +\item {} +Append number of polygons for every samples by line edit. + +\item {} +Print in a plain text edit : sample name, two sample field names, sample class names and number of polygons. + +\item {} \begin{description} +\item[{\sphinxstyleemphasis{This check box} \sphinxcode{\sphinxupquote{Image echantillonee}}, \sphinxstyleemphasis{image path for samples if the first processing image hasn’t been launched}.}] \leavevmode +\begin{sphinxadmonition}{note}{Note:} +This is for a image with one spectral band +\end{sphinxadmonition} + +\end{description} + +\item {} +Clear all widget field at the end. + +\end{itemize} + +For the simply mode (mode=0): +\begin{itemize} +\item {} +Append a sample name by a different line Edit (a line Edit for each sample). + +\item {} +Append sample class names, existing sample fields and number of polygons (a different line Edit for each sample) + +\end{itemize} + +\end{fulllineitems} + +\index{block\_for\_swh() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.block_for_swh}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{block\_for\_swh}}}{}{} +Function to block others function when SportWorldHeritage is selected in the comboxbox captor. + +\end{fulllineitems} + +\index{change\_mode() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.change_mode}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{change\_mode}}}{\emph{new\_mode}}{} +Function to switch between SIMPLE and EXPERT mode of « PHYMOBAT » + +\end{fulllineitems} + +\index{clear\_sample() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.clear_sample}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{clear\_sample}}}{}{} +Function to clear sample record. Clear in the interface and in the memory list. + +\end{fulllineitems} + +\index{close\_button() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.close_button}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{close\_button}}}{}{} +Function to close the interface. + +\end{fulllineitems} + +\index{display\_all\_levels() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.display_all_levels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{display\_all\_levels}}}{}{} +Function to display fieldnames option to launch complete classification + +\end{fulllineitems} + +\index{display\_one\_level() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.display_one_level}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{display\_one\_level}}}{}{} +Function to display fieldnames option to classifier one level + +\end{fulllineitems} + +\index{display\_two\_levels() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.display_two_levels}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{display\_two\_levels}}}{}{} +Function to display fieldnames option to classifier two first levels + +\end{fulllineitems} + +\index{enter\_sample\_name() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.enter_sample_name}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{enter\_sample\_name}}}{}{} +Open a input browser box to select the sample shapefile path by line edit. With {\hyperref[\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.add_sample}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_sample()}}}}} conditions for the expert mode. +For the simply mode, this function is used for the RPG shapefile. + +\end{fulllineitems} + +\index{enter\_sample\_name\_hl() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.enter_sample_name_hl}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{enter\_sample\_name\_hl}}}{}{} +Open a input browser box to select the grass and wooden sample shapefile path by line edit. With {\hyperref[\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.add_sample}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_sample()}}}}} conditions +for the simply mode. + +\end{fulllineitems} + +\index{enter\_sample\_name\_ll() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.enter_sample_name_ll}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{enter\_sample\_name\_ll}}}{}{} +Open a input browser box to select the wooden sample shapefile path by line edit. With {\hyperref[\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.add_sample}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_sample()}}}}} conditions for the simply mode. + +\end{fulllineitems} + +\index{f\_output\_name\_moba() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.f_output_name_moba}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{f\_output\_name\_moba}}}{}{} +Set the output classification shapefile path by line edit. + +\end{fulllineitems} + +\index{f\_path\_area() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.f_path_area}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{f\_path\_area}}}{}{} +Open a input browser box to select the study area shapefile path by line edit. + +\end{fulllineitems} + +\index{f\_path\_folder\_dpt() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.f_path_folder_dpt}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{f\_path\_folder\_dpt}}}{}{} +Open a input browser box to select the main folder path by line edit. + +\end{fulllineitems} + +\index{f\_path\_mnt() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.f_path_mnt}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{f\_path\_mnt}}}{}{} +Open a input browser box to select the MNT image path by line edit. + +\end{fulllineitems} + +\index{f\_path\_ortho() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.f_path_ortho}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{f\_path\_ortho}}}{}{} +Open a input browser box to select the VHRS image path by line edit. + +\end{fulllineitems} + +\index{f\_path\_segm() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.f_path_segm}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{f\_path\_segm}}}{}{} +Open a input browser box to select segmentation shapefile path path by line edit. + +\end{fulllineitems} + +\index{f\_proxy() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.f_proxy}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{f\_proxy}}}{}{} +Function to open a popup in order to enter proxy ID + +\end{fulllineitems} + +\index{field\_display\_1() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.field_display_1}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{field\_display\_1}}}{}{} +Function to display fieldname class 1 in the other fieldname class 2 when text changed. +For the simply mode, this is RPG sample. + +\end{fulllineitems} + +\index{field\_display\_2() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.field_display_2}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{field\_display\_2}}}{}{} +Function to display fieldname class 2 in the other fieldname class 2 when text changed. +For the simply mode, this is RPG sample. + +\end{fulllineitems} + +\index{field\_display\_3() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.field_display_3}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{field\_display\_3}}}{}{} +For the grass/wooden sample, a function to display fieldname class 1 in the other fieldname class 2 when text changed. + +\end{fulllineitems} + +\index{field\_display\_4() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.field_display_4}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{field\_display\_4}}}{}{} +For the grass/wooden sample, a function to display fieldname class 2 in the other fieldname class 2 when text changed. + +\end{fulllineitems} + +\index{field\_display\_5() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.field_display_5}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{field\_display\_5}}}{}{} +For the wooden sample, a function to display fieldname class 1 in the other fieldname class 2 when text changed. + +\end{fulllineitems} + +\index{field\_display\_6() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.field_display_6}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{field\_display\_6}}}{}{} +For the wooden sample, a function to display fieldname class 2 in the other fieldname class 2 when text changed. + +\end{fulllineitems} + +\index{forget\_raster\_sample() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.forget_raster_sample}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{forget\_raster\_sample}}}{}{} +Function to open a new window “Alert†because user forgotten to declare rasters or samples. + +\end{fulllineitems} + +\index{forget\_study\_area() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.forget_study_area}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{forget\_study\_area}}}{}{} +Function to open a new window “Alert†because user forgotten to declare study area. + +\end{fulllineitems} + +\index{get\_variable() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.get_variable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_variable}}}{}{} +Add a all system value like : +\begin{itemize} +\item {} +Main folder path by line edit + +\item {} +Satellite captor name by combo box + +\item {} +Classification year by line edit + +\item {} +Study area shapefile path by line edit + +\item {} +Connexion username and password by line edit + +\item {} +VHRS image path by line edit + +\item {} +MNT image path by line edit + +\item {} +Segmentation shapefile path path by line edit + +\item {} +Output classification shapefile path by line edit + +\item {} +Output shapefile field name by line edit and field type by combo box + +\end{itemize} + +\end{fulllineitems} + +\index{help\_tools() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.help_tools}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{help\_tools}}}{}{} +Function to open html help + +\end{fulllineitems} + +\index{img\_sample\_name() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.img_sample_name}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{img\_sample\_name}}}{}{} +Open a input browser box to select the image for samples path by line edit. With {\hyperref[\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.add_sample}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_sample()}}}}} conditions. + +\end{fulllineitems} + +\index{initUI() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.initUI}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{initUI}}}{}{} +Get initial values from interface after a click button. + +There is : +\begin{itemize} +\item {} \begin{description} +\item[{Connect browser button to search a path}] \leavevmode\begin{itemize} +\item {} +Main folder path + +\item {} +Study area shapefile path + +\item {} +VHRS image path + +\item {} +MNT image path + +\item {} +Segmentation shapefile path + +\item {} +Output classification shapefile path + +\item {} +Sample shapefile path + +\item {} +Image path for samples if the first processing image hasn’t been launched + +\end{itemize} + +\end{description} + +\item {} +Connect button to add sample in the memory list + +\item {} +Connect button to clear sample record. Clear in the interface and in the memory list + +\item {} +Connect close\textbar{}ok button + +\item {} +Connect menu bar tab (Open backup, save in a xml file, close, help, About PHYMOBAT, mode) + +\item {} +Initialize backup variable + +\end{itemize} + +\end{fulllineitems} + +\index{ok\_button() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.ok_button}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{ok\_button}}}{}{} +Function to launch the processing. This function take account : +\begin{itemize} +\item {} \begin{description} +\item[{The \sphinxcode{\sphinxupquote{Multi-processing}} check box if the processing has launched with multi process.}] \leavevmode +By default, this is checked. It need a computer with minimum 12Go memory. + +\end{description} + +\item {} +Append a few system value with {\hyperref[\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.get_variable}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_variable()}}}}}. + +\item {} \begin{description} +\item[{There are 3 principal check boxes :}] \leavevmode\begin{itemize} +\item {} +to get number download available images + +\item {} +for downloading and processing on theia platform + +\item {} +to compute optimal threshold. + +\item {} +to compute slope raster + +\item {} +for classification processing. + +\end{itemize} + +\end{description} + +\end{itemize} + +\end{fulllineitems} + +\index{open\_backup() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.open_backup}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{open\_backup}}}{\emph{test=None}}{} +Function to load input text in every fields. The input file must be a XML file. + +\end{fulllineitems} + +\index{save\_backup() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.save_backup}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{save\_backup}}}{}{} +Function to save input text in every fields. +The output file must be a XML file. + +\end{fulllineitems} + +\index{set\_variable() (méthode PHYMOBAT.PHYMOBAT)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:PHYMOBAT.PHYMOBAT.set_variable}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{set\_variable}}}{}{} +Print number of available image from Theia’s GeoJSON . + +\end{fulllineitems} + + +\end{fulllineitems} + + + +\section{Control processing} +\label{\detokenize{_sources/API:module-Processing}}\label{\detokenize{_sources/API:control-processing}}\index{Processing (module)}\index{Processing (classe dans Processing)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:Processing.Processing}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{Processing.}}\sphinxbfcode{\sphinxupquote{Processing}}} +Main processing. This class launch the others system classes. It take into account +CarHab classification method MOBA. +\begin{description} +\item[{This way is broken down into 3 parts :}] \leavevmode\begin{itemize} +\item {} +Image Processing (Search, download and processing) + +\item {} +Vector Processing (Optimal threshold, Sample processing) + +\item {} +Classification + +\item {} +Validation + +\end{itemize} + +\end{description} + +\sphinxstylestrong{Main parameters} +\begin{quote}\begin{description} +\item[{Paramètres}] \leavevmode\begin{itemize} +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{captor\_project}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Satellite captor name + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{classif\_year}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Classification year + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{nb\_avalaible\_images}} (\sphinxhref{https://docs.python.org/3/library/functions.html\#int}{\sphinxstyleliteralemphasis{\sphinxupquote{int}}}) \textendash{} Number download available images + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{path\_folder\_dpt}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Main folder path + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{folder\_processing}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Processing folder name. By default : “Traitement†+ +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{path\_area}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Study area shapefile + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{path\_ortho}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} VHRS image path + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{path\_mnt}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} MNT image path + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{path\_segm}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Segmentation shapefile + +\end{itemize} + +\end{description}\end{quote} + +\sphinxstylestrong{Id information to download on theia platform} +\begin{quote}\begin{description} +\item[{Paramètres}] \leavevmode\begin{itemize} +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{user}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Connexion Username + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{password}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Connexion Password + +\end{itemize} + +\end{description}\end{quote} + +\sphinxstylestrong{Output parameters} +\begin{quote}\begin{description} +\item[{Paramètres}] \leavevmode\begin{itemize} +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{output\_name\_moba}} (\sphinxhref{https://docs.python.org/3/library/stdtypes.html\#str}{\sphinxstyleliteralemphasis{\sphinxupquote{str}}}) \textendash{} Output classification shapefile + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{out\_fieldname\_carto}} (\sphinxstyleliteralemphasis{\sphinxupquote{list of str}}) \textendash{} Output shapefile field name + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{out\_fieldtype\_carto}} (\sphinxstyleliteralemphasis{\sphinxupquote{list of str}}\sphinxstyleliteralemphasis{\sphinxupquote{ (}}\sphinxstyleliteralemphasis{\sphinxupquote{eval ogr pointer}}\sphinxstyleliteralemphasis{\sphinxupquote{)}}) \textendash{} Output shapefile field type + +\end{itemize} + +\end{description}\end{quote} + +\sphinxstylestrong{Sample parameters} +\begin{quote}\begin{description} +\item[{Paramètres}] \leavevmode\begin{itemize} +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{fieldname\_args}} (\sphinxstyleliteralemphasis{\sphinxupquote{list of str}}) \textendash{} Sample field names 2 by 2 + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{class\_args}} (\sphinxstyleliteralemphasis{\sphinxupquote{list of str}}) \textendash{} Sample class names 2 by 2 + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{sample\_name}} (\sphinxstyleliteralemphasis{\sphinxupquote{list of str}}) \textendash{} List of sample name (path) + +\item {} +\sphinxstyleliteralstrong{\sphinxupquote{list\_nb\_sample}} (\sphinxstyleliteralemphasis{\sphinxupquote{list of int}}) \textendash{} Number of polygons for every sample + +\end{itemize} + +\end{description}\end{quote} + +\sphinxstylestrong{Multi-processing parameters} +\begin{quote}\begin{description} +\item[{Paramètres}] \leavevmode +\sphinxstyleliteralstrong{\sphinxupquote{mp}} (\sphinxhref{https://docs.python.org/3/library/functions.html\#int}{\sphinxstyleliteralemphasis{\sphinxupquote{int}}}) \textendash{} +Boolean variable -\textgreater{} 0 or 1. +\begin{itemize} +\item {} +0 means, not multi-processing + +\item {} +1 means, launch process with multi-processing + +\end{itemize} + + +\end{description}\end{quote} +\index{i\_classifier\_rf() (méthode Processing.Processing)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:Processing.Processing.i_classifier_rf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{i\_classifier\_rf}}}{}{}~\begin{description} +\item[{Interface function to launch random forest classification with a input segmentation}] \leavevmode{[}{]} +func:\sphinxtitleref{Segmentation.Segmentation}. + +\end{description} + +This function use the sklearn module to build the best of decision tree to extract classes. +The optimal threshold are stored by class \sphinxstylestrong{rf} variable in {\hyperref[\detokenize{_sources/API:Processing.Processing.i_sample_rf}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Processing.i\_sample\_rf()}}}}}. +Then it computes zonal statistics by polygons for every images in multi-processing (if \sphinxstylestrong{mp} = 1). + +\end{fulllineitems} + +\index{i\_classifier\_s() (méthode Processing.Processing)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:Processing.Processing.i_classifier_s}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{i\_classifier\_s}}}{}{} +Interface function to launch decision tree classification with a input +segmentation {\hyperref[\detokenize{_sources/package:Segmentation.Segmentation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Segmentation.Segmentation()}}}}}. + +This function store optimal threshold by class \sphinxstylestrong{Segmentation.out\_threshold}. +Then it computes zonal statistics by polygons for every images in multi-processing (if \sphinxstylestrong{mp} = 1). + +\end{fulllineitems} + +\index{i\_download() (méthode Processing.Processing)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:Processing.Processing.i_download}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{i\_download}}}{}{} +Interface function to download archives on the website Theia Land. This function extract +the number of downloadable image with {\hyperref[\detokenize{_sources/package:Archive.Archive.listing}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Archive.Archive.listing()}}}}}. + +Then, this function download \sphinxcode{\sphinxupquote{Archive.Archive.download()}} and unzip {\hyperref[\detokenize{_sources/package:Archive.Archive.decompress}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Archive.Archive.decompress()}}}}} images +in the archive folder (\sphinxstylestrong{folder\_archive}). + +\end{fulllineitems} + +\index{i\_images\_processing() (méthode Processing.Processing)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:Processing.Processing.i_images_processing}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{i\_images\_processing}}}{}{} +Interface function to launch processing VHRS images : func:\sphinxtitleref{i\_vhrs} +and satellite images {\hyperref[\detokenize{_sources/API:Processing.Processing.i_img_sat}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{i\_img\_sat()}}}}} in multi-processing. + +\end{fulllineitems} + +\index{i\_img\_sat() (méthode Processing.Processing)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:Processing.Processing.i_img_sat}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{i\_img\_sat}}}{}{} +Interface function to processing satellite images: +\begin{quote} + +1. Clip archive images and modify Archive class to integrate clip image path. +With \sphinxcode{\sphinxupquote{Toolbox.clip\_raster()}} in \sphinxcode{\sphinxupquote{Toolbox}} module. + +2. Search cloud’s percentage {\hyperref[\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date.pourc_cloud}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RasterSat\_by\_date.RasterSat\_by\_date.pourc\_cloud()}}}}}, +select image and compute ndvi index {\hyperref[\detokenize{_sources/package:RasterSat_by_date.RasterSat_by_date.calcul_ndvi}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{RasterSat\_by\_date.RasterSat\_by\_date.calcul\_ndvi()}}}}}. +If cloud’s percentage is greater than 40\%, then not select and compute ndvi index. + +3. Compute temporal stats on ndvi index {[}min, max, std, min-max{]}. With \sphinxcode{\sphinxupquote{Toolbox.calc\_serie\_stats()}} +in \sphinxcode{\sphinxupquote{Toolbox}} module. +\begin{enumerate} +\setcounter{enumi}{3} +\item {} +Create stats ndvi raster and stats cloud raster. + +\end{enumerate} + +\fvset{hllines={, ,}}% +\begin{sphinxVerbatim}[commandchars=\\\{\}] +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{k+kn}{import} \PYG{n+nn}{RasterSat\PYGZus{}by\PYGZus{}date} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{stats\PYGZus{}test} \PYG{o}{=} \PYG{n}{RasterSat\PYGZus{}by\PYGZus{}date}\PYG{p}{(}\PYG{n}{class\PYGZus{}archive}\PYG{p}{,} \PYG{n}{big\PYGZus{}folder}\PYG{p}{,} \PYG{n}{one\PYGZus{}date}\PYG{p}{)} +\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{stats\PYGZus{}test}\PYG{o}{.}\PYG{n}{complete\PYGZus{}raster}\PYG{p}{(}\PYG{n}{stats\PYGZus{}test}\PYG{o}{.}\PYG{n}{create\PYGZus{}raster}\PYG{p}{(}\PYG{n}{in\PYGZus{}raster}\PYG{p}{,} \PYG{n}{stats\PYGZus{}data}\PYG{p}{,} \PYG{n}{in\PYGZus{}ds}\PYG{p}{)}\PYG{p}{,} \PYG{n}{stats\PYGZus{}data}\PYG{p}{)} +\end{sphinxVerbatim} +\end{quote} + +\end{fulllineitems} + +\index{i\_rpg() (méthode Processing.Processing)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:Processing.Processing.i_rpg}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{i\_rpg}}}{\emph{path\_rpg}}{} +Interface function to extract mono rpg crops. + +@param path\_rpg: Input RPG shapefile. +@type path\_rpg: str + +@returns: str \textendash{} variable \sphinxstylestrong{Rpg.vector\_used}, output no duplicated crops shapefile (path). + +\end{fulllineitems} + +\index{i\_sample() (méthode Processing.Processing)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:Processing.Processing.i_sample}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{i\_sample}}}{}{} +Interface function to compute threshold with various sample. +It also extract a list of validation layer (shapefile) +to compute the precision of the next classification : func:\sphinxtitleref{i\_validate}. + +It create samples 2 by 2 with kwargs field names and class {\hyperref[\detokenize{_sources/package:Sample.Sample.create_sample}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Sample.Sample.create\_sample()}}}}}. +Then, it compute zonal statistics by polygons \sphinxcode{\sphinxupquote{Vector.Sample.zonal\_stats()}}. +\begin{description} +\item[{With zonal statistics computed, a optimal threshold is determined :}] \leavevmode +func:\sphinxtitleref{Seath.Seath.separability\_and\_threshold} that will print in a text file .lg +in the main folder. + +\end{description} + +\begin{sphinxadmonition}{warning}{Avertissement:} +{\hyperref[\detokenize{_sources/package:Seath.Seath.separability_and_threshold}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Seath.Seath.separability\_and\_threshold()}}}}} does not always +allow to discriminate optimal threshold. Then, this function will be launch +at least ten time until it reaches a optimal threshold. +\end{sphinxadmonition} + +\end{fulllineitems} + +\index{i\_sample\_rf() (méthode Processing.Processing)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:Processing.Processing.i_sample_rf}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{i\_sample\_rf}}}{}{} +This function build a random forest trees like model to create a final classification. +All of this using the method described in the : func:\sphinxtitleref{i\_validate} function and because +of sklearn module. + +\end{fulllineitems} + +\index{i\_slope() (méthode Processing.Processing)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:Processing.Processing.i_slope}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{i\_slope}}}{}{} +Interface function to processing slope raster. From a MNT, and with a command line gdal, +this function compute slope in degrees {\hyperref[\detokenize{_sources/package:Slope.Slope}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{Slope.Slope()}}}}}. + +\end{fulllineitems} + +\index{i\_tree\_direction() (méthode Processing.Processing)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:Processing.Processing.i_tree_direction}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{i\_tree\_direction}}}{}{} +Interface function to can extract one level or two levels of the final classification + +\end{fulllineitems} + +\index{i\_validate() (méthode Processing.Processing)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:Processing.Processing.i_validate}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{i\_validate}}}{}{} +Interface to validate a classification. It going to rasterize the validation shapefile and the +classification shapefile with \sphinxcode{\sphinxupquote{layer\_rasterization()}}. +Next, to compare pixel by pixel, the classification quality to built a confusion matrix in a csv file. + +\end{fulllineitems} + +\index{i\_vhrs() (méthode Processing.Processing)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:Processing.Processing.i_vhrs}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{i\_vhrs}}}{}{} +Interface function to processing VHRS images. +It create two OTB texture images : +\begin{quote} + +func: \sphinxtitleref{Vhrs.Vhrs} : SFS Texture and Haralick Texture +\end{quote} + +\end{fulllineitems} + + +\end{fulllineitems} + + + +\section{Interface element} +\label{\detokenize{_sources/API:module-ui_PHYMOBATs_tab}}\label{\detokenize{_sources/API:interface-element}}\index{ui\_PHYMOBATs\_tab (module)}\index{Ui\_PHYMOBAT (classe dans ui\_PHYMOBATs\_tab)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:ui_PHYMOBATs_tab.Ui_PHYMOBAT}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{ui\_PHYMOBATs\_tab.}}\sphinxbfcode{\sphinxupquote{Ui\_PHYMOBAT}}} +Class to display “Simplify PHYMOBAT windowâ€. + +\end{fulllineitems} + +\phantomsection\label{\detokenize{_sources/API:module-ui_PHYMOBATe_tab}}\index{ui\_PHYMOBATe\_tab (module)}\index{Ui\_PHYMOBAT (classe dans ui\_PHYMOBATe\_tab)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:ui_PHYMOBATe_tab.Ui_PHYMOBAT}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{ui\_PHYMOBATe\_tab.}}\sphinxbfcode{\sphinxupquote{Ui\_PHYMOBAT}}} +Class to display “Expert PHYMOBAT windowâ€. + +\end{fulllineitems} + + + +\section{Popup about and warming} +\label{\detokenize{_sources/API:module-ui_A_propos_PHYMOBAT_window}}\label{\detokenize{_sources/API:popup-about-and-warming}}\index{ui\_A\_propos\_PHYMOBAT\_window (module)}\index{Ui\_About (classe dans ui\_A\_propos\_PHYMOBAT\_window)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:ui_A_propos_PHYMOBAT_window.Ui_About}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{ui\_A\_propos\_PHYMOBAT\_window.}}\sphinxbfcode{\sphinxupquote{Ui\_About}}} +Class to display « About PHYMOBAT ». In this windows, it prints informations on the processing, license +and version. + +\end{fulllineitems} + +\phantomsection\label{\detokenize{_sources/API:module-ui_Warming_study_area}}\index{ui\_Warming\_study\_area (module)}\index{Ui\_Warming\_study\_area (classe dans ui\_Warming\_study\_area)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:ui_Warming_study_area.Ui_Warming_study_area}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{ui\_Warming\_study\_area.}}\sphinxbfcode{\sphinxupquote{Ui\_Warming\_study\_area}}} +Class to display a message to say there isn’t declared study area file. + +\end{fulllineitems} + +\phantomsection\label{\detokenize{_sources/API:module-ui_Warming_forgetting}}\index{ui\_Warming\_forgetting (module)}\index{Ui\_Warming\_forgetting (classe dans ui\_Warming\_forgetting)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:ui_Warming_forgetting.Ui_Warming_forgetting}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{ui\_Warming\_forgetting.}}\sphinxbfcode{\sphinxupquote{Ui\_Warming\_forgetting}}} +Class to display a message to tell you if you fogotten to enter a raster or a sample. + +\end{fulllineitems} + +\phantomsection\label{\detokenize{_sources/API:module-ui_Proxy_window}}\index{ui\_Proxy\_window (module)}\index{Ui\_Proxy\_window (classe dans ui\_Proxy\_window)} + +\begin{fulllineitems} +\phantomsection\label{\detokenize{_sources/API:ui_Proxy_window.Ui_Proxy_window}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{ui\_Proxy\_window.}}\sphinxbfcode{\sphinxupquote{Ui\_Proxy\_window}}} +Class to display “Proxy windowâ€. In this windows, there is 3 lines edit to fill (proxy server, login and password). + +\end{fulllineitems} + + + +\renewcommand{\indexname}{Index des modules Python} +\begin{sphinxtheindex} +\def\bigletter#1{{\Large\sffamily#1}\nopagebreak\vspace{1mm}} +\bigletter{a} +\item {\sphinxstyleindexentry{Archive}}\sphinxstyleindexpageref{_sources/package:\detokenize{module-Archive}} +\indexspace +\bigletter{p} +\item {\sphinxstyleindexentry{PHYMOBAT}}\sphinxstyleindexpageref{_sources/API:\detokenize{module-PHYMOBAT}} +\item {\sphinxstyleindexentry{Processing}}\sphinxstyleindexpageref{_sources/API:\detokenize{module-Processing}} +\indexspace +\bigletter{r} +\item {\sphinxstyleindexentry{RasterSat\_by\_date}}\sphinxstyleindexpageref{_sources/package:\detokenize{module-RasterSat_by_date}} +\item {\sphinxstyleindexentry{Rpg}}\sphinxstyleindexpageref{_sources/package:\detokenize{module-Rpg}} +\indexspace +\bigletter{s} +\item {\sphinxstyleindexentry{Sample}}\sphinxstyleindexpageref{_sources/package:\detokenize{module-Sample}} +\item {\sphinxstyleindexentry{Seath}}\sphinxstyleindexpageref{_sources/package:\detokenize{module-Seath}} +\item {\sphinxstyleindexentry{Segmentation}}\sphinxstyleindexpageref{_sources/package:\detokenize{module-Segmentation}} +\item {\sphinxstyleindexentry{Slope}}\sphinxstyleindexpageref{_sources/package:\detokenize{module-Slope}} +\indexspace +\bigletter{t} +\item {\sphinxstyleindexentry{Toolbox}}\sphinxstyleindexpageref{_sources/package:\detokenize{module-Toolbox}} +\indexspace +\bigletter{u} +\item {\sphinxstyleindexentry{ui\_A\_propos\_PHYMOBAT\_window}}\sphinxstyleindexpageref{_sources/API:\detokenize{module-ui_A_propos_PHYMOBAT_window}} +\item {\sphinxstyleindexentry{ui\_PHYMOBATe\_tab}}\sphinxstyleindexpageref{_sources/API:\detokenize{module-ui_PHYMOBATe_tab}} +\item {\sphinxstyleindexentry{ui\_PHYMOBATs\_tab}}\sphinxstyleindexpageref{_sources/API:\detokenize{module-ui_PHYMOBATs_tab}} +\item {\sphinxstyleindexentry{ui\_Proxy\_window}}\sphinxstyleindexpageref{_sources/API:\detokenize{module-ui_Proxy_window}} +\item {\sphinxstyleindexentry{ui\_Warming\_forgetting}}\sphinxstyleindexpageref{_sources/API:\detokenize{module-ui_Warming_forgetting}} +\item {\sphinxstyleindexentry{ui\_Warming\_study\_area}}\sphinxstyleindexpageref{_sources/API:\detokenize{module-ui_Warming_study_area}} +\indexspace +\bigletter{v} +\item {\sphinxstyleindexentry{Vector}}\sphinxstyleindexpageref{_sources/package:\detokenize{module-Vector}} +\item {\sphinxstyleindexentry{Vhrs}}\sphinxstyleindexpageref{_sources/package:\detokenize{module-Vhrs}} +\end{sphinxtheindex} + +\renewcommand{\indexname}{Index} +\printindex +\end{document} \ No newline at end of file diff --git a/Documentation/_build/latex/Phymobat.toc b/Documentation/_build/latex/Phymobat.toc new file mode 100644 index 0000000000000000000000000000000000000000..bf8294ace3408f9587d12b0a6cc330c2a9808465 --- /dev/null +++ b/Documentation/_build/latex/Phymobat.toc @@ -0,0 +1,44 @@ +\contentsline {chapter}{\numberline {1}Installation}{3}{chapter.1} +\contentsline {section}{\numberline {1.1}T\IeC {\'e}l\IeC {\'e}chargement Phymobat}{3}{section.1.1} +\contentsline {section}{\numberline {1.2}Installation SIG open source}{3}{section.1.2} +\contentsline {subsection}{\numberline {1.2.1}GDAL}{3}{subsection.1.2.1} +\contentsline {subsection}{\numberline {1.2.2}Orfeo ToolBox (OTB)}{4}{subsection.1.2.2} +\contentsline {subsection}{\numberline {1.2.3}CURL}{4}{subsection.1.2.3} +\contentsline {section}{\numberline {1.3}Installation des modules python}{4}{section.1.3} +\contentsline {chapter}{\numberline {2}Processus utilis\IeC {\'e}es et tutoriels API}{7}{chapter.2} +\contentsline {section}{\numberline {2.1}Processus algorithmiques utilis\IeC {\'e}es}{9}{section.2.1} +\contentsline {subsection}{\numberline {2.1.1}Traitement des images}{9}{subsection.2.1.1} +\contentsline {subsubsection}{1. Listing et t\IeC {\'e}l\IeC {\'e}chargements des images sur la plate-forme Theia}{10}{subsubsection*.3} +\contentsline {subsubsection}{2. Traitements des images t\IeC {\'e}l\IeC {\'e}charg\IeC {\'e}es}{11}{subsubsection*.4} +\contentsline {subsubsection}{3. Traitements des images THRS}{12}{subsubsection*.5} +\contentsline {subsection}{\numberline {2.1.2}Traitements des \IeC {\'e}chantillons}{14}{subsection.2.1.2} +\contentsline {subsubsection}{1. Mod\IeC {\`e}le Seath}{14}{subsubsection*.6} +\contentsline {subsubsection}{2. Mold\IeC {\`e}le Random Forest (RF)}{14}{subsubsection*.7} +\contentsline {subsection}{\numberline {2.1.3}Traitements de classification}{15}{subsection.2.1.3} +\contentsline {section}{\numberline {2.2}Tutoriels interface}{16}{section.2.2} +\contentsline {subsection}{\numberline {2.2.1}Interface Simplifi\IeC {\'e}e}{16}{subsection.2.2.1} +\contentsline {subsubsection}{Exemple sur un jeu de donn\IeC {\'e}es test}{18}{subsubsection*.8} +\contentsline {subsection}{\numberline {2.2.2}Interface experte}{19}{subsection.2.2.2} +\contentsline {subsection}{\numberline {2.2.3}Interface du traitement des images}{19}{subsection.2.2.3} +\contentsline {subsection}{\numberline {2.2.4}Interface du traitement des \IeC {\'e}chantillons}{23}{subsection.2.2.4} +\contentsline {subsection}{\numberline {2.2.5}Interface du traitement de classification}{25}{subsection.2.2.5} +\contentsline {chapter}{\numberline {3}CarHab Phy MOBA package}{35}{chapter.3} +\contentsline {section}{\numberline {3.1}Image processing}{35}{section.3.1} +\contentsline {subsection}{\numberline {3.1.1}Archive}{35}{subsection.3.1.1} +\contentsline {subsection}{\numberline {3.1.2}Landsat image processing}{37}{subsection.3.1.2} +\contentsline {subsection}{\numberline {3.1.3}Texture index processing}{38}{subsection.3.1.3} +\contentsline {subsection}{\numberline {3.1.4}Slope processing}{39}{subsection.3.1.4} +\contentsline {subsection}{\numberline {3.1.5}Toolbox}{39}{subsection.3.1.5} +\contentsline {section}{\numberline {3.2}Vector processing}{40}{section.3.2} +\contentsline {subsection}{\numberline {3.2.1}Super vector}{40}{subsection.3.2.1} +\contentsline {subsection}{\numberline {3.2.2}Sample}{41}{subsection.3.2.2} +\contentsline {subsection}{\numberline {3.2.3}RPG}{42}{subsection.3.2.3} +\contentsline {subsection}{\numberline {3.2.4}Separability and threshold index}{42}{subsection.3.2.4} +\contentsline {subsection}{\numberline {3.2.5}Classification}{43}{subsection.3.2.5} +\contentsline {chapter}{\numberline {4}Graphical User Interface package}{45}{chapter.4} +\contentsline {section}{\numberline {4.1}Interface command}{46}{section.4.1} +\contentsline {section}{\numberline {4.2}Control processing}{49}{section.4.2} +\contentsline {section}{\numberline {4.3}Interface element}{52}{section.4.3} +\contentsline {section}{\numberline {4.4}Popup about and warming}{52}{section.4.4} +\contentsline {chapter}{Index des modules Python}{53}{section*.113} +\contentsline {chapter}{Index}{55}{section*.114} diff --git a/Documentation/_build/latex/arbreDecision_cut.png b/Documentation/_build/latex/arbreDecision_cut.png new file mode 100644 index 0000000000000000000000000000000000000000..de7e1024ffd98b1a77468d94f2ee69a987735b1c Binary files /dev/null and b/Documentation/_build/latex/arbreDecision_cut.png differ diff --git a/Documentation/_build/latex/footnotehyper-sphinx.sty b/Documentation/_build/latex/footnotehyper-sphinx.sty new file mode 100644 index 0000000000000000000000000000000000000000..5995f012d77562a5d8a44918dbf17d73b9d62387 --- /dev/null +++ b/Documentation/_build/latex/footnotehyper-sphinx.sty @@ -0,0 +1,269 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{footnotehyper-sphinx}% + [2017/10/27 v1.7 hyperref aware footnote.sty for sphinx (JFB)] +%% +%% Package: footnotehyper-sphinx +%% Version: based on footnotehyper.sty 2017/03/07 v1.0 +%% as available at http://www.ctan.org/pkg/footnotehyper +%% License: the one applying to Sphinx +%% +%% Refer to the PDF documentation at http://www.ctan.org/pkg/footnotehyper for +%% the code comments. +%% +%% Differences: +%% 1. a partial tabulary compatibility layer added (enough for Sphinx mark-up), +%% 2. use of \spx@opt@BeforeFootnote from sphinx.sty, +%% 3. use of \sphinxunactivateextrasandspace from sphinx.sty, +%% 4. macro definition \sphinxfootnotemark, +%% 5. macro definition \sphinxlongtablepatch +%% 6. replaced an \undefined by \@undefined +\DeclareOption*{\PackageWarning{footnotehyper-sphinx}{Option `\CurrentOption' is unknown}}% +\ProcessOptions\relax +\newbox\FNH@notes +\newdimen\FNH@width +\let\FNH@colwidth\columnwidth +\newif\ifFNH@savingnotes +\AtBeginDocument {% + \let\FNH@latex@footnote \footnote + \let\FNH@latex@footnotetext\footnotetext + \let\FNH@H@@footnotetext \@footnotetext + \newenvironment{savenotes} + {\FNH@savenotes\ignorespaces}{\FNH@spewnotes\ignorespacesafterend}% + \let\spewnotes \FNH@spewnotes + \let\footnote \FNH@footnote + \let\footnotetext \FNH@footnotetext + \let\endfootnote \FNH@endfntext + \let\endfootnotetext\FNH@endfntext + \@ifpackageloaded{hyperref} + {\ifHy@hyperfootnotes + \let\FNH@H@@footnotetext\H@@footnotetext + \else + \let\FNH@hyper@fntext\FNH@nohyp@fntext + \fi}% + {\let\FNH@hyper@fntext\FNH@nohyp@fntext}% +}% +\def\FNH@hyper@fntext{\FNH@fntext\FNH@hyper@fntext@i}% +\def\FNH@nohyp@fntext{\FNH@fntext\FNH@nohyp@fntext@i}% +\def\FNH@fntext #1{% + \ifx\ifmeasuring@\@undefined + \expandafter\@secondoftwo\else\expandafter\@firstofone\fi +% these two lines modified for Sphinx (tabulary compatibility): + {\ifmeasuring@\expandafter\@gobbletwo\else\expandafter\@firstofone\fi}% + {\ifx\equation$\expandafter\@gobbletwo\fi #1}%$ +}% +\long\def\FNH@hyper@fntext@i#1{% + \global\setbox\FNH@notes\vbox + {\unvbox\FNH@notes + \FNH@startnote + \@makefntext + {\rule\z@\footnotesep\ignorespaces + \ifHy@nesting\expandafter\ltx@firstoftwo + \else\expandafter\ltx@secondoftwo + \fi + {\expandafter\hyper@@anchor\expandafter{\Hy@footnote@currentHref}{#1}}% + {\Hy@raisedlink + {\expandafter\hyper@@anchor\expandafter{\Hy@footnote@currentHref}% + {\relax}}% + \let\@currentHref\Hy@footnote@currentHref + \let\@currentlabelname\@empty + #1}% + \@finalstrut\strutbox + }% + \FNH@endnote + }% +}% +\long\def\FNH@nohyp@fntext@i#1{% + \global\setbox\FNH@notes\vbox + {\unvbox\FNH@notes + \FNH@startnote + \@makefntext{\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% + \FNH@endnote + }% +}% +\def\FNH@startnote{% + \hsize\FNH@colwidth + \interlinepenalty\interfootnotelinepenalty + \reset@font\footnotesize + \floatingpenalty\@MM + \@parboxrestore + \protected@edef\@currentlabel{\csname p@\@mpfn\endcsname\@thefnmark}% + \color@begingroup +}% +\def\FNH@endnote{\color@endgroup}% +\def\FNH@savenotes{% + \begingroup + \ifFNH@savingnotes\else + \FNH@savingnotestrue + \let\@footnotetext \FNH@hyper@fntext + \let\@mpfootnotetext \FNH@hyper@fntext + \let\H@@mpfootnotetext\FNH@nohyp@fntext + \FNH@width\columnwidth + \let\FNH@colwidth\FNH@width + \global\setbox\FNH@notes\box\voidb@x + \let\FNH@thempfn\thempfn + \let\FNH@mpfn\@mpfn + \ifx\@minipagerestore\relax\let\@minipagerestore\@empty\fi + \expandafter\def\expandafter\@minipagerestore\expandafter{% + \@minipagerestore + \let\thempfn\FNH@thempfn + \let\@mpfn\FNH@mpfn + }% + \fi +}% +\def\FNH@spewnotes {% + \endgroup + \ifFNH@savingnotes\else + \ifvoid\FNH@notes\else + \begingroup + \let\@makefntext\@empty + \let\@finalstrut\@gobble + \let\rule\@gobbletwo + \FNH@H@@footnotetext{\unvbox\FNH@notes}% + \endgroup + \fi + \fi +}% +\def\FNH@footnote@envname {footnote}% +\def\FNH@footnotetext@envname{footnotetext}% +\def\FNH@footnote{% +% this line added for Sphinx: + \spx@opt@BeforeFootnote + \ifx\@currenvir\FNH@footnote@envname + \expandafter\FNH@footnoteenv + \else + \expandafter\FNH@latex@footnote + \fi +}% +\def\FNH@footnoteenv{% +% this line added for Sphinx (footnotes in parsed literal blocks): + \catcode13=5 \sphinxunactivateextrasandspace + \@ifnextchar[% + \FNH@footnoteenv@i %] + {\stepcounter\@mpfn + \protected@xdef\@thefnmark{\thempfn}% + \@footnotemark + \def\FNH@endfntext@fntext{\@footnotetext}% + \FNH@startfntext}% +}% +\def\FNH@footnoteenv@i[#1]{% + \begingroup + \csname c@\@mpfn\endcsname #1\relax + \unrestored@protected@xdef\@thefnmark{\thempfn}% + \endgroup + \@footnotemark + \def\FNH@endfntext@fntext{\@footnotetext}% + \FNH@startfntext +}% +\def\FNH@footnotetext{% + \ifx\@currenvir\FNH@footnotetext@envname + \expandafter\FNH@footnotetextenv + \else + \expandafter\FNH@latex@footnotetext + \fi +}% +\def\FNH@footnotetextenv{% + \@ifnextchar[% + \FNH@footnotetextenv@i %] + {\protected@xdef\@thefnmark{\thempfn}% + \def\FNH@endfntext@fntext{\@footnotetext}% + \FNH@startfntext}% +}% +\def\FNH@footnotetextenv@i[#1]{% + \begingroup + \csname c@\@mpfn\endcsname #1\relax + \unrestored@protected@xdef\@thefnmark{\thempfn}% + \endgroup + \ifFNH@savingnotes + \def\FNH@endfntext@fntext{\FNH@nohyp@fntext}% + \else + \def\FNH@endfntext@fntext{\FNH@H@@footnotetext}% + \fi + \FNH@startfntext +}% +\def\FNH@startfntext{% + \setbox\z@\vbox\bgroup + \FNH@startnote + \FNH@prefntext + \rule\z@\footnotesep\ignorespaces +}% +\def\FNH@endfntext {% + \@finalstrut\strutbox + \FNH@postfntext + \FNH@endnote + \egroup + \begingroup + \let\@makefntext\@empty\let\@finalstrut\@gobble\let\rule\@gobbletwo + \FNH@endfntext@fntext {\unvbox\z@}% + \endgroup +}% +\AtBeginDocument{% + \let\FNH@@makefntext\@makefntext + \ifx\@makefntextFB\@undefined + \expandafter\@gobble\else\expandafter\@firstofone\fi + {\ifFBFrenchFootnotes \let\FNH@@makefntext\@makefntextFB \else + \let\FNH@@makefntext\@makefntextORI\fi}% + \expandafter\FNH@check@a\FNH@@makefntext{1.2!3?4,}% + \FNH@@@1.2!3?4,\FNH@@@\relax +}% +\long\def\FNH@check@a #11.2!3?4,#2\FNH@@@#3{% + \ifx\relax#3\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + \FNH@bad@makefntext@alert + {\def\FNH@prefntext{#1}\def\FNH@postfntext{#2}\FNH@check@b}% +}% +\def\FNH@check@b #1\relax{% + \expandafter\expandafter\expandafter\FNH@check@c + \expandafter\meaning\expandafter\FNH@prefntext + \meaning\FNH@postfntext1.2!3?4,\FNH@check@c\relax +}% +\def\FNH@check@c #11.2!3?4,#2#3\relax{% + \ifx\FNH@check@c#2\expandafter\@gobble\fi\FNH@bad@makefntext@alert +}% +% slight reformulation for Sphinx +\def\FNH@bad@makefntext@alert{% + \PackageWarningNoLine{footnotehyper-sphinx}% + {Footnotes will be sub-optimal, sorry. This is due to the document class or^^J + some package modifying macro \string\@makefntext.^^J + You can try to report this incompatibility at^^J + https://github.com/sphinx-doc/sphinx with this info:}% + \typeout{\meaning\@makefntext}% + \let\FNH@prefntext\@empty\let\FNH@postfntext\@empty +}% +% this macro from original footnote.sty is not used anymore by Sphinx +% but for simplicity sake let's just keep it as is +\def\makesavenoteenv{\@ifnextchar[\FNH@msne@ii\FNH@msne@i}%] +\def\FNH@msne@i #1{% + \expandafter\let\csname FNH$#1\expandafter\endcsname %$ + \csname #1\endcsname + \expandafter\let\csname endFNH$#1\expandafter\endcsname %$ + \csname end#1\endcsname + \FNH@msne@ii[#1]{FNH$#1}%$ +}% +\def\FNH@msne@ii[#1]#2{% + \expandafter\edef\csname#1\endcsname{% + \noexpand\savenotes + \expandafter\noexpand\csname#2\endcsname + }% + \expandafter\edef\csname end#1\endcsname{% + \expandafter\noexpand\csname end#2\endcsname + \noexpand\expandafter + \noexpand\spewnotes + \noexpand\if@endpe\noexpand\@endpetrue\noexpand\fi + }% +}% +% end of footnotehyper 2017/02/16 v0.99 +% some extras for Sphinx : +% \sphinxfootnotemark: usable in section titles and silently removed from TOCs. +\def\sphinxfootnotemark [#1]% + {\ifx\thepage\relax\else\protect\spx@opt@BeforeFootnote + \protect\footnotemark[#1]\fi}% +\AtBeginDocument{% + % let hyperref less complain + \pdfstringdefDisableCommands{\def\sphinxfootnotemark [#1]{}}% + % to obtain hyperlinked footnotes in longtable environment we must replace + % hyperref's patch of longtable's patch of \@footnotetext by our own + \let\LT@p@ftntext\FNH@hyper@fntext + % this *requires* longtable to be used always wrapped in savenotes environment +}% +\endinput +%% +%% End of file `footnotehyper-sphinx.sty'. diff --git a/Documentation/_build/latex/latexmkjarc b/Documentation/_build/latex/latexmkjarc new file mode 100644 index 0000000000000000000000000000000000000000..39ea47f3ba9f0218e3495a57a1447bb3dbbb2e13 --- /dev/null +++ b/Documentation/_build/latex/latexmkjarc @@ -0,0 +1,7 @@ +$latex = 'platex ' . $ENV{'LATEXOPTS'} . ' -kanji=utf8 %O %S'; +$dvipdf = 'dvipdfmx %O -o %D %S'; +$makeindex = 'rm -f %D; mendex -U -f -d %B.dic -s python.ist %S || echo "mendex exited with error code $? (ignoring)" && : >> %D'; +add_cus_dep( "glo", "gls", 0, "makeglo" ); +sub makeglo { + return system( "mendex -J -f -s gglo.ist -o '$_[0].gls' '$_[0].glo'" ); +} diff --git a/Documentation/_build/latex/latexmkrc b/Documentation/_build/latex/latexmkrc new file mode 100644 index 0000000000000000000000000000000000000000..bba17fa6bc6aa2e1a0f08088b7bd685077463e8e --- /dev/null +++ b/Documentation/_build/latex/latexmkrc @@ -0,0 +1,9 @@ +$latex = 'latex ' . $ENV{'LATEXOPTS'} . ' %O %S'; +$pdflatex = 'pdflatex ' . $ENV{'LATEXOPTS'} . ' %O %S'; +$lualatex = 'lualatex ' . $ENV{'LATEXOPTS'} . ' %O %S'; +$xelatex = 'xelatex --no-pdf ' . $ENV{'LATEXOPTS'} . ' %O %S'; +$makeindex = 'makeindex -s python.ist %O -o %D %S'; +add_cus_dep( "glo", "gls", 0, "makeglo" ); +sub makeglo { + return system( "makeindex -s gglo.ist -o '$_[0].gls' '$_[0].glo'" ); +} \ No newline at end of file diff --git a/Documentation/_build/latex/phytomasse.png b/Documentation/_build/latex/phytomasse.png new file mode 100644 index 0000000000000000000000000000000000000000..b1811ef8b3b3830e3437987caf47387d75252671 Binary files /dev/null and b/Documentation/_build/latex/phytomasse.png differ diff --git a/Documentation/_build/latex/python.ist b/Documentation/_build/latex/python.ist new file mode 100644 index 0000000000000000000000000000000000000000..687d26cd456cf2aa7743a7008e0c87943964caa5 --- /dev/null +++ b/Documentation/_build/latex/python.ist @@ -0,0 +1,13 @@ +line_max 100 +headings_flag 1 +heading_prefix " \\bigletter " + +preamble "\\begin{sphinxtheindex} +\\def\\bigletter#1{{\\Large\\sffamily#1}\\nopagebreak\\vspace{1mm}} + +" + +postamble "\n\n\\end{sphinxtheindex}\n" + +symhead_positive "{Symbols}" +numhead_positive "{Numbers}" diff --git a/Documentation/_build/latex/spectral_cloud.png b/Documentation/_build/latex/spectral_cloud.png new file mode 100644 index 0000000000000000000000000000000000000000..17b37c7900538fb6ebbb45a0fdf3d613e0911cc8 Binary files /dev/null and b/Documentation/_build/latex/spectral_cloud.png differ diff --git a/Documentation/_build/latex/sphinx.sty b/Documentation/_build/latex/sphinx.sty new file mode 100644 index 0000000000000000000000000000000000000000..63faeb058e16a9dd4cae80951e5d9cd25734be45 --- /dev/null +++ b/Documentation/_build/latex/sphinx.sty @@ -0,0 +1,1672 @@ +% +% sphinx.sty +% +% Adapted from the old python.sty, mostly written by Fred Drake, +% by Georg Brandl. +% + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{sphinx}[2018/07/18 v1.7.7 LaTeX package (Sphinx markup)] + +% provides \ltx@ifundefined +% (many packages load ltxcmds: graphicx does for pdftex and lualatex but +% not xelatex, and anyhow kvoptions does, but it may be needed in future to +% use \sphinxdeprecationwarning earlier, and it needs \ltx@ifundefined) +\RequirePackage{ltxcmds} + +%% for deprecation warnings +\newcommand\sphinxdeprecationwarning[4]{% #1 the deprecated macro or name, +% #2 = when deprecated, #3 = when removed, #4 = additional info + \edef\spx@tempa{\detokenize{#1}}% + \ltx@ifundefined{sphinx_depr_\spx@tempa}{% + \global\expandafter\let\csname sphinx_depr_\spx@tempa\endcsname\spx@tempa + \expandafter\AtEndDocument\expandafter{\expandafter\let\expandafter + \sphinxdeprecatedmacro\csname sphinx_depr_\spx@tempa\endcsname + \PackageWarningNoLine{sphinx}{^^J**** SPHINX DEPRECATION WARNING:^^J + \sphinxdeprecatedmacro^^J + \@spaces- is deprecated at Sphinx #2^^J + \@spaces- and removed at Sphinx #3.^^J + #4^^J****}}% + }{% warning already emitted (at end of latex log), don't repeat + }} + + +%% PACKAGES +% +% we delay handling of options to after having loaded packages, because +% of the need to use \definecolor. +\RequirePackage{graphicx} +\@ifclassloaded{memoir}{}{\RequirePackage{fancyhdr}} +% for \text macro and \iffirstchoice@ conditional even if amsmath not loaded +\RequirePackage{amstext} +\RequirePackage{textcomp}% "warn" option issued from template +\RequirePackage{titlesec} +\@ifpackagelater{titlesec}{2016/03/15}% + {\@ifpackagelater{titlesec}{2016/03/21}% + {}% + {\newif\ifsphinx@ttlpatch@ok + \IfFileExists{etoolbox.sty}{% + \RequirePackage{etoolbox}% + \patchcmd{\ttlh@hang}{\parindent\z@}{\parindent\z@\leavevmode}% + {\sphinx@ttlpatch@oktrue}{}% + \ifsphinx@ttlpatch@ok + \patchcmd{\ttlh@hang}{\noindent}{}{}{\sphinx@ttlpatch@okfalse}% + \fi + }{}% + \ifsphinx@ttlpatch@ok + \typeout{^^J Package Sphinx Info: ^^J + **** titlesec 2.10.1 successfully patched for bugfix ****^^J}% + \else + \AtEndDocument{\PackageWarningNoLine{sphinx}{^^J% +******** titlesec 2.10.1 has a bug, (section numbers disappear) ......|^^J% +******** and Sphinx could not patch it, perhaps because your local ...|^^J% +******** copy is already fixed without a changed release date. .......|^^J% +******** If not, you must update titlesec! ...........................|}}% + \fi + }% + }{} +\RequirePackage{tabulary} +% tabulary has a bug with its re-definition of \multicolumn in its first pass +% which is not \long. But now Sphinx does not use LaTeX's \multicolumn but its +% own macro. Hence we don't even need to patch tabulary. See sphinxmulticell.sty +% X or S (Sphinx) may have meanings if some table package is loaded hence +% \X was chosen to avoid possibility of conflict +\newcolumntype{\X}[2]{p{\dimexpr + (\linewidth-\arrayrulewidth)*#1/#2-\tw@\tabcolsep-\arrayrulewidth\relax}} +\newcolumntype{\Y}[1]{p{\dimexpr + #1\dimexpr\linewidth-\arrayrulewidth\relax-\tw@\tabcolsep-\arrayrulewidth\relax}} +% using here T (for Tabulary) feels less of a problem than the X could be +\newcolumntype{T}{J}% +% For tables allowing pagebreaks +\RequirePackage{longtable} +% User interface to set-up whitespace before and after tables: +\newcommand*\sphinxtablepre {0pt}% +\newcommand*\sphinxtablepost{\medskipamount}% +\newcommand*\sphinxbelowcaptionspace{.5\sphinxbaselineskip}% +% as one can not use \baselineskip from inside longtable (it is zero there) +% we need \sphinxbaselineskip, which defaults to \baselineskip +\def\sphinxbaselineskip{\baselineskip}% +% These commands are inserted by the table templates +\def\sphinxatlongtablestart + {\par + \vskip\parskip + \vskip\dimexpr\sphinxtablepre\relax % adjust vertical position + \vbox{}% get correct baseline from above + \LTpre\z@skip\LTpost\z@skip % set to zero longtable's own skips + \edef\sphinxbaselineskip{\dimexpr\the\dimexpr\baselineskip\relax\relax}% + }% +\def\sphinxatlongtableend{\prevdepth\z@\vskip\sphinxtablepost\relax}% +\def\sphinxlongtablecapskipadjust + {\dimexpr-\dp\strutbox-\sphinxbaselineskip+\sphinxbelowcaptionspace\relax}% +% Now for tables not using longtable +\def\sphinxattablestart + {\par + \vskip\dimexpr\sphinxtablepre\relax + }% +\let\sphinxattableend\sphinxatlongtableend +% longtable's wraps captions to a maximal width of \LTcapwidth +% so we do the same for all tables +\newcommand*\sphinxcapstartof[1]{% + \vskip\parskip + \vbox{}% force baselineskip for good positioning by capstart of hyperanchor + \def\@captype{#1}% + \capstart +% move back vertically to compensate space inserted by next paragraph + \vskip-\baselineskip\vskip-\parskip +}% +% use \LTcapwidth (default is 4in) to wrap caption (if line width is bigger) +\newcommand\sphinxcaption[2][\LTcapwidth]{% + \noindent\hb@xt@\linewidth{\hss + \vtop{\@tempdima\dimexpr#1\relax +% don't exceed linewidth for the caption width + \ifdim\@tempdima>\linewidth\hsize\linewidth\else\hsize\@tempdima\fi +% longtable ignores \abovecaptionskip/\belowcaptionskip, so add hooks here +% to uniformize control of caption distance to tables + \abovecaptionskip\sphinxabovecaptionskip + \belowcaptionskip\sphinxbelowcaptionskip + \caption[{#2}]% + {\strut\ignorespaces#2\ifhmode\unskip\@finalstrut\strutbox\fi}% + }\hss}% + \par\prevdepth\dp\strutbox +}% +\def\spx@abovecaptionskip{\abovecaptionskip} +\newcommand*\sphinxabovecaptionskip{\z@skip} +\newcommand*\sphinxbelowcaptionskip{\z@skip} + +\newcommand\sphinxaftercaption +{% this default definition serves with a caption *above* a table, to make sure + % its last baseline is \sphinxbelowcaptionspace above table top + \nobreak + \vskip\dimexpr\sphinxbelowcaptionspace\relax + \vskip-\baselineskip\vskip-\parskip +}% +% varwidth is crucial for our handling of general contents in merged cells +\RequirePackage{varwidth} +% but addition of a compatibility patch with hyperref is needed +% (tested with varwidth v 0.92 Mar 2009) +\AtBeginDocument {% + \let\@@vwid@Hy@raisedlink\Hy@raisedlink + \long\def\@vwid@Hy@raisedlink#1{\@vwid@wrap{\@@vwid@Hy@raisedlink{#1}}}% + \edef\@vwid@setup{% + \let\noexpand\Hy@raisedlink\noexpand\@vwid@Hy@raisedlink % HYPERREF ! + \unexpanded\expandafter{\@vwid@setup}}% +}% +% Homemade package to handle merged cells +\RequirePackage{sphinxmulticell} +\RequirePackage{makeidx} +% For framing code-blocks and warning type notices, and shadowing topics +\RequirePackage{framed} +% The xcolor package draws better fcolorboxes around verbatim code +\IfFileExists{xcolor.sty}{ + \RequirePackage{xcolor} +}{ + \RequirePackage{color} +} +% For highlighted code. +\RequirePackage{fancyvrb} +\fvset{fontsize=\small} +\define@key{FV}{hllines}{\def\sphinx@verbatim@checkifhl##1{\in@{, ##1,}{#1}}} +% For hyperlinked footnotes in tables; also for gathering footnotes from +% topic and warning blocks. Also to allow code-blocks in footnotes. +\RequirePackage{footnotehyper-sphinx} +% For the H specifier. Do not \restylefloat{figure}, it breaks Sphinx code +% for allowing figures in tables. +\RequirePackage{float} +% For floating figures in the text. Better to load after float. +\RequirePackage{wrapfig} +% Separate paragraphs by space by default. +\RequirePackage{parskip} +% For parsed-literal blocks. +\RequirePackage{alltt} +% Display "real" single quotes in literal blocks. +\RequirePackage{upquote} +% control caption around literal-block +\RequirePackage{capt-of} +\RequirePackage{needspace} +% LaTeX 2018-04-01 and later provides \@removefromreset +\ltx@ifundefined{@removefromreset} + {\RequirePackage{remreset}} + {}% avoid warning +% to make pdf with correct encoded bookmarks in Japanese +% this should precede the hyperref package +\ifx\kanjiskip\@undefined +% for non-Japanese: make sure bookmarks are ok also with lualatex + \PassOptionsToPackage{pdfencoding=unicode}{hyperref} +\else + \RequirePackage{atbegshi} + \ifx\ucs\@undefined + \ifnum 42146=\euc"A4A2 + \AtBeginShipoutFirst{\special{pdf:tounicode EUC-UCS2}} + \else + \AtBeginShipoutFirst{\special{pdf:tounicode 90ms-RKSJ-UCS2}} + \fi + \else + \AtBeginShipoutFirst{\special{pdf:tounicode UTF8-UCS2}} + \fi +\fi + +\ifx\@jsc@uplatextrue\@undefined\else + \PassOptionsToPackage{setpagesize=false}{hyperref} +\fi + +% These options can be overriden inside 'hyperref' key +% or by later use of \hypersetup. +\PassOptionsToPackage{colorlinks,breaklinks,% + linkcolor=InnerLinkColor,filecolor=OuterLinkColor,% + menucolor=OuterLinkColor,urlcolor=OuterLinkColor,% + citecolor=InnerLinkColor}{hyperref} + +% stylesheet for highlighting with pygments +\RequirePackage{sphinxhighlight} +% fix baseline increase from Pygments latex formatter in case of error tokens +% and keep \fboxsep's scope local via added braces +\def\PYG@tok@err{% + \def\PYG@bc##1{{\setlength{\fboxsep}{-\fboxrule}% + \fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}}% +} +\def\PYG@tok@cs{% + \def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}% + \def\PYG@bc##1{{\setlength{\fboxsep}{0pt}% + \colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}}% +}% + + +%% OPTIONS +% +% Handle options via "kvoptions" (later loaded by hyperref anyhow) +\RequirePackage{kvoptions} +\SetupKeyvalOptions{prefix=spx@opt@} % use \spx@opt@ prefix + +% Sphinx legacy text layout: 1in margins on all four sides +\ifx\@jsc@uplatextrue\@undefined +\DeclareStringOption[1in]{hmargin} +\DeclareStringOption[1in]{vmargin} +\DeclareStringOption[.5in]{marginpar} +\else +% Japanese standard document classes handle \mag in a special way +\DeclareStringOption[\inv@mag in]{hmargin} +\DeclareStringOption[\inv@mag in]{vmargin} +\DeclareStringOption[.5\dimexpr\inv@mag in\relax]{marginpar} +\fi + +\DeclareStringOption[0]{maxlistdepth}% \newcommand*\spx@opt@maxlistdepth{0} +\DeclareStringOption[-1]{numfigreset} +\DeclareBoolOption[false]{nonumfigreset} +\DeclareBoolOption[false]{mathnumfig} +% \DeclareBoolOption[false]{usespart}% not used +% dimensions, we declare the \dimen registers here. +\newdimen\sphinxverbatimsep +\newdimen\sphinxverbatimborder +\newdimen\sphinxshadowsep +\newdimen\sphinxshadowsize +\newdimen\sphinxshadowrule +% \DeclareStringOption is not convenient for the handling of these dimensions +% because we want to assign the values to the corresponding registers. Even if +% we added the code to the key handler it would be too late for the initial +% set-up and we would need to do initial assignments explicitely. We end up +% using \define@key directly. +% verbatim +\sphinxverbatimsep=\fboxsep + \define@key{sphinx}{verbatimsep}{\sphinxverbatimsep\dimexpr #1\relax} +\sphinxverbatimborder=\fboxrule + \define@key{sphinx}{verbatimborder}{\sphinxverbatimborder\dimexpr #1\relax} +% topic boxes +\sphinxshadowsep =5pt + \define@key{sphinx}{shadowsep}{\sphinxshadowsep\dimexpr #1\relax} +\sphinxshadowsize=4pt + \define@key{sphinx}{shadowsize}{\sphinxshadowsize\dimexpr #1\relax} +\sphinxshadowrule=\fboxrule + \define@key{sphinx}{shadowrule}{\sphinxshadowrule\dimexpr #1\relax} +% verbatim +\DeclareBoolOption[true]{verbatimwithframe} +\DeclareBoolOption[true]{verbatimwrapslines} +\DeclareBoolOption[true]{verbatimhintsturnover} +\DeclareBoolOption[true]{inlineliteralwraps} +\DeclareStringOption[t]{literalblockcappos} +\DeclareStringOption[r]{verbatimcontinuedalign} +\DeclareStringOption[r]{verbatimcontinuesalign} +% parsed literal +\DeclareBoolOption[true]{parsedliteralwraps} +% \textvisiblespace for compatibility with fontspec+XeTeX/LuaTeX +\DeclareStringOption[\textcolor{red}{\textvisiblespace}]{verbatimvisiblespace} +\DeclareStringOption % must use braces to hide the brackets + [{\makebox[2\fontcharwd\font`\x][r]{\textcolor{red}{\tiny$\m@th\hookrightarrow$}}}]% + {verbatimcontinued} +% notices/admonitions +% the dimensions for notices/admonitions are kept as macros and assigned to +% \spx@notice@border at time of use, hence \DeclareStringOption is ok for this +\newdimen\spx@notice@border +\DeclareStringOption[0.5pt]{noteborder} +\DeclareStringOption[0.5pt]{hintborder} +\DeclareStringOption[0.5pt]{importantborder} +\DeclareStringOption[0.5pt]{tipborder} +\DeclareStringOption[1pt]{warningborder} +\DeclareStringOption[1pt]{cautionborder} +\DeclareStringOption[1pt]{attentionborder} +\DeclareStringOption[1pt]{dangerborder} +\DeclareStringOption[1pt]{errorborder} +% footnotes +\DeclareStringOption[\mbox{ }]{AtStartFootnote} +% we need a public macro name for direct use in latex file +\newcommand*{\sphinxAtStartFootnote}{\spx@opt@AtStartFootnote} +% no such need for this one, as it is used inside other macros +\DeclareStringOption[\leavevmode\unskip]{BeforeFootnote} +% some font styling. +\DeclareStringOption[\sffamily\bfseries]{HeaderFamily} +% colours +% same problems as for dimensions: we want the key handler to use \definecolor. +% first, some colours with no prefix, for backwards compatibility +\newcommand*{\sphinxDeclareColorOption}[2]{% + \definecolor{#1}#2% + \define@key{sphinx}{#1}{\definecolor{#1}##1}% +}% +\sphinxDeclareColorOption{TitleColor}{{rgb}{0.126,0.263,0.361}} +\sphinxDeclareColorOption{InnerLinkColor}{{rgb}{0.208,0.374,0.486}} +\sphinxDeclareColorOption{OuterLinkColor}{{rgb}{0.216,0.439,0.388}} +\sphinxDeclareColorOption{VerbatimColor}{{rgb}{1,1,1}} +\sphinxDeclareColorOption{VerbatimBorderColor}{{rgb}{0,0,0}} +% now the colours defined with "sphinx" prefix in their names +\newcommand*{\sphinxDeclareSphinxColorOption}[2]{% + % set the initial default + \definecolor{sphinx#1}#2% + % set the key handler. The "value" ##1 must be acceptable by \definecolor. + \define@key{sphinx}{#1}{\definecolor{sphinx#1}##1}% +}% +% Default color chosen to be as in minted.sty LaTeX package! +\sphinxDeclareSphinxColorOption{VerbatimHighlightColor}{{rgb}{0.878,1,1}} +% admonition boxes, "light" style +\sphinxDeclareSphinxColorOption{noteBorderColor}{{rgb}{0,0,0}} +\sphinxDeclareSphinxColorOption{hintBorderColor}{{rgb}{0,0,0}} +\sphinxDeclareSphinxColorOption{importantBorderColor}{{rgb}{0,0,0}} +\sphinxDeclareSphinxColorOption{tipBorderColor}{{rgb}{0,0,0}} +% admonition boxes, "heavy" style +\sphinxDeclareSphinxColorOption{warningBorderColor}{{rgb}{0,0,0}} +\sphinxDeclareSphinxColorOption{cautionBorderColor}{{rgb}{0,0,0}} +\sphinxDeclareSphinxColorOption{attentionBorderColor}{{rgb}{0,0,0}} +\sphinxDeclareSphinxColorOption{dangerBorderColor}{{rgb}{0,0,0}} +\sphinxDeclareSphinxColorOption{errorBorderColor}{{rgb}{0,0,0}} +\sphinxDeclareSphinxColorOption{warningBgColor}{{rgb}{1,1,1}} +\sphinxDeclareSphinxColorOption{cautionBgColor}{{rgb}{1,1,1}} +\sphinxDeclareSphinxColorOption{attentionBgColor}{{rgb}{1,1,1}} +\sphinxDeclareSphinxColorOption{dangerBgColor}{{rgb}{1,1,1}} +\sphinxDeclareSphinxColorOption{errorBgColor}{{rgb}{1,1,1}} + +\DeclareDefaultOption{\@unknownoptionerror} +\ProcessKeyvalOptions* +% don't allow use of maxlistdepth via \sphinxsetup. +\DisableKeyvalOption{sphinx}{maxlistdepth} +\DisableKeyvalOption{sphinx}{numfigreset} +\DisableKeyvalOption{sphinx}{nonumfigreset} +\DisableKeyvalOption{sphinx}{mathnumfig} +% user interface: options can be changed midway in a document! +\newcommand\sphinxsetup[1]{\setkeys{sphinx}{#1}} + + +%% MAXLISTDEPTH +% +% remove LaTeX's cap on nesting depth if 'maxlistdepth' key used. +% This is a hack, which works with the standard classes: it assumes \@toodeep +% is always used in "true" branches: "\if ... \@toodeep \else .. \fi." + +% will force use the "false" branch (if there is one) +\def\spx@toodeep@hack{\fi\iffalse} + +% do nothing if 'maxlistdepth' key not used or if package enumitem loaded. +\ifnum\spx@opt@maxlistdepth=\z@\expandafter\@gobbletwo\fi +\AtBeginDocument{% +\@ifpackageloaded{enumitem}{\remove@to@nnil}{}% + \let\spx@toodeepORI\@toodeep + \def\@toodeep{% + \ifnum\@listdepth<\spx@opt@maxlistdepth\relax + \expandafter\spx@toodeep@hack + \else + \expandafter\spx@toodeepORI + \fi}% +% define all missing \@list... macros + \count@\@ne + \loop + \ltx@ifundefined{@list\romannumeral\the\count@} + {\iffalse}{\iftrue\advance\count@\@ne}% + \repeat + \loop + \ifnum\count@>\spx@opt@maxlistdepth\relax\else + \expandafter\let + \csname @list\romannumeral\the\count@\expandafter\endcsname + \csname @list\romannumeral\the\numexpr\count@-\@ne\endcsname + % workaround 2.6--3.2d babel-french issue (fixed in 3.2e; no change needed) + \ltx@ifundefined{leftmargin\romannumeral\the\count@} + {\expandafter\let + \csname leftmargin\romannumeral\the\count@\expandafter\endcsname + \csname leftmargin\romannumeral\the\numexpr\count@-\@ne\endcsname}{}% + \advance\count@\@ne + \repeat +% define all missing enum... counters and \labelenum... macros and \p@enum.. + \count@\@ne + \loop + \ltx@ifundefined{c@enum\romannumeral\the\count@} + {\iffalse}{\iftrue\advance\count@\@ne}% + \repeat + \loop + \ifnum\count@>\spx@opt@maxlistdepth\relax\else + \newcounter{enum\romannumeral\the\count@}% + \expandafter\def + \csname labelenum\romannumeral\the\count@\expandafter\endcsname + \expandafter + {\csname theenum\romannumeral\the\numexpr\count@\endcsname.}% + \expandafter\def + \csname p@enum\romannumeral\the\count@\expandafter\endcsname + \expandafter + {\csname p@enum\romannumeral\the\numexpr\count@-\@ne\expandafter + \endcsname\csname theenum\romannumeral\the\numexpr\count@-\@ne\endcsname.}% + \advance\count@\@ne + \repeat +% define all missing labelitem... macros + \count@\@ne + \loop + \ltx@ifundefined{labelitem\romannumeral\the\count@} + {\iffalse}{\iftrue\advance\count@\@ne}% + \repeat + \loop + \ifnum\count@>\spx@opt@maxlistdepth\relax\else + \expandafter\let + \csname labelitem\romannumeral\the\count@\expandafter\endcsname + \csname labelitem\romannumeral\the\numexpr\count@-\@ne\endcsname + \advance\count@\@ne + \repeat + \PackageInfo{sphinx}{maximal list depth extended to \spx@opt@maxlistdepth}% +\@gobble\@nnil +} + + +%% INDEX, BIBLIOGRAPHY, APPENDIX, TABLE OF CONTENTS +% +% fix the double index and bibliography on the table of contents +% in jsclasses (Japanese standard document classes) +\ifx\@jsc@uplatextrue\@undefined\else + \renewenvironment{sphinxtheindex} + {\cleardoublepage\phantomsection + \begin{theindex}} + {\end{theindex}} + + \renewenvironment{sphinxthebibliography}[1] + {\cleardoublepage% \phantomsection % not needed here since TeXLive 2010's hyperref + \begin{thebibliography}{1}} + {\end{thebibliography}} +\fi + +% disable \@chappos in Appendix in pTeX +\ifx\kanjiskip\@undefined\else + \let\py@OldAppendix=\appendix + \renewcommand{\appendix}{ + \py@OldAppendix + \gdef\@chappos{} + } +\fi + +% make commands known to non-Sphinx document classes +\providecommand*{\sphinxtableofcontents}{\tableofcontents} +\ltx@ifundefined{sphinxthebibliography} + {\newenvironment + {sphinxthebibliography}{\begin{thebibliography}}{\end{thebibliography}}% + } + {}% else clause of \ltx@ifundefined +\ltx@ifundefined{sphinxtheindex} + {\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}}% + {}% else clause of \ltx@ifundefined + + +%% COLOR (general) +% +% FIXME: \normalcolor should probably be used in place of \py@NormalColor +% elsewhere, and \py@NormalColor should never be defined. \normalcolor +% switches to the colour from last \color call in preamble. +\def\py@NormalColor{\color{black}} +% FIXME: it is probably better to use \color{TitleColor}, as TitleColor +% can be customized from 'sphinxsetup', and drop usage of \py@TitleColor +\def\py@TitleColor{\color{TitleColor}} +% FIXME: this line should be dropped, as "9" is default anyhow. +\ifdefined\pdfcompresslevel\pdfcompresslevel = 9 \fi + + +%% PAGE STYLING +% +% Style parameters and macros used by most documents here +\raggedbottom +\sloppy +\hbadness = 5000 % don't print trivial gripes + +\pagestyle{empty} % start this way + +% Redefine the 'normal' header/footer style when using "fancyhdr" package: +% Note: this presupposes "twoside". If "oneside" class option, there will be warnings. +\ltx@ifundefined{fancyhf}{}{ + % Use \pagestyle{normal} as the primary pagestyle for text. + \fancypagestyle{normal}{ + \fancyhf{} +% (for \py@HeaderFamily cf "TITLES") + \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}} + \fancyfoot[LO]{{\py@HeaderFamily\nouppercase{\rightmark}}} + \fancyfoot[RE]{{\py@HeaderFamily\nouppercase{\leftmark}}} + \fancyhead[LE,RO]{{\py@HeaderFamily \@title\sphinxheadercomma\py@release}} + \renewcommand{\headrulewidth}{0.4pt} + \renewcommand{\footrulewidth}{0.4pt} + % define chaptermark with \@chappos when \@chappos is available for Japanese + \ltx@ifundefined{@chappos}{} + {\def\chaptermark##1{\markboth{\@chapapp\space\thechapter\space\@chappos\space ##1}{}}} + } + % Update the plain style so we get the page number & footer line, + % but not a chapter or section title. This is to keep the first + % page of a chapter and the blank page between chapters `clean.' + \fancypagestyle{plain}{ + \fancyhf{} + \fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}} + \renewcommand{\headrulewidth}{0pt} + \renewcommand{\footrulewidth}{0.4pt} + } +} + +% geometry +\ifx\kanjiskip\@undefined + \PassOptionsToPackage{% + hmargin={\unexpanded{\spx@opt@hmargin}},% + vmargin={\unexpanded{\spx@opt@vmargin}},% + marginpar=\unexpanded{\spx@opt@marginpar}} + {geometry} +\else + % set text width for Japanese documents to be integer multiple of 1zw + % and text height to be integer multiple of \baselineskip + % the execution is delayed to \sphinxsetup then geometry.sty + \normalsize\normalfont + \newcommand*\sphinxtextwidthja[1]{% + \if@twocolumn\tw@\fi + \dimexpr + \numexpr\dimexpr\paperwidth-\tw@\dimexpr#1\relax\relax/ + \dimexpr\if@twocolumn\tw@\else\@ne\fi zw\relax + zw\relax}% + \newcommand*\sphinxmarginparwidthja[1]{% + \dimexpr\numexpr\dimexpr#1\relax/\dimexpr1zw\relax zw\relax}% + \newcommand*\sphinxtextlinesja[1]{% + \numexpr\@ne+\dimexpr\paperheight-\topskip-\tw@\dimexpr#1\relax\relax/ + \baselineskip\relax}% + \ifx\@jsc@uplatextrue\@undefined\else + % the way we found in order for the papersize special written by + % geometry in the dvi file to be correct in case of jsbook class + \ifnum\mag=\@m\else % do nothing special if nomag class option or 10pt + \PassOptionsToPackage{truedimen}{geometry}% + \fi + \fi + \PassOptionsToPackage{% + hmarginratio={1:1},% + textwidth=\unexpanded{\sphinxtextwidthja{\spx@opt@hmargin}},% + vmarginratio={1:1},% + lines=\unexpanded{\sphinxtextlinesja{\spx@opt@vmargin}},% + marginpar=\unexpanded{\sphinxmarginparwidthja{\spx@opt@marginpar}},% + footskip=2\baselineskip,% + }{geometry}% + \AtBeginDocument + {% update a dimension used by the jsclasses + \ifx\@jsc@uplatextrue\@undefined\else\fullwidth\textwidth\fi + % for some reason, jreport normalizes all dimensions with \@settopoint + \@ifclassloaded{jreport} + {\@settopoint\textwidth\@settopoint\textheight\@settopoint\marginparwidth} + {}% <-- "false" clause of \@ifclassloaded + }% +\fi + +% fix fncychap's bug which uses prematurely the \textwidth value +\@ifpackagewith{fncychap}{Bjornstrup} + {\AtBeginDocument{\mylen\textwidth\advance\mylen-2\myhi}}% + {}% <-- "false" clause of \@ifpackagewith + + +%% TITLES +% +% Since Sphinx 1.5, users should use HeaderFamily key to 'sphinxsetup' rather +% than defining their own \py@HeaderFamily command (which is still possible). +% Memo: \py@HeaderFamily is also used by \maketitle as defined in +% sphinxmanual.cls/sphinxhowto.cls +\newcommand{\py@HeaderFamily}{\spx@opt@HeaderFamily} + +% This sets up the fancy chapter headings that make the documents look +% at least a little better than the usual LaTeX output. +\@ifpackagewith{fncychap}{Bjarne}{ + \ChNameVar {\raggedleft\normalsize \py@HeaderFamily} + \ChNumVar {\raggedleft\Large \py@HeaderFamily} + \ChTitleVar{\raggedleft\Large \py@HeaderFamily} + % This creates (numbered) chapter heads without the leading \vspace*{}: + \def\@makechapterhead#1{% + {\parindent \z@ \raggedright \normalfont + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \DOCH + \fi + \fi + \interlinepenalty\@M + \if@mainmatter + \DOTI{#1}% + \else% + \DOTIS{#1}% + \fi + }} +}{}% <-- "false" clause of \@ifpackagewith + +% Augment the sectioning commands used to get our own font family in place, +% and reset some internal data items (\titleformat from titlesec package) +\titleformat{\section}{\Large\py@HeaderFamily}% + {\py@TitleColor\thesection}{0.5em}{\py@TitleColor}{\py@NormalColor} +\titleformat{\subsection}{\large\py@HeaderFamily}% + {\py@TitleColor\thesubsection}{0.5em}{\py@TitleColor}{\py@NormalColor} +\titleformat{\subsubsection}{\py@HeaderFamily}% + {\py@TitleColor\thesubsubsection}{0.5em}{\py@TitleColor}{\py@NormalColor} +% By default paragraphs (and subsubsections) will not be numbered because +% sphinxmanual.cls and sphinxhowto.cls set secnumdepth to 2 +\titleformat{\paragraph}{\py@HeaderFamily}% + {\py@TitleColor\theparagraph}{0.5em}{\py@TitleColor}{\py@NormalColor} +\titleformat{\subparagraph}{\py@HeaderFamily}% + {\py@TitleColor\thesubparagraph}{0.5em}{\py@TitleColor}{\py@NormalColor} + + +%% GRAPHICS +% +% \sphinxincludegraphics defined to resize images larger than the line width, +% except if height or width option present. +% +% If scale is present, rescale before fitting to line width. (since 1.5) +\newbox\spx@image@box +\newcommand*{\sphinxincludegraphics}[2][]{% + \in@{height}{#1}\ifin@\else\in@{width}{#1}\fi + \ifin@ % height or width present + \includegraphics[#1]{#2}% + \else % no height nor width (but #1 may be "scale=...") + \setbox\spx@image@box\hbox{\includegraphics[#1,draft]{#2}}% + \ifdim \wd\spx@image@box>\linewidth + \setbox\spx@image@box\box\voidb@x % clear memory + \includegraphics[#1,width=\linewidth]{#2}% + \else + \includegraphics[#1]{#2}% + \fi + \fi +} + + +%% FIGURE IN TABLE +% +\newenvironment{sphinxfigure-in-table}[1][\linewidth]{% + \def\@captype{figure}% + \sphinxsetvskipsforfigintablecaption + \begin{minipage}{#1}% +}{\end{minipage}} +% store original \caption macro for use with figures in longtable and tabulary +\AtBeginDocument{\let\spx@originalcaption\caption} +\newcommand*\sphinxfigcaption + {\ifx\equation$%$% this is trick to identify tabulary first pass + \firstchoice@false\else\firstchoice@true\fi + \spx@originalcaption } +\newcommand*\sphinxsetvskipsforfigintablecaption + {\abovecaptionskip\smallskipamount + \belowcaptionskip\smallskipamount} + + +%% FOOTNOTES +% +% Support large numbered footnotes in minipage +% But now obsolete due to systematic use of \savenotes/\spewnotes +% when minipages are in use in the various macro definitions next. +\def\thempfootnote{\arabic{mpfootnote}} + + +%% NUMBERING OF FIGURES, TABLES, AND LITERAL BLOCKS +\ltx@ifundefined{c@chapter} + {\newcounter{literalblock}}% + {\newcounter{literalblock}[chapter]% + \def\theliteralblock{\ifnum\c@chapter>\z@\arabic{chapter}.\fi + \arabic{literalblock}}% + }% +\ifspx@opt@nonumfigreset + \ltx@ifundefined{c@chapter}{}{% + \@removefromreset{figure}{chapter}% + \@removefromreset{table}{chapter}% + \@removefromreset{literalblock}{chapter}% + \ifspx@opt@mathnumfig + \@removefromreset{equation}{chapter}% + \fi + }% + \def\thefigure{\arabic{figure}}% + \def\thetable {\arabic{table}}% + \def\theliteralblock{\arabic{literalblock}}% + \ifspx@opt@mathnumfig + \def\theequation{\arabic{equation}}% + \fi +\else +\let\spx@preAthefigure\@empty +\let\spx@preBthefigure\@empty +% \ifspx@opt@usespart % <-- LaTeX writer could pass such a 'usespart' boolean +% % as sphinx.sty package option +% If document uses \part, (triggered in Sphinx by latex_toplevel_sectioning) +% LaTeX core per default does not reset chapter or section +% counters at each part. +% But if we modify this, we need to redefine \thechapter, \thesection to +% include the part number and this will cause problems in table of contents +% because of too wide numbering. Simplest is to do nothing. +% \fi +\ifnum\spx@opt@numfigreset>0 + \ltx@ifundefined{c@chapter} + {} + {\g@addto@macro\spx@preAthefigure{\ifnum\c@chapter>\z@\arabic{chapter}.}% + \g@addto@macro\spx@preBthefigure{\fi}}% +\fi +\ifnum\spx@opt@numfigreset>1 + \@addtoreset{figure}{section}% + \@addtoreset{table}{section}% + \@addtoreset{literalblock}{section}% + \ifspx@opt@mathnumfig + \@addtoreset{equation}{section}% + \fi + \g@addto@macro\spx@preAthefigure{\ifnum\c@section>\z@\arabic{section}.}% + \g@addto@macro\spx@preBthefigure{\fi}% +\fi +\ifnum\spx@opt@numfigreset>2 + \@addtoreset{figure}{subsection}% + \@addtoreset{table}{subsection}% + \@addtoreset{literalblock}{subsection}% + \ifspx@opt@mathnumfig + \@addtoreset{equation}{subsection}% + \fi + \g@addto@macro\spx@preAthefigure{\ifnum\c@subsection>\z@\arabic{subsection}.}% + \g@addto@macro\spx@preBthefigure{\fi}% +\fi +\ifnum\spx@opt@numfigreset>3 + \@addtoreset{figure}{subsubsection}% + \@addtoreset{table}{subsubsection}% + \@addtoreset{literalblock}{subsubsection}% + \ifspx@opt@mathnumfig + \@addtoreset{equation}{subsubsection}% + \fi + \g@addto@macro\spx@preAthefigure{\ifnum\c@subsubsection>\z@\arabic{subsubsection}.}% + \g@addto@macro\spx@preBthefigure{\fi}% +\fi +\ifnum\spx@opt@numfigreset>4 + \@addtoreset{figure}{paragraph}% + \@addtoreset{table}{paragraph}% + \@addtoreset{literalblock}{paragraph}% + \ifspx@opt@mathnumfig + \@addtoreset{equation}{paragraph}% + \fi + \g@addto@macro\spx@preAthefigure{\ifnum\c@subparagraph>\z@\arabic{subparagraph}.}% + \g@addto@macro\spx@preBthefigure{\fi}% +\fi +\ifnum\spx@opt@numfigreset>5 + \@addtoreset{figure}{subparagraph}% + \@addtoreset{table}{subparagraph}% + \@addtoreset{literalblock}{subparagraph}% + \ifspx@opt@mathnumfig + \@addtoreset{equation}{subparagraph}% + \fi + \g@addto@macro\spx@preAthefigure{\ifnum\c@subsubparagraph>\z@\arabic{subsubparagraph}.}% + \g@addto@macro\spx@preBthefigure{\fi}% +\fi +\expandafter\g@addto@macro +\expandafter\spx@preAthefigure\expandafter{\spx@preBthefigure}% +\let\thefigure\spx@preAthefigure +\let\thetable\spx@preAthefigure +\let\theliteralblock\spx@preAthefigure +\g@addto@macro\thefigure{\arabic{figure}}% +\g@addto@macro\thetable{\arabic{table}}% +\g@addto@macro\theliteralblock{\arabic{literalblock}}% + \ifspx@opt@mathnumfig + \let\theequation\spx@preAthefigure + \g@addto@macro\theequation{\arabic{equation}}% + \fi +\fi + + +%% LITERAL BLOCKS +% +% Based on use of "fancyvrb.sty"'s Verbatim. +% - with framing allowing page breaks ("framed.sty") +% - with breaking of long lines (exploits Pygments mark-up), +% - with possibly of a top caption, non-separable by pagebreak. +% - and usable inside tables or footnotes ("footnotehyper-sphinx"). + +% For extensions which use \OriginalVerbatim and compatibility with Sphinx < +% 1.5, we define and use these when (unmodified) Verbatim will be needed. But +% Sphinx >= 1.5 does not modify the \Verbatim macro anymore. +\let\OriginalVerbatim \Verbatim +\let\endOriginalVerbatim\endVerbatim + +% for captions of literal blocks +% at start of caption title +\newcommand*{\fnum@literalblock}{\literalblockname\nobreakspace\theliteralblock} +% this will be overwritten in document preamble by Babel translation +\newcommand*{\literalblockname}{Listing } +% file extension needed for \caption's good functioning, the file is created +% only if a \listof{literalblock}{foo} command is encountered, which is +% analogous to \listoffigures, but for the code listings (foo = chosen title.) +\newcommand*{\ext@literalblock}{lol} + +\newif\ifspx@inframed % flag set if we are already in a framed environment +% if forced use of minipage encapsulation is needed (e.g. table cells) +\newif\ifsphinxverbatimwithminipage \sphinxverbatimwithminipagefalse + +% Framing macro for use with framed.sty's \FrameCommand +% - it obeys current indentation, +% - frame is \fboxsep separated from the contents, +% - the contents use the full available text width, +% - #1 = color of frame, #2 = color of background, +% - #3 = above frame, #4 = below frame, #5 = within frame, +% - #3 and #4 must be already typeset boxes; they must issue \normalcolor +% or similar, else, they are under scope of color #1 +\long\def\spx@fcolorbox #1#2#3#4#5{% + \hskip\@totalleftmargin + \hskip-\fboxsep\hskip-\fboxrule + % use of \color@b@x here is compatible with both xcolor.sty and color.sty + \color@b@x {\color{#1}\spx@CustomFBox{#3}{#4}}{\color{#2}}{#5}% + \hskip-\fboxsep\hskip-\fboxrule + \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth +}% +% #1 = for material above frame, such as a caption or a "continued" hint +% #2 = for material below frame, such as a caption or "continues on next page" +% #3 = actual contents, which will be typeset with a background color +\long\def\spx@CustomFBox#1#2#3{% + \begingroup + \setbox\@tempboxa\hbox{{#3}}% inner braces to avoid color leaks + \vbox{#1% above frame + % draw frame border _latest_ to avoid pdf viewer issue + \kern\fboxrule + \hbox{\kern\fboxrule + \copy\@tempboxa + \kern-\wd\@tempboxa\kern-\fboxrule + \vrule\@width\fboxrule + \kern\wd\@tempboxa + \vrule\@width\fboxrule}% + \kern-\dimexpr\ht\@tempboxa+\dp\@tempboxa+\fboxrule\relax + \hrule\@height\fboxrule + \kern\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax + \hrule\@height\fboxrule + #2% below frame + }% + \endgroup +}% +\def\spx@fcolorbox@put@c#1{% hide width from framed.sty measuring + \moveright\dimexpr\fboxrule+.5\wd\@tempboxa\hb@xt@\z@{\hss#1\hss}% +}% +\def\spx@fcolorbox@put@r#1{% right align with contents, width hidden + \moveright\dimexpr\fboxrule+\wd\@tempboxa-\fboxsep\hb@xt@\z@{\hss#1}% +}% +\def\spx@fcolorbox@put@l#1{% left align with contents, width hidden + \moveright\dimexpr\fboxrule+\fboxsep\hb@xt@\z@{#1\hss}% +}% +% +\def\sphinxVerbatim@Continued + {\csname spx@fcolorbox@put@\spx@opt@verbatimcontinuedalign\endcsname + {\normalcolor\sphinxstylecodecontinued\literalblockcontinuedname}}% +\def\sphinxVerbatim@Continues + {\csname spx@fcolorbox@put@\spx@opt@verbatimcontinuesalign\endcsname + {\normalcolor\sphinxstylecodecontinues\literalblockcontinuesname}}% +\def\sphinxVerbatim@Title + {\spx@fcolorbox@put@c{\unhcopy\sphinxVerbatim@TitleBox}}% +\let\sphinxVerbatim@Before\@empty +\let\sphinxVerbatim@After\@empty +% Defaults are redefined in document preamble according to language +\newcommand*\literalblockcontinuedname{continued from previous page}% +\newcommand*\literalblockcontinuesname{continues on next page}% +% +\def\spx@verbatimfcolorbox{\spx@fcolorbox{VerbatimBorderColor}{VerbatimColor}}% +\def\sphinxVerbatim@FrameCommand + {\spx@verbatimfcolorbox\sphinxVerbatim@Before\sphinxVerbatim@After}% +\def\sphinxVerbatim@FirstFrameCommand + {\spx@verbatimfcolorbox\sphinxVerbatim@Before\sphinxVerbatim@Continues}% +\def\sphinxVerbatim@MidFrameCommand + {\spx@verbatimfcolorbox\sphinxVerbatim@Continued\sphinxVerbatim@Continues}% +\def\sphinxVerbatim@LastFrameCommand + {\spx@verbatimfcolorbox\sphinxVerbatim@Continued\sphinxVerbatim@After}% + +% For linebreaks inside Verbatim environment from package fancyvrb. +\newbox\sphinxcontinuationbox +\newbox\sphinxvisiblespacebox +\newcommand*\sphinxafterbreak {\copy\sphinxcontinuationbox} + +% Take advantage of the already applied Pygments mark-up to insert +% potential linebreaks for TeX processing. +% {, <, #, %, $, ' and ": go to next line. +% _, }, ^, &, >, - and ~: stay at end of broken line. +% Use of \textquotesingle for straight quote. +% FIXME: convert this to package options ? +\newcommand*\sphinxbreaksbeforelist {% + \do\PYGZob\{\do\PYGZlt\<\do\PYGZsh\#\do\PYGZpc\%% {, <, #, %, + \do\PYGZdl\$\do\PYGZdq\"% $, " + \def\PYGZsq + {\discretionary{}{\sphinxafterbreak\textquotesingle}{\textquotesingle}}% ' +} +\newcommand*\sphinxbreaksafterlist {% + \do\PYGZus\_\do\PYGZcb\}\do\PYGZca\^\do\PYGZam\&% _, }, ^, &, + \do\PYGZgt\>\do\PYGZhy\-\do\PYGZti\~% >, -, ~ +} +\newcommand*\sphinxbreaksatspecials {% + \def\do##1##2% + {\def##1{\discretionary{}{\sphinxafterbreak\char`##2}{\char`##2}}}% + \sphinxbreaksbeforelist + \def\do##1##2% + {\def##1{\discretionary{\char`##2}{\sphinxafterbreak}{\char`##2}}}% + \sphinxbreaksafterlist +} + +\def\sphinx@verbatim@nolig@list {\do \`}% +% Some characters . , ; ? ! / are not pygmentized. +% This macro makes them "active" and they will insert potential linebreaks. +% Not compatible with math mode (cf \sphinxunactivateextras). +\newcommand*\sphinxbreaksbeforeactivelist {}% none +\newcommand*\sphinxbreaksafteractivelist {\do\.\do\,\do\;\do\?\do\!\do\/} +\newcommand*\sphinxbreaksviaactive {% + \def\do##1{\lccode`\~`##1% + \lowercase{\def~}{\discretionary{}{\sphinxafterbreak\char`##1}{\char`##1}}% + \catcode`##1\active}% + \sphinxbreaksbeforeactivelist + \def\do##1{\lccode`\~`##1% + \lowercase{\def~}{\discretionary{\char`##1}{\sphinxafterbreak}{\char`##1}}% + \catcode`##1\active}% + \sphinxbreaksafteractivelist + \lccode`\~`\~ +} + +% If the linebreak is at a space, the latter will be displayed as visible +% space at end of first line, and a continuation symbol starts next line. +\def\spx@verbatim@space {% + \nobreak\hskip\z@skip + \discretionary{\copy\sphinxvisiblespacebox}{\sphinxafterbreak} + {\kern\fontdimen2\font}% +}% + +% if the available space on page is less than \literalblockneedspace, insert pagebreak +\newcommand{\sphinxliteralblockneedspace}{5\baselineskip} +\newcommand{\sphinxliteralblockwithoutcaptionneedspace}{1.5\baselineskip} +% The title (caption) is specified from outside as macro \sphinxVerbatimTitle. +% \sphinxVerbatimTitle is reset to empty after each use of Verbatim. +\newcommand*\sphinxVerbatimTitle {} +% This box to typeset the caption before framed.sty multiple passes for framing. +\newbox\sphinxVerbatim@TitleBox +% This is a workaround to a "feature" of French lists, when literal block +% follows immediately; usable generally (does only \par then), a priori... +\newcommand*\sphinxvspacefixafterfrenchlists{% + \ifvmode\ifdim\lastskip<\z@ \vskip\parskip\fi\else\par\fi +} +% Holder macro for labels of literal blocks. Set-up by LaTeX writer. +\newcommand*\sphinxLiteralBlockLabel {} +\newcommand*\sphinxSetupCaptionForVerbatim [1] +{% + \sphinxvspacefixafterfrenchlists + \needspace{\sphinxliteralblockneedspace}% +% insert a \label via \sphinxLiteralBlockLabel +% reset to normal the color for the literal block caption + \def\sphinxVerbatimTitle + {\py@NormalColor\sphinxcaption{\sphinxLiteralBlockLabel #1}}% +} +\newcommand*\sphinxSetupCodeBlockInFootnote {% + \fvset{fontsize=\footnotesize}\let\caption\sphinxfigcaption + \sphinxverbatimwithminipagetrue % reduces vertical spaces + % we counteract (this is in a group) the \@normalsize from \caption + \let\normalsize\footnotesize\let\@parboxrestore\relax + \def\spx@abovecaptionskip{\sphinxverbatimsmallskipamount}% +} +% needed to create wrapper environments of fancyvrb's Verbatim +\newcommand*{\sphinxVerbatimEnvironment}{\gdef\FV@EnvironName{sphinxVerbatim}} +\newcommand*{\sphinxverbatimsmallskipamount}{\smallskipamount} +% serves to implement line highlighting and line wrapping +\newcommand\sphinxFancyVerbFormatLine[1]{% + \expandafter\sphinx@verbatim@checkifhl\expandafter{\the\FV@CodeLineNo}% + \ifin@ + \sphinxVerbatimHighlightLine{#1}% + \else + \sphinxVerbatimFormatLine{#1}% + \fi +}% +\newcommand\sphinxVerbatimHighlightLine[1]{% + \edef\sphinxrestorefboxsep{\fboxsep\the\fboxsep\relax}% + \fboxsep0pt\relax % cf LaTeX bug graphics/4524 + \colorbox{sphinxVerbatimHighlightColor}% + {\sphinxrestorefboxsep\sphinxVerbatimFormatLine{#1}}% + % no need to restore \fboxsep here, as this ends up in a \hbox from fancyvrb +}% +% \sphinxVerbatimFormatLine will be set locally to one of those two: +\newcommand\sphinxVerbatimFormatLineWrap[1]{% + \hsize\linewidth + \vtop{\raggedright\hyphenpenalty\z@\exhyphenpenalty\z@ + \doublehyphendemerits\z@\finalhyphendemerits\z@ + \strut #1\strut}% +}% +\newcommand\sphinxVerbatimFormatLineNoWrap[1]{\hb@xt@\linewidth{\strut #1\hss}}% +\g@addto@macro\FV@SetupFont{% + \sbox\sphinxcontinuationbox {\spx@opt@verbatimcontinued}% + \sbox\sphinxvisiblespacebox {\spx@opt@verbatimvisiblespace}% +}% +\newenvironment{sphinxVerbatim}{% + % first, let's check if there is a caption + \ifx\sphinxVerbatimTitle\empty + \sphinxvspacefixafterfrenchlists + \parskip\z@skip + \vskip\sphinxverbatimsmallskipamount + % there was no caption. Check if nevertheless a label was set. + \ifx\sphinxLiteralBlockLabel\empty\else + % we require some space to be sure hyperlink target from \phantomsection + % will not be separated from upcoming verbatim by a page break + \needspace{\sphinxliteralblockwithoutcaptionneedspace}% + \phantomsection\sphinxLiteralBlockLabel + \fi + \else + \parskip\z@skip + \if t\spx@opt@literalblockcappos + \vskip\spx@abovecaptionskip + \def\sphinxVerbatim@Before + {\sphinxVerbatim@Title\nointerlineskip + \kern\dimexpr-\dp\strutbox+\sphinxbelowcaptionspace\relax}% + \else + \vskip\sphinxverbatimsmallskipamount + \def\sphinxVerbatim@After + {\nointerlineskip\kern\dp\strutbox\sphinxVerbatim@Title}% + \fi + \def\@captype{literalblock}% + \capstart + % \sphinxVerbatimTitle must reset color + \setbox\sphinxVerbatim@TitleBox + \hbox{\begin{minipage}{\linewidth}% + \sphinxVerbatimTitle + \end{minipage}}% + \fi + \global\let\sphinxLiteralBlockLabel\empty + \global\let\sphinxVerbatimTitle\empty + \fboxsep\sphinxverbatimsep \fboxrule\sphinxverbatimborder + \ifspx@opt@verbatimwithframe\else\fboxrule\z@\fi + \let\FrameCommand \sphinxVerbatim@FrameCommand + \let\FirstFrameCommand\sphinxVerbatim@FirstFrameCommand + \let\MidFrameCommand \sphinxVerbatim@MidFrameCommand + \let\LastFrameCommand \sphinxVerbatim@LastFrameCommand + \ifspx@opt@verbatimhintsturnover\else + \let\sphinxVerbatim@Continued\@empty + \let\sphinxVerbatim@Continues\@empty + \fi + \ifspx@opt@verbatimwrapslines + % fancyvrb's Verbatim puts each input line in (unbreakable) horizontal boxes. + % This customization wraps each line from the input in a \vtop, thus + % allowing it to wrap and display on two or more lines in the latex output. + % - The codeline counter will be increased only once. + % - The wrapped material will not break across pages, it is impossible + % to achieve this without extensive rewrite of fancyvrb. + % - The (not used in sphinx) obeytabs option to Verbatim is + % broken by this change (showtabs and tabspace work). + \let\sphinxVerbatimFormatLine\sphinxVerbatimFormatLineWrap + \let\FV@Space\spx@verbatim@space + % Allow breaks at special characters using \PYG... macros. + \sphinxbreaksatspecials + % Breaks at punctuation characters . , ; ? ! and / (needs catcode activation) + \fvset{codes*=\sphinxbreaksviaactive}% + \else % end of conditional code for wrapping long code lines + \let\sphinxVerbatimFormatLine\sphinxVerbatimFormatLineNoWrap + \fi + \let\FancyVerbFormatLine\sphinxFancyVerbFormatLine + % workaround to fancyvrb's check of \@currenvir + \let\VerbatimEnvironment\sphinxVerbatimEnvironment + % workaround to fancyvrb's check of current list depth + \def\@toodeep {\advance\@listdepth\@ne}% + % The list environment is needed to control perfectly the vertical space. + % Note: \OuterFrameSep used by framed.sty is later set to \topsep hence 0pt. + % - if caption: distance from last text baseline to caption baseline is + % A+(B-F)+\ht\strutbox, A = \abovecaptionskip (default 10pt), B = + % \baselineskip, F is the framed.sty \FrameHeightAdjust macro, default 6pt. + % Formula valid for F < 10pt. + % - distance of baseline of caption to top of frame is like for tables: + % \sphinxbelowcaptionspace (=0.5\baselineskip) + % - if no caption: distance of last text baseline to code frame is S+(B-F), + % with S = \sphinxverbatimtopskip (=\smallskip) + % - and distance from bottom of frame to next text baseline is + % \baselineskip+\parskip. + % The \trivlist is used to avoid possible "too deeply nested" error. + \itemsep \z@skip + \topsep \z@skip + \partopsep \z@skip + % trivlist will set \parsep to \parskip = zero + % \leftmargin will be set to zero by trivlist + \rightmargin\z@ + \parindent \z@% becomes \itemindent. Default zero, but perhaps overwritten. + \trivlist\item\relax + \ifsphinxverbatimwithminipage\spx@inframedtrue\fi + % use a minipage if we are already inside a framed environment + \ifspx@inframed\noindent\begin{minipage}{\linewidth}\fi + \MakeFramed {% adapted over from framed.sty's snugshade environment + \advance\hsize-\width\@totalleftmargin\z@\linewidth\hsize\@setminipage + }% + % For grid placement from \strut's in \FancyVerbFormatLine + \lineskip\z@skip + % active comma should not be overwritten by \@noligs + \ifspx@opt@verbatimwrapslines + \let\verbatim@nolig@list \sphinx@verbatim@nolig@list + \fi + % will fetch its optional arguments if any + \OriginalVerbatim +} +{% + \endOriginalVerbatim + \par\unskip\@minipagefalse\endMakeFramed % from framed.sty snugshade + \ifspx@inframed\end{minipage}\fi + \endtrivlist +} +\newenvironment {sphinxVerbatimNoFrame} + {\spx@opt@verbatimwithframefalse + % needed for fancyvrb as literal code will end in \end{sphinxVerbatimNoFrame} + \def\sphinxVerbatimEnvironment{\gdef\FV@EnvironName{sphinxVerbatimNoFrame}}% + \begin{sphinxVerbatim}} + {\end{sphinxVerbatim}} +\newenvironment {sphinxVerbatimintable} + {% don't use a frame if in a table cell + \spx@opt@verbatimwithframefalse + \sphinxverbatimwithminipagetrue + % the literal block caption uses \sphinxcaption which is wrapper of \caption, + % but \caption must be modified because longtable redefines it to work only + % for the own table caption, and tabulary has multiple passes + \let\caption\sphinxfigcaption + % reduce above caption skip + \def\spx@abovecaptionskip{\sphinxverbatimsmallskipamount}% + \def\sphinxVerbatimEnvironment{\gdef\FV@EnvironName{sphinxVerbatimintable}}% + \begin{sphinxVerbatim}} + {\end{sphinxVerbatim}} + + +%% PARSED LITERALS +% allow long lines to wrap like they do in code-blocks + +% this should be kept in sync with definitions in sphinx.util.texescape +\newcommand*\sphinxbreaksattexescapedchars{% + \def\do##1##2% put potential break point before character + {\def##1{\discretionary{}{\sphinxafterbreak\char`##2}{\char`##2}}}% + \do\{\{\do\textless\<\do\#\#\do\%\%\do\$\$% {, <, #, %, $ + \def\do##1##2% put potential break point after character + {\def##1{\discretionary{\char`##2}{\sphinxafterbreak}{\char`##2}}}% + \do\_\_\do\}\}\do\textasciicircum\^\do\&\&% _, }, ^, &, + \do\textgreater\>\do\textasciitilde\~% >, ~ +} +\newcommand*\sphinxbreaksviaactiveinparsedliteral{% + \sphinxbreaksviaactive % by default handles . , ; ? ! / + \do\-% we need also the hyphen character (ends up "as is" in parsed-literal) + \lccode`\~`\~ % + % update \dospecials as it is used by \url + % but deactivation will already have been done hence this is unneeded: + % \expandafter\def\expandafter\dospecials\expandafter{\dospecials + % \sphinxbreaksbeforeactivelist\sphinxbreaksafteractivelist\do\-}% +} +\newcommand*\sphinxbreaksatspaceinparsedliteral{% + \lccode`~32 \lowercase{\let~}\spx@verbatim@space\lccode`\~`\~ +} +\newcommand*{\sphinxunactivateextras}{\let\do\@makeother + \sphinxbreaksbeforeactivelist\sphinxbreaksafteractivelist\do\-}% +% the \catcode13=5\relax (deactivate end of input lines) is left to callers +\newcommand*{\sphinxunactivateextrasandspace}{\catcode32=10\relax + \sphinxunactivateextras}% +% now for the modified alltt environment +\newenvironment{sphinxalltt} +{% at start of next line to workaround Emacs/AUCTeX issue with this file +\begin{alltt}% + \ifspx@opt@parsedliteralwraps + \sbox\sphinxcontinuationbox {\spx@opt@verbatimcontinued}% + \sbox\sphinxvisiblespacebox {\spx@opt@verbatimvisiblespace}% + \sphinxbreaksattexescapedchars + \sphinxbreaksviaactiveinparsedliteral + \sphinxbreaksatspaceinparsedliteral +% alltt takes care of the ' as derivative ("prime") in math mode + \everymath\expandafter{\the\everymath\sphinxunactivateextrasandspace + \catcode`\<=12\catcode`\>=12\catcode`\^=7\catcode`\_=8 }% +% not sure if displayed math (align,...) can end up in parsed-literal, anyway + \everydisplay\expandafter{\the\everydisplay + \catcode13=5 \sphinxunactivateextrasandspace + \catcode`\<=12\catcode`\>=12\catcode`\^=7\catcode`\_=8 }% + \fi } +{\end{alltt}} + +% Protect \href's first argument in contexts such as sphinxalltt (or +% \sphinxcode). Sphinx uses \#, \%, \& ... always inside \sphinxhref. +\protected\def\sphinxhref#1#2{{% + \sphinxunactivateextrasandspace % never do \scantokens with active space! + \endlinechar\m@ne\everyeof{{#2}}% keep catcode regime for #2 + \scantokens{\href{#1}}% normalise it for #1 during \href expansion +}} +% Same for \url. And also \nolinkurl for coherence. +\protected\def\sphinxurl#1{{% + \sphinxunactivateextrasandspace\everyeof{}% (<- precaution for \scantokens) + \endlinechar\m@ne\scantokens{\url{#1}}% +}} +\protected\def\sphinxnolinkurl#1{{% + \sphinxunactivateextrasandspace\everyeof{}% + \endlinechar\m@ne\scantokens{\nolinkurl{#1}}% +}} + + +%% TOPIC AND CONTENTS BOXES +% +% Again based on use of "framed.sty", this allows breakable framed boxes. +\long\def\spx@ShadowFBox#1{% + \leavevmode\begingroup + % first we frame the box #1 + \setbox\@tempboxa + \hbox{\vrule\@width\sphinxshadowrule + \vbox{\hrule\@height\sphinxshadowrule + \kern\sphinxshadowsep + \hbox{\kern\sphinxshadowsep #1\kern\sphinxshadowsep}% + \kern\sphinxshadowsep + \hrule\@height\sphinxshadowrule}% + \vrule\@width\sphinxshadowrule}% + % Now we add the shadow, like \shadowbox from fancybox.sty would do + \dimen@\dimexpr.5\sphinxshadowrule+\sphinxshadowsize\relax + \hbox{\vbox{\offinterlineskip + \hbox{\copy\@tempboxa\kern-.5\sphinxshadowrule + % add shadow on right side + \lower\sphinxshadowsize + \hbox{\vrule\@height\ht\@tempboxa \@width\dimen@}% + }% + \kern-\dimen@ % shift back vertically to bottom of frame + % and add shadow at bottom + \moveright\sphinxshadowsize + \vbox{\hrule\@width\wd\@tempboxa \@height\dimen@}% + }% + % move left by the size of right shadow so shadow adds no width + \kern-\sphinxshadowsize + }% + \endgroup +} + +% use framed.sty to allow page breaks in frame+shadow +% works well inside Lists and Quote-like environments +% produced by ``topic'' directive (or local contents) +% could nest if LaTeX writer authorized it +\newenvironment{sphinxShadowBox} + {\def\FrameCommand {\spx@ShadowFBox }% + % configure framed.sty not to add extra vertical spacing + \ltx@ifundefined{OuterFrameSep}{}{\OuterFrameSep\z@skip}% + % the \trivlist will add the vertical spacing on top and bottom which is + % typical of center environment as used in Sphinx <= 1.4.1 + % the \noindent has the effet of an extra blank line on top, to + % imitate closely the layout from Sphinx <= 1.4.1; the \FrameHeightAdjust + % will put top part of frame on this baseline. + \def\FrameHeightAdjust {\baselineskip}% + % use package footnote to handle footnotes + \savenotes + \trivlist\item\noindent + % use a minipage if we are already inside a framed environment + \ifspx@inframed\begin{minipage}{\linewidth}\fi + \MakeFramed {\spx@inframedtrue + % framed.sty puts into "\width" the added width (=2shadowsep+2shadowrule) + % adjust \hsize to what the contents must use + \advance\hsize-\width + % adjust LaTeX parameters to behave properly in indented/quoted contexts + \FrameRestore + % typeset the contents as in a minipage (Sphinx <= 1.4.1 used a minipage and + % itemize/enumerate are therein typeset more tightly, we want to keep + % that). We copy-paste from LaTeX source code but don't do a real minipage. + \@pboxswfalse + \let\@listdepth\@mplistdepth \@mplistdepth\z@ + \@minipagerestore + \@setminipage + }% + }% + {% insert the "endminipage" code + \par\unskip + \@minipagefalse + \endMakeFramed + \ifspx@inframed\end{minipage}\fi + \endtrivlist + % output the stored footnotes + \spewnotes + } + + +%% NOTICES AND ADMONITIONS +% +% Some are quite plain +% the spx@notice@bordercolor etc are set in the sphinxadmonition environment +\newenvironment{sphinxlightbox}{% + \par\allowbreak + \noindent{\color{spx@notice@bordercolor}% + \rule{\linewidth}{\spx@notice@border}}\par\nobreak + {\parskip\z@skip\noindent}% + } + {% + % counteract previous possible negative skip (French lists!): + % (we can't cancel that any earlier \vskip introduced a potential pagebreak) + \sphinxvspacefixafterfrenchlists + \nobreak\vbox{\noindent\kern\@totalleftmargin + {\color{spx@notice@bordercolor}% + \rule[\dimexpr.4\baselineskip-\spx@notice@border\relax] + {\linewidth}{\spx@notice@border}}\hss}\allowbreak + }% end of sphinxlightbox environment definition +% may be renewenvironment'd by user for complete customization +\newenvironment{sphinxnote}[1] + {\begin{sphinxlightbox}\sphinxstrong{#1} }{\end{sphinxlightbox}} +\newenvironment{sphinxhint}[1] + {\begin{sphinxlightbox}\sphinxstrong{#1} }{\end{sphinxlightbox}} +\newenvironment{sphinximportant}[1] + {\begin{sphinxlightbox}\sphinxstrong{#1} }{\end{sphinxlightbox}} +\newenvironment{sphinxtip}[1] + {\begin{sphinxlightbox}\sphinxstrong{#1} }{\end{sphinxlightbox}} +% or just use the package options +% these are needed for common handling by notice environment of lightbox +% and heavybox but they are currently not used by lightbox environment +% and there is consequently no corresponding package option +\definecolor{sphinxnoteBgColor}{rgb}{1,1,1} +\definecolor{sphinxhintBgColor}{rgb}{1,1,1} +\definecolor{sphinximportantBgColor}{rgb}{1,1,1} +\definecolor{sphinxtipBgColor}{rgb}{1,1,1} + +% Others get more distinction +% Code adapted from framed.sty's "snugshade" environment. +% Nesting works (inner frames do not allow page breaks). +\newenvironment{sphinxheavybox}{\par + \setlength{\FrameRule}{\spx@notice@border}% + \setlength{\FrameSep}{\dimexpr.6\baselineskip-\FrameRule\relax} + % configure framed.sty's parameters to obtain same vertical spacing + % as for "light" boxes. We need for this to manually insert parskip glue and + % revert a skip done by framed before the frame. + \ltx@ifundefined{OuterFrameSep}{}{\OuterFrameSep\z@skip}% + \vspace{\FrameHeightAdjust} + % copied/adapted from framed.sty's snugshade + \def\FrameCommand##1{\hskip\@totalleftmargin + \fboxsep\FrameSep \fboxrule\FrameRule + \fcolorbox{spx@notice@bordercolor}{spx@notice@bgcolor}{##1}% + \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}% + \savenotes + % use a minipage if we are already inside a framed environment + \ifspx@inframed + \noindent\begin{minipage}{\linewidth} + \else + % handle case where notice is first thing in a list item (or is quoted) + \if@inlabel + \noindent\par\vspace{-\baselineskip} + \else + \vspace{\parskip} + \fi + \fi + \MakeFramed {\spx@inframedtrue + \advance\hsize-\width \@totalleftmargin\z@ \linewidth\hsize + % minipage initialization copied from LaTeX source code. + \@pboxswfalse + \let\@listdepth\@mplistdepth \@mplistdepth\z@ + \@minipagerestore + \@setminipage }% + } + {% + \par\unskip + \@minipagefalse + \endMakeFramed + \ifspx@inframed\end{minipage}\fi + % set footnotes at bottom of page + \spewnotes + % arrange for similar spacing below frame as for "light" boxes. + \vskip .4\baselineskip + }% end of sphinxheavybox environment definition +% may be renewenvironment'd by user for complete customization +\newenvironment{sphinxwarning}[1] + {\begin{sphinxheavybox}\sphinxstrong{#1} }{\end{sphinxheavybox}} +\newenvironment{sphinxcaution}[1] + {\begin{sphinxheavybox}\sphinxstrong{#1} }{\end{sphinxheavybox}} +\newenvironment{sphinxattention}[1] + {\begin{sphinxheavybox}\sphinxstrong{#1} }{\end{sphinxheavybox}} +\newenvironment{sphinxdanger}[1] + {\begin{sphinxheavybox}\sphinxstrong{#1} }{\end{sphinxheavybox}} +\newenvironment{sphinxerror}[1] + {\begin{sphinxheavybox}\sphinxstrong{#1} }{\end{sphinxheavybox}} +% or just use package options + +% the \colorlet of xcolor (if at all loaded) is overkill for our use case +\newcommand{\sphinxcolorlet}[2] + {\expandafter\let\csname\@backslashchar color@#1\expandafter\endcsname + \csname\@backslashchar color@#2\endcsname } + +% the main dispatch for all types of notices +\newenvironment{sphinxadmonition}[2]{% #1=type, #2=heading + % can't use #1 directly in definition of end part + \def\spx@noticetype {#1}% + % set parameters of heavybox/lightbox + \sphinxcolorlet{spx@notice@bordercolor}{sphinx#1BorderColor}% + \sphinxcolorlet{spx@notice@bgcolor}{sphinx#1BgColor}% + \spx@notice@border \dimexpr\csname spx@opt@#1border\endcsname\relax + % start specific environment, passing the heading as argument + \begin{sphinx#1}{#2}} + % workaround some LaTeX "feature" of \end command + {\edef\spx@temp{\noexpand\end{sphinx\spx@noticetype}}\spx@temp} + + +%% PYTHON DOCS MACROS AND ENVIRONMENTS +% (some macros here used by \maketitle in sphinxmanual.cls and sphinxhowto.cls) + +% \moduleauthor{name}{email} +\newcommand{\moduleauthor}[2]{} + +% \sectionauthor{name}{email} +\newcommand{\sectionauthor}[2]{} + +% Allow the release number to be specified independently of the +% \date{}. This allows the date to reflect the document's date and +% release to specify the release that is documented. +% +\newcommand{\py@release}{\releasename\space\version} +\newcommand{\version}{}% part of \py@release, used by title page and headers +% \releaseinfo is used on titlepage (sphinxmanual.cls, sphinxhowto.cls) +\newcommand{\releaseinfo}{} +\newcommand{\setreleaseinfo}[1]{\renewcommand{\releaseinfo}{#1}} +% this is inserted via template and #1=release config variable +\newcommand{\release}[1]{\renewcommand{\version}{#1}} +% this is defined by template to 'releasename' latex_elements key +\newcommand{\releasename}{} +% Fix issue in case release and releasename deliberately left blank +\newcommand{\sphinxheadercomma}{, }% used in fancyhdr header definition +\newcommand{\sphinxifemptyorblank}[1]{% +% test after one expansion of macro #1 if contents is empty or spaces + \if&\expandafter\@firstofone\detokenize\expandafter{#1}&% + \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}% +\AtBeginDocument {% + \sphinxifemptyorblank{\releasename} + {\sphinxifemptyorblank{\version}{\let\sphinxheadercomma\empty}{}} + {}% +}% + +% Allow specification of the author's address separately from the +% author's name. This can be used to format them differently, which +% is a good thing. +% +\newcommand{\py@authoraddress}{} +\newcommand{\authoraddress}[1]{\renewcommand{\py@authoraddress}{#1}} + +% {fulllineitems} is the main environment for object descriptions. +% +\newcommand{\py@itemnewline}[1]{% + \kern\labelsep + \@tempdima\linewidth + \advance\@tempdima \labelwidth\makebox[\@tempdima][l]{#1}% + \kern-\labelsep +} + +\newenvironment{fulllineitems}{% + \begin{list}{}{\labelwidth \leftmargin + \rightmargin \z@ \topsep -\parskip \partopsep \parskip + \itemsep -\parsep + \let\makelabel=\py@itemnewline}% +}{\end{list}} + +% Signatures, possibly multi-line +% +\newlength{\py@argswidth} +\newcommand{\py@sigparams}[2]{% + \parbox[t]{\py@argswidth}{#1\sphinxcode{)}#2}} +\newcommand{\pysigline}[1]{\item[{#1}]} +\newcommand{\pysiglinewithargsret}[3]{% + \settowidth{\py@argswidth}{#1\sphinxcode{(}}% + \addtolength{\py@argswidth}{-2\py@argswidth}% + \addtolength{\py@argswidth}{\linewidth}% + \item[{#1\sphinxcode{(}\py@sigparams{#2}{#3}}]} +\newcommand{\pysigstartmultiline}{% + \def\pysigstartmultiline{\vskip\smallskipamount\parskip\z@skip\itemsep\z@skip}% + \edef\pysigstopmultiline + {\noexpand\leavevmode\parskip\the\parskip\relax\itemsep\the\itemsep\relax}% + \parskip\z@skip\itemsep\z@skip +} + +% Production lists +% +\newenvironment{productionlist}{% +% \def\sphinxoptional##1{{\Large[}##1{\Large]}} + \def\production##1##2{\\\sphinxcode{\sphinxupquote{##1}}&::=&\sphinxcode{\sphinxupquote{##2}}}% + \def\productioncont##1{\\& &\sphinxcode{\sphinxupquote{##1}}}% + \parindent=2em + \indent + \setlength{\LTpre}{0pt}% + \setlength{\LTpost}{0pt}% + \begin{longtable}[l]{lcl} +}{% + \end{longtable} +} + +% Definition lists; requested by AMK for HOWTO documents. Probably useful +% elsewhere as well, so keep in in the general style support. +% +\newenvironment{definitions}{% + \begin{description}% + \def\term##1{\item[{##1}]\mbox{}\\*[0mm]}% +}{% + \end{description}% +} + +%% FROM DOCTUTILS LATEX WRITER +% +% The following is stuff copied from docutils' latex writer. +% +\newcommand{\optionlistlabel}[1]{\normalfont\bfseries #1 \hfill}% \bf deprecated +\newenvironment{optionlist}[1] +{\begin{list}{} + {\setlength{\labelwidth}{#1} + \setlength{\rightmargin}{1cm} + \setlength{\leftmargin}{\rightmargin} + \addtolength{\leftmargin}{\labelwidth} + \addtolength{\leftmargin}{\labelsep} + \renewcommand{\makelabel}{\optionlistlabel}} +}{\end{list}} + +\newlength{\lineblockindentation} +\setlength{\lineblockindentation}{2.5em} +\newenvironment{lineblock}[1] +{\begin{list}{} + {\setlength{\partopsep}{\parskip} + \addtolength{\partopsep}{\baselineskip} + \topsep0pt\itemsep0.15\baselineskip\parsep0pt + \leftmargin#1\relax} + \raggedright} +{\end{list}} + +% From docutils.writers.latex2e +% inline markup (custom roles) +% \DUrole{#1}{#2} tries \DUrole#1{#2} +\providecommand*{\DUrole}[2]{% + \ifcsname DUrole\detokenize{#1}\endcsname + \csname DUrole\detokenize{#1}\endcsname{#2}% + \else% backwards compatibility: try \docutilsrole#1{#2} + \ifcsname docutilsrole\detokenize{#1}\endcsname + \csname docutilsrole\detokenize{#1}\endcsname{#2}% + \else + #2% + \fi + \fi +} + +\providecommand*{\DUprovidelength}[2]{% + \ifdefined#1\else\newlength{#1}\setlength{#1}{#2}\fi +} + +\DUprovidelength{\DUlineblockindent}{2.5em} +\ifdefined\DUlineblock\else + \newenvironment{DUlineblock}[1]{% + \list{}{\setlength{\partopsep}{\parskip} + \addtolength{\partopsep}{\baselineskip} + \setlength{\topsep}{0pt} + \setlength{\itemsep}{0.15\baselineskip} + \setlength{\parsep}{0pt} + \setlength{\leftmargin}{#1}} + \raggedright + } + {\endlist} +\fi + +%% TEXT STYLING +% +% to obtain straight quotes we execute \@noligs as patched by upquote, and +% \scantokens is needed in cases where it would be too late for the macro to +% first set catcodes and then fetch its argument. We also make the contents +% breakable at non-escaped . , ; ? ! / using \sphinxbreaksviaactive. +% the macro must be protected if it ends up used in moving arguments, +% in 'alltt' \@noligs is done already, and the \scantokens must be avoided. +\protected\def\sphinxupquote#1{{\def\@tempa{alltt}% + \ifx\@tempa\@currenvir\else + \ifspx@opt@inlineliteralwraps + \sphinxbreaksviaactive\let\sphinxafterbreak\empty + % do not overwrite the comma set-up + \let\verbatim@nolig@list\sphinx@literal@nolig@list + \fi + % fix a space-gobbling issue due to LaTeX's original \do@noligs + \let\do@noligs\sphinx@do@noligs + \@noligs\endlinechar\m@ne\everyeof{}% (<- in case inside \sphinxhref) + \expandafter\scantokens + \fi {{#1}}}}% extra brace pair to fix end-space gobbling issue... +\def\sphinx@do@noligs #1{\catcode`#1\active\begingroup\lccode`\~`#1\relax + \lowercase{\endgroup\def~{\leavevmode\kern\z@\char`#1 }}} +\def\sphinx@literal@nolig@list {\do\`\do\<\do\>\do\'\do\-}% + +% Some custom font markup commands. +\protected\def\sphinxstrong#1{\textbf{#1}} +\protected\def\sphinxcode#1{\texttt{#1}} +\protected\def\sphinxbfcode#1{\textbf{\sphinxcode{#1}}} +\protected\def\sphinxemail#1{\textsf{#1}} +\protected\def\sphinxtablecontinued#1{\textsf{#1}} +\protected\def\sphinxtitleref#1{\emph{#1}} +\protected\def\sphinxmenuselection#1{\emph{#1}} +\protected\def\sphinxaccelerator#1{\underline{#1}} +\protected\def\sphinxcrossref#1{\emph{#1}} +\protected\def\sphinxtermref#1{\emph{#1}} +% \optional is used for ``[, arg]``, i.e. desc_optional nodes. +\long\protected\def\sphinxoptional#1{% + {\textnormal{\Large[}}{#1}\hspace{0.5mm}{\textnormal{\Large]}}} + +% additional customizable styling +% FIXME: convert this to package options ? +\protected\def\sphinxstyleindexentry #1{\texttt{#1}} +\protected\def\sphinxstyleindexextra #1{ \emph{(#1)}} +\protected\def\sphinxstyleindexpageref #1{, \pageref{#1}} +\protected\def\sphinxstyletopictitle #1{\textbf{#1}\par\medskip} +\let\sphinxstylesidebartitle\sphinxstyletopictitle +\protected\def\sphinxstyleothertitle #1{\textbf{#1}} +\protected\def\sphinxstylesidebarsubtitle #1{~\\\textbf{#1} \smallskip} +% \text.. commands do not allow multiple paragraphs +\protected\def\sphinxstyletheadfamily {\sffamily} +\protected\def\sphinxstyleemphasis #1{\emph{#1}} +\protected\def\sphinxstyleliteralemphasis#1{\emph{\sphinxcode{#1}}} +\protected\def\sphinxstylestrong #1{\textbf{#1}} +\protected\def\sphinxstyleliteralstrong#1{\sphinxbfcode{#1}} +\protected\def\sphinxstyleabbreviation #1{\textsc{#1}} +\protected\def\sphinxstyleliteralintitle#1{\sphinxcode{#1}} +\newcommand*\sphinxstylecodecontinued[1]{\footnotesize(#1)}% +\newcommand*\sphinxstylecodecontinues[1]{\footnotesize(#1)}% +% figure legend comes after caption and may contain arbitrary body elements +\newenvironment{sphinxlegend}{\par\small}{\par} +% reduce hyperref "Token not allowed in a PDF string" warnings on PDF builds +\AtBeginDocument{\pdfstringdefDisableCommands{% +% all "protected" macros possibly ending up in section titles should be here + \let\sphinxstyleemphasis \@firstofone + \let\sphinxstyleliteralemphasis \@firstofone + \let\sphinxstylestrong \@firstofone + \let\sphinxstyleliteralstrong \@firstofone + \let\sphinxstyleabbreviation \@firstofone + \let\sphinxstyleliteralintitle \@firstofone + \let\sphinxupquote \@firstofone + \let\sphinxstrong \@firstofone + \let\sphinxcode \@firstofone + \let\sphinxbfcode \@firstofone + \let\sphinxemail \@firstofone + \let\sphinxcrossref \@firstofone + \let\sphinxtermref \@firstofone +}} + +% For curly braces inside \index macro +\def\sphinxleftcurlybrace{\{} +\def\sphinxrightcurlybrace{\}} + +% Declare Unicode characters used by linux tree command to pdflatex utf8/utf8x +\def\spx@bd#1#2{% + \leavevmode + \begingroup + \ifx\spx@bd@height \@undefined\def\spx@bd@height{\baselineskip}\fi + \ifx\spx@bd@width \@undefined\setbox0\hbox{0}\def\spx@bd@width{\wd0 }\fi + \ifx\spx@bd@thickness\@undefined\def\spx@bd@thickness{.6\p@}\fi + \ifx\spx@bd@lower \@undefined\def\spx@bd@lower{\dp\strutbox}\fi + \lower\spx@bd@lower#1{#2}% + \endgroup +}% +\@namedef{sphinx@u2500}% BOX DRAWINGS LIGHT HORIZONTAL + {\spx@bd{\vbox to\spx@bd@height} + {\vss\hrule\@height\spx@bd@thickness + \@width\spx@bd@width\vss}}% +\@namedef{sphinx@u2502}% BOX DRAWINGS LIGHT VERTICAL + {\spx@bd{\hb@xt@\spx@bd@width} + {\hss\vrule\@height\spx@bd@height + \@width \spx@bd@thickness\hss}}% +\@namedef{sphinx@u2514}% BOX DRAWINGS LIGHT UP AND RIGHT + {\spx@bd{\hb@xt@\spx@bd@width} + {\hss\raise.5\spx@bd@height + \hb@xt@\z@{\hss\vrule\@height.5\spx@bd@height + \@width \spx@bd@thickness\hss}% + \vbox to\spx@bd@height{\vss\hrule\@height\spx@bd@thickness + \@width.5\spx@bd@width\vss}}}% +\@namedef{sphinx@u251C}% BOX DRAWINGS LIGHT VERTICAL AND RIGHT + {\spx@bd{\hb@xt@\spx@bd@width} + {\hss + \hb@xt@\z@{\hss\vrule\@height\spx@bd@height + \@width \spx@bd@thickness\hss}% + \vbox to\spx@bd@height{\vss\hrule\@height\spx@bd@thickness + \@width.5\spx@bd@width\vss}}}% +\protected\def\sphinxunichar#1{\@nameuse{sphinx@u#1}}% + +% Tell TeX about pathological hyphenation cases: +\hyphenation{Base-HTTP-Re-quest-Hand-ler} +\endinput diff --git a/Documentation/_build/latex/sphinxhighlight.sty b/Documentation/_build/latex/sphinxhighlight.sty new file mode 100644 index 0000000000000000000000000000000000000000..1557ce6e32d943a825cc18fa11a32e3ec2f7cc26 --- /dev/null +++ b/Documentation/_build/latex/sphinxhighlight.sty @@ -0,0 +1,105 @@ +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{sphinxhighlight}[2016/05/29 stylesheet for highlighting with pygments] + + +\makeatletter +\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax% + \let\PYG@ul=\relax \let\PYG@tc=\relax% + \let\PYG@bc=\relax \let\PYG@ff=\relax} +\def\PYG@tok#1{\csname PYG@tok@#1\endcsname} +\def\PYG@toks#1+{\ifx\relax#1\empty\else% + \PYG@tok{#1}\expandafter\PYG@toks\fi} +\def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{% + \PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}} +\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}} + +\expandafter\def\csname PYG@tok@w\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}} +\expandafter\def\csname PYG@tok@c\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} +\expandafter\def\csname PYG@tok@cp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} +\expandafter\def\csname PYG@tok@cs\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}\def\PYG@bc##1{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}} +\expandafter\def\csname PYG@tok@k\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} +\expandafter\def\csname PYG@tok@kp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} +\expandafter\def\csname PYG@tok@kt\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.56,0.13,0.00}{##1}}} +\expandafter\def\csname PYG@tok@o\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\expandafter\def\csname PYG@tok@ow\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} +\expandafter\def\csname PYG@tok@nb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} +\expandafter\def\csname PYG@tok@nf\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.02,0.16,0.49}{##1}}} +\expandafter\def\csname PYG@tok@nc\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.05,0.52,0.71}{##1}}} +\expandafter\def\csname PYG@tok@nn\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.05,0.52,0.71}{##1}}} +\expandafter\def\csname PYG@tok@ne\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} +\expandafter\def\csname PYG@tok@nv\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} +\expandafter\def\csname PYG@tok@no\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.38,0.68,0.84}{##1}}} +\expandafter\def\csname PYG@tok@nl\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.13,0.44}{##1}}} +\expandafter\def\csname PYG@tok@ni\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.84,0.33,0.22}{##1}}} +\expandafter\def\csname PYG@tok@na\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} +\expandafter\def\csname PYG@tok@nt\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.02,0.16,0.45}{##1}}} +\expandafter\def\csname PYG@tok@nd\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.33,0.33,0.33}{##1}}} +\expandafter\def\csname PYG@tok@s\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} +\expandafter\def\csname PYG@tok@sd\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} +\expandafter\def\csname PYG@tok@si\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.44,0.63,0.82}{##1}}} +\expandafter\def\csname PYG@tok@se\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} +\expandafter\def\csname PYG@tok@sr\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.14,0.33,0.53}{##1}}} +\expandafter\def\csname PYG@tok@ss\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.32,0.47,0.09}{##1}}} +\expandafter\def\csname PYG@tok@sx\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.78,0.36,0.04}{##1}}} +\expandafter\def\csname PYG@tok@m\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} +\expandafter\def\csname PYG@tok@gh\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}} +\expandafter\def\csname PYG@tok@gu\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}} +\expandafter\def\csname PYG@tok@gd\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}} +\expandafter\def\csname PYG@tok@gi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.63,0.00}{##1}}} +\expandafter\def\csname PYG@tok@gr\endcsname{\def\PYG@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}} +\expandafter\def\csname PYG@tok@ge\endcsname{\let\PYG@it=\textit} +\expandafter\def\csname PYG@tok@gs\endcsname{\let\PYG@bf=\textbf} +\expandafter\def\csname PYG@tok@gp\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.78,0.36,0.04}{##1}}} +\expandafter\def\csname PYG@tok@go\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.20,0.20,0.20}{##1}}} +\expandafter\def\csname PYG@tok@gt\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}} +\expandafter\def\csname PYG@tok@err\endcsname{\def\PYG@bc##1{\setlength{\fboxsep}{0pt}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}} +\expandafter\def\csname PYG@tok@kc\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} +\expandafter\def\csname PYG@tok@kd\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} +\expandafter\def\csname PYG@tok@kn\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} +\expandafter\def\csname PYG@tok@kr\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} +\expandafter\def\csname PYG@tok@bp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} +\expandafter\def\csname PYG@tok@fm\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.02,0.16,0.49}{##1}}} +\expandafter\def\csname PYG@tok@vc\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} +\expandafter\def\csname PYG@tok@vg\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} +\expandafter\def\csname PYG@tok@vi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} +\expandafter\def\csname PYG@tok@vm\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} +\expandafter\def\csname PYG@tok@sa\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} +\expandafter\def\csname PYG@tok@sb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} +\expandafter\def\csname PYG@tok@sc\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} +\expandafter\def\csname PYG@tok@dl\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} +\expandafter\def\csname PYG@tok@s2\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} +\expandafter\def\csname PYG@tok@sh\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} +\expandafter\def\csname PYG@tok@s1\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} +\expandafter\def\csname PYG@tok@mb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} +\expandafter\def\csname PYG@tok@mf\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} +\expandafter\def\csname PYG@tok@mh\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} +\expandafter\def\csname PYG@tok@mi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} +\expandafter\def\csname PYG@tok@il\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} +\expandafter\def\csname PYG@tok@mo\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} +\expandafter\def\csname PYG@tok@ch\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} +\expandafter\def\csname PYG@tok@cm\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} +\expandafter\def\csname PYG@tok@cpf\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} +\expandafter\def\csname PYG@tok@c1\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} + +\def\PYGZbs{\char`\\} +\def\PYGZus{\char`\_} +\def\PYGZob{\char`\{} +\def\PYGZcb{\char`\}} +\def\PYGZca{\char`\^} +\def\PYGZam{\char`\&} +\def\PYGZlt{\char`\<} +\def\PYGZgt{\char`\>} +\def\PYGZsh{\char`\#} +\def\PYGZpc{\char`\%} +\def\PYGZdl{\char`\$} +\def\PYGZhy{\char`\-} +\def\PYGZsq{\char`\'} +\def\PYGZdq{\char`\"} +\def\PYGZti{\char`\~} +% for compatibility with earlier versions +\def\PYGZat{@} +\def\PYGZlb{[} +\def\PYGZrb{]} +\makeatother + +\renewcommand\PYGZsq{\textquotesingle} diff --git a/Documentation/_build/latex/sphinxhowto.cls b/Documentation/_build/latex/sphinxhowto.cls new file mode 100644 index 0000000000000000000000000000000000000000..11a49a2050838cdb39a0eb7b69067b402529694c --- /dev/null +++ b/Documentation/_build/latex/sphinxhowto.cls @@ -0,0 +1,95 @@ +% +% sphinxhowto.cls for Sphinx (http://sphinx-doc.org/) +% + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesClass{sphinxhowto}[2017/03/26 v1.6 Document class (Sphinx HOWTO)] + +% 'oneside' option overriding the 'twoside' default +\newif\if@oneside +\DeclareOption{oneside}{\@onesidetrue} +% Pass remaining document options to the parent class. +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}} +\ProcessOptions\relax + +% Default to two-side document +\if@oneside +% nothing to do (oneside is the default) +\else +\PassOptionsToClass{twoside}{\sphinxdocclass} +\fi + +\LoadClass{\sphinxdocclass} + +% Set some sane defaults for section numbering depth and TOC depth. You can +% reset these counters in your preamble. +% +\setcounter{secnumdepth}{2} +\setcounter{tocdepth}{2}% i.e. section and subsection + +% Change the title page to look a bit better, and fit in with the fncychap +% ``Bjarne'' style a bit better. +% +\renewcommand{\maketitle}{% + \noindent\rule{\textwidth}{1pt}\par + \begingroup % for PDF information dictionary + \def\endgraf{ }\def\and{\& }% + \pdfstringdefDisableCommands{\def\\{, }}% overwrite hyperref setup + \hypersetup{pdfauthor={\@author}, pdftitle={\@title}}% + \endgroup + \begin{flushright} + \sphinxlogo + \py@HeaderFamily + {\Huge \@title }\par + {\itshape\large \py@release \releaseinfo}\par + \vspace{25pt} + {\Large + \begin{tabular}[t]{c} + \@author + \end{tabular}}\par + \vspace{25pt} + \@date \par + \py@authoraddress \par + \end{flushright} + \@thanks + \setcounter{footnote}{0} + \let\thanks\relax\let\maketitle\relax + %\gdef\@thanks{}\gdef\@author{}\gdef\@title{} +} + +\newcommand{\sphinxtableofcontents}{ + \begingroup + \parskip = 0mm + \tableofcontents + \endgroup + \rule{\textwidth}{1pt} + \vspace{12pt} +} + +\@ifundefined{fancyhf}{ + \pagestyle{plain}}{ + \pagestyle{normal}} % start this way; change for +\pagenumbering{arabic} % ToC & chapters + +\thispagestyle{empty} + +% Fix the bibliography environment to add an entry to the Table of +% Contents. +% For an article document class this environment is a section, +% so no page break before it. +% +\newenvironment{sphinxthebibliography}[1]{% + % \phantomsection % not needed here since TeXLive 2010's hyperref + \begin{thebibliography}{1}% + \addcontentsline{toc}{section}{\ifdefined\refname\refname\else\ifdefined\bibname\bibname\fi\fi}}{\end{thebibliography}} + + +% Same for the indices. +% The memoir class already does this, so we don't duplicate it in that case. +% +\@ifclassloaded{memoir} + {\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}} + {\newenvironment{sphinxtheindex}{% + \phantomsection % needed because no chapter, section, ... is created by theindex + \begin{theindex}% + \addcontentsline{toc}{section}{\indexname}}{\end{theindex}}} diff --git a/Documentation/_build/latex/sphinxmanual.cls b/Documentation/_build/latex/sphinxmanual.cls new file mode 100644 index 0000000000000000000000000000000000000000..5b3d183cb78423450f5d7f648ac71effa0e1cc6c --- /dev/null +++ b/Documentation/_build/latex/sphinxmanual.cls @@ -0,0 +1,114 @@ +% +% sphinxmanual.cls for Sphinx (http://sphinx-doc.org/) +% + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesClass{sphinxmanual}[2017/03/26 v1.6 Document class (Sphinx manual)] + +% chapters starting at odd pages (overridden by 'openany' document option) +\PassOptionsToClass{openright}{\sphinxdocclass} + +% 'oneside' option overriding the 'twoside' default +\newif\if@oneside +\DeclareOption{oneside}{\@onesidetrue} +% Pass remaining document options to the parent class. +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}} +\ProcessOptions\relax + +% Defaults two-side document +\if@oneside +% nothing to do (oneside is the default) +\else +\PassOptionsToClass{twoside}{\sphinxdocclass} +\fi + +\LoadClass{\sphinxdocclass} + +% Set some sane defaults for section numbering depth and TOC depth. You can +% reset these counters in your preamble. +% +\setcounter{secnumdepth}{2} +\setcounter{tocdepth}{1} + +% Change the title page to look a bit better, and fit in with the fncychap +% ``Bjarne'' style a bit better. +% +\renewcommand{\maketitle}{% + \let\spx@tempa\relax + \ifHy@pageanchor\def\spx@tempa{\Hy@pageanchortrue}\fi + \hypersetup{pageanchor=false}% avoid duplicate destination warnings + \begin{titlepage}% + \let\footnotesize\small + \let\footnoterule\relax + \noindent\rule{\textwidth}{1pt}\par + \begingroup % for PDF information dictionary + \def\endgraf{ }\def\and{\& }% + \pdfstringdefDisableCommands{\def\\{, }}% overwrite hyperref setup + \hypersetup{pdfauthor={\@author}, pdftitle={\@title}}% + \endgroup + \begin{flushright}% + \sphinxlogo + \py@HeaderFamily + {\Huge \@title \par} + {\itshape\LARGE \py@release\releaseinfo \par} + \vfill + {\LARGE + \begin{tabular}[t]{c} + \@author + \end{tabular} + \par} + \vfill\vfill + {\large + \@date \par + \vfill + \py@authoraddress \par + }% + \end{flushright}%\par + \@thanks + \end{titlepage}% + \setcounter{footnote}{0}% + \let\thanks\relax\let\maketitle\relax + %\gdef\@thanks{}\gdef\@author{}\gdef\@title{} + \if@openright\cleardoublepage\else\clearpage\fi + \spx@tempa +} + +\newcommand{\sphinxtableofcontents}{% + \pagenumbering{roman}% + \pagestyle{plain}% + \begingroup + \parskip \z@skip + \tableofcontents + \endgroup + % before resetting page counter, let's do the right thing. + \if@openright\cleardoublepage\else\clearpage\fi + \pagenumbering{arabic}% + \ifdefined\fancyhf\pagestyle{normal}\fi +} + +% This is needed to get the width of the section # area wide enough in the +% library reference. Doing it here keeps it the same for all the manuals. +% +\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.6em}} +\renewcommand*\l@subsection{\@dottedtocline{2}{4.1em}{3.5em}} + +% Fix the bibliography environment to add an entry to the Table of +% Contents. +% For a report document class this environment is a chapter. +% +\newenvironment{sphinxthebibliography}[1]{% + \if@openright\cleardoublepage\else\clearpage\fi + % \phantomsection % not needed here since TeXLive 2010's hyperref + \begin{thebibliography}{1}% + \addcontentsline{toc}{chapter}{\bibname}}{\end{thebibliography}} + +% Same for the indices. +% The memoir class already does this, so we don't duplicate it in that case. +% +\@ifclassloaded{memoir} + {\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}} + {\newenvironment{sphinxtheindex}{% + \if@openright\cleardoublepage\else\clearpage\fi + \phantomsection % needed as no chapter, section, ... created + \begin{theindex}% + \addcontentsline{toc}{chapter}{\indexname}}{\end{theindex}}} diff --git a/Documentation/_build/latex/sphinxmulticell.sty b/Documentation/_build/latex/sphinxmulticell.sty new file mode 100644 index 0000000000000000000000000000000000000000..f0d11b1f99a01f08b58ac273e10df5100f13babf --- /dev/null +++ b/Documentation/_build/latex/sphinxmulticell.sty @@ -0,0 +1,317 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{sphinxmulticell}% + [2017/02/23 v1.6 better span rows and columns of a table (Sphinx team)]% +\DeclareOption*{\PackageWarning{sphinxmulticell}{Option `\CurrentOption' is unknown}}% +\ProcessOptions\relax +% +% --- MULTICOLUMN --- +% standard LaTeX's \multicolumn +% 1. does not allow verbatim contents, +% 2. interacts very poorly with tabulary. +% +% It is needed to write own macros for Sphinx: to allow code-blocks in merged +% cells rendered by tabular/longtable, and to allow multi-column cells with +% paragraphs to be taken into account sanely by tabulary algorithm for column +% widths. +% +% This requires quite a bit of hacking. First, in Sphinx, the multi-column +% contents will *always* be wrapped in a varwidth environment. The issue +% becomes to pass it the correct target width. We must trick tabulary into +% believing the multicolumn is simply separate columns, else tabulary does not +% incorporate the contents in its algorithm. But then we must clear the +% vertical rules... +% +% configuration of tabulary +\setlength{\tymin}{3\fontcharwd\font`0 }% minimal width of "squeezed" columns +\setlength{\tymax}{10000pt}% allow enough room for paragraphs to "compete" +% we need access to tabulary's final computed width. \@tempdima is too volatile +% to hope it has kept tabulary's value when \sphinxcolwidth needs it. +\newdimen\sphinx@TY@tablewidth +\def\tabulary{% + \def\TY@final{\sphinx@TY@tablewidth\@tempdima\tabular}% + \let\endTY@final\endtabular + \TY@tabular}% +% next hack is needed only if user has set latex_use_latex_multicolumn to True: +% it fixes tabulary's bug with \multicolumn defined "short" in first pass. (if +% upstream tabulary adds a \long, our extra one causes no harm) +\def\sphinx@tempa #1\def\multicolumn#2#3#4#5#6#7#8#9\sphinx@tempa + {\def\TY@tab{#1\long\def\multicolumn####1####2####3{\multispan####1\relax}#9}}% +\expandafter\sphinx@tempa\TY@tab\sphinx@tempa +% +% TN. 1: as \omit is never executed, Sphinx multicolumn does not need to worry +% like standard multicolumn about |l| vs l|. On the other hand it assumes +% columns are separated by a | ... (if not it will add extraneous +% \arrayrulewidth space for each column separation in its estimate of available +% width). +% +% TN. 1b: as Sphinx multicolumn uses neither \omit nor \span, it can not +% (easily) get rid of extra macros from >{...} or <{...} between columns. At +% least, it has been made compatible with colortbl's \columncolor. +% +% TN. 2: tabulary's second pass is handled like tabular/longtable's single +% pass, with the difference that we hacked \TY@final to set in +% \sphinx@TY@tablewidth the final target width as computed by tabulary. This is +% needed only to handle columns with a "horizontal" specifier: "p" type columns +% (inclusive of tabulary's LJRC) holds the target column width in the +% \linewidth dimension. +% +% TN. 3: use of \begin{sphinxmulticolumn}...\end{sphinxmulticolumn} mark-up +% would need some hacking around the fact that groups can not span across table +% cells (the code does inserts & tokens, see TN1b). It was decided to keep it +% simple with \sphinxstartmulticolumn...\sphinxstopmulticolumn. +% +% MEMO about nesting: if sphinxmulticolumn is encountered in a nested tabular +% inside a tabulary it will think to be at top level in the tabulary. But +% Sphinx generates no nested tables, and if some LaTeX macro uses internally a +% tabular this will not have a \sphinxstartmulticolumn within it! +% +\def\sphinxstartmulticolumn{% + \ifx\equation$% $ tabulary's first pass + \expandafter\sphinx@TYI@start@multicolumn + \else % either not tabulary or tabulary's second pass + \expandafter\sphinx@start@multicolumn + \fi +}% +\def\sphinxstopmulticolumn{% + \ifx\equation$% $ tabulary's first pass + \expandafter\sphinx@TYI@stop@multicolumn + \else % either not tabulary or tabulary's second pass + \ignorespaces + \fi +}% +\def\sphinx@TYI@start@multicolumn#1{% + % use \gdef always to avoid stack space build up + \gdef\sphinx@tempa{#1}\begingroup\setbox\z@\hbox\bgroup +}% +\def\sphinx@TYI@stop@multicolumn{\egroup % varwidth was used with \tymax + \xdef\sphinx@tempb{\the\dimexpr\wd\z@/\sphinx@tempa}% per column width + \endgroup + \expandafter\sphinx@TYI@multispan\expandafter{\sphinx@tempa}% +}% +\def\sphinx@TYI@multispan #1{% + \kern\sphinx@tempb\ignorespaces % the per column occupied width + \ifnum#1>\@ne % repeat, taking into account subtleties of TeX's & ... + \expandafter\sphinx@TYI@multispan@next\expandafter{\the\numexpr#1-\@ne\expandafter}% + \fi +}% +\def\sphinx@TYI@multispan@next{&\relax\sphinx@TYI@multispan}% +% +% Now the branch handling either the second pass of tabulary or the single pass +% of tabular/longtable. This is the delicate part where we gather the +% dimensions from the p columns either set-up by tabulary or by user p column +% or Sphinx \X, \Y columns. The difficulty is that to get the said width, the +% template must be inserted (other hacks would be horribly complicated except +% if we rewrote crucial parts of LaTeX's \@array !) and we can not do +% \omit\span like standard \multicolumn's easy approach. Thus we must cancel +% the \vrule separators. Also, perhaps the column specifier is of the l, c, r +% type, then we attempt an ad hoc rescue to give varwidth a reasonable target +% width. +\def\sphinx@start@multicolumn#1{% + \gdef\sphinx@multiwidth{0pt}\gdef\sphinx@tempa{#1}\sphinx@multispan{#1}% +}% +\def\sphinx@multispan #1{% + \ifnum#1=\@ne\expandafter\sphinx@multispan@end + \else\expandafter\sphinx@multispan@next + \fi {#1}% +}% +\def\sphinx@multispan@next #1{% + % trick to recognize L, C, R, J or p, m, b type columns + \ifdim\baselineskip>\z@ + \gdef\sphinx@tempb{\linewidth}% + \else + % if in an l, r, c type column, try and hope for the best + \xdef\sphinx@tempb{\the\dimexpr(\ifx\TY@final\@undefined\linewidth\else + \sphinx@TY@tablewidth\fi-\arrayrulewidth)/\sphinx@tempa + -\tw@\tabcolsep-\arrayrulewidth\relax}% + \fi + \noindent\kern\sphinx@tempb\relax + \xdef\sphinx@multiwidth + {\the\dimexpr\sphinx@multiwidth+\sphinx@tempb+\tw@\tabcolsep+\arrayrulewidth}% + % hack the \vline and the colortbl macros + \sphinx@hack@vline\sphinx@hack@CT&\relax + % repeat + \expandafter\sphinx@multispan\expandafter{\the\numexpr#1-\@ne}% +}% +% packages like colortbl add group levels, we need to "climb back up" to be +% able to hack the \vline and also the colortbl inserted tokens. This creates +% empty space whether or not the columns were | separated: +\def\sphinx@hack@vline{\ifnum\currentgrouptype=6\relax + \kern\arrayrulewidth\arrayrulewidth\z@\else\aftergroup\sphinx@hack@vline\fi}% +\def\sphinx@hack@CT{\ifnum\currentgrouptype=6\relax + \let\CT@setup\sphinx@CT@setup\else\aftergroup\sphinx@hack@CT\fi}% +% It turns out \CT@row@color is not expanded contrarily to \CT@column@color +% during LaTeX+colortbl preamble preparation, hence it would be possible for +% \sphinx@CT@setup to discard only the column color and choose to obey or not +% row color and cell color. It would even be possible to propagate cell color +% to row color for the duration of the Sphinx multicolumn... the (provisional?) +% choice has been made to cancel the colortbl colours for the multicolumn +% duration. +\def\sphinx@CT@setup #1\endgroup{\endgroup}% hack to remove colour commands +\def\sphinx@multispan@end#1{% + % first, trace back our steps horizontally + \noindent\kern-\dimexpr\sphinx@multiwidth\relax + % and now we set the final computed width for the varwidth environment + \ifdim\baselineskip>\z@ + \xdef\sphinx@multiwidth{\the\dimexpr\sphinx@multiwidth+\linewidth}% + \else + \xdef\sphinx@multiwidth{\the\dimexpr\sphinx@multiwidth+ + (\ifx\TY@final\@undefined\linewidth\else + \sphinx@TY@tablewidth\fi-\arrayrulewidth)/\sphinx@tempa + -\tw@\tabcolsep-\arrayrulewidth\relax}% + \fi + % we need to remove colour set-up also for last cell of the multi-column + \aftergroup\sphinx@hack@CT +}% +\newcommand*\sphinxcolwidth[2]{% + % this dimension will always be used for varwidth, and serves as maximum + % width when cells are merged either via multirow or multicolumn or both, + % as always their contents is wrapped in varwidth environment. + \ifnum#1>\@ne % multi-column (and possibly also multi-row) + % we wrote our own multicolumn code especially to handle that (and allow + % verbatim contents) + \ifx\equation$%$ + \tymax % first pass of tabulary (cf MEMO above regarding nesting) + \else % the \@gobble thing is for compatibility with standard \multicolumn + \sphinx@multiwidth\@gobble{#1/#2}% + \fi + \else % single column multirow + \ifx\TY@final\@undefined % not a tabulary. + \ifdim\baselineskip>\z@ + % in a p{..} type column, \linewidth is the target box width + \linewidth + \else + % l, c, r columns. Do our best. + \dimexpr(\linewidth-\arrayrulewidth)/#2- + \tw@\tabcolsep-\arrayrulewidth\relax + \fi + \else % in tabulary + \ifx\equation$%$% first pass + \tymax % it is set to a big value so that paragraphs can express themselves + \else + % second pass. + \ifdim\baselineskip>\z@ + \linewidth % in a L, R, C, J column or a p, \X, \Y ... + \else + % we have hacked \TY@final to put in \sphinx@TY@tablewidth the table width + \dimexpr(\sphinx@TY@tablewidth-\arrayrulewidth)/#2- + \tw@\tabcolsep-\arrayrulewidth\relax + \fi + \fi + \fi + \fi +}% +% fallback default in case user has set latex_use_latex_multicolumn to True: +% \sphinxcolwidth will use this only inside LaTeX's standard \multicolumn +\def\sphinx@multiwidth #1#2{\dimexpr % #1 to gobble the \@gobble (!) + (\ifx\TY@final\@undefined\linewidth\else\sphinx@TY@tablewidth\fi + -\arrayrulewidth)*#2-\tw@\tabcolsep-\arrayrulewidth\relax}% +% +% --- MULTIROW --- +% standard \multirow +% 1. does not allow verbatim contents, +% 2. does not allow blank lines in its argument, +% 3. its * specifier means to typeset "horizontally" which is very +% bad for paragraph content. 2016 version has = specifier but it +% must be used with p type columns only, else results are bad, +% 4. it requires manual intervention if the contents is too long to fit +% in the asked-for number of rows. +% 5. colour panels (either from \rowcolor or \columncolor) will hide +% the bottom part of multirow text, hence manual tuning is needed +% to put the multirow insertion at the _bottom_. +% +% The Sphinx solution consists in always having contents wrapped +% in a varwidth environment so that it makes sense to estimate how many +% lines it will occupy, and then ensure by insertion of suitable struts +% that the table rows have the needed height. The needed mark-up is done +% by LaTeX writer, which has its own id for the merged cells. +% +% The colour issue is solved by clearing colour panels in all cells, +% whether or not the multirow is single-column or multi-column. +% +% In passing we obtain baseline alignements across rows (only if +% \arraylinestretch is 1, as LaTeX's does not obey \arraylinestretch in "p" +% multi-line contents, only first and last line...) +% +% TODO: examine the situation with \arraylinestretch > 1. The \extrarowheight +% is hopeless for multirow anyhow, it makes baseline alignment strictly +% impossible. +\newcommand\sphinxmultirow[2]{\begingroup + % #1 = nb of spanned rows, #2 = Sphinx id of "cell", #3 = contents + % but let's fetch #3 in a way allowing verbatim contents ! + \def\sphinx@nbofrows{#1}\def\sphinx@cellid{#2}% + \afterassignment\sphinx@multirow\let\next= +}% +\def\sphinx@multirow {% + \setbox\z@\hbox\bgroup\aftergroup\sphinx@@multirow\strut +}% +\def\sphinx@@multirow {% + % The contents, which is a varwidth environment, has been captured in + % \box0 (a \hbox). + % We have with \sphinx@cellid an assigned unique id. The goal is to give + % about the same height to all the involved rows. + % For this Sphinx will insert a \sphinxtablestrut{cell_id} mark-up + % in LaTeX file and the expansion of the latter will do the suitable thing. + \dimen@\dp\z@ + \dimen\tw@\ht\@arstrutbox + \advance\dimen@\dimen\tw@ + \advance\dimen\tw@\dp\@arstrutbox + \count@=\dimen@ % type conversion dim -> int + \count\tw@=\dimen\tw@ + \divide\count@\count\tw@ % TeX division truncates + \advance\dimen@-\count@\dimen\tw@ + % 1300sp is about 0.02pt. For comparison a rule default width is 0.4pt. + % (note that if \count@ holds 0, surely \dimen@>1300sp) + \ifdim\dimen@>1300sp \advance\count@\@ne \fi + % now \count@ holds the count L of needed "lines" + % and \sphinx@nbofrows holds the number N of rows + % we have L >= 1 and N >= 1 + % if L is a multiple of N, ... clear what to do ! + % else write L = qN + r, 1 <= r < N and we will + % arrange for each row to have enough space for: + % q+1 "lines" in each of the first r rows + % q "lines" in each of the (N-r) bottom rows + % for a total of (q+1) * r + q * (N-r) = q * N + r = L + % It is possible that q == 0. + \count\tw@\count@ + % the TeX division truncates + \divide\count\tw@\sphinx@nbofrows\relax + \count4\count\tw@ % q + \multiply\count\tw@\sphinx@nbofrows\relax + \advance\count@-\count\tw@ % r + \expandafter\xdef\csname sphinx@tablestrut_\sphinx@cellid\endcsname + {\noexpand\sphinx@tablestrut{\the\count4}{\the\count@}{\sphinx@cellid}}% + \dp\z@\z@ + % this will use the real height if it is >\ht\@arstrutbox + \sphinxtablestrut{\sphinx@cellid}\box\z@ + \endgroup % group was opened in \sphinxmultirow +}% +\newcommand*\sphinxtablestrut[1]{% + % #1 is a "cell_id", i.e. the id of a merged group of table cells + \csname sphinx@tablestrut_#1\endcsname +}% +% LaTeX typesets the table row by row, hence each execution can do +% an update for the next row. +\newcommand*\sphinx@tablestrut[3]{\begingroup + % #1 = q, #2 = (initially) r, #3 = cell_id, q+1 lines in first r rows + % if #2 = 0, create space for max(q,1) table lines + % if #2 > 0, create space for q+1 lines and decrement #2 + \leavevmode + \count@#1\relax + \ifnum#2=\z@ + \ifnum\count@=\z@\count@\@ne\fi + \else + % next row will be with a #2 decremented by one + \expandafter\xdef\csname sphinx@tablestrut_#3\endcsname + {\noexpand\sphinx@tablestrut{#1}{\the\numexpr#2-\@ne}{#3}}% + \advance\count@\@ne + \fi + \vrule\@height\ht\@arstrutbox + \@depth\dimexpr\count@\ht\@arstrutbox+\count@\dp\@arstrutbox-\ht\@arstrutbox\relax + \@width\z@ + \endgroup + % we need this to avoid colour panels hiding bottom parts of multirow text + \sphinx@hack@CT +}% +\endinput +%% +%% End of file `sphinxmulticell.sty'. diff --git a/Documentation/_build/latex/temporal_cloud.png b/Documentation/_build/latex/temporal_cloud.png new file mode 100644 index 0000000000000000000000000000000000000000..32a60fe0d29ff933f1f48c11e1fdb7e46690261e Binary files /dev/null and b/Documentation/_build/latex/temporal_cloud.png differ diff --git a/Documentation/_sources/API.rst.txt b/Documentation/_sources/API.rst similarity index 91% rename from Documentation/_sources/API.rst.txt rename to Documentation/_sources/API.rst index 9a6269d5c00ca30177ad5755ef721017d927ded5..5721eb4f966c5355014d4e096f6aa12e0327cd40 100644 --- a/Documentation/_sources/API.rst.txt +++ b/Documentation/_sources/API.rst @@ -3,7 +3,7 @@ Graphical User Interface package The class diagram associated to the interface is this : -.. figure:: /images_doc/ChainedeTraitementCarHab_API_UML_v3.png +.. figure:: ../_images/ChainedeTraitementCarHab_API_UML_v3.png :align: center :alt: Class diagram Interface diff --git a/Documentation/_sources/install.rst.txt b/Documentation/_sources/install.rst similarity index 57% rename from Documentation/_sources/install.rst.txt rename to Documentation/_sources/install.rst index 7d0d0b590fd14b59180702f31b5899d57571a9ed..b40ab5bd962fef120816f8ecad316243ff5c6f45 100644 --- a/Documentation/_sources/install.rst.txt +++ b/Documentation/_sources/install.rst @@ -1,6 +1,13 @@ Installation ============ +Téléchargement Phymobat +---------------------------- + +Le programme Phymobat peut être cloné à partir du Gitlab Irstea à l'adresse suivante : https://gitlab.irstea.fr/benjamin.commandre/PHYMOBAT_2018.git + +La branche courante est ``develop`` + Installation SIG open source ---------------------------- @@ -13,11 +20,12 @@ La chaîne de traitement est construite sous divers outils open-source, comme `` $ sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable $ sudo apt-get update -- Installer GDAL et OTB +GDAL +~~~~~~~~~~~~~~ .. code-block:: bash - $ sudo apt-get install gdal-bin otb-bin + $ sudo apt-get install gdal-bin Pour vérifier que GDAL est bien installé, taper : @@ -36,9 +44,31 @@ Il est bien installé, si vous avez l'aide de gdalinfo qui s'affiche (Idem pour FAILURE: No datasource specified. +Orfeo ToolBox (OTB) +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Commencer par installer les dépendances requises avec la commande suivante : + +.. code-block:: bash + + $ sudo aptitude install make cmake-curses-gui build-essential libtool automake git libbz2-dev python-dev libboost-dev libboost-filesystem-dev libboost-serialization-dev libboost-system-dev zlib1g-dev libcurl4-gnutls-dev swig + +Cloner la dernière version d'OTB présente sur le git à l'url : https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb, par exemple : + +.. code-block:: bash + + $ git clone https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb.git + +Suivez les instructions du manuel d'utilisation d'OTB, https://www.orfeo-toolbox.org/packages/OTBSoftwareGuide.pdf, pour compiler en mode "SuperBuild". + +Cloner le module SimpleExtractionTools à l'url: https://gitlab.irstea.fr/benjamin.commandre/SimpleExtractionToolsPhymobat dans le répertoire ``OTB/Module/Remote`` puis compilez et installez-le. + +CURL +~~~~~~~~~~~~~~~~~~ + Vérifier que le package CURL est installé, sur certaines versions de Ubuntu il ne l'est pas : - .. code-block:: bash +.. code-block:: bash $ apt-cache search curl @@ -46,40 +76,23 @@ Vérifier que le package CURL est installé, sur certaines versions de Ubuntu il p curl:i386 - outil en ligne de commande pour transférer des données avec une syntaxe URL p curlftpfs - Système de fichiers pour accéder à des hôtes FTP, basé sur FUSE et cURL -Si il ne l'est pas : +S'il ne l'est pas : - .. code-block:: bash +.. code-block:: bash $ sudo apt-get install curl -Modules python --------------- - -La version de Python utilisée est 2.7. Le code n'a pas encore été testé sur Python 3. Installation des modules python -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-------------------------------------------- -Installer les deux modules Python ``gdal``, ``scikit-learn``, ``Shapely``, ``numpy``, ``lxml`` et ``pyQt4`` depuis le dépôt du système de la façon suivante : +La version de Python utilisée est la 3.6.5 -.. code-block:: bash - - $ sudo apt-Âget install pythonÂ-gdal pythonÂ-sklearn python-shapely python-numpy python-lxml pyqt4-dev-tools - -Pour installer le module Python externes ``rasterstats`` version 0.3.2, il faut dans un premier temps télécharger ``pip`` sur https://pip.pypa.io/en/stable/installing/#install-pip et l'installer en tapant : +Installer les deux modules Python ``gdal``, ``scikit-learn``, ``Shapely``, ``numpy``, ``lxml`` et ``pyQt5`` depuis le dépôt du système de la façon suivante : .. code-block:: bash - $ sudo python get-pip.py - -Ensuite, télécharger le module ``rasterstats`` sur https://pypi.python.org. -Si vous avez téléchargé les **fichiers compréssés (.zip, .tar.gz, ...)**, entrer dans le dossier du module et installer le module avec la commande : - -.. code-block:: bash - - $ sudo python setup.py install - -.. note:: Si vous avez téléchargé les **fichiers compréssés wheel (.whl)**, installer le avec cette commande : sudo pip install xxxxxx-0.00.0-py2-none-any.whl + $ sudo aptitude install pythonÂ3-gdal pythonÂ3-sklearn python3-shapely python3-numpy python3-lxml libqt5 pyqt5-dev-tools Pour vérifier si les modules sont bien installé ou dèjà installé, il suffit de taper dans la console Python (Par exemple pour le module gdal): @@ -95,13 +108,3 @@ Ou >>> from osgeo import gdal ImportError: No module named gdal - - - - - - - - - - diff --git a/Documentation/_sources/methode_tuto.rst.txt b/Documentation/_sources/methode_tuto.rst similarity index 97% rename from Documentation/_sources/methode_tuto.rst.txt rename to Documentation/_sources/methode_tuto.rst index ed884b716907628fa8cb36a5d0cef63ae35e31e5..e95a572753b9bf0cd26d981a866f42bb0fc4185c 100644 --- a/Documentation/_sources/methode_tuto.rst.txt +++ b/Documentation/_sources/methode_tuto.rst @@ -6,7 +6,7 @@ Cette chaîne de traitement répond à un objectif du programme CarHab (Cartogra Pour cela, une méthode de classification orientée-objet selon une approche experte a été developpée. Le détail des étapes pour aboutir aux classifications du fond blanc physionomique est donné selon l’arbre de décision ci-dessous. -.. figure:: /images_doc/arbreDecision_cut.png +.. figure:: ../_images/arbreDecision_cut.png :align: center :alt: Arbre de decision @@ -31,7 +31,7 @@ Le Processus utilisé se décompose en trois parties : - Traitements des échantillons - Traitements de classification -.. figure:: /images_doc/ChaineTraitementCarHab.png +.. figure:: ../_images/ChaineTraitementCarHab.png :align: center :alt: Modèle conceptuel de la chaîne de traitement @@ -48,7 +48,7 @@ Deux types d'images sont utilisés dans cette chaîne de traitement : les orthop A ces images, est joint un raster de détection des nuages, figure ci-dessous b (masque des nuages), utilisé pour sélection les images dans le processus. -.. figure:: /images_doc/spectral_cloud.png +.. figure:: ../_images/spectral_cloud.png :align: center :alt: spectral_cloud @@ -145,7 +145,7 @@ Par défaut, le pourcentage de couverture nuageuse maximum accepté est de 40%. Toutes les mosaïques ayant plus de 60% de pixels clair, passeront par les fonctions :func:`RasterSat_by_date.RasterSat_by_date.calcul_ndvi` (calcul de NDVI), :func:`Toolbox.calc_serie_stats` (calcul de minimum, maximum de ndvi et temporalité nuageuse) et :func:`RasterSat_by_date.RasterSat_by_date.create_raster`. Cette dernière fonction crée cinq rasters : minimum ndvi, maximum ndvi, std ndvi (écart-type), MaxMin ndvi (max ndvi - min ndvi) et un dernier raster qui correspond au nombre d'image utilisé par pixel clair (exemple sur l'image ci-dessous). -.. figure:: /images_doc/temporal_cloud.png +.. figure:: ../_images/temporal_cloud.png :align: center :alt: temporal_cloud @@ -257,7 +257,7 @@ La classification est réalisée sur la segmentation issue de la l'orthophotogra :func:`Segmentation.Segmentation.compute_biomass_density` extrait la distribution de la densité de ligneux et de phytomasse. -.. figure:: /images_doc/phytomasse.png +.. figure:: ../_images/phytomasse.png :align: center :alt: Distribution normale et pourcentage de représentation en fonction de l’écart-type @@ -316,11 +316,11 @@ C'est l'interface par défaut. Elle s'ouverte en tapant dans la console : .. code-block:: bash - $ python PHYMOBAT.py + $ python3 PHYMOBAT.py Elle est présenté sous cette forme : -.. figure:: /images_doc/APIs_0.png +.. figure:: ../_images/APIs_0.png :align: center :alt: APIs @@ -379,7 +379,7 @@ Pour les classes de cultures (Non-naturelles) du RPG qui ne sont pas bien visibl Tous ces éléments sont également enregistrés dans le fichier "Save_test.xml" du dossier "data_test". -.. figure:: /images_doc/APIs_01.png +.. figure:: ../_images/APIs_01.png :align: center :alt: APIs_fill @@ -388,7 +388,7 @@ Interface experte Pour ouvrir l'interface experte : Sur-onglet *Mode > Mode expert* -.. figure:: /images_doc/API_0.png +.. figure:: ../_images/API_0.png :align: center :alt: APIe @@ -413,7 +413,7 @@ Interface du traitement des images Les références en rouge sur les images suivantes sont les mêmes que celles qui ont été présentées sur l'interface simplifiée. -.. figure:: /images_doc/API.png +.. figure:: ../_images/API.png :align: center :alt: APIe_empty @@ -431,7 +431,7 @@ Dans cet onglet il y a cinq traitements qui peuvent être lancés : .. warning:: Avant de lancer un traitement, il faut absolument renseigner toutes les premières lignes d'édition et sélectionner un *capteur*. -.. figure:: /images_doc/API_01.png +.. figure:: ../_images/API_01.png :align: center :alt: APIe_used @@ -442,7 +442,7 @@ Interface du traitement des échantillons .. note:: Même si cet onglet peut être indépendant des autres onglets, il faut malgré tout renseigner l'**emprise de la zone** du premier onglet "Traitement des images". -.. figure:: /images_doc/API_20.png +.. figure:: ../_images/API_20.png :align: center :alt: API 2 @@ -458,7 +458,7 @@ Cette dernière fonction est l'objectif principal de cet onglet. Il faut ajouter **Exemple pour la classe 1**, Végétation non naturelle (cultures) / Semi-naturelle : -.. figure:: /images_doc/API_threshold.png +.. figure:: ../_images/API_threshold.png :align: center :alt: API 2 @@ -466,7 +466,7 @@ L'échantillon est un fichier RPG, il faut cocher la case RPG et entrer le nom d En appuyant sur "Ajouter", une vérification des données entrées peut être éffectuée comme indiqué ci-dessous : -.. figure:: /images_doc/API_threshold_ajout.png +.. figure:: ../_images/API_threshold_ajout.png :align: center :alt: API 2 @@ -474,11 +474,11 @@ En appuyant sur "Ajouter", une vérification des données entrées peut être é Ce fichier n'est pas un fichier RPG, la case RPG reste décoché. -.. figure:: /images_doc/API_threshold_1.png +.. figure:: ../_images/API_threshold_1.png :align: center :alt: API 2 -.. figure:: /images_doc/API_threshold_2.png +.. figure:: ../_images/API_threshold_2.png :align: center :alt: API 2 @@ -489,7 +489,7 @@ Interface du traitement de classification .. note :: Cet onglet est dépendant des deux autres. Au préalable, il faut obligatoirement lancer tous les traitements précédents. -.. figure:: /images_doc/API_class.png +.. figure:: ../_images/API_class.png :align: center :alt: API 2 @@ -505,19 +505,19 @@ Pour activer les niveaux d'extraction, il faut cocher les cases associées. L'ut 26-1 - **Pour extraire que le premier niveau (Seath)** -.. figure:: /images_doc/API_class_10.png +.. figure:: ../_images/API_class_10.png :align: center :alt: API 2 26-2 - **Pour extraire les deux premiers niveaux (Seath)** -.. figure:: /images_doc/API_class_11.png +.. figure:: ../_images/API_class_11.png :align: center :alt: API 2 26-3 - **Pour extraire tous les niveaux (RF et Seath)** -.. figure:: /images_doc/API_class_12.png +.. figure:: ../_images/API_class_12.png :align: center :alt: API 2 diff --git a/Documentation/_sources/package.rst.txt b/Documentation/_sources/package.rst similarity index 93% rename from Documentation/_sources/package.rst.txt rename to Documentation/_sources/package.rst index 4d69a0c75b73dfec7fc43c9b64183e7c4e9e8a4e..ca4d0395acf8925111e67a3453f1bdcc3fcec547 100644 --- a/Documentation/_sources/package.rst.txt +++ b/Documentation/_sources/package.rst @@ -3,7 +3,7 @@ CarHab Phy MOBA package The class diagram associated to the processing is this : -.. figure:: /images_doc/ChainedeTraitementCarHab_UML_v2.png +.. figure:: ../_images/ChainedeTraitementCarHab_UML_v2.png :align: center :alt: Class diagram diff --git a/Documentation/_static/_stemmer.js b/Documentation/_static/_stemmer.js deleted file mode 100644 index 3b3c0607f9a0b3ade140044a7cb081163b15dd41..0000000000000000000000000000000000000000 --- a/Documentation/_static/_stemmer.js +++ /dev/null @@ -1,3667 +0,0 @@ -// generatedy by JSX compiler 0.9.89 (2014-05-20 06:01:03 +0900; 8e8c6105f36f3dfe440ea026a3c93a3444977102) -var JSX = {}; -(function (JSX) { -/** - * extends the class - */ -function $__jsx_extend(derivations, base) { - var ctor = function () {}; - ctor.prototype = base.prototype; - var proto = new ctor(); - for (var i in derivations) { - derivations[i].prototype = proto; - } -} - -/** - * copies the implementations from source interface to target - */ -function $__jsx_merge_interface(target, source) { - for (var k in source.prototype) - if (source.prototype.hasOwnProperty(k)) - target.prototype[k] = source.prototype[k]; -} - -/** - * defers the initialization of the property - */ -function $__jsx_lazy_init(obj, prop, func) { - function reset(obj, prop, value) { - delete obj[prop]; - obj[prop] = value; - return value; - } - - Object.defineProperty(obj, prop, { - get: function () { - return reset(obj, prop, func()); - }, - set: function (v) { - reset(obj, prop, v); - }, - enumerable: true, - configurable: true - }); -} - -var $__jsx_imul = Math.imul; -if (typeof $__jsx_imul === "undefined") { - $__jsx_imul = function (a, b) { - var ah = (a >>> 16) & 0xffff; - var al = a & 0xffff; - var bh = (b >>> 16) & 0xffff; - var bl = b & 0xffff; - return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0); - }; -} - -/** - * fused int-ops with side-effects - */ -function $__jsx_ipadd(o, p, r) { - return o[p] = (o[p] + r) | 0; -} -function $__jsx_ipsub(o, p, r) { - return o[p] = (o[p] - r) | 0; -} -function $__jsx_ipmul(o, p, r) { - return o[p] = $__jsx_imul(o[p], r); -} -function $__jsx_ipdiv(o, p, r) { - return o[p] = (o[p] / r) | 0; -} -function $__jsx_ipmod(o, p, r) { - return o[p] = (o[p] % r) | 0; -} -function $__jsx_ippostinc(o, p) { - var v = o[p]; - o[p] = (v + 1) | 0; - return v; -} -function $__jsx_ippostdec(o, p) { - var v = o[p]; - o[p] = (v - 1) | 0; - return v; -} - -/** - * non-inlined version of Array#each - */ -function $__jsx_forEach(o, f) { - var l = o.length; - for (var i = 0; i < l; ++i) - f(o[i]); -} - -/* - * global functions, renamed to avoid conflict with local variable names - */ -var $__jsx_parseInt = parseInt; -var $__jsx_parseFloat = parseFloat; -function $__jsx_isNaN(n) { return n !== n; } -var $__jsx_isFinite = isFinite; - -var $__jsx_encodeURIComponent = encodeURIComponent; -var $__jsx_decodeURIComponent = decodeURIComponent; -var $__jsx_encodeURI = encodeURI; -var $__jsx_decodeURI = decodeURI; - -var $__jsx_ObjectToString = Object.prototype.toString; -var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty; - -/* - * profiler object, initialized afterwards - */ -function $__jsx_profiler() { -} - -/* - * public interface to JSX code - */ -JSX.require = function (path) { - var m = $__jsx_classMap[path]; - return m !== undefined ? m : null; -}; - -JSX.profilerIsRunning = function () { - return $__jsx_profiler.getResults != null; -}; - -JSX.getProfileResults = function () { - return ($__jsx_profiler.getResults || function () { return {}; })(); -}; - -JSX.postProfileResults = function (url, cb) { - if ($__jsx_profiler.postResults == null) - throw new Error("profiler has not been turned on"); - return $__jsx_profiler.postResults(url, cb); -}; - -JSX.resetProfileResults = function () { - if ($__jsx_profiler.resetResults == null) - throw new Error("profiler has not been turned on"); - return $__jsx_profiler.resetResults(); -}; -JSX.DEBUG = false; -var GeneratorFunction$0 = -(function () { - try { - return Function('import {GeneratorFunction} from "std:iteration"; return GeneratorFunction')(); - } catch (e) { - return function GeneratorFunction () {}; - } -})(); -var __jsx_generator_object$0 = -(function () { - function __jsx_generator_object() { - this.__next = 0; - this.__loop = null; - this.__seed = null; - this.__value = undefined; - this.__status = 0; // SUSPENDED: 0, ACTIVE: 1, DEAD: 2 - } - - __jsx_generator_object.prototype.next = function (seed) { - switch (this.__status) { - case 0: - this.__status = 1; - this.__seed = seed; - - // go next! - this.__loop(this.__next); - - var done = false; - if (this.__next != -1) { - this.__status = 0; - } else { - this.__status = 2; - done = true; - } - return { value: this.__value, done: done }; - case 1: - throw new Error("Generator is already running"); - case 2: - throw new Error("Generator is already finished"); - default: - throw new Error("Unexpected generator internal state"); - } - }; - - return __jsx_generator_object; -}()); -function Among(s, substring_i, result) { - this.s_size = s.length; - this.s = s; - this.substring_i = substring_i; - this.result = result; - this.method = null; - this.instance = null; -}; - -function Among$0(s, substring_i, result, method, instance) { - this.s_size = s.length; - this.s = s; - this.substring_i = substring_i; - this.result = result; - this.method = method; - this.instance = instance; -}; - -$__jsx_extend([Among, Among$0], Object); -function Stemmer() { -}; - -$__jsx_extend([Stemmer], Object); -function BaseStemmer() { - var current$0; - var cursor$0; - var limit$0; - this.cache = ({ }); - current$0 = this.current = ""; - cursor$0 = this.cursor = 0; - limit$0 = this.limit = current$0.length; - this.limit_backward = 0; - this.bra = cursor$0; - this.ket = limit$0; -}; - -$__jsx_extend([BaseStemmer], Stemmer); -BaseStemmer.prototype.setCurrent$S = function (value) { - var current$0; - var cursor$0; - var limit$0; - current$0 = this.current = value; - cursor$0 = this.cursor = 0; - limit$0 = this.limit = current$0.length; - this.limit_backward = 0; - this.bra = cursor$0; - this.ket = limit$0; -}; - - -function BaseStemmer$setCurrent$LBaseStemmer$S($this, value) { - var current$0; - var cursor$0; - var limit$0; - current$0 = $this.current = value; - cursor$0 = $this.cursor = 0; - limit$0 = $this.limit = current$0.length; - $this.limit_backward = 0; - $this.bra = cursor$0; - $this.ket = limit$0; -}; - -BaseStemmer.setCurrent$LBaseStemmer$S = BaseStemmer$setCurrent$LBaseStemmer$S; - -BaseStemmer.prototype.getCurrent$ = function () { - return this.current; -}; - - -function BaseStemmer$getCurrent$LBaseStemmer$($this) { - return $this.current; -}; - -BaseStemmer.getCurrent$LBaseStemmer$ = BaseStemmer$getCurrent$LBaseStemmer$; - -BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) { - this.current = other.current; - this.cursor = other.cursor; - this.limit = other.limit; - this.limit_backward = other.limit_backward; - this.bra = other.bra; - this.ket = other.ket; -}; - - -function BaseStemmer$copy_from$LBaseStemmer$LBaseStemmer$($this, other) { - $this.current = other.current; - $this.cursor = other.cursor; - $this.limit = other.limit; - $this.limit_backward = other.limit_backward; - $this.bra = other.bra; - $this.ket = other.ket; -}; - -BaseStemmer.copy_from$LBaseStemmer$LBaseStemmer$ = BaseStemmer$copy_from$LBaseStemmer$LBaseStemmer$; - -BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) { - var ch; - var $__jsx_postinc_t; - if (this.cursor >= this.limit) { - return false; - } - ch = this.current.charCodeAt(this.cursor); - if (ch > max || ch < min) { - return false; - } - ch -= min; - if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) { - return false; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - return true; -}; - - -function BaseStemmer$in_grouping$LBaseStemmer$AIII($this, s, min, max) { - var ch; - var $__jsx_postinc_t; - if ($this.cursor >= $this.limit) { - return false; - } - ch = $this.current.charCodeAt($this.cursor); - if (ch > max || ch < min) { - return false; - } - ch -= min; - if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) { - return false; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - return true; -}; - -BaseStemmer.in_grouping$LBaseStemmer$AIII = BaseStemmer$in_grouping$LBaseStemmer$AIII; - -BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) { - var ch; - var $__jsx_postinc_t; - if (this.cursor <= this.limit_backward) { - return false; - } - ch = this.current.charCodeAt(this.cursor - 1); - if (ch > max || ch < min) { - return false; - } - ch -= min; - if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) { - return false; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t - 1) | 0, $__jsx_postinc_t); - return true; -}; - - -function BaseStemmer$in_grouping_b$LBaseStemmer$AIII($this, s, min, max) { - var ch; - var $__jsx_postinc_t; - if ($this.cursor <= $this.limit_backward) { - return false; - } - ch = $this.current.charCodeAt($this.cursor - 1); - if (ch > max || ch < min) { - return false; - } - ch -= min; - if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) { - return false; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t - 1) | 0, $__jsx_postinc_t); - return true; -}; - -BaseStemmer.in_grouping_b$LBaseStemmer$AIII = BaseStemmer$in_grouping_b$LBaseStemmer$AIII; - -BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) { - var ch; - var $__jsx_postinc_t; - if (this.cursor >= this.limit) { - return false; - } - ch = this.current.charCodeAt(this.cursor); - if (ch > max || ch < min) { - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - return true; - } - ch -= min; - if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) { - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - return true; - } - return false; -}; - - -function BaseStemmer$out_grouping$LBaseStemmer$AIII($this, s, min, max) { - var ch; - var $__jsx_postinc_t; - if ($this.cursor >= $this.limit) { - return false; - } - ch = $this.current.charCodeAt($this.cursor); - if (ch > max || ch < min) { - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - return true; - } - ch -= min; - if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) { - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - return true; - } - return false; -}; - -BaseStemmer.out_grouping$LBaseStemmer$AIII = BaseStemmer$out_grouping$LBaseStemmer$AIII; - -BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) { - var ch; - var $__jsx_postinc_t; - if (this.cursor <= this.limit_backward) { - return false; - } - ch = this.current.charCodeAt(this.cursor - 1); - if (ch > max || ch < min) { - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t - 1) | 0, $__jsx_postinc_t); - return true; - } - ch -= min; - if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) { - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t - 1) | 0, $__jsx_postinc_t); - return true; - } - return false; -}; - - -function BaseStemmer$out_grouping_b$LBaseStemmer$AIII($this, s, min, max) { - var ch; - var $__jsx_postinc_t; - if ($this.cursor <= $this.limit_backward) { - return false; - } - ch = $this.current.charCodeAt($this.cursor - 1); - if (ch > max || ch < min) { - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t - 1) | 0, $__jsx_postinc_t); - return true; - } - ch -= min; - if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) { - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t - 1) | 0, $__jsx_postinc_t); - return true; - } - return false; -}; - -BaseStemmer.out_grouping_b$LBaseStemmer$AIII = BaseStemmer$out_grouping_b$LBaseStemmer$AIII; - -BaseStemmer.prototype.in_range$II = function (min, max) { - var ch; - var $__jsx_postinc_t; - if (this.cursor >= this.limit) { - return false; - } - ch = this.current.charCodeAt(this.cursor); - if (ch > max || ch < min) { - return false; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - return true; -}; - - -function BaseStemmer$in_range$LBaseStemmer$II($this, min, max) { - var ch; - var $__jsx_postinc_t; - if ($this.cursor >= $this.limit) { - return false; - } - ch = $this.current.charCodeAt($this.cursor); - if (ch > max || ch < min) { - return false; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - return true; -}; - -BaseStemmer.in_range$LBaseStemmer$II = BaseStemmer$in_range$LBaseStemmer$II; - -BaseStemmer.prototype.in_range_b$II = function (min, max) { - var ch; - var $__jsx_postinc_t; - if (this.cursor <= this.limit_backward) { - return false; - } - ch = this.current.charCodeAt(this.cursor - 1); - if (ch > max || ch < min) { - return false; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t - 1) | 0, $__jsx_postinc_t); - return true; -}; - - -function BaseStemmer$in_range_b$LBaseStemmer$II($this, min, max) { - var ch; - var $__jsx_postinc_t; - if ($this.cursor <= $this.limit_backward) { - return false; - } - ch = $this.current.charCodeAt($this.cursor - 1); - if (ch > max || ch < min) { - return false; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t - 1) | 0, $__jsx_postinc_t); - return true; -}; - -BaseStemmer.in_range_b$LBaseStemmer$II = BaseStemmer$in_range_b$LBaseStemmer$II; - -BaseStemmer.prototype.out_range$II = function (min, max) { - var ch; - var $__jsx_postinc_t; - if (this.cursor >= this.limit) { - return false; - } - ch = this.current.charCodeAt(this.cursor); - if (! (ch > max || ch < min)) { - return false; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - return true; -}; - - -function BaseStemmer$out_range$LBaseStemmer$II($this, min, max) { - var ch; - var $__jsx_postinc_t; - if ($this.cursor >= $this.limit) { - return false; - } - ch = $this.current.charCodeAt($this.cursor); - if (! (ch > max || ch < min)) { - return false; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - return true; -}; - -BaseStemmer.out_range$LBaseStemmer$II = BaseStemmer$out_range$LBaseStemmer$II; - -BaseStemmer.prototype.out_range_b$II = function (min, max) { - var ch; - var $__jsx_postinc_t; - if (this.cursor <= this.limit_backward) { - return false; - } - ch = this.current.charCodeAt(this.cursor - 1); - if (! (ch > max || ch < min)) { - return false; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t - 1) | 0, $__jsx_postinc_t); - return true; -}; - - -function BaseStemmer$out_range_b$LBaseStemmer$II($this, min, max) { - var ch; - var $__jsx_postinc_t; - if ($this.cursor <= $this.limit_backward) { - return false; - } - ch = $this.current.charCodeAt($this.cursor - 1); - if (! (ch > max || ch < min)) { - return false; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t - 1) | 0, $__jsx_postinc_t); - return true; -}; - -BaseStemmer.out_range_b$LBaseStemmer$II = BaseStemmer$out_range_b$LBaseStemmer$II; - -BaseStemmer.prototype.eq_s$IS = function (s_size, s) { - var cursor$0; - if (((this.limit - this.cursor) | 0) < s_size) { - return false; - } - if (this.current.slice(cursor$0 = this.cursor, ((cursor$0 + s_size) | 0)) !== s) { - return false; - } - this.cursor = (this.cursor + s_size) | 0; - return true; -}; - - -function BaseStemmer$eq_s$LBaseStemmer$IS($this, s_size, s) { - var cursor$0; - if ((($this.limit - $this.cursor) | 0) < s_size) { - return false; - } - if ($this.current.slice(cursor$0 = $this.cursor, ((cursor$0 + s_size) | 0)) !== s) { - return false; - } - $this.cursor = ($this.cursor + s_size) | 0; - return true; -}; - -BaseStemmer.eq_s$LBaseStemmer$IS = BaseStemmer$eq_s$LBaseStemmer$IS; - -BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) { - var cursor$0; - if (((this.cursor - this.limit_backward) | 0) < s_size) { - return false; - } - if (this.current.slice((((cursor$0 = this.cursor) - s_size) | 0), cursor$0) !== s) { - return false; - } - this.cursor = (this.cursor - s_size) | 0; - return true; -}; - - -function BaseStemmer$eq_s_b$LBaseStemmer$IS($this, s_size, s) { - var cursor$0; - if ((($this.cursor - $this.limit_backward) | 0) < s_size) { - return false; - } - if ($this.current.slice((((cursor$0 = $this.cursor) - s_size) | 0), cursor$0) !== s) { - return false; - } - $this.cursor = ($this.cursor - s_size) | 0; - return true; -}; - -BaseStemmer.eq_s_b$LBaseStemmer$IS = BaseStemmer$eq_s_b$LBaseStemmer$IS; - -BaseStemmer.prototype.eq_v$S = function (s) { - return BaseStemmer$eq_s$LBaseStemmer$IS(this, s.length, s); -}; - - -function BaseStemmer$eq_v$LBaseStemmer$S($this, s) { - return BaseStemmer$eq_s$LBaseStemmer$IS($this, s.length, s); -}; - -BaseStemmer.eq_v$LBaseStemmer$S = BaseStemmer$eq_v$LBaseStemmer$S; - -BaseStemmer.prototype.eq_v_b$S = function (s) { - return BaseStemmer$eq_s_b$LBaseStemmer$IS(this, s.length, s); -}; - - -function BaseStemmer$eq_v_b$LBaseStemmer$S($this, s) { - return BaseStemmer$eq_s_b$LBaseStemmer$IS($this, s.length, s); -}; - -BaseStemmer.eq_v_b$LBaseStemmer$S = BaseStemmer$eq_v_b$LBaseStemmer$S; - -BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) { - var i; - var j; - var c; - var l; - var common_i; - var common_j; - var first_key_inspected; - var k; - var diff; - var common; - var w; - var i2; - var res; - i = 0; - j = v_size; - c = this.cursor; - l = this.limit; - common_i = 0; - common_j = 0; - first_key_inspected = false; - while (true) { - k = i + (j - i >>> 1); - diff = 0; - common = (common_i < common_j ? common_i : common_j); - w = v[k]; - for (i2 = common; i2 < w.s_size; i2++) { - if (c + common === l) { - diff = -1; - break; - } - diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2); - if (diff !== 0) { - break; - } - common++; - } - if (diff < 0) { - j = k; - common_j = common; - } else { - i = k; - common_i = common; - } - if (j - i <= 1) { - if (i > 0) { - break; - } - if (j === i) { - break; - } - if (first_key_inspected) { - break; - } - first_key_inspected = true; - } - } - while (true) { - w = v[i]; - if (common_i >= w.s_size) { - this.cursor = (c + w.s_size | 0); - if (w.method == null) { - return w.result; - } - res = w.method(w.instance); - this.cursor = (c + w.s_size | 0); - if (res) { - return w.result; - } - } - i = w.substring_i; - if (i < 0) { - return 0; - } - } - return -1; -}; - - -function BaseStemmer$find_among$LBaseStemmer$ALAmong$I($this, v, v_size) { - var i; - var j; - var c; - var l; - var common_i; - var common_j; - var first_key_inspected; - var k; - var diff; - var common; - var w; - var i2; - var res; - i = 0; - j = v_size; - c = $this.cursor; - l = $this.limit; - common_i = 0; - common_j = 0; - first_key_inspected = false; - while (true) { - k = i + (j - i >>> 1); - diff = 0; - common = (common_i < common_j ? common_i : common_j); - w = v[k]; - for (i2 = common; i2 < w.s_size; i2++) { - if (c + common === l) { - diff = -1; - break; - } - diff = $this.current.charCodeAt(c + common) - w.s.charCodeAt(i2); - if (diff !== 0) { - break; - } - common++; - } - if (diff < 0) { - j = k; - common_j = common; - } else { - i = k; - common_i = common; - } - if (j - i <= 1) { - if (i > 0) { - break; - } - if (j === i) { - break; - } - if (first_key_inspected) { - break; - } - first_key_inspected = true; - } - } - while (true) { - w = v[i]; - if (common_i >= w.s_size) { - $this.cursor = (c + w.s_size | 0); - if (w.method == null) { - return w.result; - } - res = w.method(w.instance); - $this.cursor = (c + w.s_size | 0); - if (res) { - return w.result; - } - } - i = w.substring_i; - if (i < 0) { - return 0; - } - } - return -1; -}; - -BaseStemmer.find_among$LBaseStemmer$ALAmong$I = BaseStemmer$find_among$LBaseStemmer$ALAmong$I; - -BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) { - var i; - var j; - var c; - var lb; - var common_i; - var common_j; - var first_key_inspected; - var k; - var diff; - var common; - var w; - var i2; - var res; - i = 0; - j = v_size; - c = this.cursor; - lb = this.limit_backward; - common_i = 0; - common_j = 0; - first_key_inspected = false; - while (true) { - k = i + (j - i >> 1); - diff = 0; - common = (common_i < common_j ? common_i : common_j); - w = v[k]; - for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) { - if (c - common === lb) { - diff = -1; - break; - } - diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2); - if (diff !== 0) { - break; - } - common++; - } - if (diff < 0) { - j = k; - common_j = common; - } else { - i = k; - common_i = common; - } - if (j - i <= 1) { - if (i > 0) { - break; - } - if (j === i) { - break; - } - if (first_key_inspected) { - break; - } - first_key_inspected = true; - } - } - while (true) { - w = v[i]; - if (common_i >= w.s_size) { - this.cursor = (c - w.s_size | 0); - if (w.method == null) { - return w.result; - } - res = w.method(this); - this.cursor = (c - w.s_size | 0); - if (res) { - return w.result; - } - } - i = w.substring_i; - if (i < 0) { - return 0; - } - } - return -1; -}; - - -function BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I($this, v, v_size) { - var i; - var j; - var c; - var lb; - var common_i; - var common_j; - var first_key_inspected; - var k; - var diff; - var common; - var w; - var i2; - var res; - i = 0; - j = v_size; - c = $this.cursor; - lb = $this.limit_backward; - common_i = 0; - common_j = 0; - first_key_inspected = false; - while (true) { - k = i + (j - i >> 1); - diff = 0; - common = (common_i < common_j ? common_i : common_j); - w = v[k]; - for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) { - if (c - common === lb) { - diff = -1; - break; - } - diff = $this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2); - if (diff !== 0) { - break; - } - common++; - } - if (diff < 0) { - j = k; - common_j = common; - } else { - i = k; - common_i = common; - } - if (j - i <= 1) { - if (i > 0) { - break; - } - if (j === i) { - break; - } - if (first_key_inspected) { - break; - } - first_key_inspected = true; - } - } - while (true) { - w = v[i]; - if (common_i >= w.s_size) { - $this.cursor = (c - w.s_size | 0); - if (w.method == null) { - return w.result; - } - res = w.method($this); - $this.cursor = (c - w.s_size | 0); - if (res) { - return w.result; - } - } - i = w.substring_i; - if (i < 0) { - return 0; - } - } - return -1; -}; - -BaseStemmer.find_among_b$LBaseStemmer$ALAmong$I = BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I; - -BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) { - var adjustment; - adjustment = ((s.length - (((c_ket - c_bra) | 0))) | 0); - this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket); - this.limit = (this.limit + adjustment) | 0; - if (this.cursor >= c_ket) { - this.cursor = (this.cursor + adjustment) | 0; - } else if (this.cursor > c_bra) { - this.cursor = c_bra; - } - return (adjustment | 0); -}; - - -function BaseStemmer$replace_s$LBaseStemmer$IIS($this, c_bra, c_ket, s) { - var adjustment; - adjustment = ((s.length - (((c_ket - c_bra) | 0))) | 0); - $this.current = $this.current.slice(0, c_bra) + s + $this.current.slice(c_ket); - $this.limit = ($this.limit + adjustment) | 0; - if ($this.cursor >= c_ket) { - $this.cursor = ($this.cursor + adjustment) | 0; - } else if ($this.cursor > c_bra) { - $this.cursor = c_bra; - } - return (adjustment | 0); -}; - -BaseStemmer.replace_s$LBaseStemmer$IIS = BaseStemmer$replace_s$LBaseStemmer$IIS; - -BaseStemmer.prototype.slice_check$ = function () { - var bra$0; - var ket$0; - var limit$0; - return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true); -}; - - -function BaseStemmer$slice_check$LBaseStemmer$($this) { - var bra$0; - var ket$0; - var limit$0; - return ((bra$0 = $this.bra) < 0 || bra$0 > (ket$0 = $this.ket) || ket$0 > (limit$0 = $this.limit) || limit$0 > $this.current.length ? false : true); -}; - -BaseStemmer.slice_check$LBaseStemmer$ = BaseStemmer$slice_check$LBaseStemmer$; - -BaseStemmer.prototype.slice_from$S = function (s) { - var result; - var bra$0; - var ket$0; - var limit$0; - result = false; - if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) { - BaseStemmer$replace_s$LBaseStemmer$IIS(this, this.bra, this.ket, s); - result = true; - } - return result; -}; - - -function BaseStemmer$slice_from$LBaseStemmer$S($this, s) { - var result; - var bra$0; - var ket$0; - var limit$0; - result = false; - if ((bra$0 = $this.bra) < 0 || bra$0 > (ket$0 = $this.ket) || ket$0 > (limit$0 = $this.limit) || limit$0 > $this.current.length ? false : true) { - BaseStemmer$replace_s$LBaseStemmer$IIS($this, $this.bra, $this.ket, s); - result = true; - } - return result; -}; - -BaseStemmer.slice_from$LBaseStemmer$S = BaseStemmer$slice_from$LBaseStemmer$S; - -BaseStemmer.prototype.slice_del$ = function () { - return BaseStemmer$slice_from$LBaseStemmer$S(this, ""); -}; - - -function BaseStemmer$slice_del$LBaseStemmer$($this) { - return BaseStemmer$slice_from$LBaseStemmer$S($this, ""); -}; - -BaseStemmer.slice_del$LBaseStemmer$ = BaseStemmer$slice_del$LBaseStemmer$; - -BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) { - var adjustment; - adjustment = BaseStemmer$replace_s$LBaseStemmer$IIS(this, c_bra, c_ket, s); - if (c_bra <= this.bra) { - this.bra = (this.bra + adjustment) | 0; - } - if (c_bra <= this.ket) { - this.ket = (this.ket + adjustment) | 0; - } -}; - - -function BaseStemmer$insert$LBaseStemmer$IIS($this, c_bra, c_ket, s) { - var adjustment; - adjustment = BaseStemmer$replace_s$LBaseStemmer$IIS($this, c_bra, c_ket, s); - if (c_bra <= $this.bra) { - $this.bra = ($this.bra + adjustment) | 0; - } - if (c_bra <= $this.ket) { - $this.ket = ($this.ket + adjustment) | 0; - } -}; - -BaseStemmer.insert$LBaseStemmer$IIS = BaseStemmer$insert$LBaseStemmer$IIS; - -BaseStemmer.prototype.slice_to$S = function (s) { - var result; - var bra$0; - var ket$0; - var limit$0; - result = ''; - if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) { - result = this.current.slice(this.bra, this.ket); - } - return result; -}; - - -function BaseStemmer$slice_to$LBaseStemmer$S($this, s) { - var result; - var bra$0; - var ket$0; - var limit$0; - result = ''; - if ((bra$0 = $this.bra) < 0 || bra$0 > (ket$0 = $this.ket) || ket$0 > (limit$0 = $this.limit) || limit$0 > $this.current.length ? false : true) { - result = $this.current.slice($this.bra, $this.ket); - } - return result; -}; - -BaseStemmer.slice_to$LBaseStemmer$S = BaseStemmer$slice_to$LBaseStemmer$S; - -BaseStemmer.prototype.assign_to$S = function (s) { - return this.current.slice(0, this.limit); -}; - - -function BaseStemmer$assign_to$LBaseStemmer$S($this, s) { - return $this.current.slice(0, $this.limit); -}; - -BaseStemmer.assign_to$LBaseStemmer$S = BaseStemmer$assign_to$LBaseStemmer$S; - -BaseStemmer.prototype.stem$ = function () { - return false; -}; - - -BaseStemmer.prototype.stemWord$S = function (word) { - var result; - var current$0; - var cursor$0; - var limit$0; - result = this.cache['.' + word]; - if (result == null) { - current$0 = this.current = word; - cursor$0 = this.cursor = 0; - limit$0 = this.limit = current$0.length; - this.limit_backward = 0; - this.bra = cursor$0; - this.ket = limit$0; - this.stem$(); - result = this.current; - this.cache['.' + word] = result; - } - return result; -}; - -BaseStemmer.prototype.stemWord = BaseStemmer.prototype.stemWord$S; - -BaseStemmer.prototype.stemWords$AS = function (words) { - var results; - var i; - var word; - var result; - var current$0; - var cursor$0; - var limit$0; - results = [ ]; - for (i = 0; i < words.length; i++) { - word = words[i]; - result = this.cache['.' + word]; - if (result == null) { - current$0 = this.current = word; - cursor$0 = this.cursor = 0; - limit$0 = this.limit = current$0.length; - this.limit_backward = 0; - this.bra = cursor$0; - this.ket = limit$0; - this.stem$(); - result = this.current; - this.cache['.' + word] = result; - } - results.push(result); - } - return results; -}; - -BaseStemmer.prototype.stemWords = BaseStemmer.prototype.stemWords$AS; - -function FrenchStemmer() { - BaseStemmer.call(this); - this.I_p2 = 0; - this.I_p1 = 0; - this.I_pV = 0; -}; - -$__jsx_extend([FrenchStemmer], BaseStemmer); -FrenchStemmer.prototype.copy_from$LFrenchStemmer$ = function (other) { - this.I_p2 = other.I_p2; - this.I_p1 = other.I_p1; - this.I_pV = other.I_pV; - BaseStemmer$copy_from$LBaseStemmer$LBaseStemmer$(this, other); -}; - -FrenchStemmer.prototype.copy_from = FrenchStemmer.prototype.copy_from$LFrenchStemmer$; - -FrenchStemmer.prototype.r_prelude$ = function () { - var v_1; - var v_2; - var v_3; - var v_4; - var lab1; - var lab3; - var lab4; - var lab5; - var lab6; - var lab7; - var lab8; - var lab9; - var cursor$0; - var $__jsx_postinc_t; -replab0: - while (true) { - v_1 = this.cursor; - lab1 = true; - lab1: - while (lab1 === true) { - lab1 = false; - golab2: - while (true) { - v_2 = this.cursor; - lab3 = true; - lab3: - while (lab3 === true) { - lab3 = false; - lab4 = true; - lab4: - while (lab4 === true) { - lab4 = false; - v_3 = this.cursor; - lab5 = true; - lab5: - while (lab5 === true) { - lab5 = false; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII(this, FrenchStemmer.g_v, 97, 251)) { - break lab5; - } - this.bra = this.cursor; - lab6 = true; - lab6: - while (lab6 === true) { - lab6 = false; - v_4 = this.cursor; - lab7 = true; - lab7: - while (lab7 === true) { - lab7 = false; - if (! BaseStemmer$eq_s$LBaseStemmer$IS(this, 1, "u")) { - break lab7; - } - this.ket = this.cursor; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII(this, FrenchStemmer.g_v, 97, 251)) { - break lab7; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "U")) { - return false; - } - break lab6; - } - this.cursor = v_4; - lab8 = true; - lab8: - while (lab8 === true) { - lab8 = false; - if (! BaseStemmer$eq_s$LBaseStemmer$IS(this, 1, "i")) { - break lab8; - } - this.ket = this.cursor; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII(this, FrenchStemmer.g_v, 97, 251)) { - break lab8; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "I")) { - return false; - } - break lab6; - } - this.cursor = v_4; - if (! BaseStemmer$eq_s$LBaseStemmer$IS(this, 1, "y")) { - break lab5; - } - this.ket = this.cursor; - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "Y")) { - return false; - } - } - break lab4; - } - this.cursor = v_3; - lab9 = true; - lab9: - while (lab9 === true) { - lab9 = false; - this.bra = this.cursor; - if (! BaseStemmer$eq_s$LBaseStemmer$IS(this, 1, "y")) { - break lab9; - } - this.ket = this.cursor; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII(this, FrenchStemmer.g_v, 97, 251)) { - break lab9; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "Y")) { - return false; - } - break lab4; - } - this.cursor = v_3; - if (! BaseStemmer$eq_s$LBaseStemmer$IS(this, 1, "q")) { - break lab3; - } - this.bra = this.cursor; - if (! BaseStemmer$eq_s$LBaseStemmer$IS(this, 1, "u")) { - break lab3; - } - this.ket = this.cursor; - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "U")) { - return false; - } - } - this.cursor = v_2; - break golab2; - } - cursor$0 = this.cursor = v_2; - if (cursor$0 >= this.limit) { - break lab1; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - } - continue replab0; - } - this.cursor = v_1; - break replab0; - } - return true; -}; - -FrenchStemmer.prototype.r_prelude = FrenchStemmer.prototype.r_prelude$; - -function FrenchStemmer$r_prelude$LFrenchStemmer$($this) { - var v_1; - var v_2; - var v_3; - var v_4; - var lab1; - var lab3; - var lab4; - var lab5; - var lab6; - var lab7; - var lab8; - var lab9; - var cursor$0; - var $__jsx_postinc_t; -replab0: - while (true) { - v_1 = $this.cursor; - lab1 = true; - lab1: - while (lab1 === true) { - lab1 = false; - golab2: - while (true) { - v_2 = $this.cursor; - lab3 = true; - lab3: - while (lab3 === true) { - lab3 = false; - lab4 = true; - lab4: - while (lab4 === true) { - lab4 = false; - v_3 = $this.cursor; - lab5 = true; - lab5: - while (lab5 === true) { - lab5 = false; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII($this, FrenchStemmer.g_v, 97, 251)) { - break lab5; - } - $this.bra = $this.cursor; - lab6 = true; - lab6: - while (lab6 === true) { - lab6 = false; - v_4 = $this.cursor; - lab7 = true; - lab7: - while (lab7 === true) { - lab7 = false; - if (! BaseStemmer$eq_s$LBaseStemmer$IS($this, 1, "u")) { - break lab7; - } - $this.ket = $this.cursor; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII($this, FrenchStemmer.g_v, 97, 251)) { - break lab7; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "U")) { - return false; - } - break lab6; - } - $this.cursor = v_4; - lab8 = true; - lab8: - while (lab8 === true) { - lab8 = false; - if (! BaseStemmer$eq_s$LBaseStemmer$IS($this, 1, "i")) { - break lab8; - } - $this.ket = $this.cursor; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII($this, FrenchStemmer.g_v, 97, 251)) { - break lab8; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "I")) { - return false; - } - break lab6; - } - $this.cursor = v_4; - if (! BaseStemmer$eq_s$LBaseStemmer$IS($this, 1, "y")) { - break lab5; - } - $this.ket = $this.cursor; - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "Y")) { - return false; - } - } - break lab4; - } - $this.cursor = v_3; - lab9 = true; - lab9: - while (lab9 === true) { - lab9 = false; - $this.bra = $this.cursor; - if (! BaseStemmer$eq_s$LBaseStemmer$IS($this, 1, "y")) { - break lab9; - } - $this.ket = $this.cursor; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII($this, FrenchStemmer.g_v, 97, 251)) { - break lab9; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "Y")) { - return false; - } - break lab4; - } - $this.cursor = v_3; - if (! BaseStemmer$eq_s$LBaseStemmer$IS($this, 1, "q")) { - break lab3; - } - $this.bra = $this.cursor; - if (! BaseStemmer$eq_s$LBaseStemmer$IS($this, 1, "u")) { - break lab3; - } - $this.ket = $this.cursor; - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "U")) { - return false; - } - } - $this.cursor = v_2; - break golab2; - } - cursor$0 = $this.cursor = v_2; - if (cursor$0 >= $this.limit) { - break lab1; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - } - continue replab0; - } - $this.cursor = v_1; - break replab0; - } - return true; -}; - -FrenchStemmer.r_prelude$LFrenchStemmer$ = FrenchStemmer$r_prelude$LFrenchStemmer$; - -FrenchStemmer.prototype.r_mark_regions$ = function () { - var v_1; - var v_2; - var v_4; - var lab0; - var lab1; - var lab2; - var lab3; - var lab5; - var lab6; - var lab8; - var lab10; - var lab12; - var lab14; - var cursor$0; - var limit$0; - var cursor$1; - var $__jsx_postinc_t; - this.I_pV = limit$0 = this.limit; - this.I_p1 = limit$0; - this.I_p2 = limit$0; - v_1 = this.cursor; - lab0 = true; -lab0: - while (lab0 === true) { - lab0 = false; - lab1 = true; - lab1: - while (lab1 === true) { - lab1 = false; - v_2 = this.cursor; - lab2 = true; - lab2: - while (lab2 === true) { - lab2 = false; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII(this, FrenchStemmer.g_v, 97, 251)) { - break lab2; - } - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII(this, FrenchStemmer.g_v, 97, 251)) { - break lab2; - } - if (this.cursor >= this.limit) { - break lab2; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - break lab1; - } - this.cursor = v_2; - lab3 = true; - lab3: - while (lab3 === true) { - lab3 = false; - if (BaseStemmer$find_among$LBaseStemmer$ALAmong$I(this, FrenchStemmer.a_0, 3) === 0) { - break lab3; - } - break lab1; - } - cursor$0 = this.cursor = v_2; - if (cursor$0 >= this.limit) { - break lab0; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - golab4: - while (true) { - lab5 = true; - lab5: - while (lab5 === true) { - lab5 = false; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII(this, FrenchStemmer.g_v, 97, 251)) { - break lab5; - } - break golab4; - } - if (this.cursor >= this.limit) { - break lab0; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - } - } - this.I_pV = this.cursor; - } - cursor$1 = this.cursor = v_1; - v_4 = cursor$1; - lab6 = true; -lab6: - while (lab6 === true) { - lab6 = false; - golab7: - while (true) { - lab8 = true; - lab8: - while (lab8 === true) { - lab8 = false; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII(this, FrenchStemmer.g_v, 97, 251)) { - break lab8; - } - break golab7; - } - if (this.cursor >= this.limit) { - break lab6; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - } - golab9: - while (true) { - lab10 = true; - lab10: - while (lab10 === true) { - lab10 = false; - if (! BaseStemmer$out_grouping$LBaseStemmer$AIII(this, FrenchStemmer.g_v, 97, 251)) { - break lab10; - } - break golab9; - } - if (this.cursor >= this.limit) { - break lab6; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - } - this.I_p1 = this.cursor; - golab11: - while (true) { - lab12 = true; - lab12: - while (lab12 === true) { - lab12 = false; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII(this, FrenchStemmer.g_v, 97, 251)) { - break lab12; - } - break golab11; - } - if (this.cursor >= this.limit) { - break lab6; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - } - golab13: - while (true) { - lab14 = true; - lab14: - while (lab14 === true) { - lab14 = false; - if (! BaseStemmer$out_grouping$LBaseStemmer$AIII(this, FrenchStemmer.g_v, 97, 251)) { - break lab14; - } - break golab13; - } - if (this.cursor >= this.limit) { - break lab6; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - } - this.I_p2 = this.cursor; - } - this.cursor = v_4; - return true; -}; - -FrenchStemmer.prototype.r_mark_regions = FrenchStemmer.prototype.r_mark_regions$; - -function FrenchStemmer$r_mark_regions$LFrenchStemmer$($this) { - var v_1; - var v_2; - var v_4; - var lab0; - var lab1; - var lab2; - var lab3; - var lab5; - var lab6; - var lab8; - var lab10; - var lab12; - var lab14; - var cursor$0; - var limit$0; - var cursor$1; - var $__jsx_postinc_t; - $this.I_pV = limit$0 = $this.limit; - $this.I_p1 = limit$0; - $this.I_p2 = limit$0; - v_1 = $this.cursor; - lab0 = true; -lab0: - while (lab0 === true) { - lab0 = false; - lab1 = true; - lab1: - while (lab1 === true) { - lab1 = false; - v_2 = $this.cursor; - lab2 = true; - lab2: - while (lab2 === true) { - lab2 = false; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII($this, FrenchStemmer.g_v, 97, 251)) { - break lab2; - } - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII($this, FrenchStemmer.g_v, 97, 251)) { - break lab2; - } - if ($this.cursor >= $this.limit) { - break lab2; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - break lab1; - } - $this.cursor = v_2; - lab3 = true; - lab3: - while (lab3 === true) { - lab3 = false; - if (BaseStemmer$find_among$LBaseStemmer$ALAmong$I($this, FrenchStemmer.a_0, 3) === 0) { - break lab3; - } - break lab1; - } - cursor$0 = $this.cursor = v_2; - if (cursor$0 >= $this.limit) { - break lab0; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - golab4: - while (true) { - lab5 = true; - lab5: - while (lab5 === true) { - lab5 = false; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII($this, FrenchStemmer.g_v, 97, 251)) { - break lab5; - } - break golab4; - } - if ($this.cursor >= $this.limit) { - break lab0; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - } - } - $this.I_pV = $this.cursor; - } - cursor$1 = $this.cursor = v_1; - v_4 = cursor$1; - lab6 = true; -lab6: - while (lab6 === true) { - lab6 = false; - golab7: - while (true) { - lab8 = true; - lab8: - while (lab8 === true) { - lab8 = false; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII($this, FrenchStemmer.g_v, 97, 251)) { - break lab8; - } - break golab7; - } - if ($this.cursor >= $this.limit) { - break lab6; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - } - golab9: - while (true) { - lab10 = true; - lab10: - while (lab10 === true) { - lab10 = false; - if (! BaseStemmer$out_grouping$LBaseStemmer$AIII($this, FrenchStemmer.g_v, 97, 251)) { - break lab10; - } - break golab9; - } - if ($this.cursor >= $this.limit) { - break lab6; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - } - $this.I_p1 = $this.cursor; - golab11: - while (true) { - lab12 = true; - lab12: - while (lab12 === true) { - lab12 = false; - if (! BaseStemmer$in_grouping$LBaseStemmer$AIII($this, FrenchStemmer.g_v, 97, 251)) { - break lab12; - } - break golab11; - } - if ($this.cursor >= $this.limit) { - break lab6; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - } - golab13: - while (true) { - lab14 = true; - lab14: - while (lab14 === true) { - lab14 = false; - if (! BaseStemmer$out_grouping$LBaseStemmer$AIII($this, FrenchStemmer.g_v, 97, 251)) { - break lab14; - } - break golab13; - } - if ($this.cursor >= $this.limit) { - break lab6; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - } - $this.I_p2 = $this.cursor; - } - $this.cursor = v_4; - return true; -}; - -FrenchStemmer.r_mark_regions$LFrenchStemmer$ = FrenchStemmer$r_mark_regions$LFrenchStemmer$; - -FrenchStemmer.prototype.r_postlude$ = function () { - var among_var; - var v_1; - var lab1; - var $__jsx_postinc_t; -replab0: - while (true) { - v_1 = this.cursor; - lab1 = true; - lab1: - while (lab1 === true) { - lab1 = false; - this.bra = this.cursor; - among_var = BaseStemmer$find_among$LBaseStemmer$ALAmong$I(this, FrenchStemmer.a_1, 4); - if (among_var === 0) { - break lab1; - } - this.ket = this.cursor; - switch (among_var) { - case 0: - break lab1; - case 1: - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "i")) { - return false; - } - break; - case 2: - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "u")) { - return false; - } - break; - case 3: - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "y")) { - return false; - } - break; - case 4: - if (this.cursor >= this.limit) { - break lab1; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - break; - } - continue replab0; - } - this.cursor = v_1; - break replab0; - } - return true; -}; - -FrenchStemmer.prototype.r_postlude = FrenchStemmer.prototype.r_postlude$; - -function FrenchStemmer$r_postlude$LFrenchStemmer$($this) { - var among_var; - var v_1; - var lab1; - var $__jsx_postinc_t; -replab0: - while (true) { - v_1 = $this.cursor; - lab1 = true; - lab1: - while (lab1 === true) { - lab1 = false; - $this.bra = $this.cursor; - among_var = BaseStemmer$find_among$LBaseStemmer$ALAmong$I($this, FrenchStemmer.a_1, 4); - if (among_var === 0) { - break lab1; - } - $this.ket = $this.cursor; - switch (among_var) { - case 0: - break lab1; - case 1: - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "i")) { - return false; - } - break; - case 2: - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "u")) { - return false; - } - break; - case 3: - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "y")) { - return false; - } - break; - case 4: - if ($this.cursor >= $this.limit) { - break lab1; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t + 1) | 0, $__jsx_postinc_t); - break; - } - continue replab0; - } - $this.cursor = v_1; - break replab0; - } - return true; -}; - -FrenchStemmer.r_postlude$LFrenchStemmer$ = FrenchStemmer$r_postlude$LFrenchStemmer$; - -FrenchStemmer.prototype.r_RV$ = function () { - return (! (this.I_pV <= this.cursor) ? false : true); -}; - -FrenchStemmer.prototype.r_RV = FrenchStemmer.prototype.r_RV$; - -function FrenchStemmer$r_RV$LFrenchStemmer$($this) { - return (! ($this.I_pV <= $this.cursor) ? false : true); -}; - -FrenchStemmer.r_RV$LFrenchStemmer$ = FrenchStemmer$r_RV$LFrenchStemmer$; - -FrenchStemmer.prototype.r_R1$ = function () { - return (! (this.I_p1 <= this.cursor) ? false : true); -}; - -FrenchStemmer.prototype.r_R1 = FrenchStemmer.prototype.r_R1$; - -function FrenchStemmer$r_R1$LFrenchStemmer$($this) { - return (! ($this.I_p1 <= $this.cursor) ? false : true); -}; - -FrenchStemmer.r_R1$LFrenchStemmer$ = FrenchStemmer$r_R1$LFrenchStemmer$; - -FrenchStemmer.prototype.r_R2$ = function () { - return (! (this.I_p2 <= this.cursor) ? false : true); -}; - -FrenchStemmer.prototype.r_R2 = FrenchStemmer.prototype.r_R2$; - -function FrenchStemmer$r_R2$LFrenchStemmer$($this) { - return (! ($this.I_p2 <= $this.cursor) ? false : true); -}; - -FrenchStemmer.r_R2$LFrenchStemmer$ = FrenchStemmer$r_R2$LFrenchStemmer$; - -FrenchStemmer.prototype.r_standard_suffix$ = function () { - var among_var; - var v_1; - var v_2; - var v_3; - var v_4; - var v_5; - var v_6; - var v_7; - var v_8; - var v_9; - var v_10; - var v_11; - var lab0; - var lab1; - var lab2; - var lab3; - var lab4; - var lab5; - var lab6; - var lab7; - var lab8; - var lab9; - var lab10; - var lab11; - var lab12; - var lab13; - var lab14; - var lab15; - var cursor$0; - var cursor$1; - var cursor$2; - var cursor$3; - this.ket = this.cursor; - among_var = BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I(this, FrenchStemmer.a_4, 43); - if (among_var === 0) { - return false; - } - this.bra = this.cursor; - switch (among_var) { - case 0: - return false; - case 1: - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break; - case 2: - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - v_1 = ((this.limit - this.cursor) | 0); - lab0 = true; - lab0: - while (lab0 === true) { - lab0 = false; - this.ket = this.cursor; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS(this, 2, "ic")) { - this.cursor = ((this.limit - v_1) | 0); - break lab0; - } - this.bra = this.cursor; - lab1 = true; - lab1: - while (lab1 === true) { - lab1 = false; - v_2 = ((this.limit - this.cursor) | 0); - lab2 = true; - lab2: - while (lab2 === true) { - lab2 = false; - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - break lab2; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break lab1; - } - this.cursor = ((this.limit - v_2) | 0); - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "iqU")) { - return false; - } - } - } - break; - case 3: - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "log")) { - return false; - } - break; - case 4: - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "u")) { - return false; - } - break; - case 5: - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "ent")) { - return false; - } - break; - case 6: - if (! (! (this.I_pV <= this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - v_3 = ((this.limit - this.cursor) | 0); - lab3 = true; - lab3: - while (lab3 === true) { - lab3 = false; - this.ket = this.cursor; - among_var = BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I(this, FrenchStemmer.a_2, 6); - if (among_var === 0) { - this.cursor = ((this.limit - v_3) | 0); - break lab3; - } - this.bra = this.cursor; - switch (among_var) { - case 0: - this.cursor = ((this.limit - v_3) | 0); - break lab3; - case 1: - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - this.cursor = ((this.limit - v_3) | 0); - break lab3; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - this.ket = this.cursor; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS(this, 2, "at")) { - this.cursor = ((this.limit - v_3) | 0); - break lab3; - } - this.bra = cursor$0 = this.cursor; - if (! (! (this.I_p2 <= cursor$0) ? false : true)) { - this.cursor = ((this.limit - v_3) | 0); - break lab3; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break; - case 2: - lab4 = true; - lab4: - while (lab4 === true) { - lab4 = false; - v_4 = ((this.limit - this.cursor) | 0); - lab5 = true; - lab5: - while (lab5 === true) { - lab5 = false; - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - break lab5; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break lab4; - } - cursor$1 = this.cursor = ((this.limit - v_4) | 0); - if (! (! (this.I_p1 <= cursor$1) ? false : true)) { - this.cursor = ((this.limit - v_3) | 0); - break lab3; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "eux")) { - return false; - } - } - break; - case 3: - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - this.cursor = ((this.limit - v_3) | 0); - break lab3; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break; - case 4: - if (! (! (this.I_pV <= this.cursor) ? false : true)) { - this.cursor = ((this.limit - v_3) | 0); - break lab3; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "i")) { - return false; - } - break; - } - } - break; - case 7: - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - v_5 = ((this.limit - this.cursor) | 0); - lab6 = true; - lab6: - while (lab6 === true) { - lab6 = false; - this.ket = this.cursor; - among_var = BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I(this, FrenchStemmer.a_3, 3); - if (among_var === 0) { - this.cursor = ((this.limit - v_5) | 0); - break lab6; - } - this.bra = this.cursor; - switch (among_var) { - case 0: - this.cursor = ((this.limit - v_5) | 0); - break lab6; - case 1: - lab7 = true; - lab7: - while (lab7 === true) { - lab7 = false; - v_6 = ((this.limit - this.cursor) | 0); - lab8 = true; - lab8: - while (lab8 === true) { - lab8 = false; - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - break lab8; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break lab7; - } - this.cursor = ((this.limit - v_6) | 0); - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "abl")) { - return false; - } - } - break; - case 2: - lab9 = true; - lab9: - while (lab9 === true) { - lab9 = false; - v_7 = ((this.limit - this.cursor) | 0); - lab10 = true; - lab10: - while (lab10 === true) { - lab10 = false; - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - break lab10; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break lab9; - } - this.cursor = ((this.limit - v_7) | 0); - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "iqU")) { - return false; - } - } - break; - case 3: - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - this.cursor = ((this.limit - v_5) | 0); - break lab6; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break; - } - } - break; - case 8: - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - v_8 = ((this.limit - this.cursor) | 0); - lab11 = true; - lab11: - while (lab11 === true) { - lab11 = false; - this.ket = this.cursor; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS(this, 2, "at")) { - this.cursor = ((this.limit - v_8) | 0); - break lab11; - } - this.bra = cursor$2 = this.cursor; - if (! (! (this.I_p2 <= cursor$2) ? false : true)) { - this.cursor = ((this.limit - v_8) | 0); - break lab11; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - this.ket = this.cursor; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS(this, 2, "ic")) { - this.cursor = ((this.limit - v_8) | 0); - break lab11; - } - this.bra = this.cursor; - lab12 = true; - lab12: - while (lab12 === true) { - lab12 = false; - v_9 = ((this.limit - this.cursor) | 0); - lab13 = true; - lab13: - while (lab13 === true) { - lab13 = false; - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - break lab13; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break lab12; - } - this.cursor = ((this.limit - v_9) | 0); - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "iqU")) { - return false; - } - } - } - break; - case 9: - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "eau")) { - return false; - } - break; - case 10: - if (! (! (this.I_p1 <= this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "al")) { - return false; - } - break; - case 11: - lab14 = true; - lab14: - while (lab14 === true) { - lab14 = false; - v_10 = ((this.limit - this.cursor) | 0); - lab15 = true; - lab15: - while (lab15 === true) { - lab15 = false; - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - break lab15; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break lab14; - } - cursor$3 = this.cursor = ((this.limit - v_10) | 0); - if (! (! (this.I_p1 <= cursor$3) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "eux")) { - return false; - } - } - break; - case 12: - if (! (! (this.I_p1 <= this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$out_grouping_b$LBaseStemmer$AIII(this, FrenchStemmer.g_v, 97, 251)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break; - case 13: - if (! (! (this.I_pV <= this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "ant")) { - return false; - } - return false; - case 14: - if (! (! (this.I_pV <= this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "ent")) { - return false; - } - return false; - case 15: - v_11 = ((this.limit - this.cursor) | 0); - if (! BaseStemmer$in_grouping_b$LBaseStemmer$AIII(this, FrenchStemmer.g_v, 97, 251)) { - return false; - } - if (! (! (this.I_pV <= this.cursor) ? false : true)) { - return false; - } - this.cursor = ((this.limit - v_11) | 0); - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - return false; - } - return true; -}; - -FrenchStemmer.prototype.r_standard_suffix = FrenchStemmer.prototype.r_standard_suffix$; - -function FrenchStemmer$r_standard_suffix$LFrenchStemmer$($this) { - var among_var; - var v_1; - var v_2; - var v_3; - var v_4; - var v_5; - var v_6; - var v_7; - var v_8; - var v_9; - var v_10; - var v_11; - var lab0; - var lab1; - var lab2; - var lab3; - var lab4; - var lab5; - var lab6; - var lab7; - var lab8; - var lab9; - var lab10; - var lab11; - var lab12; - var lab13; - var lab14; - var lab15; - var cursor$0; - var cursor$1; - var cursor$2; - var cursor$3; - $this.ket = $this.cursor; - among_var = BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I($this, FrenchStemmer.a_4, 43); - if (among_var === 0) { - return false; - } - $this.bra = $this.cursor; - switch (among_var) { - case 0: - return false; - case 1: - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break; - case 2: - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - v_1 = (($this.limit - $this.cursor) | 0); - lab0 = true; - lab0: - while (lab0 === true) { - lab0 = false; - $this.ket = $this.cursor; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS($this, 2, "ic")) { - $this.cursor = (($this.limit - v_1) | 0); - break lab0; - } - $this.bra = $this.cursor; - lab1 = true; - lab1: - while (lab1 === true) { - lab1 = false; - v_2 = (($this.limit - $this.cursor) | 0); - lab2 = true; - lab2: - while (lab2 === true) { - lab2 = false; - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - break lab2; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break lab1; - } - $this.cursor = (($this.limit - v_2) | 0); - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "iqU")) { - return false; - } - } - } - break; - case 3: - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "log")) { - return false; - } - break; - case 4: - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "u")) { - return false; - } - break; - case 5: - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "ent")) { - return false; - } - break; - case 6: - if (! (! ($this.I_pV <= $this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - v_3 = (($this.limit - $this.cursor) | 0); - lab3 = true; - lab3: - while (lab3 === true) { - lab3 = false; - $this.ket = $this.cursor; - among_var = BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I($this, FrenchStemmer.a_2, 6); - if (among_var === 0) { - $this.cursor = (($this.limit - v_3) | 0); - break lab3; - } - $this.bra = $this.cursor; - switch (among_var) { - case 0: - $this.cursor = (($this.limit - v_3) | 0); - break lab3; - case 1: - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - $this.cursor = (($this.limit - v_3) | 0); - break lab3; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - $this.ket = $this.cursor; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS($this, 2, "at")) { - $this.cursor = (($this.limit - v_3) | 0); - break lab3; - } - $this.bra = cursor$0 = $this.cursor; - if (! (! ($this.I_p2 <= cursor$0) ? false : true)) { - $this.cursor = (($this.limit - v_3) | 0); - break lab3; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break; - case 2: - lab4 = true; - lab4: - while (lab4 === true) { - lab4 = false; - v_4 = (($this.limit - $this.cursor) | 0); - lab5 = true; - lab5: - while (lab5 === true) { - lab5 = false; - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - break lab5; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break lab4; - } - cursor$1 = $this.cursor = (($this.limit - v_4) | 0); - if (! (! ($this.I_p1 <= cursor$1) ? false : true)) { - $this.cursor = (($this.limit - v_3) | 0); - break lab3; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "eux")) { - return false; - } - } - break; - case 3: - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - $this.cursor = (($this.limit - v_3) | 0); - break lab3; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break; - case 4: - if (! (! ($this.I_pV <= $this.cursor) ? false : true)) { - $this.cursor = (($this.limit - v_3) | 0); - break lab3; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "i")) { - return false; - } - break; - } - } - break; - case 7: - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - v_5 = (($this.limit - $this.cursor) | 0); - lab6 = true; - lab6: - while (lab6 === true) { - lab6 = false; - $this.ket = $this.cursor; - among_var = BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I($this, FrenchStemmer.a_3, 3); - if (among_var === 0) { - $this.cursor = (($this.limit - v_5) | 0); - break lab6; - } - $this.bra = $this.cursor; - switch (among_var) { - case 0: - $this.cursor = (($this.limit - v_5) | 0); - break lab6; - case 1: - lab7 = true; - lab7: - while (lab7 === true) { - lab7 = false; - v_6 = (($this.limit - $this.cursor) | 0); - lab8 = true; - lab8: - while (lab8 === true) { - lab8 = false; - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - break lab8; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break lab7; - } - $this.cursor = (($this.limit - v_6) | 0); - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "abl")) { - return false; - } - } - break; - case 2: - lab9 = true; - lab9: - while (lab9 === true) { - lab9 = false; - v_7 = (($this.limit - $this.cursor) | 0); - lab10 = true; - lab10: - while (lab10 === true) { - lab10 = false; - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - break lab10; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break lab9; - } - $this.cursor = (($this.limit - v_7) | 0); - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "iqU")) { - return false; - } - } - break; - case 3: - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - $this.cursor = (($this.limit - v_5) | 0); - break lab6; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break; - } - } - break; - case 8: - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - v_8 = (($this.limit - $this.cursor) | 0); - lab11 = true; - lab11: - while (lab11 === true) { - lab11 = false; - $this.ket = $this.cursor; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS($this, 2, "at")) { - $this.cursor = (($this.limit - v_8) | 0); - break lab11; - } - $this.bra = cursor$2 = $this.cursor; - if (! (! ($this.I_p2 <= cursor$2) ? false : true)) { - $this.cursor = (($this.limit - v_8) | 0); - break lab11; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - $this.ket = $this.cursor; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS($this, 2, "ic")) { - $this.cursor = (($this.limit - v_8) | 0); - break lab11; - } - $this.bra = $this.cursor; - lab12 = true; - lab12: - while (lab12 === true) { - lab12 = false; - v_9 = (($this.limit - $this.cursor) | 0); - lab13 = true; - lab13: - while (lab13 === true) { - lab13 = false; - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - break lab13; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break lab12; - } - $this.cursor = (($this.limit - v_9) | 0); - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "iqU")) { - return false; - } - } - } - break; - case 9: - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "eau")) { - return false; - } - break; - case 10: - if (! (! ($this.I_p1 <= $this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "al")) { - return false; - } - break; - case 11: - lab14 = true; - lab14: - while (lab14 === true) { - lab14 = false; - v_10 = (($this.limit - $this.cursor) | 0); - lab15 = true; - lab15: - while (lab15 === true) { - lab15 = false; - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - break lab15; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break lab14; - } - cursor$3 = $this.cursor = (($this.limit - v_10) | 0); - if (! (! ($this.I_p1 <= cursor$3) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "eux")) { - return false; - } - } - break; - case 12: - if (! (! ($this.I_p1 <= $this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$out_grouping_b$LBaseStemmer$AIII($this, FrenchStemmer.g_v, 97, 251)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break; - case 13: - if (! (! ($this.I_pV <= $this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "ant")) { - return false; - } - return false; - case 14: - if (! (! ($this.I_pV <= $this.cursor) ? false : true)) { - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "ent")) { - return false; - } - return false; - case 15: - v_11 = (($this.limit - $this.cursor) | 0); - if (! BaseStemmer$in_grouping_b$LBaseStemmer$AIII($this, FrenchStemmer.g_v, 97, 251)) { - return false; - } - if (! (! ($this.I_pV <= $this.cursor) ? false : true)) { - return false; - } - $this.cursor = (($this.limit - v_11) | 0); - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - return false; - } - return true; -}; - -FrenchStemmer.r_standard_suffix$LFrenchStemmer$ = FrenchStemmer$r_standard_suffix$LFrenchStemmer$; - -FrenchStemmer.prototype.r_i_verb_suffix$ = function () { - var among_var; - var v_1; - var v_2; - var cursor$0; - var cursor$1; - var cursor$2; - v_1 = ((this.limit - (cursor$0 = this.cursor)) | 0); - if (cursor$0 < this.I_pV) { - return false; - } - cursor$1 = this.cursor = this.I_pV; - v_2 = this.limit_backward; - this.limit_backward = cursor$1; - cursor$2 = this.cursor = ((this.limit - v_1) | 0); - this.ket = cursor$2; - among_var = BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I(this, FrenchStemmer.a_5, 35); - if (among_var === 0) { - this.limit_backward = v_2; - return false; - } - this.bra = this.cursor; - switch (among_var) { - case 0: - this.limit_backward = v_2; - return false; - case 1: - if (! BaseStemmer$out_grouping_b$LBaseStemmer$AIII(this, FrenchStemmer.g_v, 97, 251)) { - this.limit_backward = v_2; - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break; - } - this.limit_backward = v_2; - return true; -}; - -FrenchStemmer.prototype.r_i_verb_suffix = FrenchStemmer.prototype.r_i_verb_suffix$; - -function FrenchStemmer$r_i_verb_suffix$LFrenchStemmer$($this) { - var among_var; - var v_1; - var v_2; - var cursor$0; - var cursor$1; - var cursor$2; - v_1 = (($this.limit - (cursor$0 = $this.cursor)) | 0); - if (cursor$0 < $this.I_pV) { - return false; - } - cursor$1 = $this.cursor = $this.I_pV; - v_2 = $this.limit_backward; - $this.limit_backward = cursor$1; - cursor$2 = $this.cursor = (($this.limit - v_1) | 0); - $this.ket = cursor$2; - among_var = BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I($this, FrenchStemmer.a_5, 35); - if (among_var === 0) { - $this.limit_backward = v_2; - return false; - } - $this.bra = $this.cursor; - switch (among_var) { - case 0: - $this.limit_backward = v_2; - return false; - case 1: - if (! BaseStemmer$out_grouping_b$LBaseStemmer$AIII($this, FrenchStemmer.g_v, 97, 251)) { - $this.limit_backward = v_2; - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break; - } - $this.limit_backward = v_2; - return true; -}; - -FrenchStemmer.r_i_verb_suffix$LFrenchStemmer$ = FrenchStemmer$r_i_verb_suffix$LFrenchStemmer$; - -FrenchStemmer.prototype.r_verb_suffix$ = function () { - var among_var; - var v_1; - var v_2; - var v_3; - var lab0; - var cursor$0; - var cursor$1; - var cursor$2; - v_1 = ((this.limit - (cursor$0 = this.cursor)) | 0); - if (cursor$0 < this.I_pV) { - return false; - } - cursor$1 = this.cursor = this.I_pV; - v_2 = this.limit_backward; - this.limit_backward = cursor$1; - cursor$2 = this.cursor = ((this.limit - v_1) | 0); - this.ket = cursor$2; - among_var = BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I(this, FrenchStemmer.a_6, 38); - if (among_var === 0) { - this.limit_backward = v_2; - return false; - } - this.bra = this.cursor; - switch (among_var) { - case 0: - this.limit_backward = v_2; - return false; - case 1: - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - this.limit_backward = v_2; - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break; - case 2: - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break; - case 3: - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - v_3 = ((this.limit - this.cursor) | 0); - lab0 = true; - lab0: - while (lab0 === true) { - lab0 = false; - this.ket = this.cursor; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS(this, 1, "e")) { - this.cursor = ((this.limit - v_3) | 0); - break lab0; - } - this.bra = this.cursor; - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - } - break; - } - this.limit_backward = v_2; - return true; -}; - -FrenchStemmer.prototype.r_verb_suffix = FrenchStemmer.prototype.r_verb_suffix$; - -function FrenchStemmer$r_verb_suffix$LFrenchStemmer$($this) { - var among_var; - var v_1; - var v_2; - var v_3; - var lab0; - var cursor$0; - var cursor$1; - var cursor$2; - v_1 = (($this.limit - (cursor$0 = $this.cursor)) | 0); - if (cursor$0 < $this.I_pV) { - return false; - } - cursor$1 = $this.cursor = $this.I_pV; - v_2 = $this.limit_backward; - $this.limit_backward = cursor$1; - cursor$2 = $this.cursor = (($this.limit - v_1) | 0); - $this.ket = cursor$2; - among_var = BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I($this, FrenchStemmer.a_6, 38); - if (among_var === 0) { - $this.limit_backward = v_2; - return false; - } - $this.bra = $this.cursor; - switch (among_var) { - case 0: - $this.limit_backward = v_2; - return false; - case 1: - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - $this.limit_backward = v_2; - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break; - case 2: - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break; - case 3: - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - v_3 = (($this.limit - $this.cursor) | 0); - lab0 = true; - lab0: - while (lab0 === true) { - lab0 = false; - $this.ket = $this.cursor; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS($this, 1, "e")) { - $this.cursor = (($this.limit - v_3) | 0); - break lab0; - } - $this.bra = $this.cursor; - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - } - break; - } - $this.limit_backward = v_2; - return true; -}; - -FrenchStemmer.r_verb_suffix$LFrenchStemmer$ = FrenchStemmer$r_verb_suffix$LFrenchStemmer$; - -FrenchStemmer.prototype.r_residual_suffix$ = function () { - var among_var; - var v_1; - var v_2; - var v_3; - var v_4; - var v_5; - var lab0; - var lab1; - var lab2; - var cursor$0; - var cursor$1; - var cursor$2; - var cursor$3; - v_1 = ((this.limit - this.cursor) | 0); - lab0 = true; -lab0: - while (lab0 === true) { - lab0 = false; - this.ket = this.cursor; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS(this, 1, "s")) { - this.cursor = ((this.limit - v_1) | 0); - break lab0; - } - this.bra = cursor$0 = this.cursor; - v_2 = ((this.limit - cursor$0) | 0); - if (! BaseStemmer$out_grouping_b$LBaseStemmer$AIII(this, FrenchStemmer.g_keep_with_s, 97, 232)) { - this.cursor = ((this.limit - v_1) | 0); - break lab0; - } - this.cursor = ((this.limit - v_2) | 0); - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - } - v_3 = ((this.limit - (cursor$1 = this.cursor)) | 0); - if (cursor$1 < this.I_pV) { - return false; - } - cursor$2 = this.cursor = this.I_pV; - v_4 = this.limit_backward; - this.limit_backward = cursor$2; - cursor$3 = this.cursor = ((this.limit - v_3) | 0); - this.ket = cursor$3; - among_var = BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I(this, FrenchStemmer.a_7, 7); - if (among_var === 0) { - this.limit_backward = v_4; - return false; - } - this.bra = this.cursor; - switch (among_var) { - case 0: - this.limit_backward = v_4; - return false; - case 1: - if (! (! (this.I_p2 <= this.cursor) ? false : true)) { - this.limit_backward = v_4; - return false; - } - lab1 = true; - lab1: - while (lab1 === true) { - lab1 = false; - v_5 = ((this.limit - this.cursor) | 0); - lab2 = true; - lab2: - while (lab2 === true) { - lab2 = false; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS(this, 1, "s")) { - break lab2; - } - break lab1; - } - this.cursor = ((this.limit - v_5) | 0); - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS(this, 1, "t")) { - this.limit_backward = v_4; - return false; - } - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break; - case 2: - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "i")) { - return false; - } - break; - case 3: - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break; - case 4: - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS(this, 2, "gu")) { - this.limit_backward = v_4; - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "")) { - return false; - } - break; - } - this.limit_backward = v_4; - return true; -}; - -FrenchStemmer.prototype.r_residual_suffix = FrenchStemmer.prototype.r_residual_suffix$; - -function FrenchStemmer$r_residual_suffix$LFrenchStemmer$($this) { - var among_var; - var v_1; - var v_2; - var v_3; - var v_4; - var v_5; - var lab0; - var lab1; - var lab2; - var cursor$0; - var cursor$1; - var cursor$2; - var cursor$3; - v_1 = (($this.limit - $this.cursor) | 0); - lab0 = true; -lab0: - while (lab0 === true) { - lab0 = false; - $this.ket = $this.cursor; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS($this, 1, "s")) { - $this.cursor = (($this.limit - v_1) | 0); - break lab0; - } - $this.bra = cursor$0 = $this.cursor; - v_2 = (($this.limit - cursor$0) | 0); - if (! BaseStemmer$out_grouping_b$LBaseStemmer$AIII($this, FrenchStemmer.g_keep_with_s, 97, 232)) { - $this.cursor = (($this.limit - v_1) | 0); - break lab0; - } - $this.cursor = (($this.limit - v_2) | 0); - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - } - v_3 = (($this.limit - (cursor$1 = $this.cursor)) | 0); - if (cursor$1 < $this.I_pV) { - return false; - } - cursor$2 = $this.cursor = $this.I_pV; - v_4 = $this.limit_backward; - $this.limit_backward = cursor$2; - cursor$3 = $this.cursor = (($this.limit - v_3) | 0); - $this.ket = cursor$3; - among_var = BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I($this, FrenchStemmer.a_7, 7); - if (among_var === 0) { - $this.limit_backward = v_4; - return false; - } - $this.bra = $this.cursor; - switch (among_var) { - case 0: - $this.limit_backward = v_4; - return false; - case 1: - if (! (! ($this.I_p2 <= $this.cursor) ? false : true)) { - $this.limit_backward = v_4; - return false; - } - lab1 = true; - lab1: - while (lab1 === true) { - lab1 = false; - v_5 = (($this.limit - $this.cursor) | 0); - lab2 = true; - lab2: - while (lab2 === true) { - lab2 = false; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS($this, 1, "s")) { - break lab2; - } - break lab1; - } - $this.cursor = (($this.limit - v_5) | 0); - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS($this, 1, "t")) { - $this.limit_backward = v_4; - return false; - } - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break; - case 2: - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "i")) { - return false; - } - break; - case 3: - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break; - case 4: - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS($this, 2, "gu")) { - $this.limit_backward = v_4; - return false; - } - if (! BaseStemmer$slice_from$LBaseStemmer$S($this, "")) { - return false; - } - break; - } - $this.limit_backward = v_4; - return true; -}; - -FrenchStemmer.r_residual_suffix$LFrenchStemmer$ = FrenchStemmer$r_residual_suffix$LFrenchStemmer$; - -FrenchStemmer.prototype.r_un_double$ = function () { - var v_1; - var cursor$0; - var $__jsx_postinc_t; - v_1 = ((this.limit - this.cursor) | 0); - if (BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I(this, FrenchStemmer.a_8, 5) === 0) { - return false; - } - cursor$0 = this.cursor = ((this.limit - v_1) | 0); - this.ket = cursor$0; - if (cursor$0 <= this.limit_backward) { - return false; - } - ($__jsx_postinc_t = this.cursor, this.cursor = ($__jsx_postinc_t - 1) | 0, $__jsx_postinc_t); - this.bra = this.cursor; - return (! BaseStemmer$slice_from$LBaseStemmer$S(this, "") ? false : true); -}; - -FrenchStemmer.prototype.r_un_double = FrenchStemmer.prototype.r_un_double$; - -function FrenchStemmer$r_un_double$LFrenchStemmer$($this) { - var v_1; - var cursor$0; - var $__jsx_postinc_t; - v_1 = (($this.limit - $this.cursor) | 0); - if (BaseStemmer$find_among_b$LBaseStemmer$ALAmong$I($this, FrenchStemmer.a_8, 5) === 0) { - return false; - } - cursor$0 = $this.cursor = (($this.limit - v_1) | 0); - $this.ket = cursor$0; - if (cursor$0 <= $this.limit_backward) { - return false; - } - ($__jsx_postinc_t = $this.cursor, $this.cursor = ($__jsx_postinc_t - 1) | 0, $__jsx_postinc_t); - $this.bra = $this.cursor; - return (! BaseStemmer$slice_from$LBaseStemmer$S($this, "") ? false : true); -}; - -FrenchStemmer.r_un_double$LFrenchStemmer$ = FrenchStemmer$r_un_double$LFrenchStemmer$; - -FrenchStemmer.prototype.r_un_accent$ = function () { - var v_3; - var v_1; - var lab1; - var lab2; - var lab3; - v_1 = 1; -replab0: - while (true) { - lab1 = true; - lab1: - while (lab1 === true) { - lab1 = false; - if (! BaseStemmer$out_grouping_b$LBaseStemmer$AIII(this, FrenchStemmer.g_v, 97, 251)) { - break lab1; - } - v_1--; - continue replab0; - } - break replab0; - } - if (v_1 > 0) { - return false; - } - this.ket = this.cursor; - lab2 = true; -lab2: - while (lab2 === true) { - lab2 = false; - v_3 = ((this.limit - this.cursor) | 0); - lab3 = true; - lab3: - while (lab3 === true) { - lab3 = false; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS(this, 1, "\u00E9")) { - break lab3; - } - break lab2; - } - this.cursor = ((this.limit - v_3) | 0); - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS(this, 1, "\u00E8")) { - return false; - } - } - this.bra = this.cursor; - return (! BaseStemmer$slice_from$LBaseStemmer$S(this, "e") ? false : true); -}; - -FrenchStemmer.prototype.r_un_accent = FrenchStemmer.prototype.r_un_accent$; - -function FrenchStemmer$r_un_accent$LFrenchStemmer$($this) { - var v_3; - var v_1; - var lab1; - var lab2; - var lab3; - v_1 = 1; -replab0: - while (true) { - lab1 = true; - lab1: - while (lab1 === true) { - lab1 = false; - if (! BaseStemmer$out_grouping_b$LBaseStemmer$AIII($this, FrenchStemmer.g_v, 97, 251)) { - break lab1; - } - v_1--; - continue replab0; - } - break replab0; - } - if (v_1 > 0) { - return false; - } - $this.ket = $this.cursor; - lab2 = true; -lab2: - while (lab2 === true) { - lab2 = false; - v_3 = (($this.limit - $this.cursor) | 0); - lab3 = true; - lab3: - while (lab3 === true) { - lab3 = false; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS($this, 1, "\u00E9")) { - break lab3; - } - break lab2; - } - $this.cursor = (($this.limit - v_3) | 0); - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS($this, 1, "\u00E8")) { - return false; - } - } - $this.bra = $this.cursor; - return (! BaseStemmer$slice_from$LBaseStemmer$S($this, "e") ? false : true); -}; - -FrenchStemmer.r_un_accent$LFrenchStemmer$ = FrenchStemmer$r_un_accent$LFrenchStemmer$; - -FrenchStemmer.prototype.stem$ = function () { - var v_1; - var v_2; - var v_3; - var v_4; - var v_5; - var v_6; - var v_7; - var v_8; - var v_9; - var v_11; - var lab0; - var lab1; - var lab2; - var lab3; - var lab4; - var lab5; - var lab6; - var lab7; - var lab8; - var lab9; - var lab10; - var lab11; - var lab12; - var lab13; - var cursor$0; - var limit$0; - var cursor$1; - var cursor$2; - var limit$1; - var cursor$3; - var limit$2; - var cursor$4; - var cursor$5; - v_1 = this.cursor; - lab0 = true; -lab0: - while (lab0 === true) { - lab0 = false; - if (! FrenchStemmer$r_prelude$LFrenchStemmer$(this)) { - break lab0; - } - } - cursor$0 = this.cursor = v_1; - v_2 = cursor$0; - lab1 = true; -lab1: - while (lab1 === true) { - lab1 = false; - if (! FrenchStemmer$r_mark_regions$LFrenchStemmer$(this)) { - break lab1; - } - } - cursor$2 = this.cursor = v_2; - this.limit_backward = cursor$2; - cursor$3 = this.cursor = limit$1 = this.limit; - v_3 = ((limit$1 - cursor$3) | 0); - lab2 = true; -lab2: - while (lab2 === true) { - lab2 = false; - lab3 = true; - lab3: - while (lab3 === true) { - lab3 = false; - v_4 = ((this.limit - this.cursor) | 0); - lab4 = true; - lab4: - while (lab4 === true) { - lab4 = false; - v_5 = ((this.limit - this.cursor) | 0); - lab5 = true; - lab5: - while (lab5 === true) { - lab5 = false; - v_6 = ((this.limit - this.cursor) | 0); - lab6 = true; - lab6: - while (lab6 === true) { - lab6 = false; - if (! FrenchStemmer$r_standard_suffix$LFrenchStemmer$(this)) { - break lab6; - } - break lab5; - } - this.cursor = ((this.limit - v_6) | 0); - lab7 = true; - lab7: - while (lab7 === true) { - lab7 = false; - if (! FrenchStemmer$r_i_verb_suffix$LFrenchStemmer$(this)) { - break lab7; - } - break lab5; - } - this.cursor = ((this.limit - v_6) | 0); - if (! FrenchStemmer$r_verb_suffix$LFrenchStemmer$(this)) { - break lab4; - } - } - cursor$1 = this.cursor = (((limit$0 = this.limit) - v_5) | 0); - v_7 = ((limit$0 - cursor$1) | 0); - lab8 = true; - lab8: - while (lab8 === true) { - lab8 = false; - this.ket = this.cursor; - lab9 = true; - lab9: - while (lab9 === true) { - lab9 = false; - v_8 = ((this.limit - this.cursor) | 0); - lab10 = true; - lab10: - while (lab10 === true) { - lab10 = false; - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS(this, 1, "Y")) { - break lab10; - } - this.bra = this.cursor; - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "i")) { - return false; - } - break lab9; - } - this.cursor = ((this.limit - v_8) | 0); - if (! BaseStemmer$eq_s_b$LBaseStemmer$IS(this, 1, "\u00E7")) { - this.cursor = ((this.limit - v_7) | 0); - break lab8; - } - this.bra = this.cursor; - if (! BaseStemmer$slice_from$LBaseStemmer$S(this, "c")) { - return false; - } - } - } - break lab3; - } - this.cursor = ((this.limit - v_4) | 0); - if (! FrenchStemmer$r_residual_suffix$LFrenchStemmer$(this)) { - break lab2; - } - } - } - cursor$4 = this.cursor = (((limit$2 = this.limit) - v_3) | 0); - v_9 = ((limit$2 - cursor$4) | 0); - lab11 = true; -lab11: - while (lab11 === true) { - lab11 = false; - if (! FrenchStemmer$r_un_double$LFrenchStemmer$(this)) { - break lab11; - } - } - this.cursor = ((this.limit - v_9) | 0); - lab12 = true; -lab12: - while (lab12 === true) { - lab12 = false; - if (! FrenchStemmer$r_un_accent$LFrenchStemmer$(this)) { - break lab12; - } - } - cursor$5 = this.cursor = this.limit_backward; - v_11 = cursor$5; - lab13 = true; -lab13: - while (lab13 === true) { - lab13 = false; - if (! FrenchStemmer$r_postlude$LFrenchStemmer$(this)) { - break lab13; - } - } - this.cursor = v_11; - return true; -}; - -FrenchStemmer.prototype.stem = FrenchStemmer.prototype.stem$; - -FrenchStemmer.prototype.equals$X = function (o) { - return o instanceof FrenchStemmer; -}; - -FrenchStemmer.prototype.equals = FrenchStemmer.prototype.equals$X; - -function FrenchStemmer$equals$LFrenchStemmer$X($this, o) { - return o instanceof FrenchStemmer; -}; - -FrenchStemmer.equals$LFrenchStemmer$X = FrenchStemmer$equals$LFrenchStemmer$X; - -FrenchStemmer.prototype.hashCode$ = function () { - var classname; - var hash; - var i; - var char; - classname = "FrenchStemmer"; - hash = 0; - for (i = 0; i < classname.length; i++) { - char = classname.charCodeAt(i); - hash = (hash << 5) - hash + char; - hash = hash & hash; - } - return (hash | 0); -}; - -FrenchStemmer.prototype.hashCode = FrenchStemmer.prototype.hashCode$; - -function FrenchStemmer$hashCode$LFrenchStemmer$($this) { - var classname; - var hash; - var i; - var char; - classname = "FrenchStemmer"; - hash = 0; - for (i = 0; i < classname.length; i++) { - char = classname.charCodeAt(i); - hash = (hash << 5) - hash + char; - hash = hash & hash; - } - return (hash | 0); -}; - -FrenchStemmer.hashCode$LFrenchStemmer$ = FrenchStemmer$hashCode$LFrenchStemmer$; - -FrenchStemmer.serialVersionUID = 1; -$__jsx_lazy_init(FrenchStemmer, "methodObject", function () { - return new FrenchStemmer(); -}); -$__jsx_lazy_init(FrenchStemmer, "a_0", function () { - return [ new Among("col", -1, -1), new Among("par", -1, -1), new Among("tap", -1, -1) ]; -}); -$__jsx_lazy_init(FrenchStemmer, "a_1", function () { - return [ new Among("", -1, 4), new Among("I", 0, 1), new Among("U", 0, 2), new Among("Y", 0, 3) ]; -}); -$__jsx_lazy_init(FrenchStemmer, "a_2", function () { - return [ new Among("iqU", -1, 3), new Among("abl", -1, 3), new Among("I\u00E8r", -1, 4), new Among("i\u00E8r", -1, 4), new Among("eus", -1, 2), new Among("iv", -1, 1) ]; -}); -$__jsx_lazy_init(FrenchStemmer, "a_3", function () { - return [ new Among("ic", -1, 2), new Among("abil", -1, 1), new Among("iv", -1, 3) ]; -}); -$__jsx_lazy_init(FrenchStemmer, "a_4", function () { - return [ new Among("iqUe", -1, 1), new Among("atrice", -1, 2), new Among("ance", -1, 1), new Among("ence", -1, 5), new Among("logie", -1, 3), new Among("able", -1, 1), new Among("isme", -1, 1), new Among("euse", -1, 11), new Among("iste", -1, 1), new Among("ive", -1, 8), new Among("if", -1, 8), new Among("usion", -1, 4), new Among("ation", -1, 2), new Among("ution", -1, 4), new Among("ateur", -1, 2), new Among("iqUes", -1, 1), new Among("atrices", -1, 2), new Among("ances", -1, 1), new Among("ences", -1, 5), new Among("logies", -1, 3), new Among("ables", -1, 1), new Among("ismes", -1, 1), new Among("euses", -1, 11), new Among("istes", -1, 1), new Among("ives", -1, 8), new Among("ifs", -1, 8), new Among("usions", -1, 4), new Among("ations", -1, 2), new Among("utions", -1, 4), new Among("ateurs", -1, 2), new Among("ments", -1, 15), new Among("ements", 30, 6), new Among("issements", 31, 12), new Among("it\u00E9s", -1, 7), new Among("ment", -1, 15), new Among("ement", 34, 6), new Among("issement", 35, 12), new Among("amment", 34, 13), new Among("emment", 34, 14), new Among("aux", -1, 10), new Among("eaux", 39, 9), new Among("eux", -1, 1), new Among("it\u00E9", -1, 7) ]; -}); -$__jsx_lazy_init(FrenchStemmer, "a_5", function () { - return [ new Among("ira", -1, 1), new Among("ie", -1, 1), new Among("isse", -1, 1), new Among("issante", -1, 1), new Among("i", -1, 1), new Among("irai", 4, 1), new Among("ir", -1, 1), new Among("iras", -1, 1), new Among("ies", -1, 1), new Among("\u00EEmes", -1, 1), new Among("isses", -1, 1), new Among("issantes", -1, 1), new Among("\u00EEtes", -1, 1), new Among("is", -1, 1), new Among("irais", 13, 1), new Among("issais", 13, 1), new Among("irions", -1, 1), new Among("issions", -1, 1), new Among("irons", -1, 1), new Among("issons", -1, 1), new Among("issants", -1, 1), new Among("it", -1, 1), new Among("irait", 21, 1), new Among("issait", 21, 1), new Among("issant", -1, 1), new Among("iraIent", -1, 1), new Among("issaIent", -1, 1), new Among("irent", -1, 1), new Among("issent", -1, 1), new Among("iront", -1, 1), new Among("\u00EEt", -1, 1), new Among("iriez", -1, 1), new Among("issiez", -1, 1), new Among("irez", -1, 1), new Among("issez", -1, 1) ]; -}); -$__jsx_lazy_init(FrenchStemmer, "a_6", function () { - return [ new Among("a", -1, 3), new Among("era", 0, 2), new Among("asse", -1, 3), new Among("ante", -1, 3), new Among("\u00E9e", -1, 2), new Among("ai", -1, 3), new Among("erai", 5, 2), new Among("er", -1, 2), new Among("as", -1, 3), new Among("eras", 8, 2), new Among("\u00E2mes", -1, 3), new Among("asses", -1, 3), new Among("antes", -1, 3), new Among("\u00E2tes", -1, 3), new Among("\u00E9es", -1, 2), new Among("ais", -1, 3), new Among("erais", 15, 2), new Among("ions", -1, 1), new Among("erions", 17, 2), new Among("assions", 17, 3), new Among("erons", -1, 2), new Among("ants", -1, 3), new Among("\u00E9s", -1, 2), new Among("ait", -1, 3), new Among("erait", 23, 2), new Among("ant", -1, 3), new Among("aIent", -1, 3), new Among("eraIent", 26, 2), new Among("\u00E8rent", -1, 2), new Among("assent", -1, 3), new Among("eront", -1, 2), new Among("\u00E2t", -1, 3), new Among("ez", -1, 2), new Among("iez", 32, 2), new Among("eriez", 33, 2), new Among("assiez", 33, 3), new Among("erez", 32, 2), new Among("\u00E9", -1, 2) ]; -}); -$__jsx_lazy_init(FrenchStemmer, "a_7", function () { - return [ new Among("e", -1, 3), new Among("I\u00E8re", 0, 2), new Among("i\u00E8re", 0, 2), new Among("ion", -1, 1), new Among("Ier", -1, 2), new Among("ier", -1, 2), new Among("\u00EB", -1, 4) ]; -}); -$__jsx_lazy_init(FrenchStemmer, "a_8", function () { - return [ new Among("ell", -1, -1), new Among("eill", -1, -1), new Among("enn", -1, -1), new Among("onn", -1, -1), new Among("ett", -1, -1) ]; -}); -FrenchStemmer.g_v = [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 130, 103, 8, 5 ]; -FrenchStemmer.g_keep_with_s = [ 1, 65, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 ]; - -var $__jsx_classMap = { - "src/among.jsx": { - Among: Among, - Among$SII: Among, - Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$0 - }, - "src/stemmer.jsx": { - Stemmer: Stemmer, - Stemmer$: Stemmer - }, - "src/base-stemmer.jsx": { - BaseStemmer: BaseStemmer, - BaseStemmer$: BaseStemmer - }, - "src/french-stemmer.jsx": { - FrenchStemmer: FrenchStemmer, - FrenchStemmer$: FrenchStemmer - } -}; - - -})(JSX); - -var Among = JSX.require("src/among.jsx").Among; -var Among$SII = JSX.require("src/among.jsx").Among$SII; -var Stemmer = JSX.require("src/stemmer.jsx").Stemmer; -var BaseStemmer = JSX.require("src/base-stemmer.jsx").BaseStemmer; -var FrenchStemmer = JSX.require("src/french-stemmer.jsx").FrenchStemmer; diff --git a/Documentation/_static/ajax-loader.gif b/Documentation/_static/ajax-loader.gif deleted file mode 100644 index 61faf8cab23993bd3e1560bff0668bd628642330..0000000000000000000000000000000000000000 Binary files a/Documentation/_static/ajax-loader.gif and /dev/null differ diff --git a/Documentation/_static/alabaster.css b/Documentation/_static/alabaster.css deleted file mode 100644 index be65b13746c7033a612b3de3c75c6750f5479134..0000000000000000000000000000000000000000 --- a/Documentation/_static/alabaster.css +++ /dev/null @@ -1,693 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif; - font-size: 17px; - background-color: #fff; - color: #000; - margin: 0; - padding: 0; -} - - -div.document { - width: 940px; - margin: 30px auto 0 auto; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 220px; -} - -div.sphinxsidebar { - width: 220px; - font-size: 14px; - line-height: 1.5; -} - -hr { - border: 1px solid #B1B4B6; -} - -div.body { - background-color: #fff; - color: #3E4349; - padding: 0 30px 0 30px; -} - -div.body > .section { - text-align: left; -} - -div.footer { - width: 940px; - margin: 20px auto 30px auto; - font-size: 14px; - color: #888; - text-align: right; -} - -div.footer a { - color: #888; -} - -p.caption { - font-family: inherit; - font-size: inherit; -} - - -div.relations { - display: none; -} - - -div.sphinxsidebar a { - color: #444; - text-decoration: none; - border-bottom: 1px dotted #999; -} - -div.sphinxsidebar a:hover { - border-bottom: 1px solid #999; -} - -div.sphinxsidebarwrapper { - padding: 18px 10px; -} - -div.sphinxsidebarwrapper p.logo { - padding: 0; - margin: -10px 0 0 0px; - text-align: center; -} - -div.sphinxsidebarwrapper h1.logo { - margin-top: -10px; - text-align: center; - margin-bottom: 5px; - text-align: left; -} - -div.sphinxsidebarwrapper h1.logo-name { - margin-top: 0px; -} - -div.sphinxsidebarwrapper p.blurb { - margin-top: 0; - font-style: normal; -} - -div.sphinxsidebar h3, -div.sphinxsidebar h4 { - font-family: 'Garamond', 'Georgia', serif; - color: #444; - font-size: 24px; - font-weight: normal; - margin: 0 0 5px 0; - padding: 0; -} - -div.sphinxsidebar h4 { - font-size: 20px; -} - -div.sphinxsidebar h3 a { - color: #444; -} - -div.sphinxsidebar p.logo a, -div.sphinxsidebar h3 a, -div.sphinxsidebar p.logo a:hover, -div.sphinxsidebar h3 a:hover { - border: none; -} - -div.sphinxsidebar p { - color: #555; - margin: 10px 0; -} - -div.sphinxsidebar ul { - margin: 10px 0; - padding: 0; - color: #000; -} - -div.sphinxsidebar ul li.toctree-l1 > a { - font-size: 120%; -} - -div.sphinxsidebar ul li.toctree-l2 > a { - font-size: 110%; -} - -div.sphinxsidebar input { - border: 1px solid #CCC; - font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif; - font-size: 1em; -} - -div.sphinxsidebar hr { - border: none; - height: 1px; - color: #AAA; - background: #AAA; - - text-align: left; - margin-left: 0; - width: 50%; -} - -/* -- body styles ----------------------------------------------------------- */ - -a { - color: #004B6B; - text-decoration: underline; -} - -a:hover { - color: #6D4100; - text-decoration: underline; -} - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - margin: 30px 0px 10px 0px; - padding: 0; -} - -div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } -div.body h2 { font-size: 180%; } -div.body h3 { font-size: 150%; } -div.body h4 { font-size: 130%; } -div.body h5 { font-size: 100%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #DDD; - padding: 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - color: #444; - background: #EAEAEA; -} - -div.body p, div.body dd, div.body li { - line-height: 1.4em; -} - -div.admonition { - margin: 20px 0px; - padding: 10px 30px; - background-color: #EEE; - border: 1px solid #CCC; -} - -div.admonition tt.xref, div.admonition code.xref, div.admonition a tt { - background-color: #FBFBFB; - border-bottom: 1px solid #fafafa; -} - -div.admonition p.admonition-title { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - font-size: 24px; - margin: 0 0 10px 0; - padding: 0; - line-height: 1; -} - -div.admonition p.last { - margin-bottom: 0; -} - -div.highlight { - background-color: #fff; -} - -dt:target, .highlight { - background: #FAF3E8; -} - -div.warning { - background-color: #FCC; - border: 1px solid #FAA; -} - -div.danger { - background-color: #FCC; - border: 1px solid #FAA; - -moz-box-shadow: 2px 2px 4px #D52C2C; - -webkit-box-shadow: 2px 2px 4px #D52C2C; - box-shadow: 2px 2px 4px #D52C2C; -} - -div.error { - background-color: #FCC; - border: 1px solid #FAA; - -moz-box-shadow: 2px 2px 4px #D52C2C; - -webkit-box-shadow: 2px 2px 4px #D52C2C; - box-shadow: 2px 2px 4px #D52C2C; -} - -div.caution { - background-color: #FCC; - border: 1px solid #FAA; -} - -div.attention { - background-color: #FCC; - border: 1px solid #FAA; -} - -div.important { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.note { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.tip { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.hint { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.seealso { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.topic { - background-color: #EEE; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre, tt, code { - font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; - font-size: 0.9em; -} - -.hll { - background-color: #FFC; - margin: 0 -12px; - padding: 0 12px; - display: block; -} - -img.screenshot { -} - -tt.descname, tt.descclassname, code.descname, code.descclassname { - font-size: 0.95em; -} - -tt.descname, code.descname { - padding-right: 0.08em; -} - -img.screenshot { - -moz-box-shadow: 2px 2px 4px #EEE; - -webkit-box-shadow: 2px 2px 4px #EEE; - box-shadow: 2px 2px 4px #EEE; -} - -table.docutils { - border: 1px solid #888; - -moz-box-shadow: 2px 2px 4px #EEE; - -webkit-box-shadow: 2px 2px 4px #EEE; - box-shadow: 2px 2px 4px #EEE; -} - -table.docutils td, table.docutils th { - border: 1px solid #888; - padding: 0.25em 0.7em; -} - -table.field-list, table.footnote { - border: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} - -table.footnote { - margin: 15px 0; - width: 100%; - border: 1px solid #EEE; - background: #FDFDFD; - font-size: 0.9em; -} - -table.footnote + table.footnote { - margin-top: -15px; - border-top: none; -} - -table.field-list th { - padding: 0 0.8em 0 0; -} - -table.field-list td { - padding: 0; -} - -table.field-list p { - margin-bottom: 0.8em; -} - -/* Cloned from - * https://github.com/sphinx-doc/sphinx/commit/ef60dbfce09286b20b7385333d63a60321784e68 - */ -.field-name { - -moz-hyphens: manual; - -ms-hyphens: manual; - -webkit-hyphens: manual; - hyphens: manual; -} - -table.footnote td.label { - width: .1px; - padding: 0.3em 0 0.3em 0.5em; -} - -table.footnote td { - padding: 0.3em 0.5em; -} - -dl { - margin: 0; - padding: 0; -} - -dl dd { - margin-left: 30px; -} - -blockquote { - margin: 0 0 0 30px; - padding: 0; -} - -ul, ol { - /* Matches the 30px from the narrow-screen "li > ul" selector below */ - margin: 10px 0 10px 30px; - padding: 0; -} - -pre { - background: #EEE; - padding: 7px 30px; - margin: 15px 0px; - line-height: 1.3em; -} - -div.viewcode-block:target { - background: #ffd; -} - -dl pre, blockquote pre, li pre { - margin-left: 0; - padding-left: 30px; -} - -tt, code { - background-color: #ecf0f3; - color: #222; - /* padding: 1px 2px; */ -} - -tt.xref, code.xref, a tt { - background-color: #FBFBFB; - border-bottom: 1px solid #fff; -} - -a.reference { - text-decoration: none; - border-bottom: 1px dotted #004B6B; -} - -/* Don't put an underline on images */ -a.image-reference, a.image-reference:hover { - border-bottom: none; -} - -a.reference:hover { - border-bottom: 1px solid #6D4100; -} - -a.footnote-reference { - text-decoration: none; - font-size: 0.7em; - vertical-align: top; - border-bottom: 1px dotted #004B6B; -} - -a.footnote-reference:hover { - border-bottom: 1px solid #6D4100; -} - -a:hover tt, a:hover code { - background: #EEE; -} - - -@media screen and (max-width: 870px) { - - div.sphinxsidebar { - display: none; - } - - div.document { - width: 100%; - - } - - div.documentwrapper { - margin-left: 0; - margin-top: 0; - margin-right: 0; - margin-bottom: 0; - } - - div.bodywrapper { - margin-top: 0; - margin-right: 0; - margin-bottom: 0; - margin-left: 0; - } - - ul { - margin-left: 0; - } - - li > ul { - /* Matches the 30px from the "ul, ol" selector above */ - margin-left: 30px; - } - - .document { - width: auto; - } - - .footer { - width: auto; - } - - .bodywrapper { - margin: 0; - } - - .footer { - width: auto; - } - - .github { - display: none; - } - - - -} - - - -@media screen and (max-width: 875px) { - - body { - margin: 0; - padding: 20px 30px; - } - - div.documentwrapper { - float: none; - background: #fff; - } - - div.sphinxsidebar { - display: block; - float: none; - width: 102.5%; - margin: 50px -30px -20px -30px; - padding: 10px 20px; - background: #333; - color: #FFF; - } - - div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, - div.sphinxsidebar h3 a { - color: #fff; - } - - div.sphinxsidebar a { - color: #AAA; - } - - div.sphinxsidebar p.logo { - display: none; - } - - div.document { - width: 100%; - margin: 0; - } - - div.footer { - display: none; - } - - div.bodywrapper { - margin: 0; - } - - div.body { - min-height: 0; - padding: 0; - } - - .rtd_doc_footer { - display: none; - } - - .document { - width: auto; - } - - .footer { - width: auto; - } - - .footer { - width: auto; - } - - .github { - display: none; - } -} - - -/* misc. */ - -.revsys-inline { - display: none!important; -} - -/* Make nested-list/multi-paragraph items look better in Releases changelog - * pages. Without this, docutils' magical list fuckery causes inconsistent - * formatting between different release sub-lists. - */ -div#changelog > div.section > ul > li > p:only-child { - margin-bottom: 0; -} - -/* Hide fugly table cell borders in ..bibliography:: directive output */ -table.docutils.citation, table.docutils.citation td, table.docutils.citation th { - border: none; - /* Below needed in some edge cases; if not applied, bottom shadows appear */ - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} \ No newline at end of file diff --git a/Documentation/_static/basic.css b/Documentation/_static/basic.css deleted file mode 100644 index 7ed0e58edb31c235c086d98790de21cabd63f3ec..0000000000000000000000000000000000000000 --- a/Documentation/_static/basic.css +++ /dev/null @@ -1,632 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; - word-wrap: break-word; - overflow-wrap : break-word; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox input[type="text"] { - width: 170px; -} - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; - margin-left: auto; - margin-right: auto; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable ul { - margin-top: 0; - margin-bottom: 0; - list-style-type: none; -} - -table.indextable > tbody > tr > td > ul { - padding-left: 0em; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- domain module index --------------------------------------------------- */ - -table.modindextable td { - padding: 2px; - border-collapse: collapse; -} - -/* -- general body styles --------------------------------------------------- */ - -div.body p, div.body dd, div.body li, div.body blockquote { - -moz-hyphens: auto; - -ms-hyphens: auto; - -webkit-hyphens: auto; - hyphens: auto; -} - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink, -caption:hover > a.headerlink, -p.caption:hover > a.headerlink, -div.code-block-caption:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table caption span.caption-number { - font-style: italic; -} - -table caption span.caption-text { -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -/* -- figures --------------------------------------------------------------- */ - -div.figure { - margin: 0.5em; - padding: 0.5em; -} - -div.figure p.caption { - padding: 0.3em; -} - -div.figure p.caption span.caption-number { - font-style: italic; -} - -div.figure p.caption span.caption-text { -} - -/* -- field list styles ----------------------------------------------------- */ - -table.field-list td, table.field-list th { - border: 0 !important; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -dl { - margin-bottom: 15px; -} - -dd p { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, .highlighted { - background-color: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -span.pre { - -moz-hyphens: none; - -ms-hyphens: none; - -webkit-hyphens: none; - hyphens: none; -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -div.code-block-caption { - padding: 2px 5px; - font-size: small; -} - -div.code-block-caption code { - background-color: transparent; -} - -div.code-block-caption + div > div.highlight > pre { - margin-top: 0; -} - -div.code-block-caption span.caption-number { - padding: 0.1em 0.3em; - font-style: italic; -} - -div.code-block-caption span.caption-text { -} - -div.literal-block-wrapper { - padding: 1em 1em 0; -} - -div.literal-block-wrapper div.highlight { - margin: 0; -} - -code.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -code.descclassname { - background-color: transparent; -} - -code.xref, a code { - background-color: transparent; - font-weight: bold; -} - -h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -span.eqno a.headerlink { - position: relative; - left: 0px; - z-index: 1; -} - -div.math:hover a.headerlink { - visibility: visible; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/Documentation/_static/classic.css b/Documentation/_static/classic.css deleted file mode 100644 index 20db95e22ef2dfd0f02a85f75b658ccdf3f37a71..0000000000000000000000000000000000000000 --- a/Documentation/_static/classic.css +++ /dev/null @@ -1,261 +0,0 @@ -/* - * classic.css_t - * ~~~~~~~~~~~~~ - * - * Sphinx stylesheet -- classic theme. - * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: sans-serif; - font-size: 100%; - background-color: #11303d; - color: #000; - margin: 0; - padding: 0; -} - -div.document { - background-color: #1c4e63; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 230px; -} - -div.body { - background-color: #ffffff; - color: #000000; - padding: 0 20px 30px 20px; -} - -div.footer { - color: #ffffff; - width: 100%; - padding: 9px 0 9px 0; - text-align: center; - font-size: 75%; -} - -div.footer a { - color: #ffffff; - text-decoration: underline; -} - -div.related { - background-color: #133f52; - line-height: 30px; - color: #ffffff; -} - -div.related a { - color: #ffffff; -} - -div.sphinxsidebar { -} - -div.sphinxsidebar h3 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.4em; - font-weight: normal; - margin: 0; - padding: 0; -} - -div.sphinxsidebar h3 a { - color: #ffffff; -} - -div.sphinxsidebar h4 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.3em; - font-weight: normal; - margin: 5px 0 0 0; - padding: 0; -} - -div.sphinxsidebar p { - color: #ffffff; -} - -div.sphinxsidebar p.topless { - margin: 5px 10px 10px 10px; -} - -div.sphinxsidebar ul { - margin: 10px; - padding: 0; - color: #ffffff; -} - -div.sphinxsidebar a { - color: #98dbcc; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - - - -/* -- hyperlink styles ------------------------------------------------------ */ - -a { - color: #355f7c; - text-decoration: none; -} - -a:visited { - color: #355f7c; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - - - -/* -- body styles ----------------------------------------------------------- */ - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Trebuchet MS', sans-serif; - background-color: #f2f2f2; - font-weight: normal; - color: #20435c; - border-bottom: 1px solid #ccc; - margin: 20px -20px 10px -20px; - padding: 3px 0 3px 10px; -} - -div.body h1 { margin-top: 0; font-size: 200%; } -div.body h2 { font-size: 160%; } -div.body h3 { font-size: 140%; } -div.body h4 { font-size: 120%; } -div.body h5 { font-size: 110%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #c60f0f; - font-size: 0.8em; - padding: 0 4px 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - background-color: #c60f0f; - color: white; -} - -div.body p, div.body dd, div.body li, div.body blockquote { - text-align: justify; - line-height: 130%; -} - -div.admonition p.admonition-title + p { - display: inline; -} - -div.admonition p { - margin-bottom: 5px; -} - -div.admonition pre { - margin-bottom: 5px; -} - -div.admonition ul, div.admonition ol { - margin-bottom: 5px; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -div.warning { - background-color: #ffe4e4; - border: 1px solid #f66; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre { - padding: 5px; - background-color: #eeffcc; - color: #333333; - line-height: 120%; - border: 1px solid #ac9; - border-left: none; - border-right: none; -} - -code { - background-color: #ecf0f3; - padding: 0 1px 0 1px; - font-size: 0.95em; -} - -th { - background-color: #ede; -} - -.warning code { - background: #efc2c2; -} - -.note code { - background: #d6d6d6; -} - -.viewcode-back { - font-family: sans-serif; -} - -div.viewcode-block:target { - background-color: #f4debf; - border-top: 1px solid #ac9; - border-bottom: 1px solid #ac9; -} - -div.code-block-caption { - color: #efefef; - background-color: #1c4e63; -} \ No newline at end of file diff --git a/Documentation/_static/comment-bright.png b/Documentation/_static/comment-bright.png deleted file mode 100644 index 15e27edb12ac25701ac0ac21b97b52bb4e45415e..0000000000000000000000000000000000000000 Binary files a/Documentation/_static/comment-bright.png and /dev/null differ diff --git a/Documentation/_static/comment-close.png b/Documentation/_static/comment-close.png deleted file mode 100644 index 4d91bcf57de866a901a89a2a68c0f36af1114841..0000000000000000000000000000000000000000 Binary files a/Documentation/_static/comment-close.png and /dev/null differ diff --git a/Documentation/_static/comment.png b/Documentation/_static/comment.png deleted file mode 100644 index dfbc0cbd512bdeefcb1984c99d8e577efb77f006..0000000000000000000000000000000000000000 Binary files a/Documentation/_static/comment.png and /dev/null differ diff --git a/Documentation/_static/custom.css b/Documentation/_static/custom.css deleted file mode 100644 index 2a924f1d6a8bc930c5296bdb2d5c2d3e39b04a1c..0000000000000000000000000000000000000000 --- a/Documentation/_static/custom.css +++ /dev/null @@ -1 +0,0 @@ -/* This file intentionally left blank. */ diff --git a/Documentation/_static/default.css b/Documentation/_static/default.css deleted file mode 100644 index 5f1399abd5d85bc2519ad8f3a0c266cfa51fd2a4..0000000000000000000000000000000000000000 --- a/Documentation/_static/default.css +++ /dev/null @@ -1,256 +0,0 @@ -/* - * default.css_t - * ~~~~~~~~~~~~~ - * - * Sphinx stylesheet -- default theme. - * - * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: sans-serif; - font-size: 100%; - background-color: #11303d; - color: #000; - margin: 0; - padding: 0; -} - -div.document { - background-color: #1c4e63; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 230px; -} - -div.body { - background-color: #ffffff; - color: #000000; - padding: 0 20px 30px 20px; -} - -div.footer { - color: #ffffff; - width: 100%; - padding: 9px 0 9px 0; - text-align: center; - font-size: 75%; -} - -div.footer a { - color: #ffffff; - text-decoration: underline; -} - -div.related { - background-color: #133f52; - line-height: 30px; - color: #ffffff; -} - -div.related a { - color: #ffffff; -} - -div.sphinxsidebar { -} - -div.sphinxsidebar h3 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.4em; - font-weight: normal; - margin: 0; - padding: 0; -} - -div.sphinxsidebar h3 a { - color: #ffffff; -} - -div.sphinxsidebar h4 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.3em; - font-weight: normal; - margin: 5px 0 0 0; - padding: 0; -} - -div.sphinxsidebar p { - color: #ffffff; -} - -div.sphinxsidebar p.topless { - margin: 5px 10px 10px 10px; -} - -div.sphinxsidebar ul { - margin: 10px; - padding: 0; - color: #ffffff; -} - -div.sphinxsidebar a { - color: #98dbcc; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - - - -/* -- hyperlink styles ------------------------------------------------------ */ - -a { - color: #355f7c; - text-decoration: none; -} - -a:visited { - color: #355f7c; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - - - -/* -- body styles ----------------------------------------------------------- */ - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Trebuchet MS', sans-serif; - background-color: #f2f2f2; - font-weight: normal; - color: #20435c; - border-bottom: 1px solid #ccc; - margin: 20px -20px 10px -20px; - padding: 3px 0 3px 10px; -} - -div.body h1 { margin-top: 0; font-size: 200%; } -div.body h2 { font-size: 160%; } -div.body h3 { font-size: 140%; } -div.body h4 { font-size: 120%; } -div.body h5 { font-size: 110%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #c60f0f; - font-size: 0.8em; - padding: 0 4px 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - background-color: #c60f0f; - color: white; -} - -div.body p, div.body dd, div.body li { - text-align: justify; - line-height: 130%; -} - -div.admonition p.admonition-title + p { - display: inline; -} - -div.admonition p { - margin-bottom: 5px; -} - -div.admonition pre { - margin-bottom: 5px; -} - -div.admonition ul, div.admonition ol { - margin-bottom: 5px; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -div.warning { - background-color: #ffe4e4; - border: 1px solid #f66; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre { - padding: 5px; - background-color: #eeffcc; - color: #333333; - line-height: 120%; - border: 1px solid #ac9; - border-left: none; - border-right: none; -} - -tt { - background-color: #ecf0f3; - padding: 0 1px 0 1px; - font-size: 0.95em; -} - -th { - background-color: #ede; -} - -.warning tt { - background: #efc2c2; -} - -.note tt { - background: #d6d6d6; -} - -.viewcode-back { - font-family: sans-serif; -} - -div.viewcode-block:target { - background-color: #f4debf; - border-top: 1px solid #ac9; - border-bottom: 1px solid #ac9; -} \ No newline at end of file diff --git a/Documentation/_static/doctools.js b/Documentation/_static/doctools.js deleted file mode 100644 index 816349563588e87ca99c7cf2d6e54268e52e761d..0000000000000000000000000000000000000000 --- a/Documentation/_static/doctools.js +++ /dev/null @@ -1,287 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Sphinx JavaScript utilities for all documentation. - * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s == 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node) { - if (node.nodeType == 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { - var span = document.createElement("span"); - span.className = className; - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this); - }); - } - } - return this.each(function() { - highlight(this); - }); -}; - -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} - -/** - * Small JavaScript module for the documentation. - */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - - }, - - /** - * i18n support - */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, - LOCALE : 'unknown', - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated == 'undefined') - return string; - return (typeof translated == 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated == 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('<a class="headerlink">\u00B6</a>'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('<a class="headerlink">\u00B6</a>'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); - }, - - /** - * workaround a firefox stupidity - * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - if (!body.length) { - body = $('body'); - } - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('<p class="highlight-link"><a href="javascript:Documentation.' + - 'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>') - .appendTo($('#searchbox')); - } - }, - - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) == 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('#searchbox .highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, - - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, - - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this == '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - }, - - initOnKeyListeners: function() { - $(document).keyup(function(event) { - var activeElementType = document.activeElement.tagName; - // don't navigate when in search box or textarea - if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { - switch (event.keyCode) { - case 37: // left - var prevHref = $('link[rel="prev"]').prop('href'); - if (prevHref) { - window.location.href = prevHref; - return false; - } - case 39: // right - var nextHref = $('link[rel="next"]').prop('href'); - if (nextHref) { - window.location.href = nextHref; - return false; - } - } - } - }); - } -}; - -// quick alias for translations -_ = Documentation.gettext; - -$(document).ready(function() { - Documentation.init(); -}); \ No newline at end of file diff --git a/Documentation/_static/down-pressed.png b/Documentation/_static/down-pressed.png deleted file mode 100644 index 5756c8cad8854722893dc70b9eb4bb0400343a39..0000000000000000000000000000000000000000 Binary files a/Documentation/_static/down-pressed.png and /dev/null differ diff --git a/Documentation/_static/down.png b/Documentation/_static/down.png deleted file mode 100644 index 1b3bdad2ceffae91cee61b32f3295f9bbe646e48..0000000000000000000000000000000000000000 Binary files a/Documentation/_static/down.png and /dev/null differ diff --git a/Documentation/_static/file.png b/Documentation/_static/file.png deleted file mode 100644 index a858a410e4faa62ce324d814e4b816fff83a6fb3..0000000000000000000000000000000000000000 Binary files a/Documentation/_static/file.png and /dev/null differ diff --git a/Documentation/_static/jquery-3.1.0.js b/Documentation/_static/jquery-3.1.0.js deleted file mode 100644 index f2fc2747874e38d72f12812ed38418bc21935608..0000000000000000000000000000000000000000 --- a/Documentation/_static/jquery-3.1.0.js +++ /dev/null @@ -1,10074 +0,0 @@ -/*eslint-disable no-unused-vars*/ -/*! - * jQuery JavaScript Library v3.1.0 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2016-07-07T21:44Z - */ -( function( global, factory ) { - - "use strict"; - - if ( typeof module === "object" && typeof module.exports === "object" ) { - - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 -// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode -// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common -// enough that all such attempts are guarded in a try block. -"use strict"; - -var arr = []; - -var document = window.document; - -var getProto = Object.getPrototypeOf; - -var slice = arr.slice; - -var concat = arr.concat; - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var fnToString = hasOwn.toString; - -var ObjectFunctionString = fnToString.call( Object ); - -var support = {}; - - - - function DOMEval( code, doc ) { - doc = doc || document; - - var script = doc.createElement( "script" ); - - script.text = code; - doc.head.appendChild( script ).parentNode.removeChild( script ); - } -/* global Symbol */ -// Defining this global in .eslintrc would create a danger of using the global -// unguarded in another place, it seems safer to define global only for this module - - - -var - version = "3.1.0", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }, - - // Support: Android <=4.0 only - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([a-z])/g, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }; - -jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num != null ? - - // Return just the one element from the set - ( num < 0 ? this[ num + this.length ] : this[ num ] ) : - - // Return all the elements in a clean array - slice.call( this ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // Skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { - target = {}; - } - - // Extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = jQuery.isArray( copy ) ) ) ) { - - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray( src ) ? src : []; - - } else { - clone = src && jQuery.isPlainObject( src ) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - isFunction: function( obj ) { - return jQuery.type( obj ) === "function"; - }, - - isArray: Array.isArray, - - isWindow: function( obj ) { - return obj != null && obj === obj.window; - }, - - isNumeric: function( obj ) { - - // As of jQuery 3.0, isNumeric is limited to - // strings and numbers (primitives or objects) - // that can be coerced to finite numbers (gh-2662) - var type = jQuery.type( obj ); - return ( type === "number" || type === "string" ) && - - // parseFloat NaNs numeric-cast false positives ("") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - !isNaN( obj - parseFloat( obj ) ); - }, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - - /* eslint-disable no-unused-vars */ - // See https://github.com/eslint/eslint/issues/6125 - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; - }, - - // Evaluates a script in a global context - globalEval: function( code ) { - DOMEval( code ); - }, - - // Convert dashed to camelCase; used by the css and data modules - // Support: IE <=9 - 11, Edge 12 - 13 - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - // Support: Android <=4.0 only - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var tmp, args, proxy; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - now: Date.now, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -} ); - -if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; -} - -// Populate the class2type map -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), -function( i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -} ); - -function isArrayLike( obj ) { - - // Support: real iOS 8.2 only (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = !!obj && "length" in obj && obj.length, - type = jQuery.type( obj ); - - if ( type === "function" || jQuery.isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.3.0 - * https://sizzlejs.com/ - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2016-01-04 - */ -(function( window ) { - -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf as it's faster than native - // https://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - - // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", - - pseudos = ":(" + identifier + ")(?:\\((" + - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + identifier + ")" ), - "CLASS": new RegExp( "^\\.(" + identifier + ")" ), - "TAG": new RegExp( "^(" + identifier + "|[*])" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - - // CSS escapes - // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - high < 0 ? - // BMP codepoint - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // CSS string/identifier serialization - // https://drafts.csswg.org/cssom/#common-serializing-idioms - rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g, - fcssescape = function( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }, - - disabledAncestor = addCombinator( - function( elem ) { - return elem.disabled === true; - }, - { dir: "parentNode", next: "legend" } - ); - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var m, i, elem, nid, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - context = context || document; - - if ( documentIsHTML ) { - - // If the selector is sufficiently simple, try using a "get*By*" DOM method - // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { - - // ID selector - if ( (m = match[1]) ) { - - // Document context - if ( nodeType === 9 ) { - if ( (elem = context.getElementById( m )) ) { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( newContext && (elem = newContext.getElementById( m )) && - contains( context, elem ) && - elem.id === m ) { - - results.push( elem ); - return results; - } - } - - // Type selector - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( (m = match[3]) && support.getElementsByClassName && - context.getElementsByClassName ) { - - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( support.qsa && - !compilerCache[ selector + " " ] && - (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - - if ( nodeType !== 1 ) { - newContext = context; - newSelector = selector; - - // qSA looks outside Element context, which is not what we want - // Thanks to Andrew Dupont for this workaround technique - // Support: IE <=8 - // Exclude object elements - } else if ( context.nodeName.toLowerCase() !== "object" ) { - - // Capture the context ID, setting it first if necessary - if ( (nid = context.getAttribute( "id" )) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", (nid = expando) ); - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[i] = "#" + nid + " " + toSelector( groups[i] ); - } - newSelector = groups.join( "," ); - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {function(string, object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key + " " ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created element and returns a boolean result - */ -function assert( fn ) { - var el = document.createElement("fieldset"); - - try { - return !!fn( el ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - // release memory in IE - el = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = arr.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - a.sourceIndex - b.sourceIndex; - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ -function createDisabledPseudo( disabled ) { - // Known :disabled false positives: - // IE: *[disabled]:not(button, input, select, textarea, optgroup, option, menuitem, fieldset) - // not IE: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Check form elements and option elements for explicit disabling - return "label" in elem && elem.disabled === disabled || - "form" in elem && elem.disabled === disabled || - - // Check non-disabled form elements for fieldset[disabled] ancestors - "form" in elem && elem.disabled === false && ( - // Support: IE6-11+ - // Ancestry is covered for us - elem.isDisabled === disabled || - - // Otherwise, assume any non-<option> under fieldset[disabled] is disabled - /* jshint -W018 */ - elem.isDisabled !== !disabled && - ("label" in elem || !disabledAncestor( elem )) !== disabled - ); - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, subWindow, - doc = node ? node.ownerDocument || node : preferredDoc; - - // Return early if doc is invalid or already selected - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Update global variables - document = doc; - docElem = document.documentElement; - documentIsHTML = !isXML( document ); - - // Support: IE 9-11, Edge - // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - if ( preferredDoc !== document && - (subWindow = document.defaultView) && subWindow.top !== subWindow ) { - - // Support: IE 11, Edge - if ( subWindow.addEventListener ) { - subWindow.addEventListener( "unload", unloadHandler, false ); - - // Support: IE 9 - 10 only - } else if ( subWindow.attachEvent ) { - subWindow.attachEvent( "onunload", unloadHandler ); - } - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert(function( el ) { - el.className = "i"; - return !el.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( el ) { - el.appendChild( document.createComment("") ); - return !el.getElementsByTagName("*").length; - }); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( document.getElementsByClassName ); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programmatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( el ) { - docElem.appendChild( el ).id = expando; - return !document.getElementsByName || !document.getElementsByName( expando ).length; - }); - - // ID find and filter - if ( support.getById ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var m = context.getElementById( id ); - return m ? [ m ] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - // Support: IE6/7 - // getElementById is not reliable as a find shortcut - delete Expr.find["ID"]; - - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); - - // DocumentFragment nodes don't have gEBTN - } else if ( support.qsa ) { - return context.querySelectorAll( tag ); - } - } : - - function( tag, context ) { - var elem, - tmp = [], - i = 0, - // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See https://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( el ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // https://bugs.jquery.com/ticket/12359 - docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + - "<select id='" + expando + "-\r\\' msallowcapture=''>" + - "<option selected=''></option></select>"; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( el.querySelectorAll("[msallowcapture^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !el.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ - if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push("~="); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !el.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibling-combinator selector` fails - if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push(".#.+[+~]"); - } - }); - - assert(function( el ) { - el.innerHTML = "<a href='' disabled='disabled'></a>" + - "<select disabled='disabled'><option/></select>"; - - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement("input"); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( el.querySelectorAll("[name=d]").length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( el.querySelectorAll(":enabled").length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: IE9-11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - docElem.appendChild( el ).disabled = true; - if ( el.querySelectorAll(":disabled").length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - el.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( el ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( el, "*" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( el, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully self-exclusive - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { - return -1; - } - if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - return a === document ? -1 : - b === document ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - !compilerCache[ expr + " " ] && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch (e) {} - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null; -}; - -Sizzle.escape = function( sel ) { - return (sel + "").replace( rcssescape, fcssescape ); -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - while ( (node = elem[i++]) ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[6] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[3] ) { - match[2] = match[4] || match[5] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, uniqueCache, outerCache, node, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType, - diff = false; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) { - - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - - // Seek `elem` from a previously-cached index - - // ...in a gzip-friendly way - node = parent; - outerCache = node[ expando ] || (node[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex && cache[ 2 ]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - } else { - // Use previously-cached element index if available - if ( useCache ) { - // ...in a gzip-friendly way - node = elem; - outerCache = node[ expando ] || (node[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex; - } - - // xml :nth-child(...) - // or :nth-last-child(...) or :nth(-last)?-of-type(...) - if ( diff === false ) { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) && - ++diff ) { - - // Cache the index of each encountered element - if ( useCache ) { - outerCache = node[ expando ] || (node[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); - - uniqueCache[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - // Don't keep the element (issue #299) - input[0] = null; - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - text = text.replace( runescape, funescape ); - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": createDisabledPseudo( false ), - "disabled": createDisabledPseudo( true ), - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( (tokens = []) ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - skip = combinator.next, - key = skip || dir, - checkNonElements = base && key === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, uniqueCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); - - if ( skip && skip === elem.nodeName.toLowerCase() ) { - elem = elem[ dir ] || elem; - } else if ( (oldCache = uniqueCache[ key ]) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return (newCache[ 2 ] = oldCache[ 2 ]); - } else { - // Reuse newcache so results back-propagate to previous elements - uniqueCache[ key ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - // Avoid hanging onto element (issue #299) - checkContext = null; - return ret; - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), - len = elems.length; - - if ( outermost ) { - outermostContext = context === document || context || outermost; - } - - // Add elements passing elementMatchers directly to results - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id - for ( ; i !== len && (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - if ( !context && elem.ownerDocument !== document ) { - setDocument( elem ); - xml = !documentIsHTML; - } - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context || document, xml) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // `i` is now the count of elements visited above, and adding it to `matchedCount` - // makes the latter nonnegative. - matchedCount += i; - - // Apply set filters to unmatched elements - // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` - // equals `i`), unless we didn't visit _any_ elements in the above loop because we have - // no element matchers and no seed. - // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that - // case, which will result in a "00" `matchedCount` that differs from `i` but is also - // numerically zero. - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); - - results = results || []; - - // Try to minimize operations if there is only one selector in the list and no seed - // (the latter of which guarantees us context) - if ( match.length === 1 ) { - - // Reduce context if the leading compound selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - !context || rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome 14-35+ -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( el ) { - // Should return 1, but returns 4 (following) - return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; -}); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( el ) { - el.innerHTML = "<a href='#'></a>"; - return el.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - }); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( el ) { - el.innerHTML = "<input/>"; - el.firstChild.setAttribute( "value", "" ); - return el.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( el ) { - return el.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - null; - } - }); -} - -return Sizzle; - -})( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; - -// Deprecated -jQuery.expr[ ":" ] = jQuery.expr.pseudos; -jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; -jQuery.escapeSelector = Sizzle.escape; - - - - -var dir = function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; -}; - - -var siblings = function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; -}; - - -var rneedsContext = jQuery.expr.match.needsContext; - -var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); - - - -var risSimple = /^.[^:#\[\.,]*$/; - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) !== not; - } ); - - } - - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - } ); - - } - - if ( typeof qualifier === "string" ) { - if ( risSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - qualifier = jQuery.filter( qualifier, elements ); - } - - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1; - } ); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 && elem.nodeType === 1 ? - jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : - jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - } ) ); -}; - -jQuery.fn.extend( { - find: function( selector ) { - var i, ret, - len = this.length, - self = this; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter( function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - } ) ); - } - - ret = this.pushStack( [] ); - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - return len > 1 ? jQuery.uniqueSort( ret ) : ret; - }, - filter: function( selector ) { - return this.pushStack( winnow( this, selector || [], false ) ); - }, - not: function( selector ) { - return this.pushStack( winnow( this, selector || [], true ) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -} ); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // A simple way to check for HTML strings - // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - // Shortcut simple #id case for speed - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - - init = jQuery.fn.init = function( selector, context, root ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Method init() accepts an alternate rootjQuery - // so migrate can support jQuery.sub (gh-2101) - root = root || rootjQuery; - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector[ 0 ] === "<" && - selector[ selector.length - 1 ] === ">" && - selector.length >= 3 ) { - - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && ( match[ 1 ] || !context ) ) { - - // HANDLE: $(html) -> $(array) - if ( match[ 1 ] ) { - context = context instanceof jQuery ? context[ 0 ] : context; - - // Option to run scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[ 1 ], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[ 2 ] ); - - if ( elem ) { - - // Inject the element directly into the jQuery object - this[ 0 ] = elem; - this.length = 1; - } - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || root ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this[ 0 ] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return root.ready !== undefined ? - root.ready( selector ) : - - // Execute immediately if ready is not present - selector( jQuery ); - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - - // Methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend( { - has: function( target ) { - var targets = jQuery( target, this ), - l = targets.length; - - return this.filter( function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[ i ] ) ) { - return true; - } - } - } ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - targets = typeof selectors !== "string" && jQuery( selectors ); - - // Positional selectors never match, since there's no _selection_ context - if ( !rneedsContext.test( selectors ) ) { - for ( ; i < l; i++ ) { - for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - - // Always skip document fragments - if ( cur.nodeType < 11 && ( targets ? - targets.index( cur ) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector( cur, selectors ) ) ) { - - matched.push( cur ); - break; - } - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); - }, - - // Determine the position of an element within the set - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // Index in selector - if ( typeof elem === "string" ) { - return indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.uniqueSort( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - } -} ); - -function sibling( cur, dir ) { - while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} - return cur; -} - -jQuery.each( { - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return siblings( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return siblings( elem.firstChild ); - }, - contents: function( elem ) { - return elem.contentDocument || jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.uniqueSort( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; -} ); -var rnotwhite = ( /\S+/g ); - - - -// Convert String-formatted options into Object-formatted ones -function createOptions( options ) { - var object = {}; - jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { - object[ flag ] = true; - } ); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - createOptions( options ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - - // Last fire value for non-forgettable lists - memory, - - // Flag to know if list was already fired - fired, - - // Flag to prevent firing - locked, - - // Actual callback list - list = [], - - // Queue of execution data for repeatable lists - queue = [], - - // Index of currently firing callback (modified by add/remove as needed) - firingIndex = -1, - - // Fire callbacks - fire = function() { - - // Enforce single-firing - locked = options.once; - - // Execute callbacks for all pending executions, - // respecting firingIndex overrides and runtime changes - fired = firing = true; - for ( ; queue.length; firingIndex = -1 ) { - memory = queue.shift(); - while ( ++firingIndex < list.length ) { - - // Run callback and check for early termination - if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && - options.stopOnFalse ) { - - // Jump to end and forget the data so .add doesn't re-fire - firingIndex = list.length; - memory = false; - } - } - } - - // Forget the data if we're done with it - if ( !options.memory ) { - memory = false; - } - - firing = false; - - // Clean up if we're done firing for good - if ( locked ) { - - // Keep an empty list if we have data for future add calls - if ( memory ) { - list = []; - - // Otherwise, this object is spent - } else { - list = ""; - } - } - }, - - // Actual Callbacks object - self = { - - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - - // If we have memory from a past run, we should fire after adding - if ( memory && !firing ) { - firingIndex = list.length - 1; - queue.push( memory ); - } - - ( function add( args ) { - jQuery.each( args, function( _, arg ) { - if ( jQuery.isFunction( arg ) ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { - - // Inspect recursively - add( arg ); - } - } ); - } )( arguments ); - - if ( memory && !firing ) { - fire(); - } - } - return this; - }, - - // Remove a callback from the list - remove: function() { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - - // Handle firing indexes - if ( index <= firingIndex ) { - firingIndex--; - } - } - } ); - return this; - }, - - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? - jQuery.inArray( fn, list ) > -1 : - list.length > 0; - }, - - // Remove all callbacks from the list - empty: function() { - if ( list ) { - list = []; - } - return this; - }, - - // Disable .fire and .add - // Abort any current/pending executions - // Clear all callbacks and values - disable: function() { - locked = queue = []; - list = memory = ""; - return this; - }, - disabled: function() { - return !list; - }, - - // Disable .fire - // Also disable .add unless we have memory (since it would have no effect) - // Abort any pending executions - lock: function() { - locked = queue = []; - if ( !memory && !firing ) { - list = memory = ""; - } - return this; - }, - locked: function() { - return !!locked; - }, - - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( !locked ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - queue.push( args ); - if ( !firing ) { - fire(); - } - } - return this; - }, - - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -function Identity( v ) { - return v; -} -function Thrower( ex ) { - throw ex; -} - -function adoptValue( value, resolve, reject ) { - var method; - - try { - - // Check for promise aspect first to privilege synchronous behavior - if ( value && jQuery.isFunction( ( method = value.promise ) ) ) { - method.call( value ).done( resolve ).fail( reject ); - - // Other thenables - } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) { - method.call( value, resolve, reject ); - - // Other non-thenables - } else { - - // Support: Android 4.0 only - // Strict mode functions invoked without .call/.apply get global-object context - resolve.call( undefined, value ); - } - - // For Promises/A+, convert exceptions into rejections - // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in - // Deferred#then to conditionally suppress rejection. - } catch ( value ) { - - // Support: Android 4.0 only - // Strict mode functions invoked without .call/.apply get global-object context - reject.call( undefined, value ); - } -} - -jQuery.extend( { - - Deferred: function( func ) { - var tuples = [ - - // action, add listener, callbacks, - // ... .then handlers, argument index, [final state] - [ "notify", "progress", jQuery.Callbacks( "memory" ), - jQuery.Callbacks( "memory" ), 2 ], - [ "resolve", "done", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 0, "resolved" ], - [ "reject", "fail", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 1, "rejected" ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - "catch": function( fn ) { - return promise.then( null, fn ); - }, - - // Keep pipe for back-compat - pipe: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - - return jQuery.Deferred( function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - - // Map tuples (progress, done, fail) to arguments (done, fail, progress) - var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; - - // deferred.progress(function() { bind to newDefer or newDefer.notify }) - // deferred.done(function() { bind to newDefer or newDefer.resolve }) - // deferred.fail(function() { bind to newDefer or newDefer.reject }) - deferred[ tuple[ 1 ] ]( function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .progress( newDefer.notify ) - .done( newDefer.resolve ) - .fail( newDefer.reject ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( - this, - fn ? [ returned ] : arguments - ); - } - } ); - } ); - fns = null; - } ).promise(); - }, - then: function( onFulfilled, onRejected, onProgress ) { - var maxDepth = 0; - function resolve( depth, deferred, handler, special ) { - return function() { - var that = this, - args = arguments, - mightThrow = function() { - var returned, then; - - // Support: Promises/A+ section 2.3.3.3.3 - // https://promisesaplus.com/#point-59 - // Ignore double-resolution attempts - if ( depth < maxDepth ) { - return; - } - - returned = handler.apply( that, args ); - - // Support: Promises/A+ section 2.3.1 - // https://promisesaplus.com/#point-48 - if ( returned === deferred.promise() ) { - throw new TypeError( "Thenable self-resolution" ); - } - - // Support: Promises/A+ sections 2.3.3.1, 3.5 - // https://promisesaplus.com/#point-54 - // https://promisesaplus.com/#point-75 - // Retrieve `then` only once - then = returned && - - // Support: Promises/A+ section 2.3.4 - // https://promisesaplus.com/#point-64 - // Only check objects and functions for thenability - ( typeof returned === "object" || - typeof returned === "function" ) && - returned.then; - - // Handle a returned thenable - if ( jQuery.isFunction( then ) ) { - - // Special processors (notify) just wait for resolution - if ( special ) { - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ) - ); - - // Normal processors (resolve) also hook into progress - } else { - - // ...and disregard older resolution values - maxDepth++; - - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ), - resolve( maxDepth, deferred, Identity, - deferred.notifyWith ) - ); - } - - // Handle all other returned values - } else { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Identity ) { - that = undefined; - args = [ returned ]; - } - - // Process the value(s) - // Default process is resolve - ( special || deferred.resolveWith )( that, args ); - } - }, - - // Only normal processors (resolve) catch and reject exceptions - process = special ? - mightThrow : - function() { - try { - mightThrow(); - } catch ( e ) { - - if ( jQuery.Deferred.exceptionHook ) { - jQuery.Deferred.exceptionHook( e, - process.stackTrace ); - } - - // Support: Promises/A+ section 2.3.3.3.4.1 - // https://promisesaplus.com/#point-61 - // Ignore post-resolution exceptions - if ( depth + 1 >= maxDepth ) { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Thrower ) { - that = undefined; - args = [ e ]; - } - - deferred.rejectWith( that, args ); - } - } - }; - - // Support: Promises/A+ section 2.3.3.3.1 - // https://promisesaplus.com/#point-57 - // Re-resolve promises immediately to dodge false rejection from - // subsequent errors - if ( depth ) { - process(); - } else { - - // Call an optional hook to record the stack, in case of exception - // since it's otherwise lost when execution goes async - if ( jQuery.Deferred.getStackHook ) { - process.stackTrace = jQuery.Deferred.getStackHook(); - } - window.setTimeout( process ); - } - }; - } - - return jQuery.Deferred( function( newDefer ) { - - // progress_handlers.add( ... ) - tuples[ 0 ][ 3 ].add( - resolve( - 0, - newDefer, - jQuery.isFunction( onProgress ) ? - onProgress : - Identity, - newDefer.notifyWith - ) - ); - - // fulfilled_handlers.add( ... ) - tuples[ 1 ][ 3 ].add( - resolve( - 0, - newDefer, - jQuery.isFunction( onFulfilled ) ? - onFulfilled : - Identity - ) - ); - - // rejected_handlers.add( ... ) - tuples[ 2 ][ 3 ].add( - resolve( - 0, - newDefer, - jQuery.isFunction( onRejected ) ? - onRejected : - Thrower - ) - ); - } ).promise(); - }, - - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 5 ]; - - // promise.progress = list.add - // promise.done = list.add - // promise.fail = list.add - promise[ tuple[ 1 ] ] = list.add; - - // Handle state - if ( stateString ) { - list.add( - function() { - - // state = "resolved" (i.e., fulfilled) - // state = "rejected" - state = stateString; - }, - - // rejected_callbacks.disable - // fulfilled_callbacks.disable - tuples[ 3 - i ][ 2 ].disable, - - // progress_callbacks.lock - tuples[ 0 ][ 2 ].lock - ); - } - - // progress_handlers.fire - // fulfilled_handlers.fire - // rejected_handlers.fire - list.add( tuple[ 3 ].fire ); - - // deferred.notify = function() { deferred.notifyWith(...) } - // deferred.resolve = function() { deferred.resolveWith(...) } - // deferred.reject = function() { deferred.rejectWith(...) } - deferred[ tuple[ 0 ] ] = function() { - deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); - return this; - }; - - // deferred.notifyWith = list.fireWith - // deferred.resolveWith = list.fireWith - // deferred.rejectWith = list.fireWith - deferred[ tuple[ 0 ] + "With" ] = list.fireWith; - } ); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( singleValue ) { - var - - // count of uncompleted subordinates - remaining = arguments.length, - - // count of unprocessed arguments - i = remaining, - - // subordinate fulfillment data - resolveContexts = Array( i ), - resolveValues = slice.call( arguments ), - - // the master Deferred - master = jQuery.Deferred(), - - // subordinate callback factory - updateFunc = function( i ) { - return function( value ) { - resolveContexts[ i ] = this; - resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( !( --remaining ) ) { - master.resolveWith( resolveContexts, resolveValues ); - } - }; - }; - - // Single- and empty arguments are adopted like Promise.resolve - if ( remaining <= 1 ) { - adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject ); - - // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( master.state() === "pending" || - jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - - return master.then(); - } - } - - // Multiple arguments are aggregated like Promise.all array elements - while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); - } - - return master.promise(); - } -} ); - - -// These usually indicate a programmer mistake during development, -// warn about them ASAP rather than swallowing them by default. -var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; - -jQuery.Deferred.exceptionHook = function( error, stack ) { - - // Support: IE 8 - 9 only - // Console exists when dev tools are open, which can happen at any time - if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { - window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); - } -}; - - - - -jQuery.readyException = function( error ) { - window.setTimeout( function() { - throw error; - } ); -}; - - - - -// The deferred used on DOM ready -var readyList = jQuery.Deferred(); - -jQuery.fn.ready = function( fn ) { - - readyList - .then( fn ) - - // Wrap jQuery.readyException in a function so that the lookup - // happens at the time of error handling instead of callback - // registration. - .catch( function( error ) { - jQuery.readyException( error ); - } ); - - return this; -}; - -jQuery.extend( { - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - } -} ); - -jQuery.ready.then = readyList.then; - -// The ready event handler and self cleanup method -function completed() { - document.removeEventListener( "DOMContentLoaded", completed ); - window.removeEventListener( "load", completed ); - jQuery.ready(); -} - -// Catch cases where $(document).ready() is called -// after the browser event has already occurred. -// Support: IE <=9 - 10 only -// Older IE sometimes signals "interactive" too soon -if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - - // Handle it asynchronously to allow scripts the opportunity to delay ready - window.setTimeout( jQuery.ready ); - -} else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed ); -} - - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - access( elems, fn, i, key[ i ], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < len; i++ ) { - fn( - elems[ i ], key, raw ? - value : - value.call( elems[ i ], i, fn( elems[ i ], key ) ) - ); - } - } - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - len ? fn( elems[ 0 ], key ) : emptyGet; -}; -var acceptData = function( owner ) { - - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); -}; - - - - -function Data() { - this.expando = jQuery.expando + Data.uid++; -} - -Data.uid = 1; - -Data.prototype = { - - cache: function( owner ) { - - // Check if the owner object already has a cache - var value = owner[ this.expando ]; - - // If not, create one - if ( !value ) { - value = {}; - - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return an empty object. - if ( acceptData( owner ) ) { - - // If it is a node unlikely to be stringify-ed or looped over - // use plain assignment - if ( owner.nodeType ) { - owner[ this.expando ] = value; - - // Otherwise secure it in a non-enumerable property - // configurable must be true to allow the property to be - // deleted when data is removed - } else { - Object.defineProperty( owner, this.expando, { - value: value, - configurable: true - } ); - } - } - } - - return value; - }, - set: function( owner, data, value ) { - var prop, - cache = this.cache( owner ); - - // Handle: [ owner, key, value ] args - // Always use camelCase key (gh-2257) - if ( typeof data === "string" ) { - cache[ jQuery.camelCase( data ) ] = value; - - // Handle: [ owner, { properties } ] args - } else { - - // Copy the properties one-by-one to the cache object - for ( prop in data ) { - cache[ jQuery.camelCase( prop ) ] = data[ prop ]; - } - } - return cache; - }, - get: function( owner, key ) { - return key === undefined ? - this.cache( owner ) : - - // Always use camelCase key (gh-2257) - owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ]; - }, - access: function( owner, key, value ) { - - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ( ( key && typeof key === "string" ) && value === undefined ) ) { - - return this.get( owner, key ); - } - - // When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, - cache = owner[ this.expando ]; - - if ( cache === undefined ) { - return; - } - - if ( key !== undefined ) { - - // Support array or space separated string of keys - if ( jQuery.isArray( key ) ) { - - // If key is an array of keys... - // We always set camelCase keys, so remove that. - key = key.map( jQuery.camelCase ); - } else { - key = jQuery.camelCase( key ); - - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - key = key in cache ? - [ key ] : - ( key.match( rnotwhite ) || [] ); - } - - i = key.length; - - while ( i-- ) { - delete cache[ key[ i ] ]; - } - } - - // Remove the expando if there's no more data - if ( key === undefined || jQuery.isEmptyObject( cache ) ) { - - // Support: Chrome <=35 - 45 - // Webkit & Blink performance suffers when deleting properties - // from DOM nodes, so set to undefined instead - // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) - if ( owner.nodeType ) { - owner[ this.expando ] = undefined; - } else { - delete owner[ this.expando ]; - } - } - }, - hasData: function( owner ) { - var cache = owner[ this.expando ]; - return cache !== undefined && !jQuery.isEmptyObject( cache ); - } -}; -var dataPriv = new Data(); - -var dataUser = new Data(); - - - -// Implementation Summary -// -// 1. Enforce API surface and semantic compatibility with 1.9.x branch -// 2. Improve the module's maintainability by reducing the storage -// paths to a single mechanism. -// 3. Use the same single mechanism to support "private" and "user" data. -// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) -// 5. Avoid exposing implementation details on user objects (eg. expando properties) -// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /[A-Z]/g; - -function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? JSON.parse( data ) : - data; - } catch ( e ) {} - - // Make sure we set the data so it isn't changed later - dataUser.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; -} - -jQuery.extend( { - hasData: function( elem ) { - return dataUser.hasData( elem ) || dataPriv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return dataUser.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - dataUser.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to dataPriv methods, these can be deprecated. - _data: function( elem, name, data ) { - return dataPriv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - dataPriv.remove( elem, name ); - } -} ); - -jQuery.fn.extend( { - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = dataUser.get( elem ); - - if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE 11 only - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice( 5 ) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - dataPriv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each( function() { - dataUser.set( this, key ); - } ); - } - - return access( this, function( value ) { - var data; - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - - // Attempt to get data from the cache - // The key will always be camelCased in Data - data = dataUser.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, key ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each( function() { - - // We always store the camelCased key - dataUser.set( this, key, value ); - } ); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each( function() { - dataUser.remove( this, key ); - } ); - } -} ); - - -jQuery.extend( { - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = dataPriv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray( data ) ) { - queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // Clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // Not public - generate a queueHooks object, or return the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { - empty: jQuery.Callbacks( "once memory" ).add( function() { - dataPriv.remove( elem, [ type + "queue", key ] ); - } ) - } ); - } -} ); - -jQuery.fn.extend( { - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[ 0 ], type ); - } - - return data === undefined ? - this : - this.each( function() { - var queue = jQuery.queue( this, type, data ); - - // Ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - } ); - }, - dequeue: function( type ) { - return this.each( function() { - jQuery.dequeue( this, type ); - } ); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -} ); -var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; - -var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); - - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var isHiddenWithinTree = function( elem, el ) { - - // isHiddenWithinTree might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - - // Inline style trumps all - return elem.style.display === "none" || - elem.style.display === "" && - - // Otherwise, check computed style - // Support: Firefox <=43 - 45 - // Disconnected elements can have computed display: none, so first confirm that elem is - // in the document. - jQuery.contains( elem.ownerDocument, elem ) && - - jQuery.css( elem, "display" ) === "none"; - }; - -var swap = function( elem, options, callback, args ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.apply( elem, args || [] ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; -}; - - - - -function adjustCSS( elem, prop, valueParts, tween ) { - var adjusted, - scale = 1, - maxIterations = 20, - currentValue = tween ? - function() { - return tween.cur(); - } : - function() { - return jQuery.css( elem, prop, "" ); - }, - initial = currentValue(), - unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), - - // Starting value computation is required for potential unit mismatches - initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && - rcssNum.exec( jQuery.css( elem, prop ) ); - - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { - - // Trust units reported by jQuery.css - unit = unit || initialInUnit[ 3 ]; - - // Make sure we update the tween properties later on - valueParts = valueParts || []; - - // Iteratively approximate from a nonzero starting point - initialInUnit = +initial || 1; - - do { - - // If previous iteration zeroed out, double until we get *something*. - // Use string for doubling so we don't accidentally see scale as unchanged below - scale = scale || ".5"; - - // Adjust and apply - initialInUnit = initialInUnit / scale; - jQuery.style( elem, prop, initialInUnit + unit ); - - // Update scale, tolerating zero or NaN from tween.cur() - // Break the loop if scale is unchanged or perfect, or if we've just had enough. - } while ( - scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations - ); - } - - if ( valueParts ) { - initialInUnit = +initialInUnit || +initial || 0; - - // Apply relative offset (+=/-=) if specified - adjusted = valueParts[ 1 ] ? - initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : - +valueParts[ 2 ]; - if ( tween ) { - tween.unit = unit; - tween.start = initialInUnit; - tween.end = adjusted; - } - } - return adjusted; -} - - -var defaultDisplayMap = {}; - -function getDefaultDisplay( elem ) { - var temp, - doc = elem.ownerDocument, - nodeName = elem.nodeName, - display = defaultDisplayMap[ nodeName ]; - - if ( display ) { - return display; - } - - temp = doc.body.appendChild( doc.createElement( nodeName ) ), - display = jQuery.css( temp, "display" ); - - temp.parentNode.removeChild( temp ); - - if ( display === "none" ) { - display = "block"; - } - defaultDisplayMap[ nodeName ] = display; - - return display; -} - -function showHide( elements, show ) { - var display, elem, - values = [], - index = 0, - length = elements.length; - - // Determine new display value for elements that need to change - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - display = elem.style.display; - if ( show ) { - - // Since we force visibility upon cascade-hidden elements, an immediate (and slow) - // check is required in this first loop unless we have a nonempty display value (either - // inline or about-to-be-restored) - if ( display === "none" ) { - values[ index ] = dataPriv.get( elem, "display" ) || null; - if ( !values[ index ] ) { - elem.style.display = ""; - } - } - if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { - values[ index ] = getDefaultDisplay( elem ); - } - } else { - if ( display !== "none" ) { - values[ index ] = "none"; - - // Remember what we're overwriting - dataPriv.set( elem, "display", display ); - } - } - } - - // Set the display of the elements in a second loop to avoid constant reflow - for ( index = 0; index < length; index++ ) { - if ( values[ index ] != null ) { - elements[ index ].style.display = values[ index ]; - } - } - - return elements; -} - -jQuery.fn.extend( { - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each( function() { - if ( isHiddenWithinTree( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - } ); - } -} ); -var rcheckableType = ( /^(?:checkbox|radio)$/i ); - -var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); - -var rscriptType = ( /^$|\/(?:java|ecma)script/i ); - - - -// We have to close these tags to support XHTML (#13200) -var wrapMap = { - - // Support: IE <=9 only - option: [ 1, "<select multiple='multiple'>", "</select>" ], - - // XHTML parsers do not magically insert elements in the - // same way that tag soup parsers do. So we cannot shorten - // this by omitting <tbody> or other required elements. - thead: [ 1, "<table>", "</table>" ], - col: [ 2, "<table><colgroup>", "</colgroup></table>" ], - tr: [ 2, "<table><tbody>", "</tbody></table>" ], - td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], - - _default: [ 0, "", "" ] -}; - -// Support: IE <=9 only -wrapMap.optgroup = wrapMap.option; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - - -function getAll( context, tag ) { - - // Support: IE <=9 - 11 only - // Use typeof to avoid zero-argument method invocation on host objects (#15151) - var ret = typeof context.getElementsByTagName !== "undefined" ? - context.getElementsByTagName( tag || "*" ) : - typeof context.querySelectorAll !== "undefined" ? - context.querySelectorAll( tag || "*" ) : - []; - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], ret ) : - ret; -} - - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - dataPriv.set( - elems[ i ], - "globalEval", - !refElements || dataPriv.get( refElements[ i ], "globalEval" ) - ); - } -} - - -var rhtml = /<|&#?\w+;/; - -function buildFragment( elems, context, scripts, selection, ignored ) { - var elem, tmp, tag, wrap, contains, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Ensure the created nodes are orphaned (#12392) - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( ( elem = nodes[ i++ ] ) ) { - - // Skip elements already in the context collection (trac-4087) - if ( selection && jQuery.inArray( elem, selection ) > -1 ) { - if ( ignored ) { - ignored.push( elem ); - } - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( ( elem = tmp[ j++ ] ) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; -} - - -( function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Android 4.0 - 4.3 only - // Check state lost if the name is set (#11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Android <=4.1 only - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE <=11 only - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = "<textarea>x</textarea>"; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; -} )(); -var documentElement = document.documentElement; - - - -var - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -// Support: IE <=9 only -// See #13393 for more info -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -function on( elem, types, selector, data, fn, one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - on( elem, type, selector, data, types[ type ], one ); - } - return elem; - } - - if ( data == null && fn == null ) { - - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return elem; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return elem.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - } ); -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.get( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Ensure that invalid selectors throw exceptions at attach time - // Evaluate against documentElement in case elem is a non-element node (e.g., document) - if ( selector ) { - jQuery.find.matchesSelector( documentElement, selector ); - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !( events = elemData.events ) ) { - events = elemData.events = {}; - } - if ( !( eventHandle = elemData.handle ) ) { - eventHandle = elemData.handle = function( e ) { - - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend( { - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join( "." ) - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !( handlers = events[ type ] ) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener if the special events handler returns false - if ( !special.setup || - special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - - if ( !elemData || !( events = elemData.events ) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[ 2 ] && - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || - selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || - special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove data and the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - dataPriv.remove( elem, "handle events" ); - } - }, - - dispatch: function( nativeEvent ) { - - // Make a writable jQuery.Event from the native event object - var event = jQuery.event.fix( nativeEvent ); - - var i, j, ret, matched, handleObj, handlerQueue, - args = new Array( arguments.length ), - handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[ 0 ] = event; - - for ( i = 1; i < arguments.length; i++ ) { - args[ i ] = arguments[ i ]; - } - - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( ( handleObj = matched.handlers[ j++ ] ) && - !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or 2) have namespace(s) - // a subset or equal to those in the bound event (both can have no namespace). - if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || - handleObj.handler ).apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( ( event.result = ret ) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, matches, sel, handleObj, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Support: IE <=9 - // Find delegate handlers - // Black-hole SVG <use> instance trees (#13180) - // - // Support: Firefox <=42 - // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) - if ( delegateCount && cur.nodeType && - ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) > -1 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matches[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push( { elem: cur, handlers: matches } ); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( delegateCount < handlers.length ) { - handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); - } - - return handlerQueue; - }, - - addProp: function( name, hook ) { - Object.defineProperty( jQuery.Event.prototype, name, { - enumerable: true, - configurable: true, - - get: jQuery.isFunction( hook ) ? - function() { - if ( this.originalEvent ) { - return hook( this.originalEvent ); - } - } : - function() { - if ( this.originalEvent ) { - return this.originalEvent[ name ]; - } - }, - - set: function( value ) { - Object.defineProperty( this, name, { - enumerable: true, - configurable: true, - writable: true, - value: value - } ); - } - } ); - }, - - fix: function( originalEvent ) { - return originalEvent[ jQuery.expando ] ? - originalEvent : - new jQuery.Event( originalEvent ); - }, - - special: { - load: { - - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - focus: { - - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - this.focus(); - return false; - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - click: { - - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return jQuery.nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - } -}; - -jQuery.removeEvent = function( elem, type, handle ) { - - // This "if" is needed for plain objects - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle ); - } -}; - -jQuery.Event = function( src, props ) { - - // Allow instantiation without the 'new' keyword - if ( !( this instanceof jQuery.Event ) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - - // Support: Android <=2.3 only - src.returnValue === false ? - returnTrue : - returnFalse; - - // Create target properties - // Support: Safari <=6 - 7 only - // Target should not be a text node (#504, #13143) - this.target = ( src.target && src.target.nodeType === 3 ) ? - src.target.parentNode : - src.target; - - this.currentTarget = src.currentTarget; - this.relatedTarget = src.relatedTarget; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - constructor: jQuery.Event, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - isSimulated: false, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && !this.isSimulated ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Includes all common event props including KeyEvent and MouseEvent specific props -jQuery.each( { - altKey: true, - bubbles: true, - cancelable: true, - changedTouches: true, - ctrlKey: true, - detail: true, - eventPhase: true, - metaKey: true, - pageX: true, - pageY: true, - shiftKey: true, - view: true, - "char": true, - charCode: true, - key: true, - keyCode: true, - button: true, - buttons: true, - clientX: true, - clientY: true, - offsetX: true, - offsetY: true, - pointerId: true, - pointerType: true, - screenX: true, - screenY: true, - targetTouches: true, - toElement: true, - touches: true, - - which: function( event ) { - var button = event.button; - - // Add which for key events - if ( event.which == null && rkeyEvent.test( event.type ) ) { - return event.charCode != null ? event.charCode : event.keyCode; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { - return ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event.which; - } -}, jQuery.event.addProp ); - -// Create mouseenter/leave events using mouseover/out and event-time checks -// so that event delegation works in jQuery. -// Do the same for pointerenter/pointerleave and pointerover/pointerout -// -// Support: Safari 7 only -// Safari sends mouseenter too often; see: -// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 -// for the description of the bug (it existed in older Chrome versions as well). -jQuery.each( { - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mouseenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -} ); - -jQuery.fn.extend( { - - on: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn ); - }, - one: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? - handleObj.origType + "." + handleObj.namespace : - handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each( function() { - jQuery.event.remove( this, types, fn, selector ); - } ); - } -} ); - - -var - - /* eslint-disable max-len */ - - // See https://github.com/eslint/eslint/issues/3229 - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, - - /* eslint-enable */ - - // Support: IE <=10 - 11, Edge 12 - 13 - // In IE/Edge using regex groups here causes severe slowdowns. - // See https://connect.microsoft.com/IE/feedback/details/1736512/ - rnoInnerhtml = /<script|<style|<link/i, - - // checked="checked" or checked - rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, - rscriptTypeMasked = /^true\/(.*)/, - rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; - -function manipulationTarget( elem, content ) { - if ( jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - - return elem.getElementsByTagName( "tbody" )[ 0 ] || elem; - } - - return elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - - if ( match ) { - elem.type = match[ 1 ]; - } else { - elem.removeAttribute( "type" ); - } - - return elem; -} - -function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( dataPriv.hasData( src ) ) { - pdataOld = dataPriv.access( src ); - pdataCur = dataPriv.set( dest, pdataOld ); - events = pdataOld.events; - - if ( events ) { - delete pdataCur.handle; - pdataCur.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( dataUser.hasData( src ) ) { - udataOld = dataUser.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - dataUser.set( dest, udataCur ); - } -} - -// Fix IE bugs, see support tests -function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -function domManip( collection, args, callback, ignored ) { - - // Flatten any nested arrays - args = concat.apply( [], args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = collection.length, - iNoClone = l - 1, - value = args[ 0 ], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return collection.each( function( index ) { - var self = collection.eq( index ); - if ( isFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - domManip( self, args, callback, ignored ); - } ); - } - - if ( l ) { - fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - // Require either new content or an interest in ignored elements to invoke the callback - if ( first || ignored ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item - // instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( collection[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !dataPriv.access( node, "globalEval" ) && - jQuery.contains( doc, node ) ) { - - if ( node.src ) { - - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); - } - } else { - DOMEval( node.textContent.replace( rcleanScript, "" ), doc ); - } - } - } - } - } - } - - return collection; -} - -function remove( elem, selector, keepData ) { - var node, - nodes = selector ? jQuery.filter( selector, elem ) : elem, - i = 0; - - for ( ; ( node = nodes[ i ] ) != null; i++ ) { - if ( !keepData && node.nodeType === 1 ) { - jQuery.cleanData( getAll( node ) ); - } - - if ( node.parentNode ) { - if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { - setGlobalEval( getAll( node, "script" ) ); - } - node.parentNode.removeChild( node ); - } - } - - return elem; -} - -jQuery.extend( { - htmlPrefilter: function( html ) { - return html.replace( rxhtmlTag, "<$1></$2>" ); - }, - - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = jQuery.contains( elem.ownerDocument, elem ); - - // Fix IE cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - cleanData: function( elems ) { - var data, elem, type, - special = jQuery.event.special, - i = 0; - - for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { - if ( acceptData( elem ) ) { - if ( ( data = elem[ dataPriv.expando ] ) ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataPriv.expando ] = undefined; - } - if ( elem[ dataUser.expando ] ) { - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataUser.expando ] = undefined; - } - } - } - } -} ); - -jQuery.fn.extend( { - detach: function( selector ) { - return remove( this, selector, true ); - }, - - remove: function( selector ) { - return remove( this, selector ); - }, - - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().each( function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = value; - } - } ); - }, null, value, arguments.length ); - }, - - append: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - } ); - }, - - prepend: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - } ); - }, - - before: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - } ); - }, - - after: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - } ); - }, - - empty: function() { - var elem, - i = 0; - - for ( ; ( elem = this[ i ] ) != null; i++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - } ); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = jQuery.htmlPrefilter( value ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch ( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var ignored = []; - - // Make the changes, replacing each non-ignored context element with the new content - return domManip( this, arguments, function( elem ) { - var parent = this.parentNode; - - if ( jQuery.inArray( this, ignored ) < 0 ) { - jQuery.cleanData( getAll( this ) ); - if ( parent ) { - parent.replaceChild( elem, this ); - } - } - - // Force callback invocation - }, ignored ); - } -} ); - -jQuery.each( { - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: Android <=4.0 only, PhantomJS 1 only - // .get() because push.apply(_, arraylike) throws on ancient WebKit - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -} ); -var rmargin = ( /^margin/ ); - -var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); - -var getStyles = function( elem ) { - - // Support: IE <=11 only, Firefox <=30 (#15098, #14150) - // IE throws on elements created in popups - // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" - var view = elem.ownerDocument.defaultView; - - if ( !view || !view.opener ) { - view = window; - } - - return view.getComputedStyle( elem ); - }; - - - -( function() { - - // Executing both pixelPosition & boxSizingReliable tests require only one layout - // so they're executed at the same time to save the second computation. - function computeStyleTests() { - - // This is a singleton, we need to execute it only once - if ( !div ) { - return; - } - - div.style.cssText = - "box-sizing:border-box;" + - "position:relative;display:block;" + - "margin:auto;border:1px;padding:1px;" + - "top:1%;width:50%"; - div.innerHTML = ""; - documentElement.appendChild( container ); - - var divStyle = window.getComputedStyle( div ); - pixelPositionVal = divStyle.top !== "1%"; - - // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 - reliableMarginLeftVal = divStyle.marginLeft === "2px"; - boxSizingReliableVal = divStyle.width === "4px"; - - // Support: Android 4.0 - 4.3 only - // Some styles come back with percentage values, even though they shouldn't - div.style.marginRight = "50%"; - pixelMarginRightVal = divStyle.marginRight === "4px"; - - documentElement.removeChild( container ); - - // Nullify the div so it wouldn't be stored in the memory and - // it will also be a sign that checks already performed - div = null; - } - - var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal, - container = document.createElement( "div" ), - div = document.createElement( "div" ); - - // Finish early in limited (non-browser) environments - if ( !div.style ) { - return; - } - - // Support: IE <=9 - 11 only - // Style of cloned element affects source element cloned (#8908) - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + - "padding:0;margin-top:1px;position:absolute"; - container.appendChild( div ); - - jQuery.extend( support, { - pixelPosition: function() { - computeStyleTests(); - return pixelPositionVal; - }, - boxSizingReliable: function() { - computeStyleTests(); - return boxSizingReliableVal; - }, - pixelMarginRight: function() { - computeStyleTests(); - return pixelMarginRightVal; - }, - reliableMarginLeft: function() { - computeStyleTests(); - return reliableMarginLeftVal; - } - } ); -} )(); - - -function curCSS( elem, name, computed ) { - var width, minWidth, maxWidth, ret, - style = elem.style; - - computed = computed || getStyles( elem ); - - // Support: IE <=9 only - // getPropertyValue is only needed for .css('filter') (#12537) - if ( computed ) { - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Android Browser returns percentage for some values, - // but width seems to be reliably pixels. - // This is against the CSSOM draft spec: - // https://drafts.csswg.org/cssom/#resolved-values - if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret !== undefined ? - - // Support: IE <=9 - 11 only - // IE returns zIndex value as an integer. - ret + "" : - ret; -} - - -function addGetHookIf( conditionFn, hookFn ) { - - // Define the hook, we'll check on the first run if it's really needed. - return { - get: function() { - if ( conditionFn() ) { - - // Hook not needed (or it's not possible to use it due - // to missing dependency), remove it. - delete this.get; - return; - } - - // Hook needed; redefine it so that the support test is not executed again. - return ( this.get = hookFn ).apply( this, arguments ); - } - }; -} - - -var - - // Swappable if display is none or starts with table - // except "table", "table-cell", or "table-caption" - // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" - }, - - cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style; - -// Return a css property mapped to a potentially vendor prefixed property -function vendorPropName( name ) { - - // Shortcut for names that are not vendor prefixed - if ( name in emptyStyle ) { - return name; - } - - // Check for vendor prefixed names - var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in emptyStyle ) { - return name; - } - } -} - -function setPositiveNumber( elem, value, subtract ) { - - // Any relative (+/-) values have already been - // normalized at this point - var matches = rcssNum.exec( value ); - return matches ? - - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : - value; -} - -function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { - var i = extra === ( isBorderBox ? "border" : "content" ) ? - - // If we already have the right measurement, avoid augmentation - 4 : - - // Otherwise initialize for horizontal or vertical properties - name === "width" ? 1 : 0, - - val = 0; - - for ( ; i < 4; i += 2 ) { - - // Both box models exclude margin, so add it if we want it - if ( extra === "margin" ) { - val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); - } - - if ( isBorderBox ) { - - // border-box includes padding, so remove it if we want content - if ( extra === "content" ) { - val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // At this point, extra isn't border nor margin, so remove border - if ( extra !== "margin" ) { - val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } else { - - // At this point, extra isn't content, so add padding - val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // At this point, extra isn't content nor padding, so add border - if ( extra !== "padding" ) { - val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - return val; -} - -function getWidthOrHeight( elem, name, extra ) { - - // Start with offset property, which is equivalent to the border-box value - var val, - valueIsBorderBox = true, - styles = getStyles( elem ), - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // Support: IE <=11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - if ( elem.getClientRects().length ) { - val = elem.getBoundingClientRect()[ name ]; - } - - // Some non-html elements return undefined for offsetWidth, so check for null/undefined - // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 - // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 - if ( val <= 0 || val == null ) { - - // Fall back to computed then uncomputed css if necessary - val = curCSS( elem, name, styles ); - if ( val < 0 || val == null ) { - val = elem.style[ name ]; - } - - // Computed unit is not pixels. Stop here and return. - if ( rnumnonpx.test( val ) ) { - return val; - } - - // Check for style in case a browser which returns unreliable values - // for getComputedStyle silently falls back to the reliable elem.style - valueIsBorderBox = isBorderBox && - ( support.boxSizingReliable() || val === elem.style[ name ] ); - - // Normalize "", auto, and prepare for extra - val = parseFloat( val ) || 0; - } - - // Use the active box-sizing model to add/subtract irrelevant styles - return ( val + - augmentWidthOrHeight( - elem, - name, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles - ) - ) + "px"; -} - -jQuery.extend( { - - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "animationIterationCount": true, - "columnCount": true, - "fillOpacity": true, - "flexGrow": true, - "flexShrink": true, - "fontWeight": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: { - "float": "cssFloat" - }, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = jQuery.camelCase( name ), - style = elem.style; - - name = jQuery.cssProps[ origName ] || - ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); - - // Gets hook for the prefixed version, then unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // Convert "+=" or "-=" to relative numbers (#7345) - if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { - value = adjustCSS( elem, name, ret ); - - // Fixes bug #9237 - type = "number"; - } - - // Make sure that null and NaN values aren't set (#7116) - if ( value == null || value !== value ) { - return; - } - - // If a number was passed in, add the unit (except for certain CSS properties) - if ( type === "number" ) { - value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); - } - - // background-* props affect original clone's values - if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !( "set" in hooks ) || - ( value = hooks.set( elem, value, extra ) ) !== undefined ) { - - style[ name ] = value; - } - - } else { - - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && - ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { - - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var val, num, hooks, - origName = jQuery.camelCase( name ); - - // Make sure that we're working with the right name - name = jQuery.cssProps[ origName ] || - ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); - - // Try prefixed name followed by the unprefixed name - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - // Convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Make numeric if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || isFinite( num ) ? num || 0 : val; - } - return val; - } -} ); - -jQuery.each( [ "height", "width" ], function( i, name ) { - jQuery.cssHooks[ name ] = { - get: function( elem, computed, extra ) { - if ( computed ) { - - // Certain elements can have dimension info if we invisibly show them - // but it must have a current display style that would benefit - return rdisplayswap.test( jQuery.css( elem, "display" ) ) && - - // Support: Safari 8+ - // Table columns in Safari have non-zero offsetWidth & zero - // getBoundingClientRect().width unless display is changed. - // Support: IE <=11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? - swap( elem, cssShow, function() { - return getWidthOrHeight( elem, name, extra ); - } ) : - getWidthOrHeight( elem, name, extra ); - } - }, - - set: function( elem, value, extra ) { - var matches, - styles = extra && getStyles( elem ), - subtract = extra && augmentWidthOrHeight( - elem, - name, - extra, - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - styles - ); - - // Convert to pixels if value adjustment is needed - if ( subtract && ( matches = rcssNum.exec( value ) ) && - ( matches[ 3 ] || "px" ) !== "px" ) { - - elem.style[ name ] = value; - value = jQuery.css( elem, name ); - } - - return setPositiveNumber( elem, value, subtract ); - } - }; -} ); - -jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, - function( elem, computed ) { - if ( computed ) { - return ( parseFloat( curCSS( elem, "marginLeft" ) ) || - elem.getBoundingClientRect().left - - swap( elem, { marginLeft: 0 }, function() { - return elem.getBoundingClientRect().left; - } ) - ) + "px"; - } - } -); - -// These hooks are used by animate to expand properties -jQuery.each( { - margin: "", - padding: "", - border: "Width" -}, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { - expand: function( value ) { - var i = 0, - expanded = {}, - - // Assumes a single number if not a string - parts = typeof value === "string" ? value.split( " " ) : [ value ]; - - for ( ; i < 4; i++ ) { - expanded[ prefix + cssExpand[ i ] + suffix ] = - parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; - } - - return expanded; - } - }; - - if ( !rmargin.test( prefix ) ) { - jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; - } -} ); - -jQuery.fn.extend( { - css: function( name, value ) { - return access( this, function( elem, name, value ) { - var styles, len, - map = {}, - i = 0; - - if ( jQuery.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - } -} ); - - -function Tween( elem, options, prop, end, easing ) { - return new Tween.prototype.init( elem, options, prop, end, easing ); -} -jQuery.Tween = Tween; - -Tween.prototype = { - constructor: Tween, - init: function( elem, options, prop, end, easing, unit ) { - this.elem = elem; - this.prop = prop; - this.easing = easing || jQuery.easing._default; - this.options = options; - this.start = this.now = this.cur(); - this.end = end; - this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - }, - cur: function() { - var hooks = Tween.propHooks[ this.prop ]; - - return hooks && hooks.get ? - hooks.get( this ) : - Tween.propHooks._default.get( this ); - }, - run: function( percent ) { - var eased, - hooks = Tween.propHooks[ this.prop ]; - - if ( this.options.duration ) { - this.pos = eased = jQuery.easing[ this.easing ]( - percent, this.options.duration * percent, 0, 1, this.options.duration - ); - } else { - this.pos = eased = percent; - } - this.now = ( this.end - this.start ) * eased + this.start; - - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - if ( hooks && hooks.set ) { - hooks.set( this ); - } else { - Tween.propHooks._default.set( this ); - } - return this; - } -}; - -Tween.prototype.init.prototype = Tween.prototype; - -Tween.propHooks = { - _default: { - get: function( tween ) { - var result; - - // Use a property on the element directly when it is not a DOM element, - // or when there is no matching style property that exists. - if ( tween.elem.nodeType !== 1 || - tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { - return tween.elem[ tween.prop ]; - } - - // Passing an empty string as a 3rd parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails. - // Simple values such as "10px" are parsed to Float; - // complex values such as "rotate(1rad)" are returned as-is. - result = jQuery.css( tween.elem, tween.prop, "" ); - - // Empty strings, null, undefined and "auto" are converted to 0. - return !result || result === "auto" ? 0 : result; - }, - set: function( tween ) { - - // Use step hook for back compat. - // Use cssHook if its there. - // Use .style if available and use plain properties where available. - if ( jQuery.fx.step[ tween.prop ] ) { - jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.nodeType === 1 && - ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || - jQuery.cssHooks[ tween.prop ] ) ) { - jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); - } else { - tween.elem[ tween.prop ] = tween.now; - } - } - } -}; - -// Support: IE <=9 only -// Panic based approach to setting things on disconnected nodes -Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { - set: function( tween ) { - if ( tween.elem.nodeType && tween.elem.parentNode ) { - tween.elem[ tween.prop ] = tween.now; - } - } -}; - -jQuery.easing = { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return 0.5 - Math.cos( p * Math.PI ) / 2; - }, - _default: "swing" -}; - -jQuery.fx = Tween.prototype.init; - -// Back compat <1.8 extension point -jQuery.fx.step = {}; - - - - -var - fxNow, timerId, - rfxtypes = /^(?:toggle|show|hide)$/, - rrun = /queueHooks$/; - -function raf() { - if ( timerId ) { - window.requestAnimationFrame( raf ); - jQuery.fx.tick(); - } -} - -// Animations created synchronously will run synchronously -function createFxNow() { - window.setTimeout( function() { - fxNow = undefined; - } ); - return ( fxNow = jQuery.now() ); -} - -// Generate parameters to create a standard animation -function genFx( type, includeWidth ) { - var which, - i = 0, - attrs = { height: type }; - - // If we include width, step value is 1 to do all cssExpand values, - // otherwise step value is 2 to skip over Left and Right - includeWidth = includeWidth ? 1 : 0; - for ( ; i < 4; i += 2 - includeWidth ) { - which = cssExpand[ i ]; - attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; - } - - if ( includeWidth ) { - attrs.opacity = attrs.width = type; - } - - return attrs; -} - -function createTween( value, prop, animation ) { - var tween, - collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), - index = 0, - length = collection.length; - for ( ; index < length; index++ ) { - if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { - - // We're done with this property - return tween; - } - } -} - -function defaultPrefilter( elem, props, opts ) { - var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, - isBox = "width" in props || "height" in props, - anim = this, - orig = {}, - style = elem.style, - hidden = elem.nodeType && isHiddenWithinTree( elem ), - dataShow = dataPriv.get( elem, "fxshow" ); - - // Queue-skipping animations hijack the fx hooks - if ( !opts.queue ) { - hooks = jQuery._queueHooks( elem, "fx" ); - if ( hooks.unqueued == null ) { - hooks.unqueued = 0; - oldfire = hooks.empty.fire; - hooks.empty.fire = function() { - if ( !hooks.unqueued ) { - oldfire(); - } - }; - } - hooks.unqueued++; - - anim.always( function() { - - // Ensure the complete handler is called before this completes - anim.always( function() { - hooks.unqueued--; - if ( !jQuery.queue( elem, "fx" ).length ) { - hooks.empty.fire(); - } - } ); - } ); - } - - // Detect show/hide animations - for ( prop in props ) { - value = props[ prop ]; - if ( rfxtypes.test( value ) ) { - delete props[ prop ]; - toggle = toggle || value === "toggle"; - if ( value === ( hidden ? "hide" : "show" ) ) { - - // Pretend to be hidden if this is a "show" and - // there is still data from a stopped show/hide - if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { - hidden = true; - - // Ignore all other no-op show/hide data - } else { - continue; - } - } - orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); - } - } - - // Bail out if this is a no-op like .hide().hide() - propTween = !jQuery.isEmptyObject( props ); - if ( !propTween && jQuery.isEmptyObject( orig ) ) { - return; - } - - // Restrict "overflow" and "display" styles during box animations - if ( isBox && elem.nodeType === 1 ) { - - // Support: IE <=9 - 11, Edge 12 - 13 - // Record all 3 overflow attributes because IE does not infer the shorthand - // from identically-valued overflowX and overflowY - opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - - // Identify a display type, preferring old show/hide data over the CSS cascade - restoreDisplay = dataShow && dataShow.display; - if ( restoreDisplay == null ) { - restoreDisplay = dataPriv.get( elem, "display" ); - } - display = jQuery.css( elem, "display" ); - if ( display === "none" ) { - if ( restoreDisplay ) { - display = restoreDisplay; - } else { - - // Get nonempty value(s) by temporarily forcing visibility - showHide( [ elem ], true ); - restoreDisplay = elem.style.display || restoreDisplay; - display = jQuery.css( elem, "display" ); - showHide( [ elem ] ); - } - } - - // Animate inline elements as inline-block - if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { - if ( jQuery.css( elem, "float" ) === "none" ) { - - // Restore the original display value at the end of pure show/hide animations - if ( !propTween ) { - anim.done( function() { - style.display = restoreDisplay; - } ); - if ( restoreDisplay == null ) { - display = style.display; - restoreDisplay = display === "none" ? "" : display; - } - } - style.display = "inline-block"; - } - } - } - - if ( opts.overflow ) { - style.overflow = "hidden"; - anim.always( function() { - style.overflow = opts.overflow[ 0 ]; - style.overflowX = opts.overflow[ 1 ]; - style.overflowY = opts.overflow[ 2 ]; - } ); - } - - // Implement show/hide animations - propTween = false; - for ( prop in orig ) { - - // General show/hide setup for this element animation - if ( !propTween ) { - if ( dataShow ) { - if ( "hidden" in dataShow ) { - hidden = dataShow.hidden; - } - } else { - dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); - } - - // Store hidden/visible for toggle so `.stop().toggle()` "reverses" - if ( toggle ) { - dataShow.hidden = !hidden; - } - - // Show elements before animating them - if ( hidden ) { - showHide( [ elem ], true ); - } - - /* eslint-disable no-loop-func */ - - anim.done( function() { - - /* eslint-enable no-loop-func */ - - // The final step of a "hide" animation is actually hiding the element - if ( !hidden ) { - showHide( [ elem ] ); - } - dataPriv.remove( elem, "fxshow" ); - for ( prop in orig ) { - jQuery.style( elem, prop, orig[ prop ] ); - } - } ); - } - - // Per-property setup - propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); - if ( !( prop in dataShow ) ) { - dataShow[ prop ] = propTween.start; - if ( hidden ) { - propTween.end = propTween.start; - propTween.start = 0; - } - } - } -} - -function propFilter( props, specialEasing ) { - var index, name, easing, value, hooks; - - // camelCase, specialEasing and expand cssHook pass - for ( index in props ) { - name = jQuery.camelCase( index ); - easing = specialEasing[ name ]; - value = props[ index ]; - if ( jQuery.isArray( value ) ) { - easing = value[ 1 ]; - value = props[ index ] = value[ 0 ]; - } - - if ( index !== name ) { - props[ name ] = value; - delete props[ index ]; - } - - hooks = jQuery.cssHooks[ name ]; - if ( hooks && "expand" in hooks ) { - value = hooks.expand( value ); - delete props[ name ]; - - // Not quite $.extend, this won't overwrite existing keys. - // Reusing 'index' because we have the correct "name" - for ( index in value ) { - if ( !( index in props ) ) { - props[ index ] = value[ index ]; - specialEasing[ index ] = easing; - } - } - } else { - specialEasing[ name ] = easing; - } - } -} - -function Animation( elem, properties, options ) { - var result, - stopped, - index = 0, - length = Animation.prefilters.length, - deferred = jQuery.Deferred().always( function() { - - // Don't match elem in the :animated selector - delete tick.elem; - } ), - tick = function() { - if ( stopped ) { - return false; - } - var currentTime = fxNow || createFxNow(), - remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), - - // Support: Android 2.3 only - // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) - temp = remaining / animation.duration || 0, - percent = 1 - temp, - index = 0, - length = animation.tweens.length; - - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( percent ); - } - - deferred.notifyWith( elem, [ animation, percent, remaining ] ); - - if ( percent < 1 && length ) { - return remaining; - } else { - deferred.resolveWith( elem, [ animation ] ); - return false; - } - }, - animation = deferred.promise( { - elem: elem, - props: jQuery.extend( {}, properties ), - opts: jQuery.extend( true, { - specialEasing: {}, - easing: jQuery.easing._default - }, options ), - originalProperties: properties, - originalOptions: options, - startTime: fxNow || createFxNow(), - duration: options.duration, - tweens: [], - createTween: function( prop, end ) { - var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); - animation.tweens.push( tween ); - return tween; - }, - stop: function( gotoEnd ) { - var index = 0, - - // If we are going to the end, we want to run all the tweens - // otherwise we skip this part - length = gotoEnd ? animation.tweens.length : 0; - if ( stopped ) { - return this; - } - stopped = true; - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( 1 ); - } - - // Resolve when we played the last frame; otherwise, reject - if ( gotoEnd ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - deferred.resolveWith( elem, [ animation, gotoEnd ] ); - } else { - deferred.rejectWith( elem, [ animation, gotoEnd ] ); - } - return this; - } - } ), - props = animation.props; - - propFilter( props, animation.opts.specialEasing ); - - for ( ; index < length; index++ ) { - result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); - if ( result ) { - if ( jQuery.isFunction( result.stop ) ) { - jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = - jQuery.proxy( result.stop, result ); - } - return result; - } - } - - jQuery.map( props, createTween, animation ); - - if ( jQuery.isFunction( animation.opts.start ) ) { - animation.opts.start.call( elem, animation ); - } - - jQuery.fx.timer( - jQuery.extend( tick, { - elem: elem, - anim: animation, - queue: animation.opts.queue - } ) - ); - - // attach callbacks from options - return animation.progress( animation.opts.progress ) - .done( animation.opts.done, animation.opts.complete ) - .fail( animation.opts.fail ) - .always( animation.opts.always ); -} - -jQuery.Animation = jQuery.extend( Animation, { - - tweeners: { - "*": [ function( prop, value ) { - var tween = this.createTween( prop, value ); - adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); - return tween; - } ] - }, - - tweener: function( props, callback ) { - if ( jQuery.isFunction( props ) ) { - callback = props; - props = [ "*" ]; - } else { - props = props.match( rnotwhite ); - } - - var prop, - index = 0, - length = props.length; - - for ( ; index < length; index++ ) { - prop = props[ index ]; - Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; - Animation.tweeners[ prop ].unshift( callback ); - } - }, - - prefilters: [ defaultPrefilter ], - - prefilter: function( callback, prepend ) { - if ( prepend ) { - Animation.prefilters.unshift( callback ); - } else { - Animation.prefilters.push( callback ); - } - } -} ); - -jQuery.speed = function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - jQuery.isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing - }; - - // Go to the end state if fx are off or if document is hidden - if ( jQuery.fx.off || document.hidden ) { - opt.duration = 0; - - } else { - opt.duration = typeof opt.duration === "number" ? - opt.duration : opt.duration in jQuery.fx.speeds ? - jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; - } - - // Normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function() { - if ( jQuery.isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } - }; - - return opt; -}; - -jQuery.fn.extend( { - fadeTo: function( speed, to, easing, callback ) { - - // Show any hidden elements after setting opacity to 0 - return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() - - // Animate to the value specified - .end().animate( { opacity: to }, speed, easing, callback ); - }, - animate: function( prop, speed, easing, callback ) { - var empty = jQuery.isEmptyObject( prop ), - optall = jQuery.speed( speed, easing, callback ), - doAnimation = function() { - - // Operate on a copy of prop so per-property easing won't be lost - var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - - // Empty animations, or finishing resolves immediately - if ( empty || dataPriv.get( this, "finish" ) ) { - anim.stop( true ); - } - }; - doAnimation.finish = doAnimation; - - return empty || optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - stop: function( type, clearQueue, gotoEnd ) { - var stopQueue = function( hooks ) { - var stop = hooks.stop; - delete hooks.stop; - stop( gotoEnd ); - }; - - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue && type !== false ) { - this.queue( type || "fx", [] ); - } - - return this.each( function() { - var dequeue = true, - index = type != null && type + "queueHooks", - timers = jQuery.timers, - data = dataPriv.get( this ); - - if ( index ) { - if ( data[ index ] && data[ index ].stop ) { - stopQueue( data[ index ] ); - } - } else { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { - stopQueue( data[ index ] ); - } - } - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && - ( type == null || timers[ index ].queue === type ) ) { - - timers[ index ].anim.stop( gotoEnd ); - dequeue = false; - timers.splice( index, 1 ); - } - } - - // Start the next in the queue if the last step wasn't forced. - // Timers currently will call their complete callbacks, which - // will dequeue but only if they were gotoEnd. - if ( dequeue || !gotoEnd ) { - jQuery.dequeue( this, type ); - } - } ); - }, - finish: function( type ) { - if ( type !== false ) { - type = type || "fx"; - } - return this.each( function() { - var index, - data = dataPriv.get( this ), - queue = data[ type + "queue" ], - hooks = data[ type + "queueHooks" ], - timers = jQuery.timers, - length = queue ? queue.length : 0; - - // Enable finishing flag on private data - data.finish = true; - - // Empty the queue first - jQuery.queue( this, type, [] ); - - if ( hooks && hooks.stop ) { - hooks.stop.call( this, true ); - } - - // Look for any active animations, and finish them - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && timers[ index ].queue === type ) { - timers[ index ].anim.stop( true ); - timers.splice( index, 1 ); - } - } - - // Look for any animations in the old queue and finish them - for ( index = 0; index < length; index++ ) { - if ( queue[ index ] && queue[ index ].finish ) { - queue[ index ].finish.call( this ); - } - } - - // Turn off finishing flag - delete data.finish; - } ); - } -} ); - -jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { - var cssFn = jQuery.fn[ name ]; - jQuery.fn[ name ] = function( speed, easing, callback ) { - return speed == null || typeof speed === "boolean" ? - cssFn.apply( this, arguments ) : - this.animate( genFx( name, true ), speed, easing, callback ); - }; -} ); - -// Generate shortcuts for custom animations -jQuery.each( { - slideDown: genFx( "show" ), - slideUp: genFx( "hide" ), - slideToggle: genFx( "toggle" ), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } -}, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; -} ); - -jQuery.timers = []; -jQuery.fx.tick = function() { - var timer, - i = 0, - timers = jQuery.timers; - - fxNow = jQuery.now(); - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - - // Checks the timer has not already been removed - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - fxNow = undefined; -}; - -jQuery.fx.timer = function( timer ) { - jQuery.timers.push( timer ); - if ( timer() ) { - jQuery.fx.start(); - } else { - jQuery.timers.pop(); - } -}; - -jQuery.fx.interval = 13; -jQuery.fx.start = function() { - if ( !timerId ) { - timerId = window.requestAnimationFrame ? - window.requestAnimationFrame( raf ) : - window.setInterval( jQuery.fx.tick, jQuery.fx.interval ); - } -}; - -jQuery.fx.stop = function() { - if ( window.cancelAnimationFrame ) { - window.cancelAnimationFrame( timerId ); - } else { - window.clearInterval( timerId ); - } - - timerId = null; -}; - -jQuery.fx.speeds = { - slow: 600, - fast: 200, - - // Default speed - _default: 400 -}; - - -// Based off of the plugin by Clint Helfers, with permission. -// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ -jQuery.fn.delay = function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = window.setTimeout( next, time ); - hooks.stop = function() { - window.clearTimeout( timeout ); - }; - } ); -}; - - -( function() { - var input = document.createElement( "input" ), - select = document.createElement( "select" ), - opt = select.appendChild( document.createElement( "option" ) ); - - input.type = "checkbox"; - - // Support: Android <=4.3 only - // Default value for a checkbox should be "on" - support.checkOn = input.value !== ""; - - // Support: IE <=11 only - // Must access selectedIndex to make default options select - support.optSelected = opt.selected; - - // Support: IE <=11 only - // An input loses its value after becoming a radio - input = document.createElement( "input" ); - input.value = "t"; - input.type = "radio"; - support.radioValue = input.value === "t"; -} )(); - - -var boolHook, - attrHandle = jQuery.expr.attrHandle; - -jQuery.fn.extend( { - attr: function( name, value ) { - return access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each( function() { - jQuery.removeAttr( this, name ); - } ); - } -} ); - -jQuery.extend( { - attr: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set attributes on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - // Attribute hooks are determined by the lowercase version - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - hooks = jQuery.attrHooks[ name.toLowerCase() ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); - } - - if ( value !== undefined ) { - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - } - - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - elem.setAttribute( name, value + "" ); - return value; - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? undefined : ret; - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !support.radioValue && value === "radio" && - jQuery.nodeName( elem, "input" ) ) { - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - removeAttr: function( elem, value ) { - var name, - i = 0, - attrNames = value && value.match( rnotwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( ( name = attrNames[ i++ ] ) ) { - elem.removeAttribute( name ); - } - } - } -} ); - -// Hooks for boolean attributes -boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - elem.setAttribute( name, name ); - } - return name; - } -}; - -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { - var getter = attrHandle[ name ] || jQuery.find.attr; - - attrHandle[ name ] = function( elem, name, isXML ) { - var ret, handle, - lowercaseName = name.toLowerCase(); - - if ( !isXML ) { - - // Avoid an infinite loop by temporarily removing this function from the getter - handle = attrHandle[ lowercaseName ]; - attrHandle[ lowercaseName ] = ret; - ret = getter( elem, name, isXML ) != null ? - lowercaseName : - null; - attrHandle[ lowercaseName ] = handle; - } - return ret; - }; -} ); - - - - -var rfocusable = /^(?:input|select|textarea|button)$/i, - rclickable = /^(?:a|area)$/i; - -jQuery.fn.extend( { - prop: function( name, value ) { - return access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - return this.each( function() { - delete this[ jQuery.propFix[ name ] || name ]; - } ); - } -} ); - -jQuery.extend( { - prop: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set properties on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - return ( elem[ name ] = value ); - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - return elem[ name ]; - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - - // Support: IE <=9 - 11 only - // elem.tabIndex doesn't always return the - // correct value when it hasn't been explicitly set - // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - return tabindex ? - parseInt( tabindex, 10 ) : - rfocusable.test( elem.nodeName ) || - rclickable.test( elem.nodeName ) && elem.href ? - 0 : - -1; - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - } -} ); - -// Support: IE <=11 only -// Accessing the selectedIndex property -// forces the browser to respect setting selected -// on the option -// The getter ensures a default option is selected -// when in an optgroup -if ( !support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - var parent = elem.parentNode; - if ( parent && parent.parentNode ) { - parent.parentNode.selectedIndex; - } - return null; - }, - set: function( elem ) { - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }; -} - -jQuery.each( [ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" -], function() { - jQuery.propFix[ this.toLowerCase() ] = this; -} ); - - - - -var rclass = /[\t\r\n\f]/g; - -function getClass( elem ) { - return elem.getAttribute && elem.getAttribute( "class" ) || ""; -} - -jQuery.fn.extend( { - addClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( jQuery.isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( typeof value === "string" && value ) { - classes = value.match( rnotwhite ) || []; - - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - cur = elem.nodeType === 1 && - ( " " + curValue + " " ).replace( rclass, " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = jQuery.trim( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( jQuery.isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( !arguments.length ) { - return this.attr( "class", "" ); - } - - if ( typeof value === "string" && value ) { - classes = value.match( rnotwhite ) || []; - - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && - ( " " + curValue + " " ).replace( rclass, " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) > -1 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = jQuery.trim( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value; - - if ( typeof stateVal === "boolean" && type === "string" ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( jQuery.isFunction( value ) ) { - return this.each( function( i ) { - jQuery( this ).toggleClass( - value.call( this, i, getClass( this ), stateVal ), - stateVal - ); - } ); - } - - return this.each( function() { - var className, i, self, classNames; - - if ( type === "string" ) { - - // Toggle individual class names - i = 0; - self = jQuery( this ); - classNames = value.match( rnotwhite ) || []; - - while ( ( className = classNames[ i++ ] ) ) { - - // Check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( value === undefined || type === "boolean" ) { - className = getClass( this ); - if ( className ) { - - // Store className if set - dataPriv.set( this, "__className__", className ); - } - - // If the element has a class name or if we're passed `false`, - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - if ( this.setAttribute ) { - this.setAttribute( "class", - className || value === false ? - "" : - dataPriv.get( this, "__className__" ) || "" - ); - } - } - } ); - }, - - hasClass: function( selector ) { - var className, elem, - i = 0; - - className = " " + selector + " "; - while ( ( elem = this[ i++ ] ) ) { - if ( elem.nodeType === 1 && - ( " " + getClass( elem ) + " " ).replace( rclass, " " ) - .indexOf( className ) > -1 - ) { - return true; - } - } - - return false; - } -} ); - - - - -var rreturn = /\r/g, - rspaces = /[\x20\t\r\n\f]+/g; - -jQuery.fn.extend( { - val: function( value ) { - var hooks, ret, isFunction, - elem = this[ 0 ]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || - jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && - "get" in hooks && - ( ret = hooks.get( elem, "value" ) ) !== undefined - ) { - return ret; - } - - ret = elem.value; - - return typeof ret === "string" ? - - // Handle most common string cases - ret.replace( rreturn, "" ) : - - // Handle cases where value is null/undef or number - ret == null ? "" : ret; - } - - return; - } - - isFunction = jQuery.isFunction( value ); - - return this.each( function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - - } else if ( typeof val === "number" ) { - val += ""; - - } else if ( jQuery.isArray( val ) ) { - val = jQuery.map( val, function( value ) { - return value == null ? "" : value + ""; - } ); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - } ); - } -} ); - -jQuery.extend( { - valHooks: { - option: { - get: function( elem ) { - - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - - // Support: IE <=10 - 11 only - // option.text throws exceptions (#14686, #14858) - // Strip and collapse whitespace - // https://html.spec.whatwg.org/#strip-and-collapse-whitespace - jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " ); - } - }, - select: { - get: function( elem ) { - var value, option, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one", - values = one ? null : [], - max = one ? index + 1 : options.length, - i = index < 0 ? - max : - one ? index : 0; - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Support: IE <=9 only - // IE8-9 doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - - // Don't return options that are disabled or in a disabled optgroup - !option.disabled && - ( !option.parentNode.disabled || - !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - - /* eslint-disable no-cond-assign */ - - if ( option.selected = - jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 - ) { - optionSet = true; - } - - /* eslint-enable no-cond-assign */ - } - - // Force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - } -} ); - -// Radios and checkboxes getter/setter -jQuery.each( [ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); - } - } - }; - if ( !support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - return elem.getAttribute( "value" ) === null ? "on" : elem.value; - }; - } -} ); - - - - -// Return jQuery for attributes-only inclusion - - -var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/; - -jQuery.extend( jQuery.event, { - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "." ) > -1 ) { - - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split( "." ); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf( ":" ) < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join( "." ); - event.rnamespace = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === ( elem.ownerDocument || document ) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && - dataPriv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( ( !special._default || - special._default.apply( eventPath.pop(), data ) === false ) && - acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - elem[ type ](); - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - // Piggyback on a donor event to simulate a different one - // Used only for `focus(in | out)` events - simulate: function( type, elem, event ) { - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true - } - ); - - jQuery.event.trigger( e, null, elem ); - } - -} ); - -jQuery.fn.extend( { - - trigger: function( type, data ) { - return this.each( function() { - jQuery.event.trigger( type, data, this ); - } ); - }, - triggerHandler: function( type, data ) { - var elem = this[ 0 ]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -} ); - - -jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup contextmenu" ).split( " " ), - function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - return arguments.length > 0 ? - this.on( name, null, data, fn ) : - this.trigger( name ); - }; -} ); - -jQuery.fn.extend( { - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -} ); - - - - -support.focusin = "onfocusin" in window; - - -// Support: Firefox <=44 -// Firefox doesn't have focus(in | out) events -// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 -// -// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 -// focus(in | out) events fire after focus & blur events, -// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order -// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 -if ( !support.focusin ) { - jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - var doc = this.ownerDocument || this, - attaches = dataPriv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = dataPriv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - dataPriv.remove( doc, fix ); - - } else { - dataPriv.access( doc, fix, attaches ); - } - } - }; - } ); -} -var location = window.location; - -var nonce = jQuery.now(); - -var rquery = ( /\?/ ); - - - -// Cross-browser xml parsing -jQuery.parseXML = function( data ) { - var xml; - if ( !data || typeof data !== "string" ) { - return null; - } - - // Support: IE 9 - 11 only - // IE throws on parseFromString with invalid input. - try { - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) { - xml = undefined; - } - - if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; -}; - - -var - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, - rsubmittable = /^(?:input|select|textarea|keygen)/i; - -function buildParams( prefix, obj, traditional, add ) { - var name; - - if ( jQuery.isArray( obj ) ) { - - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - - // Item is non-scalar (array or object), encode its numeric index. - buildParams( - prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", - v, - traditional, - add - ); - } - } ); - - } else if ( !traditional && jQuery.type( obj ) === "object" ) { - - // Serialize object item. - for ( name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - - // Serialize scalar item. - add( prefix, obj ); - } -} - -// Serialize an array of form elements or a set of -// key/values into a query string -jQuery.param = function( a, traditional ) { - var prefix, - s = [], - add = function( key, valueOrFunction ) { - - // If value is a function, invoke it and use its return value - var value = jQuery.isFunction( valueOrFunction ) ? - valueOrFunction() : - valueOrFunction; - - s[ s.length ] = encodeURIComponent( key ) + "=" + - encodeURIComponent( value == null ? "" : value ); - }; - - // If an array was passed in, assume that it is an array of form elements. - if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - } ); - - } else { - - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ); -}; - -jQuery.fn.extend( { - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - serializeArray: function() { - return this.map( function() { - - // Can add propHook for "elements" to filter or add form elements - var elements = jQuery.prop( this, "elements" ); - return elements ? jQuery.makeArray( elements ) : this; - } ) - .filter( function() { - var type = this.type; - - // Use .is( ":disabled" ) so that fieldset[disabled] works - return this.name && !jQuery( this ).is( ":disabled" ) && - rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && - ( this.checked || !rcheckableType.test( type ) ); - } ) - .map( function( i, elem ) { - var val = jQuery( this ).val(); - - return val == null ? - null : - jQuery.isArray( val ) ? - jQuery.map( val, function( val ) { - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ) : - { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ).get(); - } -} ); - - -var - r20 = /%20/g, - rhash = /#.*$/, - rts = /([?&])_=[^&]*/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, - - // #7653, #8125, #8152: local protocol detection - rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = "*/".concat( "*" ), - - // Anchor tag for parsing the document origin - originAnchor = document.createElement( "a" ); - originAnchor.href = location.href; - -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport -function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - var dataType, - i = 0, - dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; - - if ( jQuery.isFunction( func ) ) { - - // For each dataType in the dataTypeExpression - while ( ( dataType = dataTypes[ i++ ] ) ) { - - // Prepend if requested - if ( dataType[ 0 ] === "+" ) { - dataType = dataType.slice( 1 ) || "*"; - ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); - - // Otherwise append - } else { - ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); - } - } - } - }; -} - -// Base inspection function for prefilters and transports -function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { - - var inspected = {}, - seekingTransport = ( structure === transports ); - - function inspect( dataType ) { - var selected; - inspected[ dataType ] = true; - jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { - var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); - if ( typeof dataTypeOrTransport === "string" && - !seekingTransport && !inspected[ dataTypeOrTransport ] ) { - - options.dataTypes.unshift( dataTypeOrTransport ); - inspect( dataTypeOrTransport ); - return false; - } else if ( seekingTransport ) { - return !( selected = dataTypeOrTransport ); - } - } ); - return selected; - } - - return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); -} - -// A special extend for ajax options -// that takes "flat" options (not to be deep extended) -// Fixes #9887 -function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } - - return target; -} - -/* Handles responses to an ajax request: - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ -function ajaxHandleResponses( s, jqXHR, responses ) { - - var ct, type, finalDataType, firstDataType, - contents = s.contents, - dataTypes = s.dataTypes; - - // Remove auto dataType and get content-type in the process - while ( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } -} - -/* Chain conversions given the request and the original response - * Also sets the responseXXX fields on the jqXHR instance - */ -function ajaxConvert( s, response, jqXHR, isSuccess ) { - var conv2, current, conv, tmp, prev, - converters = {}, - - // Work with a copy of dataTypes in case we need to modify it for conversion - dataTypes = s.dataTypes.slice(); - - // Create converters map with lowercased keys - if ( dataTypes[ 1 ] ) { - for ( conv in s.converters ) { - converters[ conv.toLowerCase() ] = s.converters[ conv ]; - } - } - - current = dataTypes.shift(); - - // Convert to each sequential dataType - while ( current ) { - - if ( s.responseFields[ current ] ) { - jqXHR[ s.responseFields[ current ] ] = response; - } - - // Apply the dataFilter if provided - if ( !prev && isSuccess && s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - prev = current; - current = dataTypes.shift(); - - if ( current ) { - - // There's only work to do if current dataType is non-auto - if ( current === "*" ) { - - current = prev; - - // Convert response if prev dataType is non-auto and differs from current - } else if ( prev !== "*" && prev !== current ) { - - // Seek a direct converter - conv = converters[ prev + " " + current ] || converters[ "* " + current ]; - - // If none found, seek a pair - if ( !conv ) { - for ( conv2 in converters ) { - - // If conv2 outputs current - tmp = conv2.split( " " ); - if ( tmp[ 1 ] === current ) { - - // If prev can be converted to accepted input - conv = converters[ prev + " " + tmp[ 0 ] ] || - converters[ "* " + tmp[ 0 ] ]; - if ( conv ) { - - // Condense equivalence converters - if ( conv === true ) { - conv = converters[ conv2 ]; - - // Otherwise, insert the intermediate dataType - } else if ( converters[ conv2 ] !== true ) { - current = tmp[ 0 ]; - dataTypes.unshift( tmp[ 1 ] ); - } - break; - } - } - } - } - - // Apply converter (if not an equivalence) - if ( conv !== true ) { - - // Unless errors are allowed to bubble, catch and return them - if ( conv && s.throws ) { - response = conv( response ); - } else { - try { - response = conv( response ); - } catch ( e ) { - return { - state: "parsererror", - error: conv ? e : "No conversion from " + prev + " to " + current - }; - } - } - } - } - } - } - - return { state: "success", data: response }; -} - -jQuery.extend( { - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {}, - - ajaxSettings: { - url: location.href, - type: "GET", - isLocal: rlocalProtocol.test( location.protocol ), - global: true, - processData: true, - async: true, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - throws: false, - traditional: false, - headers: {}, - */ - - accepts: { - "*": allTypes, - text: "text/plain", - html: "text/html", - xml: "application/xml, text/xml", - json: "application/json, text/javascript" - }, - - contents: { - xml: /\bxml\b/, - html: /\bhtml/, - json: /\bjson\b/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText", - json: "responseJSON" - }, - - // Data converters - // Keys separate source (or catchall "*") and destination types with a single space - converters: { - - // Convert anything to text - "* text": String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": JSON.parse, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - url: true, - context: true - } - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - return settings ? - - // Building a settings object - ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : - - // Extending ajaxSettings - ajaxExtend( jQuery.ajaxSettings, target ); - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var transport, - - // URL without anti-cache param - cacheURL, - - // Response headers - responseHeadersString, - responseHeaders, - - // timeout handle - timeoutTimer, - - // Url cleanup var - urlAnchor, - - // Request state (becomes false upon send and true upon completion) - completed, - - // To know if global events are to be dispatched - fireGlobals, - - // Loop variable - i, - - // uncached part of the url - uncached, - - // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - - // Callbacks context - callbackContext = s.context || s, - - // Context for global events is callbackContext if it is a DOM node or jQuery collection - globalEventContext = s.context && - ( callbackContext.nodeType || callbackContext.jquery ) ? - jQuery( callbackContext ) : - jQuery.event, - - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - - // Status-dependent callbacks - statusCode = s.statusCode || {}, - - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - - // Default abort message - strAbort = "canceled", - - // Fake xhr - jqXHR = { - readyState: 0, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( completed ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; - } - } - match = responseHeaders[ key.toLowerCase() ]; - } - return match == null ? null : match; - }, - - // Raw string - getAllResponseHeaders: function() { - return completed ? responseHeadersString : null; - }, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( completed == null ) { - name = requestHeadersNames[ name.toLowerCase() ] = - requestHeadersNames[ name.toLowerCase() ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( completed == null ) { - s.mimeType = type; - } - return this; - }, - - // Status-dependent callbacks - statusCode: function( map ) { - var code; - if ( map ) { - if ( completed ) { - - // Execute the appropriate callbacks - jqXHR.always( map[ jqXHR.status ] ); - } else { - - // Lazy-add the new callbacks in a way that preserves old ones - for ( code in map ) { - statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; - } - } - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - var finalText = statusText || strAbort; - if ( transport ) { - transport.abort( finalText ); - } - done( 0, finalText ); - return this; - } - }; - - // Attach deferreds - deferred.promise( jqXHR ); - - // Add protocol if not provided (prefilters might expect it) - // Handle falsy url in the settings object (#10093: consistency with old signature) - // We also use the url parameter if available - s.url = ( ( url || s.url || location.href ) + "" ) - .replace( rprotocol, location.protocol + "//" ); - - // Alias method option to type as per ticket #12004 - s.type = options.method || options.type || s.method || s.type; - - // Extract dataTypes list - s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; - - // A cross-domain request is in order when the origin doesn't match the current origin. - if ( s.crossDomain == null ) { - urlAnchor = document.createElement( "a" ); - - // Support: IE <=8 - 11, Edge 12 - 13 - // IE throws exception on accessing the href property if url is malformed, - // e.g. http://example.com:80x/ - try { - urlAnchor.href = s.url; - - // Support: IE <=8 - 11 only - // Anchor's host property isn't correctly set when s.url is relative - urlAnchor.href = urlAnchor.href; - s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== - urlAnchor.protocol + "//" + urlAnchor.host; - } catch ( e ) { - - // If there is an error parsing the URL, assume it is crossDomain, - // it can be rejected by the transport if it is invalid - s.crossDomain = true; - } - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefilter, stop there - if ( completed ) { - return jqXHR; - } - - // We can fire global events as of now if asked to - // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) - fireGlobals = jQuery.event && s.global; - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Save the URL in case we're toying with the If-Modified-Since - // and/or If-None-Match header later on - // Remove hash to simplify url manipulation - cacheURL = s.url.replace( rhash, "" ); - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // Remember the hash so we can put it back - uncached = s.url.slice( cacheURL.length ); - - // If data is available, append data to url - if ( s.data ) { - cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; - - // #9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Add anti-cache in uncached url if needed - if ( s.cache === false ) { - cacheURL = cacheURL.replace( rts, "" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; - } - - // Put hash and anti-cache on the URL that will be requested (gh-1732) - s.url = cacheURL + uncached; - - // Change '%20' to '+' if this is encoded form body content (gh-2658) - } else if ( s.data && s.processData && - ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { - s.data = s.data.replace( r20, "+" ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - if ( jQuery.lastModified[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); - } - if ( jQuery.etag[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? - s.accepts[ s.dataTypes[ 0 ] ] + - ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && - ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { - - // Abort if not done already and return - return jqXHR.abort(); - } - - // Aborting is no longer a cancellation - strAbort = "abort"; - - // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - - // If request was aborted inside ajaxSend, stop there - if ( completed ) { - return jqXHR; - } - - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = window.setTimeout( function() { - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - completed = false; - transport.send( requestHeaders, done ); - } catch ( e ) { - - // Rethrow post-completion exceptions - if ( completed ) { - throw e; - } - - // Propagate others as results - done( -1, e ); - } - } - - // Callback for when everything is done - function done( status, nativeStatusText, responses, headers ) { - var isSuccess, success, error, response, modified, - statusText = nativeStatusText; - - // Ignore repeat invocations - if ( completed ) { - return; - } - - completed = true; - - // Clear timeout if it exists - if ( timeoutTimer ) { - window.clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - // Determine if successful - isSuccess = status >= 200 && status < 300 || status === 304; - - // Get response data - if ( responses ) { - response = ajaxHandleResponses( s, jqXHR, responses ); - } - - // Convert no matter what (that way responseXXX fields are always set) - response = ajaxConvert( s, response, jqXHR, isSuccess ); - - // If successful, handle type chaining - if ( isSuccess ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - modified = jqXHR.getResponseHeader( "Last-Modified" ); - if ( modified ) { - jQuery.lastModified[ cacheURL ] = modified; - } - modified = jqXHR.getResponseHeader( "etag" ); - if ( modified ) { - jQuery.etag[ cacheURL ] = modified; - } - } - - // if no content - if ( status === 204 || s.type === "HEAD" ) { - statusText = "nocontent"; - - // if not modified - } else if ( status === 304 ) { - statusText = "notmodified"; - - // If we have data, let's convert it - } else { - statusText = response.state; - success = response.data; - error = response.error; - isSuccess = !error; - } - } else { - - // Extract error from statusText and normalize for non-aborts - error = statusText; - if ( status || !statusText ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = ( nativeStatusText || statusText ) + ""; - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - return jqXHR; - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - } -} ); - -jQuery.each( [ "get", "post" ], function( i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - - // Shift arguments if data argument was omitted - if ( jQuery.isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - // The url can be an options object (which then must have .url) - return jQuery.ajax( jQuery.extend( { - url: url, - type: method, - dataType: type, - data: data, - success: callback - }, jQuery.isPlainObject( url ) && url ) ); - }; -} ); - - -jQuery._evalUrl = function( url ) { - return jQuery.ajax( { - url: url, - - // Make this explicit, since user can override this through ajaxSetup (#11264) - type: "GET", - dataType: "script", - cache: true, - async: false, - global: false, - "throws": true - } ); -}; - - -jQuery.fn.extend( { - wrapAll: function( html ) { - var wrap; - - if ( this[ 0 ] ) { - if ( jQuery.isFunction( html ) ) { - html = html.call( this[ 0 ] ); - } - - // The elements to wrap the target around - wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); - - if ( this[ 0 ].parentNode ) { - wrap.insertBefore( this[ 0 ] ); - } - - wrap.map( function() { - var elem = this; - - while ( elem.firstElementChild ) { - elem = elem.firstElementChild; - } - - return elem; - } ).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each( function( i ) { - jQuery( this ).wrapInner( html.call( this, i ) ); - } ); - } - - return this.each( function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - } ); - }, - - wrap: function( html ) { - var isFunction = jQuery.isFunction( html ); - - return this.each( function( i ) { - jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); - } ); - }, - - unwrap: function( selector ) { - this.parent( selector ).not( "body" ).each( function() { - jQuery( this ).replaceWith( this.childNodes ); - } ); - return this; - } -} ); - - -jQuery.expr.pseudos.hidden = function( elem ) { - return !jQuery.expr.pseudos.visible( elem ); -}; -jQuery.expr.pseudos.visible = function( elem ) { - return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); -}; - - - - -jQuery.ajaxSettings.xhr = function() { - try { - return new window.XMLHttpRequest(); - } catch ( e ) {} -}; - -var xhrSuccessStatus = { - - // File protocol always yields status code 0, assume 200 - 0: 200, - - // Support: IE <=9 only - // #1450: sometimes IE returns 1223 when it should be 204 - 1223: 204 - }, - xhrSupported = jQuery.ajaxSettings.xhr(); - -support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); -support.ajax = xhrSupported = !!xhrSupported; - -jQuery.ajaxTransport( function( options ) { - var callback, errorCallback; - - // Cross domain only allowed if supported through XMLHttpRequest - if ( support.cors || xhrSupported && !options.crossDomain ) { - return { - send: function( headers, complete ) { - var i, - xhr = options.xhr(); - - xhr.open( - options.type, - options.url, - options.async, - options.username, - options.password - ); - - // Apply custom fields if provided - if ( options.xhrFields ) { - for ( i in options.xhrFields ) { - xhr[ i ] = options.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( options.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( options.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Set headers - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - - // Callback - callback = function( type ) { - return function() { - if ( callback ) { - callback = errorCallback = xhr.onload = - xhr.onerror = xhr.onabort = xhr.onreadystatechange = null; - - if ( type === "abort" ) { - xhr.abort(); - } else if ( type === "error" ) { - - // Support: IE <=9 only - // On a manual native abort, IE9 throws - // errors on any property access that is not readyState - if ( typeof xhr.status !== "number" ) { - complete( 0, "error" ); - } else { - complete( - - // File: protocol always yields status 0; see #8605, #14207 - xhr.status, - xhr.statusText - ); - } - } else { - complete( - xhrSuccessStatus[ xhr.status ] || xhr.status, - xhr.statusText, - - // Support: IE <=9 only - // IE9 has no XHR2 but throws on binary (trac-11426) - // For XHR2 non-text, let the caller handle it (gh-2498) - ( xhr.responseType || "text" ) !== "text" || - typeof xhr.responseText !== "string" ? - { binary: xhr.response } : - { text: xhr.responseText }, - xhr.getAllResponseHeaders() - ); - } - } - }; - }; - - // Listen to events - xhr.onload = callback(); - errorCallback = xhr.onerror = callback( "error" ); - - // Support: IE 9 only - // Use onreadystatechange to replace onabort - // to handle uncaught aborts - if ( xhr.onabort !== undefined ) { - xhr.onabort = errorCallback; - } else { - xhr.onreadystatechange = function() { - - // Check readyState before timeout as it changes - if ( xhr.readyState === 4 ) { - - // Allow onerror to be called first, - // but that will not handle a native abort - // Also, save errorCallback to a variable - // as xhr.onerror cannot be accessed - window.setTimeout( function() { - if ( callback ) { - errorCallback(); - } - } ); - } - }; - } - - // Create the abort callback - callback = callback( "abort" ); - - try { - - // Do send the request (this may raise an exception) - xhr.send( options.hasContent && options.data || null ); - } catch ( e ) { - - // #14683: Only rethrow if this hasn't been notified as an error yet - if ( callback ) { - throw e; - } - } - }, - - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } -} ); - - - - -// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) -jQuery.ajaxPrefilter( function( s ) { - if ( s.crossDomain ) { - s.contents.script = false; - } -} ); - -// Install script dataType -jQuery.ajaxSetup( { - accepts: { - script: "text/javascript, application/javascript, " + - "application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /\b(?:java|ecma)script\b/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } -} ); - -// Handle cache's special case and crossDomain -jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - } -} ); - -// Bind script tag hack transport -jQuery.ajaxTransport( "script", function( s ) { - - // This transport only deals with cross domain requests - if ( s.crossDomain ) { - var script, callback; - return { - send: function( _, complete ) { - script = jQuery( "<script>" ).prop( { - charset: s.scriptCharset, - src: s.url - } ).on( - "load error", - callback = function( evt ) { - script.remove(); - callback = null; - if ( evt ) { - complete( evt.type === "error" ? 404 : 200, evt.type ); - } - } - ); - - // Use native DOM manipulation to avoid our domManip AJAX trickery - document.head.appendChild( script[ 0 ] ); - }, - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } -} ); - - - - -var oldCallbacks = [], - rjsonp = /(=)\?(?=&|$)|\?\?/; - -// Default jsonp settings -jQuery.ajaxSetup( { - jsonp: "callback", - jsonpCallback: function() { - var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); - this[ callback ] = true; - return callback; - } -} ); - -// Detect, normalize options and install callbacks for jsonp requests -jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { - - var callbackName, overwritten, responseContainer, - jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? - "url" : - typeof s.data === "string" && - ( s.contentType || "" ) - .indexOf( "application/x-www-form-urlencoded" ) === 0 && - rjsonp.test( s.data ) && "data" - ); - - // Handle iff the expected data type is "jsonp" or we have a parameter to set - if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { - - // Get callback name, remembering preexisting value associated with it - callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? - s.jsonpCallback() : - s.jsonpCallback; - - // Insert callback into url or form data - if ( jsonProp ) { - s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); - } else if ( s.jsonp !== false ) { - s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; - } - - // Use data converter to retrieve json after script execution - s.converters[ "script json" ] = function() { - if ( !responseContainer ) { - jQuery.error( callbackName + " was not called" ); - } - return responseContainer[ 0 ]; - }; - - // Force json dataType - s.dataTypes[ 0 ] = "json"; - - // Install callback - overwritten = window[ callbackName ]; - window[ callbackName ] = function() { - responseContainer = arguments; - }; - - // Clean-up function (fires after converters) - jqXHR.always( function() { - - // If previous value didn't exist - remove it - if ( overwritten === undefined ) { - jQuery( window ).removeProp( callbackName ); - - // Otherwise restore preexisting value - } else { - window[ callbackName ] = overwritten; - } - - // Save back as free - if ( s[ callbackName ] ) { - - // Make sure that re-using the options doesn't screw things around - s.jsonpCallback = originalSettings.jsonpCallback; - - // Save the callback name for future use - oldCallbacks.push( callbackName ); - } - - // Call if it was a function and we have a response - if ( responseContainer && jQuery.isFunction( overwritten ) ) { - overwritten( responseContainer[ 0 ] ); - } - - responseContainer = overwritten = undefined; - } ); - - // Delegate to script - return "script"; - } -} ); - - - - -// Support: Safari 8 only -// In Safari 8 documents created via document.implementation.createHTMLDocument -// collapse sibling forms: the second one becomes a child of the first one. -// Because of that, this security measure has to be disabled in Safari 8. -// https://bugs.webkit.org/show_bug.cgi?id=137337 -support.createHTMLDocument = ( function() { - var body = document.implementation.createHTMLDocument( "" ).body; - body.innerHTML = "<form></form><form></form>"; - return body.childNodes.length === 2; -} )(); - - -// Argument "data" should be string of html -// context (optional): If specified, the fragment will be created in this context, -// defaults to document -// keepScripts (optional): If true, will include scripts passed in the html string -jQuery.parseHTML = function( data, context, keepScripts ) { - if ( typeof data !== "string" ) { - return []; - } - if ( typeof context === "boolean" ) { - keepScripts = context; - context = false; - } - - var base, parsed, scripts; - - if ( !context ) { - - // Stop scripts or inline event handlers from being executed immediately - // by using document.implementation - if ( support.createHTMLDocument ) { - context = document.implementation.createHTMLDocument( "" ); - - // Set the base href for the created document - // so any parsed elements with URLs - // are based on the document's URL (gh-2965) - base = context.createElement( "base" ); - base.href = document.location.href; - context.head.appendChild( base ); - } else { - context = document; - } - } - - parsed = rsingleTag.exec( data ); - scripts = !keepScripts && []; - - // Single tag - if ( parsed ) { - return [ context.createElement( parsed[ 1 ] ) ]; - } - - parsed = buildFragment( [ data ], context, scripts ); - - if ( scripts && scripts.length ) { - jQuery( scripts ).remove(); - } - - return jQuery.merge( [], parsed.childNodes ); -}; - - -/** - * Load a url into a page - */ -jQuery.fn.load = function( url, params, callback ) { - var selector, type, response, - self = this, - off = url.indexOf( " " ); - - if ( off > -1 ) { - selector = jQuery.trim( url.slice( off ) ); - url = url.slice( 0, off ); - } - - // If it's a function - if ( jQuery.isFunction( params ) ) { - - // We assume that it's the callback - callback = params; - params = undefined; - - // Otherwise, build a param string - } else if ( params && typeof params === "object" ) { - type = "POST"; - } - - // If we have elements to modify, make the request - if ( self.length > 0 ) { - jQuery.ajax( { - url: url, - - // If "type" variable is undefined, then "GET" method will be used. - // Make value of this field explicit since - // user can override it through ajaxSetup method - type: type || "GET", - dataType: "html", - data: params - } ).done( function( responseText ) { - - // Save response for use in complete callback - response = arguments; - - self.html( selector ? - - // If a selector was specified, locate the right elements in a dummy div - // Exclude scripts to avoid IE 'Permission Denied' errors - jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : - - // Otherwise use the full result - responseText ); - - // If the request succeeds, this function gets "data", "status", "jqXHR" - // but they are ignored because response was set above. - // If it fails, this function gets "jqXHR", "status", "error" - } ).always( callback && function( jqXHR, status ) { - self.each( function() { - callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); - } ); - } ); - } - - return this; -}; - - - - -// Attach a bunch of functions for handling common AJAX events -jQuery.each( [ - "ajaxStart", - "ajaxStop", - "ajaxComplete", - "ajaxError", - "ajaxSuccess", - "ajaxSend" -], function( i, type ) { - jQuery.fn[ type ] = function( fn ) { - return this.on( type, fn ); - }; -} ); - - - - -jQuery.expr.pseudos.animated = function( elem ) { - return jQuery.grep( jQuery.timers, function( fn ) { - return elem === fn.elem; - } ).length; -}; - - - - -/** - * Gets a window from an element - */ -function getWindow( elem ) { - return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView; -} - -jQuery.offset = { - setOffset: function( elem, options, i ) { - var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, - position = jQuery.css( elem, "position" ), - curElem = jQuery( elem ), - props = {}; - - // Set position first, in-case top/left are set even on static elem - if ( position === "static" ) { - elem.style.position = "relative"; - } - - curOffset = curElem.offset(); - curCSSTop = jQuery.css( elem, "top" ); - curCSSLeft = jQuery.css( elem, "left" ); - calculatePosition = ( position === "absolute" || position === "fixed" ) && - ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; - - // Need to be able to calculate position if either - // top or left is auto and position is either absolute or fixed - if ( calculatePosition ) { - curPosition = curElem.position(); - curTop = curPosition.top; - curLeft = curPosition.left; - - } else { - curTop = parseFloat( curCSSTop ) || 0; - curLeft = parseFloat( curCSSLeft ) || 0; - } - - if ( jQuery.isFunction( options ) ) { - - // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) - options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); - } - - if ( options.top != null ) { - props.top = ( options.top - curOffset.top ) + curTop; - } - if ( options.left != null ) { - props.left = ( options.left - curOffset.left ) + curLeft; - } - - if ( "using" in options ) { - options.using.call( elem, props ); - - } else { - curElem.css( props ); - } - } -}; - -jQuery.fn.extend( { - offset: function( options ) { - - // Preserve chaining for setter - if ( arguments.length ) { - return options === undefined ? - this : - this.each( function( i ) { - jQuery.offset.setOffset( this, options, i ); - } ); - } - - var docElem, win, rect, doc, - elem = this[ 0 ]; - - if ( !elem ) { - return; - } - - // Support: IE <=11 only - // Running getBoundingClientRect on a - // disconnected node in IE throws an error - if ( !elem.getClientRects().length ) { - return { top: 0, left: 0 }; - } - - rect = elem.getBoundingClientRect(); - - // Make sure element is not hidden (display: none) - if ( rect.width || rect.height ) { - doc = elem.ownerDocument; - win = getWindow( doc ); - docElem = doc.documentElement; - - return { - top: rect.top + win.pageYOffset - docElem.clientTop, - left: rect.left + win.pageXOffset - docElem.clientLeft - }; - } - - // Return zeros for disconnected and hidden elements (gh-2310) - return rect; - }, - - position: function() { - if ( !this[ 0 ] ) { - return; - } - - var offsetParent, offset, - elem = this[ 0 ], - parentOffset = { top: 0, left: 0 }; - - // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, - // because it is its only offset parent - if ( jQuery.css( elem, "position" ) === "fixed" ) { - - // Assume getBoundingClientRect is there when computed position is fixed - offset = elem.getBoundingClientRect(); - - } else { - - // Get *real* offsetParent - offsetParent = this.offsetParent(); - - // Get correct offsets - offset = this.offset(); - if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { - parentOffset = offsetParent.offset(); - } - - // Add offsetParent borders - parentOffset = { - top: parentOffset.top + jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ), - left: parentOffset.left + jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ) - }; - } - - // Subtract parent offsets and element margins - return { - top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), - left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) - }; - }, - - // This method will return documentElement in the following cases: - // 1) For the element inside the iframe without offsetParent, this method will return - // documentElement of the parent window - // 2) For the hidden or detached element - // 3) For body or html element, i.e. in case of the html node - it will return itself - // - // but those exceptions were never presented as a real life use-cases - // and might be considered as more preferable results. - // - // This logic, however, is not guaranteed and can change at any point in the future - offsetParent: function() { - return this.map( function() { - var offsetParent = this.offsetParent; - - while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { - offsetParent = offsetParent.offsetParent; - } - - return offsetParent || documentElement; - } ); - } -} ); - -// Create scrollLeft and scrollTop methods -jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { - var top = "pageYOffset" === prop; - - jQuery.fn[ method ] = function( val ) { - return access( this, function( elem, method, val ) { - var win = getWindow( elem ); - - if ( val === undefined ) { - return win ? win[ prop ] : elem[ method ]; - } - - if ( win ) { - win.scrollTo( - !top ? val : win.pageXOffset, - top ? val : win.pageYOffset - ); - - } else { - elem[ method ] = val; - } - }, method, val, arguments.length ); - }; -} ); - -// Support: Safari <=7 - 9.1, Chrome <=37 - 49 -// Add the top/left cssHooks using jQuery.fn.position -// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 -// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 -// getComputedStyle returns percent when specified for top/left/bottom/right; -// rather than make the css module depend on the offset module, just check for it here -jQuery.each( [ "top", "left" ], function( i, prop ) { - jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, - function( elem, computed ) { - if ( computed ) { - computed = curCSS( elem, prop ); - - // If curCSS returns percentage, fallback to offset - return rnumnonpx.test( computed ) ? - jQuery( elem ).position()[ prop ] + "px" : - computed; - } - } - ); -} ); - - -// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods -jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { - jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, - function( defaultExtra, funcName ) { - - // Margin is only for outerHeight, outerWidth - jQuery.fn[ funcName ] = function( margin, value ) { - var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), - extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); - - return access( this, function( elem, type, value ) { - var doc; - - if ( jQuery.isWindow( elem ) ) { - - // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) - return funcName.indexOf( "outer" ) === 0 ? - elem[ "inner" + name ] : - elem.document.documentElement[ "client" + name ]; - } - - // Get document width or height - if ( elem.nodeType === 9 ) { - doc = elem.documentElement; - - // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], - // whichever is greatest - return Math.max( - elem.body[ "scroll" + name ], doc[ "scroll" + name ], - elem.body[ "offset" + name ], doc[ "offset" + name ], - doc[ "client" + name ] - ); - } - - return value === undefined ? - - // Get width or height on the element, requesting but not forcing parseFloat - jQuery.css( elem, type, extra ) : - - // Set width or height on the element - jQuery.style( elem, type, value, extra ); - }, type, chainable ? margin : undefined, chainable ); - }; - } ); -} ); - - -jQuery.fn.extend( { - - bind: function( types, data, fn ) { - return this.on( types, null, data, fn ); - }, - unbind: function( types, fn ) { - return this.off( types, null, fn ); - }, - - delegate: function( selector, types, data, fn ) { - return this.on( types, selector, data, fn ); - }, - undelegate: function( selector, types, fn ) { - - // ( namespace ) or ( selector, types [, fn] ) - return arguments.length === 1 ? - this.off( selector, "**" ) : - this.off( types, selector || "**", fn ); - } -} ); - -jQuery.parseJSON = JSON.parse; - - - - -// Register as a named AMD module, since jQuery can be concatenated with other -// files that may use define, but not via a proper concatenation script that -// understands anonymous AMD modules. A named AMD is safest and most robust -// way to register. Lowercase jquery is used because AMD module names are -// derived from file names, and jQuery is normally delivered in a lowercase -// file name. Do this after creating the global so that if an AMD module wants -// to call noConflict to hide this version of jQuery, it will work. - -// Note that for maximum portability, libraries that are not jQuery should -// declare themselves as anonymous modules, and avoid setting a global if an -// AMD loader is present. jQuery is a special case. For more information, see -// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon - -if ( typeof define === "function" && define.amd ) { - define( "jquery", [], function() { - return jQuery; - } ); -} - - - - - -var - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$; - -jQuery.noConflict = function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; -}; - -// Expose jQuery and $ identifiers, even in AMD -// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) -// and CommonJS for browser emulators (#13566) -if ( !noGlobal ) { - window.jQuery = window.$ = jQuery; -} - - -return jQuery; -} ); diff --git a/Documentation/_static/jquery.js b/Documentation/_static/jquery.js deleted file mode 100644 index f6a6a99e60ee9a5ce4d0922a3a82c6d81c1db7f2..0000000000000000000000000000000000000000 --- a/Documentation/_static/jquery.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v3.1.0 | (c) jQuery Foundation | jquery.org/license */ -!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.0",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null!=a?a<0?this[a+this.length]:this[a]:f.call(this)},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=r.isArray(d)))?(e?(e=!1,f=c&&r.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"label"in b&&b.disabled===a||"form"in b&&b.disabled===a||"form"in b&&b.disabled===!1&&(b.isDisabled===a||b.isDisabled!==!a&&("label"in b||!ea(b))!==a)}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e)}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(_,aa),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=V.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(_,aa),$.test(j[0].type)&&qa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&sa(j),!a)return G.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||$.test(a)&&qa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){if(r.isFunction(b))return r.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return r.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(C.test(b))return r.filter(b,a,c);b=r.filter(b,a)}return r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType})}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/\S+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,M,e),g(f,c,N,e)):(f++,j.call(a,g(f,c,M,e),g(f,c,N,e),g(f,c,M,c.notifyWith))):(d!==M&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0, -r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},T=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function U(){this.expando=r.expando+U.uid++}U.uid=1,U.prototype={cache:function(a){var b=a[this.expando];return b||(b={},T(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){r.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(K)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var V=new U,W=new U,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function Z(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Y,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:X.test(c)?JSON.parse(c):c)}catch(e){}W.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return W.hasData(a)||V.hasData(a)},data:function(a,b,c){return W.access(a,b,c)},removeData:function(a,b){W.remove(a,b)},_data:function(a,b,c){return V.access(a,b,c)},_removeData:function(a,b){V.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=W.get(f),1===f.nodeType&&!V.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),Z(f,d,e[d])));V.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){W.set(this,a)}):S(this,function(b){var c;if(f&&void 0===b){if(c=W.get(f,a),void 0!==c)return c;if(c=Z(f,a),void 0!==c)return c}else this.each(function(){W.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=V.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var $=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,_=new RegExp("^(?:([+-])=|)("+$+")([a-z%]*)$","i"),aa=["Top","Right","Bottom","Left"],ba=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},ca=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function da(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&_.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var ea={};function fa(a){var b,c=a.ownerDocument,d=a.nodeName,e=ea[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),ea[d]=e,e)}function ga(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=V.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&ba(d)&&(e[f]=fa(d))):"none"!==c&&(e[f]="none",V.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ga(this,!0)},hide:function(){return ga(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){ba(this)?r(this).show():r(this).hide()})}});var ha=/^(?:checkbox|radio)$/i,ia=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ja=/^$|\/(?:java|ecma)script/i,ka={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ka.optgroup=ka.option,ka.tbody=ka.tfoot=ka.colgroup=ka.caption=ka.thead,ka.th=ka.td;function la(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function ma(a,b){for(var c=0,d=a.length;c<d;c++)V.set(a[c],"globalEval",!b||V.get(b[c],"globalEval"))}var na=/<|&#?\w+;/;function oa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(na.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ia.exec(f)||["",""])[1].toLowerCase(),i=ka[h]||ka._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=la(l.appendChild(f),"script"),j&&ma(g),c){k=0;while(f=g[k++])ja.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var pa=d.documentElement,qa=/^key/,ra=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,sa=/^([^.]*)(?:\.(.+)|)/;function ta(){return!0}function ua(){return!1}function va(){try{return d.activeElement}catch(a){}}function wa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)wa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ua;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(pa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;c<h;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?r(e,this).index(i)>-1:r.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==va()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===va()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&r.nodeName(this,"input"))return this.click(),!1},_default:function(a){return r.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ta:ua,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:ua,isPropagationStopped:ua,isImmediatePropagationStopped:ua,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ta,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ta,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ta,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&qa.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&ra.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return wa(this,a,b,c,d)},one:function(a,b,c,d){return wa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=ua),this.each(function(){r.event.remove(this,a,c,b)})}});var xa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,ya=/<script|<style|<link/i,za=/checked\s*(?:[^=]|=\s*.checked.)/i,Aa=/^true\/(.*)/,Ba=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ca(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Da(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ea(a){var b=Aa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}W.hasData(a)&&(h=W.access(a),i=r.extend({},h),W.set(b,i))}}function Ga(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ha.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ha(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&za.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(m&&(e=oa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(la(e,"script"),Da),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,la(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ea),l=0;l<i;l++)j=h[l],ja.test(j.type||"")&&!V.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Ba,""),k))}return a}function Ia(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(la(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&ma(la(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(xa,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=la(h),f=la(a),d=0,e=f.length;d<e;d++)Ga(f[d],g[d]);if(b)if(c)for(f=f||la(a),g=g||la(h),d=0,e=f.length;d<e;d++)Fa(f[d],g[d]);else Fa(a,h);return g=la(h,"script"),g.length>0&&ma(g,!i&&la(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(la(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!ya.test(a)&&!ka[(ia.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(la(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(la(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var Ja=/^margin/,Ka=new RegExp("^("+$+")(?!px)[a-z%]+$","i"),La=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",pa.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,pa.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Ma(a,b,c){var d,e,f,g,h=a.style;return c=c||La(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ka.test(g)&&Ja.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Na(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Oa=/^(none|table(?!-c[ea]).+)/,Pa={position:"absolute",visibility:"hidden",display:"block"},Qa={letterSpacing:"0",fontWeight:"400"},Ra=["Webkit","Moz","ms"],Sa=d.createElement("div").style;function Ta(a){if(a in Sa)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ra.length;while(c--)if(a=Ra[c]+b,a in Sa)return a}function Ua(a,b,c){var d=_.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Va(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+aa[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+aa[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+aa[f]+"Width",!0,e))):(g+=r.css(a,"padding"+aa[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+aa[f]+"Width",!0,e)));return g}function Wa(a,b,c){var d,e=!0,f=La(a),g="border-box"===r.css(a,"boxSizing",!1,f);if(a.getClientRects().length&&(d=a.getBoundingClientRect()[b]),d<=0||null==d){if(d=Ma(a,b,f),(d<0||null==d)&&(d=a.style[b]),Ka.test(d))return d;e=g&&(o.boxSizingReliable()||d===a.style[b]),d=parseFloat(d)||0}return d+Va(a,b,c||(g?"border":"content"),e,f)+"px"}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ma(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=a.style;return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=_.exec(c))&&e[1]&&(c=da(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b);return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Ma(a,b,d)),"normal"===e&&b in Qa&&(e=Qa[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Oa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?Wa(a,b,d):ca(a,Pa,function(){return Wa(a,b,d)})},set:function(a,c,d){var e,f=d&&La(a),g=d&&Va(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=_.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ua(a,c,g)}}}),r.cssHooks.marginLeft=Na(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Ma(a,"marginLeft"))||a.getBoundingClientRect().left-ca(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+aa[d]+b]=f[d]||f[d-2]||f[0];return e}},Ja.test(a)||(r.cssHooks[a+b].set=Ua)}),r.fn.extend({css:function(a,b){return S(this,function(a,b,c){var d,e,f={},g=0;if(r.isArray(b)){for(d=La(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function Xa(a,b,c,d,e){return new Xa.prototype.init(a,b,c,d,e)}r.Tween=Xa,Xa.prototype={constructor:Xa,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Xa.propHooks[this.prop];return a&&a.get?a.get(this):Xa.propHooks._default.get(this)},run:function(a){var b,c=Xa.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Xa.propHooks._default.set(this),this}},Xa.prototype.init.prototype=Xa.prototype,Xa.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Xa.propHooks.scrollTop=Xa.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Xa.prototype.init,r.fx.step={};var Ya,Za,$a=/^(?:toggle|show|hide)$/,_a=/queueHooks$/;function ab(){Za&&(a.requestAnimationFrame(ab),r.fx.tick())}function bb(){return a.setTimeout(function(){Ya=void 0}),Ya=r.now()}function cb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=aa[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function db(a,b,c){for(var d,e=(gb.tweeners[b]||[]).concat(gb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function eb(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&ba(a),q=V.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],$a.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=V.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ga([a],!0),j=a.style.display||j,k=r.css(a,"display"),ga([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=V.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ga([a],!0),m.done(function(){p||ga([a]),V.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=db(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function fb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],r.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function gb(a,b,c){var d,e,f=0,g=gb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Ya||bb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:Ya||bb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(fb(k,j.opts.specialEasing);f<g;f++)if(d=gb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,db,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}r.Animation=r.extend(gb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return da(c.elem,a,_.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(K);for(var c,d=0,e=a.length;d<e;d++)c=a[d],gb.tweeners[c]=gb.tweeners[c]||[],gb.tweeners[c].unshift(b)},prefilters:[eb],prefilter:function(a,b){b?gb.prefilters.unshift(a):gb.prefilters.push(a)}}),r.speed=function(a,b,c){var e=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off||d.hidden?e.duration=0:e.duration="number"==typeof e.duration?e.duration:e.duration in r.fx.speeds?r.fx.speeds[e.duration]:r.fx.speeds._default,null!=e.queue&&e.queue!==!0||(e.queue="fx"),e.old=e.complete,e.complete=function(){r.isFunction(e.old)&&e.old.call(this),e.queue&&r.dequeue(this,e.queue)},e},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(ba).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=gb(this,r.extend({},a),f);(e||V.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=V.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&_a.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=V.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(cb(b,!0),a,d,e)}}),r.each({slideDown:cb("show"),slideUp:cb("hide"),slideToggle:cb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(Ya=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),Ya=void 0},r.fx.timer=function(a){r.timers.push(a),a()?r.fx.start():r.timers.pop()},r.fx.interval=13,r.fx.start=function(){Za||(Za=a.requestAnimationFrame?a.requestAnimationFrame(ab):a.setInterval(r.fx.tick,r.fx.interval))},r.fx.stop=function(){a.cancelAnimationFrame?a.cancelAnimationFrame(Za):a.clearInterval(Za),Za=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var hb,ib=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return S(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?hb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K); -if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),hb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ib[b]||r.find.attr;ib[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=ib[g],ib[g]=e,e=null!=c(a,b,d)?g:null,ib[g]=f),e}});var jb=/^(?:input|select|textarea|button)$/i,kb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):jb.test(a.nodeName)||kb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});var lb=/[\t\r\n\f]/g;function mb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,mb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,mb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,mb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=mb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(c)+" ").replace(lb," ").indexOf(b)>-1)return!0;return!1}});var nb=/\r/g,ob=/[\x20\t\r\n\f]+/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(nb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:r.trim(r.text(a)).replace(ob," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type,g=f?null:[],h=f?e+1:d.length,i=e<0?h:f?e:0;i<h;i++)if(c=d[i],(c.selected||i===e)&&!c.disabled&&(!c.parentNode.disabled||!r.nodeName(c.parentNode,"optgroup"))){if(b=r(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ha.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,""),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Qb=[],Rb=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Qb.pop()||r.expando+"_"+rb++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Rb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Rb.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Rb,"$1"+e):b.jsonp!==!1&&(b.url+=(sb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Qb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=B.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=oa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=r.trim(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length};function Sb(a){return r.isWindow(a)?a:9===a.nodeType&&a.defaultView}r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),d.width||d.height?(e=f.ownerDocument,c=Sb(e),b=e.documentElement,{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}):d):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),r.nodeName(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||pa})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return S(this,function(a,d,e){var f=Sb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Na(o.pixelPosition,function(a,c){if(c)return c=Ma(a,b),Ka.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return S(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.parseJSON=JSON.parse,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Tb=a.jQuery,Ub=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Ub),b&&a.jQuery===r&&(a.jQuery=Tb),r},b||(a.jQuery=a.$=r),r}); diff --git a/Documentation/_static/minus.png b/Documentation/_static/minus.png deleted file mode 100644 index d96755fdaf8bb2214971e0db9c1fd3077d7c419d..0000000000000000000000000000000000000000 Binary files a/Documentation/_static/minus.png and /dev/null differ diff --git a/Documentation/_static/plus.png b/Documentation/_static/plus.png deleted file mode 100644 index 7107cec93a979b9a5f64843235a16651d563ce2d..0000000000000000000000000000000000000000 Binary files a/Documentation/_static/plus.png and /dev/null differ diff --git a/Documentation/_static/pygments.css b/Documentation/_static/pygments.css deleted file mode 100644 index 20c4814dcf0d3f437ee9a46f5957e3165aa5fb17..0000000000000000000000000000000000000000 --- a/Documentation/_static/pygments.css +++ /dev/null @@ -1,69 +0,0 @@ -.highlight .hll { background-color: #ffffcc } -.highlight { background: #eeffcc; } -.highlight .c { color: #408090; font-style: italic } /* Comment */ -.highlight .err { border: 1px solid #FF0000 } /* Error */ -.highlight .k { color: #007020; font-weight: bold } /* Keyword */ -.highlight .o { color: #666666 } /* Operator */ -.highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ -.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #007020 } /* Comment.Preproc */ -.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ -.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ -.highlight .gd { color: #A00000 } /* Generic.Deleted */ -.highlight .ge { font-style: italic } /* Generic.Emph */ -.highlight .gr { color: #FF0000 } /* Generic.Error */ -.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.highlight .gi { color: #00A000 } /* Generic.Inserted */ -.highlight .go { color: #333333 } /* Generic.Output */ -.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ -.highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #0044DD } /* Generic.Traceback */ -.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ -.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ -.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ -.highlight .kp { color: #007020 } /* Keyword.Pseudo */ -.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ -.highlight .kt { color: #902000 } /* Keyword.Type */ -.highlight .m { color: #208050 } /* Literal.Number */ -.highlight .s { color: #4070a0 } /* Literal.String */ -.highlight .na { color: #4070a0 } /* Name.Attribute */ -.highlight .nb { color: #007020 } /* Name.Builtin */ -.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ -.highlight .no { color: #60add5 } /* Name.Constant */ -.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ -.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ -.highlight .ne { color: #007020 } /* Name.Exception */ -.highlight .nf { color: #06287e } /* Name.Function */ -.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ -.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ -.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #bb60d5 } /* Name.Variable */ -.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ -.highlight .w { color: #bbbbbb } /* Text.Whitespace */ -.highlight .mb { color: #208050 } /* Literal.Number.Bin */ -.highlight .mf { color: #208050 } /* Literal.Number.Float */ -.highlight .mh { color: #208050 } /* Literal.Number.Hex */ -.highlight .mi { color: #208050 } /* Literal.Number.Integer */ -.highlight .mo { color: #208050 } /* Literal.Number.Oct */ -.highlight .sa { color: #4070a0 } /* Literal.String.Affix */ -.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ -.highlight .sc { color: #4070a0 } /* Literal.String.Char */ -.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ -.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ -.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ -.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ -.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ -.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ -.highlight .sx { color: #c65d09 } /* Literal.String.Other */ -.highlight .sr { color: #235388 } /* Literal.String.Regex */ -.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ -.highlight .ss { color: #517918 } /* Literal.String.Symbol */ -.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ -.highlight .fm { color: #06287e } /* Name.Function.Magic */ -.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ -.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ -.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ -.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ -.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/Documentation/_static/searchtools.js b/Documentation/_static/searchtools.js deleted file mode 100644 index 2ea69a9f822a6cb2daef716d060fc111e093ead8..0000000000000000000000000000000000000000 --- a/Documentation/_static/searchtools.js +++ /dev/null @@ -1,579 +0,0 @@ -/* - * searchtools.js_t - * ~~~~~~~~~~~~~~~~ - * - * Sphinx JavaScript utilities for the full-text search. - * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - - -/* Non-minified version JS is _stemmer.js if file is provided */ -var JSX={};(function(l){function m(b,e){var a=function(){};a.prototype=e.prototype;var c=new a;for(var d in b){b[d].prototype=c}}function P(c,b){for(var a in b.prototype)if(b.prototype.hasOwnProperty(a))c.prototype[a]=b.prototype[a]}function g(a,b,d){function c(a,b,c){delete a[b];a[b]=c;return c}Object.defineProperty(a,b,{get:function(){return c(a,b,d())},set:function(d){c(a,b,d)},enumerable:true,configurable:true})}function O(a,b,c){return a[b]=a[b]/c|0}var u=parseInt;var v=parseFloat;function N(a){return a!==a}var x=isFinite;var y=encodeURIComponent;var z=decodeURIComponent;var A=encodeURI;var B=decodeURI;var C=Object.prototype.toString;var D=Object.prototype.hasOwnProperty;function k(){}l.require=function(b){var a=q[b];return a!==undefined?a:null};l.profilerIsRunning=function(){return k.getResults!=null};l.getProfileResults=function(){return(k.getResults||function(){return{}})()};l.postProfileResults=function(a,b){if(k.postResults==null)throw new Error('profiler has not been turned on');return k.postResults(a,b)};l.resetProfileResults=function(){if(k.resetResults==null)throw new Error('profiler has not been turned on');return k.resetResults()};l.DEBUG=false;function G(){};m([G],Error);function a(a,b,c){this.F=a.length;this.K=a;this.L=b;this.I=c;this.H=null;this.P=null};m([a],Object);function p(){};m([p],Object);function i(){var a;var b;var c;this.G={};a=this.E='';b=this._=0;c=this.A=a.length;this.B=0;this.D=b;this.C=c};m([i],p);function s(a,b){a.E=b.E;a._=b._;a.A=b.A;a.B=b.B;a.D=b.D;a.C=b.C};function e(b,d,c,e){var a;if(b._>=b.A){return false}a=b.E.charCodeAt(b._);if(a>e||a<c){return false}a-=c;if((d[a>>>3]&1<<(a&7))===0){return false}b._++;return true};function r(b,d,c,e){var a;if(b._<=b.B){return false}a=b.E.charCodeAt(b._-1);if(a>e||a<c){return false}a-=c;if((d[a>>>3]&1<<(a&7))===0){return false}b._--;return true};function o(a,d,c,e){var b;if(a._>=a.A){return false}b=a.E.charCodeAt(a._);if(b>e||b<c){a._++;return true}b-=c;if((d[b>>>3]&1<<(b&7))===0){a._++;return true}return false};function j(a,d,c,e){var b;if(a._<=a.B){return false}b=a.E.charCodeAt(a._-1);if(b>e||b<c){a._--;return true}b-=c;if((d[b>>>3]&1<<(b&7))===0){a._--;return true}return false};function h(a,b,d){var c;if(a.A-a._<b){return false}if(a.E.slice(c=a._,c+b)!==d){return false}a._+=b;return true};function d(a,b,d){var c;if(a._-a.B<b){return false}if(a.E.slice((c=a._)-b,c)!==d){return false}a._-=b;return true};function n(f,m,p){var b;var d;var e;var n;var g;var k;var l;var i;var h;var c;var a;var j;var o;b=0;d=p;e=f._;n=f.A;g=0;k=0;l=false;while(true){i=b+(d-b>>>1);h=0;c=g<k?g:k;a=m[i];for(j=c;j<a.F;j++){if(e+c===n){h=-1;break}h=f.E.charCodeAt(e+c)-a.K.charCodeAt(j);if(h!==0){break}c++}if(h<0){d=i;k=c}else{b=i;g=c}if(d-b<=1){if(b>0){break}if(d===b){break}if(l){break}l=true}}while(true){a=m[b];if(g>=a.F){f._=e+a.F|0;if(a.H==null){return a.I}o=a.H(a.P);f._=e+a.F|0;if(o){return a.I}}b=a.L;if(b<0){return 0}}return-1};function f(d,m,p){var b;var g;var e;var n;var f;var k;var l;var i;var h;var c;var a;var j;var o;b=0;g=p;e=d._;n=d.B;f=0;k=0;l=false;while(true){i=b+(g-b>>1);h=0;c=f<k?f:k;a=m[i];for(j=a.F-1-c;j>=0;j--){if(e-c===n){h=-1;break}h=d.E.charCodeAt(e-1-c)-a.K.charCodeAt(j);if(h!==0){break}c++}if(h<0){g=i;k=c}else{b=i;f=c}if(g-b<=1){if(b>0){break}if(g===b){break}if(l){break}l=true}}while(true){a=m[b];if(f>=a.F){d._=e-a.F|0;if(a.H==null){return a.I}o=a.H(d);d._=e-a.F|0;if(o){return a.I}}b=a.L;if(b<0){return 0}}return-1};function E(a,b,d,e){var c;c=e.length-(d-b);a.E=a.E.slice(0,b)+e+a.E.slice(d);a.A+=c|0;if(a._>=d){a._+=c|0}else if(a._>b){a._=b}return c|0};function c(a,f){var b;var c;var d;var e;b=false;if((c=a.D)<0||c>(d=a.C)||d>(e=a.A)||e>a.E.length?false:true){E(a,a.D,a.C,f);b=true}return b};i.prototype.J=function(){return false};i.prototype.c=function(b){var a;var c;var d;var e;a=this.G['.'+b];if(a==null){c=this.E=b;d=this._=0;e=this.A=c.length;this.B=0;this.D=d;this.C=e;this.J();a=this.E;this.G['.'+b]=a}return a};i.prototype.stemWord=i.prototype.c;i.prototype.d=function(e){var d;var b;var c;var a;var f;var g;var h;d=[];for(b=0;b<e.length;b++){c=e[b];a=this.G['.'+c];if(a==null){f=this.E=c;g=this._=0;h=this.A=f.length;this.B=0;this.D=g;this.C=h;this.J();a=this.E;this.G['.'+c]=a}d.push(a)}return d};i.prototype.stemWords=i.prototype.d;function b(){i.call(this);this.I_p2=0;this.I_p1=0;this.I_pV=0};m([b],i);b.prototype.M=function(a){this.I_p2=a.I_p2;this.I_p1=a.I_p1;this.I_pV=a.I_pV;s(this,a)};b.prototype.copy_from=b.prototype.M;b.prototype.W=function(){var p;var j;var f;var g;var i;var a;var d;var k;var l;var m;var n;var o;var q;a:while(true){p=this._;i=true;g:while(i===true){i=false;h:while(true){j=this._;a=true;b:while(a===true){a=false;d=true;c:while(d===true){d=false;f=this._;k=true;d:while(k===true){k=false;if(!e(this,b.g_v,97,251)){break d}this.D=this._;l=true;e:while(l===true){l=false;g=this._;m=true;f:while(m===true){m=false;if(!h(this,1,'u')){break f}this.C=this._;if(!e(this,b.g_v,97,251)){break f}if(!c(this,'U')){return false}break e}this._=g;n=true;f:while(n===true){n=false;if(!h(this,1,'i')){break f}this.C=this._;if(!e(this,b.g_v,97,251)){break f}if(!c(this,'I')){return false}break e}this._=g;if(!h(this,1,'y')){break d}this.C=this._;if(!c(this,'Y')){return false}}break c}this._=f;o=true;d:while(o===true){o=false;this.D=this._;if(!h(this,1,'y')){break d}this.C=this._;if(!e(this,b.g_v,97,251)){break d}if(!c(this,'Y')){return false}break c}this._=f;if(!h(this,1,'q')){break b}this.D=this._;if(!h(this,1,'u')){break b}this.C=this._;if(!c(this,'U')){return false}}this._=j;break h}q=this._=j;if(q>=this.A){break g}this._++}continue a}this._=p;break a}return true};b.prototype.r_prelude=b.prototype.W;function H(a){var q;var k;var f;var g;var i;var j;var d;var l;var m;var n;var o;var p;var r;a:while(true){q=a._;i=true;g:while(i===true){i=false;h:while(true){k=a._;j=true;b:while(j===true){j=false;d=true;c:while(d===true){d=false;f=a._;l=true;d:while(l===true){l=false;if(!e(a,b.g_v,97,251)){break d}a.D=a._;m=true;e:while(m===true){m=false;g=a._;n=true;f:while(n===true){n=false;if(!h(a,1,'u')){break f}a.C=a._;if(!e(a,b.g_v,97,251)){break f}if(!c(a,'U')){return false}break e}a._=g;o=true;f:while(o===true){o=false;if(!h(a,1,'i')){break f}a.C=a._;if(!e(a,b.g_v,97,251)){break f}if(!c(a,'I')){return false}break e}a._=g;if(!h(a,1,'y')){break d}a.C=a._;if(!c(a,'Y')){return false}}break c}a._=f;p=true;d:while(p===true){p=false;a.D=a._;if(!h(a,1,'y')){break d}a.C=a._;if(!e(a,b.g_v,97,251)){break d}if(!c(a,'Y')){return false}break c}a._=f;if(!h(a,1,'q')){break b}a.D=a._;if(!h(a,1,'u')){break b}a.C=a._;if(!c(a,'U')){return false}}a._=k;break h}r=a._=k;if(r>=a.A){break g}a._++}continue a}a._=q;break a}return true};b.prototype.U=function(){var t;var i;var r;var d;var f;var g;var h;var c;var a;var j;var k;var l;var m;var s;var p;var q;this.I_pV=p=this.A;this.I_p1=p;this.I_p2=p;t=this._;d=true;b:while(d===true){d=false;f=true;c:while(f===true){f=false;i=this._;g=true;a:while(g===true){g=false;if(!e(this,b.g_v,97,251)){break a}if(!e(this,b.g_v,97,251)){break a}if(this._>=this.A){break a}this._++;break c}this._=i;h=true;a:while(h===true){h=false;if(n(this,b.a_0,3)===0){break a}break c}s=this._=i;if(s>=this.A){break b}this._++;a:while(true){c=true;d:while(c===true){c=false;if(!e(this,b.g_v,97,251)){break d}break a}if(this._>=this.A){break b}this._++}}this.I_pV=this._}q=this._=t;r=q;a=true;a:while(a===true){a=false;c:while(true){j=true;b:while(j===true){j=false;if(!e(this,b.g_v,97,251)){break b}break c}if(this._>=this.A){break a}this._++}b:while(true){k=true;c:while(k===true){k=false;if(!o(this,b.g_v,97,251)){break c}break b}if(this._>=this.A){break a}this._++}this.I_p1=this._;b:while(true){l=true;c:while(l===true){l=false;if(!e(this,b.g_v,97,251)){break c}break b}if(this._>=this.A){break a}this._++}c:while(true){m=true;b:while(m===true){m=false;if(!o(this,b.g_v,97,251)){break b}break c}if(this._>=this.A){break a}this._++}this.I_p2=this._}this._=r;return true};b.prototype.r_mark_regions=b.prototype.U;function I(a){var s;var i;var r;var d;var f;var g;var h;var c;var j;var k;var l;var m;var p;var t;var q;var u;a.I_pV=q=a.A;a.I_p1=q;a.I_p2=q;s=a._;d=true;b:while(d===true){d=false;f=true;c:while(f===true){f=false;i=a._;g=true;a:while(g===true){g=false;if(!e(a,b.g_v,97,251)){break a}if(!e(a,b.g_v,97,251)){break a}if(a._>=a.A){break a}a._++;break c}a._=i;h=true;a:while(h===true){h=false;if(n(a,b.a_0,3)===0){break a}break c}t=a._=i;if(t>=a.A){break b}a._++;a:while(true){c=true;d:while(c===true){c=false;if(!e(a,b.g_v,97,251)){break d}break a}if(a._>=a.A){break b}a._++}}a.I_pV=a._}u=a._=s;r=u;j=true;a:while(j===true){j=false;c:while(true){k=true;b:while(k===true){k=false;if(!e(a,b.g_v,97,251)){break b}break c}if(a._>=a.A){break a}a._++}b:while(true){l=true;c:while(l===true){l=false;if(!o(a,b.g_v,97,251)){break c}break b}if(a._>=a.A){break a}a._++}a.I_p1=a._;b:while(true){m=true;c:while(m===true){m=false;if(!e(a,b.g_v,97,251)){break c}break b}if(a._>=a.A){break a}a._++}c:while(true){p=true;b:while(p===true){p=false;if(!o(a,b.g_v,97,251)){break b}break c}if(a._>=a.A){break a}a._++}a.I_p2=a._}a._=r;return true};b.prototype.V=function(){var a;var e;var d;b:while(true){e=this._;d=true;a:while(d===true){d=false;this.D=this._;a=n(this,b.a_1,4);if(a===0){break a}this.C=this._;switch(a){case 0:break a;case 1:if(!c(this,'i')){return false}break;case 2:if(!c(this,'u')){return false}break;case 3:if(!c(this,'y')){return false}break;case 4:if(this._>=this.A){break a}this._++;break}continue b}this._=e;break b}return true};b.prototype.r_postlude=b.prototype.V;function J(a){var d;var f;var e;b:while(true){f=a._;e=true;a:while(e===true){e=false;a.D=a._;d=n(a,b.a_1,4);if(d===0){break a}a.C=a._;switch(d){case 0:break a;case 1:if(!c(a,'i')){return false}break;case 2:if(!c(a,'u')){return false}break;case 3:if(!c(a,'y')){return false}break;case 4:if(a._>=a.A){break a}a._++;break}continue b}a._=f;break b}return true};b.prototype.S=function(){return!(this.I_pV<=this._)?false:true};b.prototype.r_RV=b.prototype.S;b.prototype.Q=function(){return!(this.I_p1<=this._)?false:true};b.prototype.r_R1=b.prototype.Q;b.prototype.R=function(){return!(this.I_p2<=this._)?false:true};b.prototype.r_R2=b.prototype.R;b.prototype.Y=function(){var a;var E;var H;var e;var D;var g;var F;var G;var h;var I;var A;var B;var p;var k;var l;var m;var n;var o;var i;var q;var s;var t;var u;var v;var w;var x;var y;var z;var J;var K;var L;var C;this.C=this._;a=f(this,b.a_4,43);if(a===0){return false}this.D=this._;switch(a){case 0:return false;case 1:if(!(!(this.I_p2<=this._)?false:true)){return false}if(!c(this,'')){return false}break;case 2:if(!(!(this.I_p2<=this._)?false:true)){return false}if(!c(this,'')){return false}E=this.A-this._;p=true;c:while(p===true){p=false;this.C=this._;if(!d(this,2,'ic')){this._=this.A-E;break c}this.D=this._;k=true;b:while(k===true){k=false;H=this.A-this._;l=true;a:while(l===true){l=false;if(!(!(this.I_p2<=this._)?false:true)){break a}if(!c(this,'')){return false}break b}this._=this.A-H;if(!c(this,'iqU')){return false}}}break;case 3:if(!(!(this.I_p2<=this._)?false:true)){return false}if(!c(this,'log')){return false}break;case 4:if(!(!(this.I_p2<=this._)?false:true)){return false}if(!c(this,'u')){return false}break;case 5:if(!(!(this.I_p2<=this._)?false:true)){return false}if(!c(this,'ent')){return false}break;case 6:if(!(!(this.I_pV<=this._)?false:true)){return false}if(!c(this,'')){return false}e=this.A-this._;m=true;a:while(m===true){m=false;this.C=this._;a=f(this,b.a_2,6);if(a===0){this._=this.A-e;break a}this.D=this._;switch(a){case 0:this._=this.A-e;break a;case 1:if(!(!(this.I_p2<=this._)?false:true)){this._=this.A-e;break a}if(!c(this,'')){return false}this.C=this._;if(!d(this,2,'at')){this._=this.A-e;break a}this.D=J=this._;if(!(!(this.I_p2<=J)?false:true)){this._=this.A-e;break a}if(!c(this,'')){return false}break;case 2:n=true;b:while(n===true){n=false;D=this.A-this._;o=true;c:while(o===true){o=false;if(!(!(this.I_p2<=this._)?false:true)){break c}if(!c(this,'')){return false}break b}K=this._=this.A-D;if(!(!(this.I_p1<=K)?false:true)){this._=this.A-e;break a}if(!c(this,'eux')){return false}}break;case 3:if(!(!(this.I_p2<=this._)?false:true)){this._=this.A-e;break a}if(!c(this,'')){return false}break;case 4:if(!(!(this.I_pV<=this._)?false:true)){this._=this.A-e;break a}if(!c(this,'i')){return false}break}}break;case 7:if(!(!(this.I_p2<=this._)?false:true)){return false}if(!c(this,'')){return false}g=this.A-this._;i=true;a:while(i===true){i=false;this.C=this._;a=f(this,b.a_3,3);if(a===0){this._=this.A-g;break a}this.D=this._;switch(a){case 0:this._=this.A-g;break a;case 1:q=true;c:while(q===true){q=false;F=this.A-this._;s=true;b:while(s===true){s=false;if(!(!(this.I_p2<=this._)?false:true)){break b}if(!c(this,'')){return false}break c}this._=this.A-F;if(!c(this,'abl')){return false}}break;case 2:t=true;b:while(t===true){t=false;G=this.A-this._;u=true;c:while(u===true){u=false;if(!(!(this.I_p2<=this._)?false:true)){break c}if(!c(this,'')){return false}break b}this._=this.A-G;if(!c(this,'iqU')){return false}}break;case 3:if(!(!(this.I_p2<=this._)?false:true)){this._=this.A-g;break a}if(!c(this,'')){return false}break}}break;case 8:if(!(!(this.I_p2<=this._)?false:true)){return false}if(!c(this,'')){return false}h=this.A-this._;v=true;a:while(v===true){v=false;this.C=this._;if(!d(this,2,'at')){this._=this.A-h;break a}this.D=L=this._;if(!(!(this.I_p2<=L)?false:true)){this._=this.A-h;break a}if(!c(this,'')){return false}this.C=this._;if(!d(this,2,'ic')){this._=this.A-h;break a}this.D=this._;w=true;b:while(w===true){w=false;I=this.A-this._;x=true;c:while(x===true){x=false;if(!(!(this.I_p2<=this._)?false:true)){break c}if(!c(this,'')){return false}break b}this._=this.A-I;if(!c(this,'iqU')){return false}}}break;case 9:if(!c(this,'eau')){return false}break;case 10:if(!(!(this.I_p1<=this._)?false:true)){return false}if(!c(this,'al')){return false}break;case 11:y=true;a:while(y===true){y=false;A=this.A-this._;z=true;b:while(z===true){z=false;if(!(!(this.I_p2<=this._)?false:true)){break b}if(!c(this,'')){return false}break a}C=this._=this.A-A;if(!(!(this.I_p1<=C)?false:true)){return false}if(!c(this,'eux')){return false}}break;case 12:if(!(!(this.I_p1<=this._)?false:true)){return false}if(!j(this,b.g_v,97,251)){return false}if(!c(this,'')){return false}break;case 13:if(!(!(this.I_pV<=this._)?false:true)){return false}if(!c(this,'ant')){return false}return false;case 14:if(!(!(this.I_pV<=this._)?false:true)){return false}if(!c(this,'ent')){return false}return false;case 15:B=this.A-this._;if(!r(this,b.g_v,97,251)){return false}if(!(!(this.I_pV<=this._)?false:true)){return false}this._=this.A-B;if(!c(this,'')){return false}return false}return true};b.prototype.r_standard_suffix=b.prototype.Y;function K(a){var g;var F;var I;var e;var E;var h;var G;var H;var i;var J;var B;var C;var p;var l;var m;var n;var o;var k;var q;var s;var t;var u;var v;var w;var x;var y;var z;var A;var K;var L;var M;var D;a.C=a._;g=f(a,b.a_4,43);if(g===0){return false}a.D=a._;switch(g){case 0:return false;case 1:if(!(!(a.I_p2<=a._)?false:true)){return false}if(!c(a,'')){return false}break;case 2:if(!(!(a.I_p2<=a._)?false:true)){return false}if(!c(a,'')){return false}F=a.A-a._;p=true;c:while(p===true){p=false;a.C=a._;if(!d(a,2,'ic')){a._=a.A-F;break c}a.D=a._;l=true;b:while(l===true){l=false;I=a.A-a._;m=true;a:while(m===true){m=false;if(!(!(a.I_p2<=a._)?false:true)){break a}if(!c(a,'')){return false}break b}a._=a.A-I;if(!c(a,'iqU')){return false}}}break;case 3:if(!(!(a.I_p2<=a._)?false:true)){return false}if(!c(a,'log')){return false}break;case 4:if(!(!(a.I_p2<=a._)?false:true)){return false}if(!c(a,'u')){return false}break;case 5:if(!(!(a.I_p2<=a._)?false:true)){return false}if(!c(a,'ent')){return false}break;case 6:if(!(!(a.I_pV<=a._)?false:true)){return false}if(!c(a,'')){return false}e=a.A-a._;n=true;a:while(n===true){n=false;a.C=a._;g=f(a,b.a_2,6);if(g===0){a._=a.A-e;break a}a.D=a._;switch(g){case 0:a._=a.A-e;break a;case 1:if(!(!(a.I_p2<=a._)?false:true)){a._=a.A-e;break a}if(!c(a,'')){return false}a.C=a._;if(!d(a,2,'at')){a._=a.A-e;break a}a.D=K=a._;if(!(!(a.I_p2<=K)?false:true)){a._=a.A-e;break a}if(!c(a,'')){return false}break;case 2:o=true;b:while(o===true){o=false;E=a.A-a._;k=true;c:while(k===true){k=false;if(!(!(a.I_p2<=a._)?false:true)){break c}if(!c(a,'')){return false}break b}L=a._=a.A-E;if(!(!(a.I_p1<=L)?false:true)){a._=a.A-e;break a}if(!c(a,'eux')){return false}}break;case 3:if(!(!(a.I_p2<=a._)?false:true)){a._=a.A-e;break a}if(!c(a,'')){return false}break;case 4:if(!(!(a.I_pV<=a._)?false:true)){a._=a.A-e;break a}if(!c(a,'i')){return false}break}}break;case 7:if(!(!(a.I_p2<=a._)?false:true)){return false}if(!c(a,'')){return false}h=a.A-a._;q=true;a:while(q===true){q=false;a.C=a._;g=f(a,b.a_3,3);if(g===0){a._=a.A-h;break a}a.D=a._;switch(g){case 0:a._=a.A-h;break a;case 1:s=true;c:while(s===true){s=false;G=a.A-a._;t=true;b:while(t===true){t=false;if(!(!(a.I_p2<=a._)?false:true)){break b}if(!c(a,'')){return false}break c}a._=a.A-G;if(!c(a,'abl')){return false}}break;case 2:u=true;b:while(u===true){u=false;H=a.A-a._;v=true;c:while(v===true){v=false;if(!(!(a.I_p2<=a._)?false:true)){break c}if(!c(a,'')){return false}break b}a._=a.A-H;if(!c(a,'iqU')){return false}}break;case 3:if(!(!(a.I_p2<=a._)?false:true)){a._=a.A-h;break a}if(!c(a,'')){return false}break}}break;case 8:if(!(!(a.I_p2<=a._)?false:true)){return false}if(!c(a,'')){return false}i=a.A-a._;w=true;a:while(w===true){w=false;a.C=a._;if(!d(a,2,'at')){a._=a.A-i;break a}a.D=M=a._;if(!(!(a.I_p2<=M)?false:true)){a._=a.A-i;break a}if(!c(a,'')){return false}a.C=a._;if(!d(a,2,'ic')){a._=a.A-i;break a}a.D=a._;x=true;b:while(x===true){x=false;J=a.A-a._;y=true;c:while(y===true){y=false;if(!(!(a.I_p2<=a._)?false:true)){break c}if(!c(a,'')){return false}break b}a._=a.A-J;if(!c(a,'iqU')){return false}}}break;case 9:if(!c(a,'eau')){return false}break;case 10:if(!(!(a.I_p1<=a._)?false:true)){return false}if(!c(a,'al')){return false}break;case 11:z=true;a:while(z===true){z=false;B=a.A-a._;A=true;b:while(A===true){A=false;if(!(!(a.I_p2<=a._)?false:true)){break b}if(!c(a,'')){return false}break a}D=a._=a.A-B;if(!(!(a.I_p1<=D)?false:true)){return false}if(!c(a,'eux')){return false}}break;case 12:if(!(!(a.I_p1<=a._)?false:true)){return false}if(!j(a,b.g_v,97,251)){return false}if(!c(a,'')){return false}break;case 13:if(!(!(a.I_pV<=a._)?false:true)){return false}if(!c(a,'ant')){return false}return false;case 14:if(!(!(a.I_pV<=a._)?false:true)){return false}if(!c(a,'ent')){return false}return false;case 15:C=a.A-a._;if(!r(a,b.g_v,97,251)){return false}if(!(!(a.I_pV<=a._)?false:true)){return false}a._=a.A-C;if(!c(a,'')){return false}return false}return true};b.prototype.T=function(){var d;var e;var a;var g;var h;var i;e=this.A-(g=this._);if(g<this.I_pV){return false}h=this._=this.I_pV;a=this.B;this.B=h;i=this._=this.A-e;this.C=i;d=f(this,b.a_5,35);if(d===0){this.B=a;return false}this.D=this._;switch(d){case 0:this.B=a;return false;case 1:if(!j(this,b.g_v,97,251)){this.B=a;return false}if(!c(this,'')){return false}break}this.B=a;return true};b.prototype.r_i_verb_suffix=b.prototype.T;function L(a){var e;var g;var d;var h;var i;var k;g=a.A-(h=a._);if(h<a.I_pV){return false}i=a._=a.I_pV;d=a.B;a.B=i;k=a._=a.A-g;a.C=k;e=f(a,b.a_5,35);if(e===0){a.B=d;return false}a.D=a._;switch(e){case 0:a.B=d;return false;case 1:if(!j(a,b.g_v,97,251)){a.B=d;return false}if(!c(a,'')){return false}break}a.B=d;return true};b.prototype.b=function(){var e;var h;var a;var i;var g;var j;var k;var l;h=this.A-(j=this._);if(j<this.I_pV){return false}k=this._=this.I_pV;a=this.B;this.B=k;l=this._=this.A-h;this.C=l;e=f(this,b.a_6,38);if(e===0){this.B=a;return false}this.D=this._;switch(e){case 0:this.B=a;return false;case 1:if(!(!(this.I_p2<=this._)?false:true)){this.B=a;return false}if(!c(this,'')){return false}break;case 2:if(!c(this,'')){return false}break;case 3:if(!c(this,'')){return false}i=this.A-this._;g=true;a:while(g===true){g=false;this.C=this._;if(!d(this,1,'e')){this._=this.A-i;break a}this.D=this._;if(!c(this,'')){return false}}break}this.B=a;return true};b.prototype.r_verb_suffix=b.prototype.b;function M(a){var g;var i;var e;var j;var h;var k;var l;var m;i=a.A-(k=a._);if(k<a.I_pV){return false}l=a._=a.I_pV;e=a.B;a.B=l;m=a._=a.A-i;a.C=m;g=f(a,b.a_6,38);if(g===0){a.B=e;return false}a.D=a._;switch(g){case 0:a.B=e;return false;case 1:if(!(!(a.I_p2<=a._)?false:true)){a.B=e;return false}if(!c(a,'')){return false}break;case 2:if(!c(a,'')){return false}break;case 3:if(!c(a,'')){return false}j=a.A-a._;h=true;a:while(h===true){h=false;a.C=a._;if(!d(a,1,'e')){a._=a.A-j;break a}a.D=a._;if(!c(a,'')){return false}}break}a.B=e;return true};b.prototype.X=function(){var h;var g;var m;var n;var a;var l;var e;var i;var k;var p;var q;var r;var o;g=this.A-this._;e=true;a:while(e===true){e=false;this.C=this._;if(!d(this,1,'s')){this._=this.A-g;break a}this.D=p=this._;m=this.A-p;if(!j(this,b.g_keep_with_s,97,232)){this._=this.A-g;break a}this._=this.A-m;if(!c(this,'')){return false}}n=this.A-(q=this._);if(q<this.I_pV){return false}r=this._=this.I_pV;a=this.B;this.B=r;o=this._=this.A-n;this.C=o;h=f(this,b.a_7,7);if(h===0){this.B=a;return false}this.D=this._;switch(h){case 0:this.B=a;return false;case 1:if(!(!(this.I_p2<=this._)?false:true)){this.B=a;return false}i=true;a:while(i===true){i=false;l=this.A-this._;k=true;b:while(k===true){k=false;if(!d(this,1,'s')){break b}break a}this._=this.A-l;if(!d(this,1,'t')){this.B=a;return false}}if(!c(this,'')){return false}break;case 2:if(!c(this,'i')){return false}break;case 3:if(!c(this,'')){return false}break;case 4:if(!d(this,2,'gu')){this.B=a;return false}if(!c(this,'')){return false}break}this.B=a;return true};b.prototype.r_residual_suffix=b.prototype.X;function w(a){var g;var h;var p;var n;var e;var m;var i;var k;var l;var q;var r;var s;var o;h=a.A-a._;i=true;a:while(i===true){i=false;a.C=a._;if(!d(a,1,'s')){a._=a.A-h;break a}a.D=q=a._;p=a.A-q;if(!j(a,b.g_keep_with_s,97,232)){a._=a.A-h;break a}a._=a.A-p;if(!c(a,'')){return false}}n=a.A-(r=a._);if(r<a.I_pV){return false}s=a._=a.I_pV;e=a.B;a.B=s;o=a._=a.A-n;a.C=o;g=f(a,b.a_7,7);if(g===0){a.B=e;return false}a.D=a._;switch(g){case 0:a.B=e;return false;case 1:if(!(!(a.I_p2<=a._)?false:true)){a.B=e;return false}k=true;a:while(k===true){k=false;m=a.A-a._;l=true;b:while(l===true){l=false;if(!d(a,1,'s')){break b}break a}a._=a.A-m;if(!d(a,1,'t')){a.B=e;return false}}if(!c(a,'')){return false}break;case 2:if(!c(a,'i')){return false}break;case 3:if(!c(a,'')){return false}break;case 4:if(!d(a,2,'gu')){a.B=e;return false}if(!c(a,'')){return false}break}a.B=e;return true};b.prototype.a=function(){var d;var a;d=this.A-this._;if(f(this,b.a_8,5)===0){return false}a=this._=this.A-d;this.C=a;if(a<=this.B){return false}this._--;this.D=this._;return!c(this,'')?false:true};b.prototype.r_un_double=b.prototype.a;function t(a){var e;var d;e=a.A-a._;if(f(a,b.a_8,5)===0){return false}d=a._=a.A-e;a.C=d;if(d<=a.B){return false}a._--;a.D=a._;return!c(a,'')?false:true};b.prototype.Z=function(){var h;var a;var e;var f;var g;a=1;a:while(true){e=true;b:while(e===true){e=false;if(!j(this,b.g_v,97,251)){break b}a--;continue a}break a}if(a>0){return false}this.C=this._;f=true;a:while(f===true){f=false;h=this.A-this._;g=true;b:while(g===true){g=false;if(!d(this,1,'é')){break b}break a}this._=this.A-h;if(!d(this,1,'è')){return false}}this.D=this._;return!c(this,'e')?false:true};b.prototype.r_un_accent=b.prototype.Z;function F(a){var i;var e;var f;var g;var h;e=1;a:while(true){f=true;b:while(f===true){f=false;if(!j(a,b.g_v,97,251)){break b}e--;continue a}break a}if(e>0){return false}a.C=a._;g=true;a:while(g===true){g=false;i=a.A-a._;h=true;b:while(h===true){h=false;if(!d(a,1,'é')){break b}break a}a._=a.A-i;if(!d(a,1,'è')){return false}}a.D=a._;return!c(a,'e')?false:true};b.prototype.J=function(){var u;var z;var A;var B;var C;var j;var s;var v;var x;var y;var e;var f;var g;var h;var i;var a;var b;var k;var l;var m;var n;var o;var p;var q;var D;var E;var G;var N;var O;var P;var Q;var R;var r;u=this._;e=true;a:while(e===true){e=false;if(!H(this)){break a}}D=this._=u;z=D;f=true;a:while(f===true){f=false;if(!I(this)){break a}}N=this._=z;this.B=N;P=this._=O=this.A;A=O-P;g=true;c:while(g===true){g=false;h=true;d:while(h===true){h=false;B=this.A-this._;i=true;e:while(i===true){i=false;C=this.A-this._;a=true;a:while(a===true){a=false;j=this.A-this._;b=true;b:while(b===true){b=false;if(!K(this)){break b}break a}this._=this.A-j;k=true;b:while(k===true){k=false;if(!L(this)){break b}break a}this._=this.A-j;if(!M(this)){break e}}G=this._=(E=this.A)-C;s=E-G;l=true;a:while(l===true){l=false;this.C=this._;m=true;b:while(m===true){m=false;v=this.A-this._;n=true;f:while(n===true){n=false;if(!d(this,1,'Y')){break f}this.D=this._;if(!c(this,'i')){return false}break b}this._=this.A-v;if(!d(this,1,'ç')){this._=this.A-s;break a}this.D=this._;if(!c(this,'c')){return false}}}break d}this._=this.A-B;if(!w(this)){break c}}}R=this._=(Q=this.A)-A;x=Q-R;o=true;a:while(o===true){o=false;if(!t(this)){break a}}this._=this.A-x;p=true;a:while(p===true){p=false;if(!F(this)){break a}}r=this._=this.B;y=r;q=true;a:while(q===true){q=false;if(!J(this)){break a}}this._=y;return true};b.prototype.stem=b.prototype.J;b.prototype.N=function(a){return a instanceof b};b.prototype.equals=b.prototype.N;b.prototype.O=function(){var c;var a;var b;var d;c='FrenchStemmer';a=0;for(b=0;b<c.length;b++){d=c.charCodeAt(b);a=(a<<5)-a+d;a=a&a}return a|0};b.prototype.hashCode=b.prototype.O;b.serialVersionUID=1;g(b,'methodObject',function(){return new b});g(b,'a_0',function(){return[new a('col',-1,-1),new a('par',-1,-1),new a('tap',-1,-1)]});g(b,'a_1',function(){return[new a('',-1,4),new a('I',0,1),new a('U',0,2),new a('Y',0,3)]});g(b,'a_2',function(){return[new a('iqU',-1,3),new a('abl',-1,3),new a('Ièr',-1,4),new a('ièr',-1,4),new a('eus',-1,2),new a('iv',-1,1)]});g(b,'a_3',function(){return[new a('ic',-1,2),new a('abil',-1,1),new a('iv',-1,3)]});g(b,'a_4',function(){return[new a('iqUe',-1,1),new a('atrice',-1,2),new a('ance',-1,1),new a('ence',-1,5),new a('logie',-1,3),new a('able',-1,1),new a('isme',-1,1),new a('euse',-1,11),new a('iste',-1,1),new a('ive',-1,8),new a('if',-1,8),new a('usion',-1,4),new a('ation',-1,2),new a('ution',-1,4),new a('ateur',-1,2),new a('iqUes',-1,1),new a('atrices',-1,2),new a('ances',-1,1),new a('ences',-1,5),new a('logies',-1,3),new a('ables',-1,1),new a('ismes',-1,1),new a('euses',-1,11),new a('istes',-1,1),new a('ives',-1,8),new a('ifs',-1,8),new a('usions',-1,4),new a('ations',-1,2),new a('utions',-1,4),new a('ateurs',-1,2),new a('ments',-1,15),new a('ements',30,6),new a('issements',31,12),new a('ités',-1,7),new a('ment',-1,15),new a('ement',34,6),new a('issement',35,12),new a('amment',34,13),new a('emment',34,14),new a('aux',-1,10),new a('eaux',39,9),new a('eux',-1,1),new a('ité',-1,7)]});g(b,'a_5',function(){return[new a('ira',-1,1),new a('ie',-1,1),new a('isse',-1,1),new a('issante',-1,1),new a('i',-1,1),new a('irai',4,1),new a('ir',-1,1),new a('iras',-1,1),new a('ies',-1,1),new a('îmes',-1,1),new a('isses',-1,1),new a('issantes',-1,1),new a('îtes',-1,1),new a('is',-1,1),new a('irais',13,1),new a('issais',13,1),new a('irions',-1,1),new a('issions',-1,1),new a('irons',-1,1),new a('issons',-1,1),new a('issants',-1,1),new a('it',-1,1),new a('irait',21,1),new a('issait',21,1),new a('issant',-1,1),new a('iraIent',-1,1),new a('issaIent',-1,1),new a('irent',-1,1),new a('issent',-1,1),new a('iront',-1,1),new a('ît',-1,1),new a('iriez',-1,1),new a('issiez',-1,1),new a('irez',-1,1),new a('issez',-1,1)]});g(b,'a_6',function(){return[new a('a',-1,3),new a('era',0,2),new a('asse',-1,3),new a('ante',-1,3),new a('ée',-1,2),new a('ai',-1,3),new a('erai',5,2),new a('er',-1,2),new a('as',-1,3),new a('eras',8,2),new a('âmes',-1,3),new a('asses',-1,3),new a('antes',-1,3),new a('âtes',-1,3),new a('ées',-1,2),new a('ais',-1,3),new a('erais',15,2),new a('ions',-1,1),new a('erions',17,2),new a('assions',17,3),new a('erons',-1,2),new a('ants',-1,3),new a('és',-1,2),new a('ait',-1,3),new a('erait',23,2),new a('ant',-1,3),new a('aIent',-1,3),new a('eraIent',26,2),new a('èrent',-1,2),new a('assent',-1,3),new a('eront',-1,2),new a('ât',-1,3),new a('ez',-1,2),new a('iez',32,2),new a('eriez',33,2),new a('assiez',33,3),new a('erez',32,2),new a('é',-1,2)]});g(b,'a_7',function(){return[new a('e',-1,3),new a('Ière',0,2),new a('ière',0,2),new a('ion',-1,1),new a('Ier',-1,2),new a('ier',-1,2),new a('ë',-1,4)]});g(b,'a_8',function(){return[new a('ell',-1,-1),new a('eill',-1,-1),new a('enn',-1,-1),new a('onn',-1,-1),new a('ett',-1,-1)]});g(b,'g_v',function(){return[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,128,130,103,8,5]});g(b,'g_keep_with_s',function(){return[1,65,20,0,0,0,0,0,0,0,0,0,0,0,0,0,128]});var q={'src/stemmer.jsx':{Stemmer:p},'src/french-stemmer.jsx':{FrenchStemmer:b}}}(JSX)) -var Stemmer = JSX.require("src/french-stemmer.jsx").FrenchStemmer; - - - -/** - * Simple result scoring code. - */ -var Scorer = { - // Implement the following function to further tweak the score for each result - // The function takes a result array [filename, title, anchor, descr, score] - // and returns the new score. - /* - score: function(result) { - return result[4]; - }, - */ - - // query matches the full name of an object - objNameMatch: 11, - // or matches in the last dotted part of the object name - objPartialMatch: 6, - // Additive scores depending on the priority of the object - objPrio: {0: 15, // used to be importantResults - 1: 5, // used to be objectResults - 2: -5}, // used to be unimportantResults - // Used when the priority is not in the mapping. - objPrioDefault: 0, - - // query found in title - title: 15, - // query found in terms - term: 5 -}; - - - - - -var splitChars = (function() { - var result = {}; - var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, - 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702, - 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971, - 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345, - 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761, - 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, - 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125, - 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695, - 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587, - 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141]; - var i, j, start, end; - for (i = 0; i < singles.length; i++) { - result[singles[i]] = true; - } - var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709], - [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161], - [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568], - [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807], - [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047], - [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383], - [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450], - [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547], - [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673], - [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820], - [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946], - [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023], - [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173], - [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332], - [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481], - [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718], - [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791], - [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095], - [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205], - [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687], - [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968], - [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869], - [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102], - [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271], - [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592], - [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822], - [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167], - [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959], - [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143], - [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318], - [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483], - [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101], - [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567], - [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292], - [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444], - [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783], - [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311], - [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511], - [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774], - [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071], - [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263], - [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519], - [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647], - [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967], - [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295], - [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274], - [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007], - [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381], - [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]]; - for (i = 0; i < ranges.length; i++) { - start = ranges[i][0]; - end = ranges[i][1]; - for (j = start; j <= end; j++) { - result[j] = true; - } - } - return result; -})(); - -function splitQuery(query) { - var result = []; - var start = -1; - for (var i = 0; i < query.length; i++) { - if (splitChars[query.charCodeAt(i)]) { - if (start !== -1) { - result.push(query.slice(start, i)); - start = -1; - } - } else if (start === -1) { - start = i; - } - } - if (start !== -1) { - result.push(query.slice(start)); - } - return result; -} - - - - -/** - * Search Module - */ -var Search = { - - _index : null, - _queued_query : null, - _pulse_status : -1, - - init : function() { - var params = $.getQueryParameters(); - if (params.q) { - var query = params.q[0]; - $('input[name="q"]')[0].value = query; - this.performSearch(query); - } - }, - - loadIndex : function(url) { - $.ajax({type: "GET", url: url, data: null, - dataType: "script", cache: true, - complete: function(jqxhr, textstatus) { - if (textstatus != "success") { - document.getElementById("searchindexloader").src = url; - } - }}); - }, - - setIndex : function(index) { - var q; - this._index = index; - if ((q = this._queued_query) !== null) { - this._queued_query = null; - Search.query(q); - } - }, - - hasIndex : function() { - return this._index !== null; - }, - - deferQuery : function(query) { - this._queued_query = query; - }, - - stopPulse : function() { - this._pulse_status = 0; - }, - - startPulse : function() { - if (this._pulse_status >= 0) - return; - function pulse() { - var i; - Search._pulse_status = (Search._pulse_status + 1) % 4; - var dotString = ''; - for (i = 0; i < Search._pulse_status; i++) - dotString += '.'; - Search.dots.text(dotString); - if (Search._pulse_status > -1) - window.setTimeout(pulse, 500); - } - pulse(); - }, - - /** - * perform a search for something (or wait until index is loaded) - */ - performSearch : function(query) { - // create the required interface elements - this.out = $('#search-results'); - this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out); - this.dots = $('<span></span>').appendTo(this.title); - this.status = $('<p style="display: none"></p>').appendTo(this.out); - this.output = $('<ul class="search"/>').appendTo(this.out); - - $('#search-progress').text(_('Preparing search...')); - this.startPulse(); - - // index already loaded, the browser was quick! - if (this.hasIndex()) - this.query(query); - else - this.deferQuery(query); - }, - - /** - * execute search (requires search index to be loaded) - */ - query : function(query) { - var i; - var stopwords = ["ai","aie","aient","aies","ait","as","au","aura","aurai","auraient","aurais","aurait","auras","aurez","auriez","aurions","aurons","auront","aux","avaient","avais","avait","avec","avez","aviez","avions","avons","ayant","ayez","ayons","c","ce","ceci","cela","cel\u00e0","ces","cet","cette","d","dans","de","des","du","elle","en","es","est","et","eu","eue","eues","eurent","eus","eusse","eussent","eusses","eussiez","eussions","eut","eux","e\u00fbmes","e\u00fbt","e\u00fbtes","furent","fus","fusse","fussent","fusses","fussiez","fussions","fut","f\u00fbmes","f\u00fbt","f\u00fbtes","ici","il","ils","j","je","l","la","le","les","leur","leurs","lui","m","ma","mais","me","mes","moi","mon","m\u00eame","n","ne","nos","notre","nous","on","ont","ou","par","pas","pour","qu","que","quel","quelle","quelles","quels","qui","s","sa","sans","se","sera","serai","seraient","serais","serait","seras","serez","seriez","serions","serons","seront","ses","soi","soient","sois","soit","sommes","son","sont","soyez","soyons","suis","sur","t","ta","te","tes","toi","ton","tu","un","une","vos","votre","vous","y","\u00e0","\u00e9taient","\u00e9tais","\u00e9tait","\u00e9tant","\u00e9tiez","\u00e9tions","\u00e9t\u00e9","\u00e9t\u00e9e","\u00e9t\u00e9es","\u00e9t\u00e9s","\u00eates"]; - - // stem the searchterms and add them to the correct list - var stemmer = new Stemmer(); - var searchterms = []; - var excluded = []; - var hlterms = []; - var tmp = splitQuery(query); - var objectterms = []; - for (i = 0; i < tmp.length; i++) { - if (tmp[i] !== "") { - objectterms.push(tmp[i].toLowerCase()); - } - - if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) || - tmp[i] === "") { - // skip this "word" - continue; - } - // stem the word - var word = stemmer.stemWord(tmp[i].toLowerCase()); - // prevent stemmer from cutting word smaller than two chars - if(word.length < 3 && tmp[i].length >= 3) { - word = tmp[i]; - } - var toAppend; - // select the correct list - if (word[0] == '-') { - toAppend = excluded; - word = word.substr(1); - } - else { - toAppend = searchterms; - hlterms.push(tmp[i].toLowerCase()); - } - // only add if not already in the list - if (!$u.contains(toAppend, word)) - toAppend.push(word); - } - var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" ")); - - // console.debug('SEARCH: searching for:'); - // console.info('required: ', searchterms); - // console.info('excluded: ', excluded); - - // prepare search - var terms = this._index.terms; - var titleterms = this._index.titleterms; - - // array of [filename, title, anchor, descr, score] - var results = []; - $('#search-progress').empty(); - - // lookup as object - for (i = 0; i < objectterms.length; i++) { - var others = [].concat(objectterms.slice(0, i), - objectterms.slice(i+1, objectterms.length)); - results = results.concat(this.performObjectSearch(objectterms[i], others)); - } - - // lookup as search terms in fulltext - results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms)); - - // let the scorer override scores with a custom scoring function - if (Scorer.score) { - for (i = 0; i < results.length; i++) - results[i][4] = Scorer.score(results[i]); - } - - // now sort the results by score (in opposite order of appearance, since the - // display function below uses pop() to retrieve items) and then - // alphabetically - results.sort(function(a, b) { - var left = a[4]; - var right = b[4]; - if (left > right) { - return 1; - } else if (left < right) { - return -1; - } else { - // same score: sort alphabetically - left = a[1].toLowerCase(); - right = b[1].toLowerCase(); - return (left > right) ? -1 : ((left < right) ? 1 : 0); - } - }); - - // for debugging - //Search.lastresults = results.slice(); // a copy - //console.info('search results:', Search.lastresults); - - // print the results - var resultCount = results.length; - function displayNextItem() { - // results left, load the summary and display it - if (results.length) { - var item = results.pop(); - var listItem = $('<li style="display:none"></li>'); - if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') { - // dirhtml builder - var dirname = item[0] + '/'; - if (dirname.match(/\/index\/$/)) { - dirname = dirname.substring(0, dirname.length-6); - } else if (dirname == 'index/') { - dirname = ''; - } - listItem.append($('<a/>').attr('href', - DOCUMENTATION_OPTIONS.URL_ROOT + dirname + - highlightstring + item[2]).html(item[1])); - } else { - // normal html builders - listItem.append($('<a/>').attr('href', - item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX + - highlightstring + item[2]).html(item[1])); - } - if (item[3]) { - listItem.append($('<span> (' + item[3] + ')</span>')); - Search.output.append(listItem); - listItem.slideDown(5, function() { - displayNextItem(); - }); - } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) { - var suffix = DOCUMENTATION_OPTIONS.SOURCELINK_SUFFIX; - $.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[5] + (item[5].slice(-suffix.length) === suffix ? '' : suffix), - dataType: "text", - complete: function(jqxhr, textstatus) { - var data = jqxhr.responseText; - if (data !== '' && data !== undefined) { - listItem.append(Search.makeSearchSummary(data, searchterms, hlterms)); - } - Search.output.append(listItem); - listItem.slideDown(5, function() { - displayNextItem(); - }); - }}); - } else { - // no source available, just display title - Search.output.append(listItem); - listItem.slideDown(5, function() { - displayNextItem(); - }); - } - } - // search finished, update title and status message - else { - Search.stopPulse(); - Search.title.text(_('Search Results')); - if (!resultCount) - Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.')); - else - Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount)); - Search.status.fadeIn(500); - } - } - displayNextItem(); - }, - - /** - * search for object names - */ - performObjectSearch : function(object, otherterms) { - var filenames = this._index.filenames; - var docnames = this._index.docnames; - var objects = this._index.objects; - var objnames = this._index.objnames; - var titles = this._index.titles; - - var i; - var results = []; - - for (var prefix in objects) { - for (var name in objects[prefix]) { - var fullname = (prefix ? prefix + '.' : '') + name; - if (fullname.toLowerCase().indexOf(object) > -1) { - var score = 0; - var parts = fullname.split('.'); - // check for different match types: exact matches of full name or - // "last name" (i.e. last dotted part) - if (fullname == object || parts[parts.length - 1] == object) { - score += Scorer.objNameMatch; - // matches in last name - } else if (parts[parts.length - 1].indexOf(object) > -1) { - score += Scorer.objPartialMatch; - } - var match = objects[prefix][name]; - var objname = objnames[match[1]][2]; - var title = titles[match[0]]; - // If more than one term searched for, we require other words to be - // found in the name/title/description - if (otherterms.length > 0) { - var haystack = (prefix + ' ' + name + ' ' + - objname + ' ' + title).toLowerCase(); - var allfound = true; - for (i = 0; i < otherterms.length; i++) { - if (haystack.indexOf(otherterms[i]) == -1) { - allfound = false; - break; - } - } - if (!allfound) { - continue; - } - } - var descr = objname + _(', in ') + title; - - var anchor = match[3]; - if (anchor === '') - anchor = fullname; - else if (anchor == '-') - anchor = objnames[match[1]][1] + '-' + fullname; - // add custom score for some objects according to scorer - if (Scorer.objPrio.hasOwnProperty(match[2])) { - score += Scorer.objPrio[match[2]]; - } else { - score += Scorer.objPrioDefault; - } - results.push([docnames[match[0]], fullname, '#'+anchor, descr, score, filenames[match[0]]]); - } - } - } - - return results; - }, - - /** - * search for full-text terms in the index - */ - performTermsSearch : function(searchterms, excluded, terms, titleterms) { - var docnames = this._index.docnames; - var filenames = this._index.filenames; - var titles = this._index.titles; - - var i, j, file; - var fileMap = {}; - var scoreMap = {}; - var results = []; - - // perform the search on the required terms - for (i = 0; i < searchterms.length; i++) { - var word = searchterms[i]; - var files = []; - var _o = [ - {files: terms[word], score: Scorer.term}, - {files: titleterms[word], score: Scorer.title} - ]; - - // no match but word was a required one - if ($u.every(_o, function(o){return o.files === undefined;})) { - break; - } - // found search word in contents - $u.each(_o, function(o) { - var _files = o.files; - if (_files === undefined) - return - - if (_files.length === undefined) - _files = [_files]; - files = files.concat(_files); - - // set score for the word in each file to Scorer.term - for (j = 0; j < _files.length; j++) { - file = _files[j]; - if (!(file in scoreMap)) - scoreMap[file] = {} - scoreMap[file][word] = o.score; - } - }); - - // create the mapping - for (j = 0; j < files.length; j++) { - file = files[j]; - if (file in fileMap) - fileMap[file].push(word); - else - fileMap[file] = [word]; - } - } - - // now check if the files don't contain excluded terms - for (file in fileMap) { - var valid = true; - - // check if all requirements are matched - if (fileMap[file].length != searchterms.length) - continue; - - // ensure that none of the excluded terms is in the search result - for (i = 0; i < excluded.length; i++) { - if (terms[excluded[i]] == file || - titleterms[excluded[i]] == file || - $u.contains(terms[excluded[i]] || [], file) || - $u.contains(titleterms[excluded[i]] || [], file)) { - valid = false; - break; - } - } - - // if we have still a valid result we can add it to the result list - if (valid) { - // select one (max) score for the file. - // for better ranking, we should calculate ranking by using words statistics like basic tf-idf... - var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]})); - results.push([docnames[file], titles[file], '', null, score, filenames[file]]); - } - } - return results; - }, - - /** - * helper function to return a node containing the - * search summary for a given text. keywords is a list - * of stemmed words, hlwords is the list of normal, unstemmed - * words. the first one is used to find the occurrence, the - * latter for highlighting it. - */ - makeSearchSummary : function(text, keywords, hlwords) { - var textLower = text.toLowerCase(); - var start = 0; - $.each(keywords, function() { - var i = textLower.indexOf(this.toLowerCase()); - if (i > -1) - start = i; - }); - start = Math.max(start - 120, 0); - var excerpt = ((start > 0) ? '...' : '') + - $.trim(text.substr(start, 240)) + - ((start + 240 - text.length) ? '...' : ''); - var rv = $('<div class="context"></div>').text(excerpt); - $.each(hlwords, function() { - rv = rv.highlightText(this, 'highlighted'); - }); - return rv; - } -}; - -$(document).ready(function() { - Search.init(); -}); \ No newline at end of file diff --git a/Documentation/_static/sidebar.js b/Documentation/_static/sidebar.js deleted file mode 100644 index 4282fe91c1c15c33f77bd171b8965d3aa1c148e9..0000000000000000000000000000000000000000 --- a/Documentation/_static/sidebar.js +++ /dev/null @@ -1,159 +0,0 @@ -/* - * sidebar.js - * ~~~~~~~~~~ - * - * This script makes the Sphinx sidebar collapsible. - * - * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds - * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton - * used to collapse and expand the sidebar. - * - * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden - * and the width of the sidebar and the margin-left of the document - * are decreased. When the sidebar is expanded the opposite happens. - * This script saves a per-browser/per-session cookie used to - * remember the position of the sidebar among the pages. - * Once the browser is closed the cookie is deleted and the position - * reset to the default (expanded). - * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -$(function() { - - - - - - - - - // global elements used by the functions. - // the 'sidebarbutton' element is defined as global after its - // creation, in the add_sidebar_button function - var bodywrapper = $('.bodywrapper'); - var sidebar = $('.sphinxsidebar'); - var sidebarwrapper = $('.sphinxsidebarwrapper'); - - // for some reason, the document has no sidebar; do not run into errors - if (!sidebar.length) return; - - // original margin-left of the bodywrapper and width of the sidebar - // with the sidebar expanded - var bw_margin_expanded = bodywrapper.css('margin-left'); - var ssb_width_expanded = sidebar.width(); - - // margin-left of the bodywrapper and width of the sidebar - // with the sidebar collapsed - var bw_margin_collapsed = '.8em'; - var ssb_width_collapsed = '.8em'; - - // colors used by the current theme - var dark_color = $('.related').css('background-color'); - var light_color = $('.document').css('background-color'); - - function sidebar_is_collapsed() { - return sidebarwrapper.is(':not(:visible)'); - } - - function toggle_sidebar() { - if (sidebar_is_collapsed()) - expand_sidebar(); - else - collapse_sidebar(); - } - - function collapse_sidebar() { - sidebarwrapper.hide(); - sidebar.css('width', ssb_width_collapsed); - bodywrapper.css('margin-left', bw_margin_collapsed); - sidebarbutton.css({ - 'margin-left': '0', - 'height': bodywrapper.height() - }); - sidebarbutton.find('span').text('»'); - sidebarbutton.attr('title', _('Expand sidebar')); - document.cookie = 'sidebar=collapsed'; - } - - function expand_sidebar() { - bodywrapper.css('margin-left', bw_margin_expanded); - sidebar.css('width', ssb_width_expanded); - sidebarwrapper.show(); - sidebarbutton.css({ - 'margin-left': ssb_width_expanded-12, - 'height': bodywrapper.height() - }); - sidebarbutton.find('span').text('«'); - sidebarbutton.attr('title', _('Collapse sidebar')); - document.cookie = 'sidebar=expanded'; - } - - function add_sidebar_button() { - sidebarwrapper.css({ - 'float': 'left', - 'margin-right': '0', - 'width': ssb_width_expanded - 28 - }); - // create the button - sidebar.append( - '<div id="sidebarbutton"><span>«</span></div>' - ); - var sidebarbutton = $('#sidebarbutton'); - light_color = sidebarbutton.css('background-color'); - // find the height of the viewport to center the '<<' in the page - var viewport_height; - if (window.innerHeight) - viewport_height = window.innerHeight; - else - viewport_height = $(window).height(); - sidebarbutton.find('span').css({ - 'display': 'block', - 'margin-top': (viewport_height - sidebar.position().top - 20) / 2 - }); - - sidebarbutton.click(toggle_sidebar); - sidebarbutton.attr('title', _('Collapse sidebar')); - sidebarbutton.css({ - 'color': '#FFFFFF', - 'border-left': '1px solid ' + dark_color, - 'font-size': '1.2em', - 'cursor': 'pointer', - 'height': bodywrapper.height(), - 'padding-top': '1px', - 'margin-left': ssb_width_expanded - 12 - }); - - sidebarbutton.hover( - function () { - $(this).css('background-color', dark_color); - }, - function () { - $(this).css('background-color', light_color); - } - ); - } - - function set_position_from_cookie() { - if (!document.cookie) - return; - var items = document.cookie.split(';'); - for(var k=0; k<items.length; k++) { - var key_val = items[k].split('='); - var key = key_val[0].replace(/ /, ""); // strip leading spaces - if (key == 'sidebar') { - var value = key_val[1]; - if ((value == 'collapsed') && (!sidebar_is_collapsed())) - collapse_sidebar(); - else if ((value == 'expanded') && (sidebar_is_collapsed())) - expand_sidebar(); - } - } - } - - add_sidebar_button(); - var sidebarbutton = $('#sidebarbutton'); - set_position_from_cookie(); -}); \ No newline at end of file diff --git a/Documentation/_static/translations.js b/Documentation/_static/translations.js deleted file mode 100644 index a6a171181f3cee1e5b03c9d2d4f9c53269edf6ac..0000000000000000000000000000000000000000 --- a/Documentation/_static/translations.js +++ /dev/null @@ -1 +0,0 @@ -Documentation.addTranslations({"locale": "fr", "messages": {"%(filename)s — %(docstitle)s": "", "© <a href=\"%(path)s\">Copyright</a> %(copyright)s.": "", "© Copyright %(copyright)s.": "", ", in ": ", dans", "About these documents": "\u00c0 propos de ces documents", "Automatically generated list of changes in version %(version)s": "Liste auto-g\u00e9n\u00e9r\u00e9e des modifications dans la version %(version)s", "C API changes": "Modifications de l'API C", "Changes in Version %(version)s — %(docstitle)s": "", "Collapse sidebar": "R\u00e9duire la barre lat\u00e9rale", "Complete Table of Contents": "Table des mati\u00e8res compl\u00e8te", "Contents": "Contenu", "Copyright": "Copyright", "Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "Cr\u00e9\u00e9 avec <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.", "Expand sidebar": "Agrandir la barre lat\u00e9rale", "From here you can search these documents. Enter your search\n words into the box below and click \"search\". Note that the search\n function will automatically search for all of the words. Pages\n containing fewer words won't appear in the result list.": "Vous pouvez effectuer une recherche au sein des documents. Saisissez les termes\nde votre recherche dans le champs ci-dessous et cliquez sur \"rechercher\". Notez que la fonctionnalit\u00e9 de recherche\nva automatiquement chercher l'ensemble des mots. Les pages\ncontenant moins de mots n'appara\u00eetront pas dans la liste des r\u00e9sultats.", "Full index on one page": "Index complet sur une seule page", "General Index": "Index g\u00e9n\u00e9ral", "Global Module Index": "Index g\u00e9n\u00e9ral des modules", "Go": "Go", "Hide Search Matches": "Cacher les r\u00e9sultats de la recherche", "Index": "Index", "Index – %(key)s": "Index – %(key)s", "Index pages by letter": "Indexer les pages par lettre", "Indices and tables:": "Indices et Tables :", "Last updated on %(last_updated)s.": "Mis \u00e0 jour le %(last_updated)s.", "Library changes": "Modifications de la biblioth\u00e8que", "Navigation": "Navigation", "Next topic": "Sujet suivant", "Other changes": "Autres modifications", "Overview": "R\u00e9sum\u00e9", "Permalink to this definition": "Lien permanent vers cette d\u00e9finition", "Permalink to this headline": "Lien permanent vers ce titre", "Please activate JavaScript to enable the search\n functionality.": "Veuillez activer le JavaScript pour que la recherche fonctionne.", "Preparing search...": "Pr\u00e9paration de la recherche...", "Previous topic": "Sujet pr\u00e9c\u00e9dent", "Quick search": "Recherche rapide", "Search": "Recherche", "Search Page": "Page de recherche", "Search Results": "R\u00e9sultats de la recherche", "Search finished, found %s page(s) matching the search query.": "La recherche est finie, %s page(s) trouv\u00e9e(s) qui corresponde(nt) \u00e0 la recherche.", "Search within %(docstitle)s": "Recherchez dans %(docstitle)s", "Searching": "Recherche en cours", "Show Source": "Montrer le code source", "Table Of Contents": "Table des Mati\u00e8res", "This Page": "Cette page", "Welcome! This is": "Bienvenue ! Ceci est", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Votre recherche ne correspond \u00e0 aucun document. Veuillez v\u00e9rifier que les mots sont correctement orthographi\u00e9s et que vous avez s\u00e9lectionn\u00e9 assez de cat\u00e9gories.", "all functions, classes, terms": "toutes les fonctions, classes, termes", "can be huge": "peut \u00eatre \u00e9norme", "last updated": "derni\u00e8re modification", "lists all sections and subsections": "lister l'ensemble des sections et sous-sections", "next chapter": "Chapitre suivant", "previous chapter": "Chapitre pr\u00e9c\u00e9dent", "quick access to all modules": "acc\u00e8s rapide \u00e0 l'ensemble des modules", "search": "rechercher", "search this documentation": "rechercher dans cette documentation", "the documentation for": "la documentation pour"}, "plural_expr": "(n > 1)"}); \ No newline at end of file diff --git a/Documentation/_static/underscore-1.3.1.js b/Documentation/_static/underscore-1.3.1.js deleted file mode 100644 index 208d4cd890c3183d946092ebe982738ade565061..0000000000000000000000000000000000000000 --- a/Documentation/_static/underscore-1.3.1.js +++ /dev/null @@ -1,999 +0,0 @@ -// Underscore.js 1.3.1 -// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore is freely distributable under the MIT license. -// Portions of Underscore are inspired or borrowed from Prototype, -// Oliver Steele's Functional, and John Resig's Micro-Templating. -// For all details and documentation: -// http://documentcloud.github.com/underscore - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `global` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var slice = ArrayProto.slice, - unshift = ArrayProto.unshift, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { return new wrapper(obj); }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root['_'] = _; - } - - // Current version. - _.VERSION = '1.3.1'; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - for (var key in obj) { - if (_.has(obj, key)) { - if (iterator.call(context, obj[key], key, obj) === breaker) return; - } - } - } - }; - - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); - }); - if (obj.length === +obj.length) results.length = obj.length; - return results; - }; - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); - } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError('Reduce of empty array with no initial value'); - return memo; - }; - - // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); - } - var reversed = _.toArray(obj).reverse(); - if (context && !initial) iterator = _.bind(iterator, context); - return initial ? _.reduce(reversed, iterator, memo, context) : _.reduce(reversed, iterator); - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { - var result; - any(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select`. - _.filter = _.select = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); - each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results[results.length] = value; - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - each(obj, function(value, index, list) { - if (!iterator.call(context, value, index, list)) results[results.length] = value; - }); - return results; - }; - - // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. - // Aliased as `all`. - _.every = _.all = function(obj, iterator, context) { - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); - each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; - }); - return result; - }; - - // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. - // Aliased as `any`. - var any = _.some = _.any = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); - each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if a given value is included in the array or object using `===`. - // Aliased as `contains`. - _.include = _.contains = function(obj, target) { - var found = false; - if (obj == null) return found; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - found = any(obj, function(value) { - return value === target; - }); - return found; - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - return _.map(obj, function(value) { - return (_.isFunction(method) ? method || value : value[method]).apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); - }; - - // Return the maximum element or (element-based computation). - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj); - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed >= result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj); - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Shuffle an array. - _.shuffle = function(obj) { - var shuffled = [], rand; - each(obj, function(value, index, list) { - if (index == 0) { - shuffled[0] = value; - } else { - rand = Math.floor(Math.random() * (index + 1)); - shuffled[index] = shuffled[rand]; - shuffled[rand] = value; - } - }); - return shuffled; - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, iterator, context) { - return _.pluck(_.map(obj, function(value, index, list) { - return { - value : value, - criteria : iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }), 'value'); - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = function(obj, val) { - var result = {}; - var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; }; - each(obj, function(value, index) { - var key = iterator(value, index); - (result[key] || (result[key] = [])).push(value); - }); - return result; - }; - - // Use a comparator function to figure out at what index an object should - // be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator) { - iterator || (iterator = _.identity); - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >> 1; - iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid; - } - return low; - }; - - // Safely convert anything iterable into a real, live array. - _.toArray = function(iterable) { - if (!iterable) return []; - if (iterable.toArray) return iterable.toArray(); - if (_.isArray(iterable)) return slice.call(iterable); - if (_.isArguments(iterable)) return slice.call(iterable); - return _.values(iterable); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - return _.toArray(obj).length; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head`. The **guard** check allows it to work - // with `_.map`. - _.first = _.head = function(array, n, guard) { - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; - }; - - // Returns everything but the last entry of the array. Especcialy useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function(array, n, guard) { - if ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } - }; - - // Returns everything but the first entry of the array. Aliased as `tail`. - // Especially useful on the arguments object. Passing an **index** will return - // the rest of the values in the array from that index onward. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = function(array, index, guard) { - return slice.call(array, (index == null) || guard ? 1 : index); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, function(value){ return !!value; }); - }; - - // Return a completely flattened version of an array. - _.flatten = function(array, shallow) { - return _.reduce(array, function(memo, value) { - if (_.isArray(value)) return memo.concat(shallow ? value : _.flatten(value)); - memo[memo.length] = value; - return memo; - }, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator) { - var initial = iterator ? _.map(array, iterator) : array; - var result = []; - _.reduce(initial, function(memo, el, i) { - if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) { - memo[memo.length] = el; - result[result.length] = array[i]; - } - return memo; - }, []); - return result; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(_.flatten(arguments, true)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. (Aliased as "intersect" for back-compat.) - _.intersection = _.intersect = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = _.flatten(slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.include(rest, value); }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var args = slice.call(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); - for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i); - return results; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - if (array == null) return -1; - var i, l; - if (isSorted) { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item); - for (i = 0, l = array.length; i < l; i++) if (i in array && array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function(array, item) { - if (array == null) return -1; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item); - var i = array.length; - while (i--) if (i in array && array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = arguments[2] || 1; - - var len = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(len); - - while(idx < len) { - range[idx++] = start; - start += step; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Reusable constructor function for prototype setting. - var ctor = function(){}; - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Binding with arguments is also known as `curry`. - // Delegates to **ECMAScript 5**'s native `Function.bind` if available. - // We check for `func.bind` first, to fail fast when `func` is undefined. - _.bind = function bind(func, context) { - var bound, args; - if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!_.isFunction(func)) throw new TypeError; - args = slice.call(arguments, 2); - return bound = function() { - if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); - ctor.prototype = func.prototype; - var self = new ctor; - var result = func.apply(self, args.concat(slice.call(arguments))); - if (Object(result) === result) return result; - return self; - }; - }; - - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length == 0) funcs = _.functions(obj); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); - }; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(func, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. - _.throttle = function(func, wait) { - var context, args, timeout, throttling, more; - var whenDone = _.debounce(function(){ more = throttling = false; }, wait); - return function() { - context = this; args = arguments; - var later = function() { - timeout = null; - if (more) func.apply(context, args); - whenDone(); - }; - if (!timeout) timeout = setTimeout(later, wait); - if (throttling) { - more = true; - } else { - func.apply(context, args); - } - whenDone(); - throttling = true; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. - _.debounce = function(func, wait) { - var timeout; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - func.apply(context, args); - }; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; - return function() { - if (ran) return memo; - ran = true; - return memo = func.apply(this, arguments); - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return function() { - var args = [func].concat(slice.call(arguments, 0)); - return wrapper.apply(this, args); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = arguments; - return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - // Returns a function that will only be executed after being called N times. - _.after = function(times, func) { - if (times <= 0) return func(); - return function() { - if (--times < 1) { return func.apply(this, arguments); } - }; - }; - - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - return _.map(obj, _.identity); - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - for (var prop in source) { - obj[prop] = source[prop]; - } - }); - return obj; - }; - - // Fill in a given object with default properties. - _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - for (var prop in source) { - if (obj[prop] == null) obj[prop] = source[prop]; - } - }); - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Internal recursive comparison function. - function eq(a, b, stack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. - if (a === b) return a !== 0 || 1 / a == 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a._chain) a = a._wrapped; - if (b._chain) b = b._wrapped; - // Invoke a custom `isEqual` method if one is provided. - if (a.isEqual && _.isFunction(a.isEqual)) return a.isEqual(b); - if (b.isEqual && _.isFunction(b.isEqual)) return b.isEqual(a); - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className != toString.call(b)) return false; - switch (className) { - // Strings, numbers, dates, and booleans are compared by value. - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return a == String(b); - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = stack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (stack[length] == a) return true; - } - // Add the first object to the stack of traversed objects. - stack.push(a); - var size = 0, result = true; - // Recursively compare objects and arrays. - if (className == '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size == b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - // Ensure commutative equality for sparse arrays. - if (!(result = size in a == size in b && eq(a[size], b[size], stack))) break; - } - } - } else { - // Objects with different constructors are not equivalent. - if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) return false; - // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], stack))) break; - } - } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } - } - // Remove the first object from the stack of traversed objects. - stack.pop(); - return result; - } - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b, []); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType == 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - return obj === Object(obj); - }; - - // Is a given variable an arguments object? - _.isArguments = function(obj) { - return toString.call(obj) == '[object Arguments]'; - }; - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } - - // Is a given value a function? - _.isFunction = function(obj) { - return toString.call(obj) == '[object Function]'; - }; - - // Is a given value a string? - _.isString = function(obj) { - return toString.call(obj) == '[object String]'; - }; - - // Is a given value a number? - _.isNumber = function(obj) { - return toString.call(obj) == '[object Number]'; - }; - - // Is the given value `NaN`? - _.isNaN = function(obj) { - // `NaN` is the only value for which `===` is not reflexive. - return obj !== obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; - }; - - // Is a given value a date? - _.isDate = function(obj) { - return toString.call(obj) == '[object Date]'; - }; - - // Is the given value a regular expression? - _.isRegExp = function(obj) { - return toString.call(obj) == '[object RegExp]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Has own property? - _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - // Run a function **n** times. - _.times = function (n, iterator, context) { - for (var i = 0; i < n; i++) iterator.call(context, i); - }; - - // Escape a string for HTML interpolation. - _.escape = function(string) { - return (''+string).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\//g,'/'); - }; - - // Add your own custom functions to the Underscore object, ensuring that - // they're correctly added to the OOP wrapper as well. - _.mixin = function(obj) { - each(_.functions(obj), function(name){ - addToWrapper(name, _[name] = obj[name]); - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = idCounter++; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /.^/; - - // Within an interpolation, evaluation, or escaping, remove HTML escaping - // that had been previously added. - var unescape = function(code) { - return code.replace(/\\\\/g, '\\').replace(/\\'/g, "'"); - }; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - _.template = function(str, data) { - var c = _.templateSettings; - var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' + - 'with(obj||{}){__p.push(\'' + - str.replace(/\\/g, '\\\\') - .replace(/'/g, "\\'") - .replace(c.escape || noMatch, function(match, code) { - return "',_.escape(" + unescape(code) + "),'"; - }) - .replace(c.interpolate || noMatch, function(match, code) { - return "'," + unescape(code) + ",'"; - }) - .replace(c.evaluate || noMatch, function(match, code) { - return "');" + unescape(code).replace(/[\r\n\t]/g, ' ') + ";__p.push('"; - }) - .replace(/\r/g, '\\r') - .replace(/\n/g, '\\n') - .replace(/\t/g, '\\t') - + "');}return __p.join('');"; - var func = new Function('obj', '_', tmpl); - if (data) return func(data, _); - return function(data) { - return func.call(this, data, _); - }; - }; - - // Add a "chain" function, which will delegate to the wrapper. - _.chain = function(obj) { - return _(obj).chain(); - }; - - // The OOP Wrapper - // --------------- - - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - var wrapper = function(obj) { this._wrapped = obj; }; - - // Expose `wrapper.prototype` as `_.prototype` - _.prototype = wrapper.prototype; - - // Helper function to continue chaining intermediate results. - var result = function(obj, chain) { - return chain ? _(obj).chain() : obj; - }; - - // A method to easily add functions to the OOP wrapper. - var addToWrapper = function(name, func) { - wrapper.prototype[name] = function() { - var args = slice.call(arguments); - unshift.call(args, this._wrapped); - return result(func.apply(_, args), this._chain); - }; - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - wrapper.prototype[name] = function() { - var wrapped = this._wrapped; - method.apply(wrapped, arguments); - var length = wrapped.length; - if ((name == 'shift' || name == 'splice') && length === 0) delete wrapped[0]; - return result(wrapped, this._chain); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - wrapper.prototype[name] = function() { - return result(method.apply(this._wrapped, arguments), this._chain); - }; - }); - - // Start chaining a wrapped Underscore object. - wrapper.prototype.chain = function() { - this._chain = true; - return this; - }; - - // Extracts the result from a wrapped and chained object. - wrapper.prototype.value = function() { - return this._wrapped; - }; - -}).call(this); diff --git a/Documentation/_static/underscore.js b/Documentation/_static/underscore.js deleted file mode 100644 index 5b55f32beaca186f84cca115514f02cddbd1bbd5..0000000000000000000000000000000000000000 --- a/Documentation/_static/underscore.js +++ /dev/null @@ -1,31 +0,0 @@ -// Underscore.js 1.3.1 -// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore is freely distributable under the MIT license. -// Portions of Underscore are inspired or borrowed from Prototype, -// Oliver Steele's Functional, and John Resig's Micro-Templating. -// For all details and documentation: -// http://documentcloud.github.com/underscore -(function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== -c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, -h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= -b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e<f;e++){if(e in a&&c.call(d,a[e],e,a)===n)break}else for(e in a)if(b.has(a,e)&&c.call(d,a[e],e,a)===n)break};b.map=b.collect=function(a,c,b){var e=[];if(a==null)return e;if(x&&a.map===x)return a.map(c,b);j(a,function(a,g,h){e[e.length]=c.call(b,a,g,h)});if(a.length===+a.length)e.length=a.length;return e};b.reduce=b.foldl=b.inject=function(a,c,d,e){var f=arguments.length>2;a== -null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= -function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= -e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= -function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b<e.computed&&(e={value:a,computed:b})}); -return e.value};b.shuffle=function(a){var b=[],d;j(a,function(a,f){f==0?b[0]=a:(d=Math.floor(Math.random()*(f+1)),b[f]=b[d],b[d]=a)});return b};b.sortBy=function(a,c,d){return b.pluck(b.map(a,function(a,b,g){return{value:a,criteria:c.call(d,a,b,g)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, -c,d){d||(d=b.identity);for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?e=g+1:f=g}return e};b.toArray=function(a){return!a?[]:a.toArray?a.toArray():b.isArray(a)?i.call(a):b.isArguments(a)?i.call(a):b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=b.head=function(a,b,d){return b!=null&&!d?i.call(a,0,b):a[0]};b.initial=function(a,b,d){return i.call(a,0,a.length-(b==null||d?1:b))};b.last=function(a,b,d){return b!=null&&!d?i.call(a,Math.max(a.length-b,0)):a[a.length-1]};b.rest= -b.tail=function(a,b,d){return i.call(a,b==null||d?1:b)};b.compact=function(a){return b.filter(a,function(a){return!!a})};b.flatten=function(a,c){return b.reduce(a,function(a,e){if(b.isArray(e))return a.concat(c?e:b.flatten(e));a[a.length]=e;return a},[])};b.without=function(a){return b.difference(a,i.call(arguments,1))};b.uniq=b.unique=function(a,c,d){var d=d?b.map(a,d):a,e=[];b.reduce(d,function(d,g,h){if(0==h||(c===true?b.last(d)!=g:!b.include(d,g)))d[d.length]=g,e[e.length]=a[h];return d},[]); -return e};b.union=function(){return b.uniq(b.flatten(arguments,true))};b.intersection=b.intersect=function(a){var c=i.call(arguments,1);return b.filter(b.uniq(a),function(a){return b.every(c,function(c){return b.indexOf(c,a)>=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e<c;e++)d[e]=b.pluck(a,""+e);return d};b.indexOf=function(a,c, -d){if(a==null)return-1;var e;if(d)return d=b.sortedIndex(a,c),a[d]===c?d:-1;if(p&&a.indexOf===p)return a.indexOf(c);for(d=0,e=a.length;d<e;d++)if(d in a&&a[d]===c)return d;return-1};b.lastIndexOf=function(a,b){if(a==null)return-1;if(D&&a.lastIndexOf===D)return a.lastIndexOf(b);for(var d=a.length;d--;)if(d in a&&a[d]===b)return d;return-1};b.range=function(a,b,d){arguments.length<=1&&(b=a||0,a=0);for(var d=arguments[2]||1,e=Math.max(Math.ceil((b-a)/d),0),f=0,g=Array(e);f<e;)g[f++]=a,a+=d;return g}; -var F=function(){};b.bind=function(a,c){var d,e;if(a.bind===s&&s)return s.apply(a,i.call(arguments,1));if(!b.isFunction(a))throw new TypeError;e=i.call(arguments,2);return d=function(){if(!(this instanceof d))return a.apply(c,e.concat(i.call(arguments)));F.prototype=a.prototype;var b=new F,g=a.apply(b,e.concat(i.call(arguments)));return Object(g)===g?g:b}};b.bindAll=function(a){var c=i.call(arguments,1);c.length==0&&(c=b.functions(a));j(c,function(c){a[c]=b.bind(a[c],a)});return a};b.memoize=function(a, -c){var d={};c||(c=b.identity);return function(){var e=c.apply(this,arguments);return b.has(d,e)?d[e]:d[e]=a.apply(this,arguments)}};b.delay=function(a,b){var d=i.call(arguments,2);return setTimeout(function(){return a.apply(a,d)},b)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(i.call(arguments,1)))};b.throttle=function(a,c){var d,e,f,g,h,i=b.debounce(function(){h=g=false},c);return function(){d=this;e=arguments;var b;f||(f=setTimeout(function(){f=null;h&&a.apply(d,e);i()},c));g?h=true: -a.apply(d,e);i();g=true}};b.debounce=function(a,b){var d;return function(){var e=this,f=arguments;clearTimeout(d);d=setTimeout(function(){d=null;a.apply(e,f)},b)}};b.once=function(a){var b=false,d;return function(){if(b)return d;b=true;return d=a.apply(this,arguments)}};b.wrap=function(a,b){return function(){var d=[a].concat(i.call(arguments,0));return b.apply(this,d)}};b.compose=function(){var a=arguments;return function(){for(var b=arguments,d=a.length-1;d>=0;d--)b=[a[d].apply(this,b)];return b[0]}}; -b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, -1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; -b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; -b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e<a;e++)b.call(d,e)};b.escape=function(a){return(""+a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), -function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ -u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= -function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= -true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); diff --git a/Documentation/_static/up-pressed.png b/Documentation/_static/up-pressed.png deleted file mode 100644 index acee3b68efbbfb9de3bfa73fce2531380f4bd820..0000000000000000000000000000000000000000 Binary files a/Documentation/_static/up-pressed.png and /dev/null differ diff --git a/Documentation/_static/up.png b/Documentation/_static/up.png deleted file mode 100644 index 2a940a7da7c14e6a36901e83306849ba7efad4d4..0000000000000000000000000000000000000000 Binary files a/Documentation/_static/up.png and /dev/null differ diff --git a/Documentation/_static/websupport.js b/Documentation/_static/websupport.js deleted file mode 100644 index 98e7f40b6327e673e382068cdfb3bf3674a06cca..0000000000000000000000000000000000000000 --- a/Documentation/_static/websupport.js +++ /dev/null @@ -1,808 +0,0 @@ -/* - * websupport.js - * ~~~~~~~~~~~~~ - * - * sphinx.websupport utilities for all documentation. - * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -(function($) { - $.fn.autogrow = function() { - return this.each(function() { - var textarea = this; - - $.fn.autogrow.resize(textarea); - - $(textarea) - .focus(function() { - textarea.interval = setInterval(function() { - $.fn.autogrow.resize(textarea); - }, 500); - }) - .blur(function() { - clearInterval(textarea.interval); - }); - }); - }; - - $.fn.autogrow.resize = function(textarea) { - var lineHeight = parseInt($(textarea).css('line-height'), 10); - var lines = textarea.value.split('\n'); - var columns = textarea.cols; - var lineCount = 0; - $.each(lines, function() { - lineCount += Math.ceil(this.length / columns) || 1; - }); - var height = lineHeight * (lineCount + 1); - $(textarea).css('height', height); - }; -})(jQuery); - -(function($) { - var comp, by; - - function init() { - initEvents(); - initComparator(); - } - - function initEvents() { - $(document).on("click", 'a.comment-close', function(event) { - event.preventDefault(); - hide($(this).attr('id').substring(2)); - }); - $(document).on("click", 'a.vote', function(event) { - event.preventDefault(); - handleVote($(this)); - }); - $(document).on("click", 'a.reply', function(event) { - event.preventDefault(); - openReply($(this).attr('id').substring(2)); - }); - $(document).on("click", 'a.close-reply', function(event) { - event.preventDefault(); - closeReply($(this).attr('id').substring(2)); - }); - $(document).on("click", 'a.sort-option', function(event) { - event.preventDefault(); - handleReSort($(this)); - }); - $(document).on("click", 'a.show-proposal', function(event) { - event.preventDefault(); - showProposal($(this).attr('id').substring(2)); - }); - $(document).on("click", 'a.hide-proposal', function(event) { - event.preventDefault(); - hideProposal($(this).attr('id').substring(2)); - }); - $(document).on("click", 'a.show-propose-change', function(event) { - event.preventDefault(); - showProposeChange($(this).attr('id').substring(2)); - }); - $(document).on("click", 'a.hide-propose-change', function(event) { - event.preventDefault(); - hideProposeChange($(this).attr('id').substring(2)); - }); - $(document).on("click", 'a.accept-comment', function(event) { - event.preventDefault(); - acceptComment($(this).attr('id').substring(2)); - }); - $(document).on("click", 'a.delete-comment', function(event) { - event.preventDefault(); - deleteComment($(this).attr('id').substring(2)); - }); - $(document).on("click", 'a.comment-markup', function(event) { - event.preventDefault(); - toggleCommentMarkupBox($(this).attr('id').substring(2)); - }); - } - - /** - * Set comp, which is a comparator function used for sorting and - * inserting comments into the list. - */ - function setComparator() { - // If the first three letters are "asc", sort in ascending order - // and remove the prefix. - if (by.substring(0,3) == 'asc') { - var i = by.substring(3); - comp = function(a, b) { return a[i] - b[i]; }; - } else { - // Otherwise sort in descending order. - comp = function(a, b) { return b[by] - a[by]; }; - } - - // Reset link styles and format the selected sort option. - $('a.sel').attr('href', '#').removeClass('sel'); - $('a.by' + by).removeAttr('href').addClass('sel'); - } - - /** - * Create a comp function. If the user has preferences stored in - * the sortBy cookie, use those, otherwise use the default. - */ - function initComparator() { - by = 'rating'; // Default to sort by rating. - // If the sortBy cookie is set, use that instead. - if (document.cookie.length > 0) { - var start = document.cookie.indexOf('sortBy='); - if (start != -1) { - start = start + 7; - var end = document.cookie.indexOf(";", start); - if (end == -1) { - end = document.cookie.length; - by = unescape(document.cookie.substring(start, end)); - } - } - } - setComparator(); - } - - /** - * Show a comment div. - */ - function show(id) { - $('#ao' + id).hide(); - $('#ah' + id).show(); - var context = $.extend({id: id}, opts); - var popup = $(renderTemplate(popupTemplate, context)).hide(); - popup.find('textarea[name="proposal"]').hide(); - popup.find('a.by' + by).addClass('sel'); - var form = popup.find('#cf' + id); - form.submit(function(event) { - event.preventDefault(); - addComment(form); - }); - $('#s' + id).after(popup); - popup.slideDown('fast', function() { - getComments(id); - }); - } - - /** - * Hide a comment div. - */ - function hide(id) { - $('#ah' + id).hide(); - $('#ao' + id).show(); - var div = $('#sc' + id); - div.slideUp('fast', function() { - div.remove(); - }); - } - - /** - * Perform an ajax request to get comments for a node - * and insert the comments into the comments tree. - */ - function getComments(id) { - $.ajax({ - type: 'GET', - url: opts.getCommentsURL, - data: {node: id}, - success: function(data, textStatus, request) { - var ul = $('#cl' + id); - var speed = 100; - $('#cf' + id) - .find('textarea[name="proposal"]') - .data('source', data.source); - - if (data.comments.length === 0) { - ul.html('<li>No comments yet.</li>'); - ul.data('empty', true); - } else { - // If there are comments, sort them and put them in the list. - var comments = sortComments(data.comments); - speed = data.comments.length * 100; - appendComments(comments, ul); - ul.data('empty', false); - } - $('#cn' + id).slideUp(speed + 200); - ul.slideDown(speed); - }, - error: function(request, textStatus, error) { - showError('Oops, there was a problem retrieving the comments.'); - }, - dataType: 'json' - }); - } - - /** - * Add a comment via ajax and insert the comment into the comment tree. - */ - function addComment(form) { - var node_id = form.find('input[name="node"]').val(); - var parent_id = form.find('input[name="parent"]').val(); - var text = form.find('textarea[name="comment"]').val(); - var proposal = form.find('textarea[name="proposal"]').val(); - - if (text == '') { - showError('Please enter a comment.'); - return; - } - - // Disable the form that is being submitted. - form.find('textarea,input').attr('disabled', 'disabled'); - - // Send the comment to the server. - $.ajax({ - type: "POST", - url: opts.addCommentURL, - dataType: 'json', - data: { - node: node_id, - parent: parent_id, - text: text, - proposal: proposal - }, - success: function(data, textStatus, error) { - // Reset the form. - if (node_id) { - hideProposeChange(node_id); - } - form.find('textarea') - .val('') - .add(form.find('input')) - .removeAttr('disabled'); - var ul = $('#cl' + (node_id || parent_id)); - if (ul.data('empty')) { - $(ul).empty(); - ul.data('empty', false); - } - insertComment(data.comment); - var ao = $('#ao' + node_id); - ao.find('img').attr({'src': opts.commentBrightImage}); - if (node_id) { - // if this was a "root" comment, remove the commenting box - // (the user can get it back by reopening the comment popup) - $('#ca' + node_id).slideUp(); - } - }, - error: function(request, textStatus, error) { - form.find('textarea,input').removeAttr('disabled'); - showError('Oops, there was a problem adding the comment.'); - } - }); - } - - /** - * Recursively append comments to the main comment list and children - * lists, creating the comment tree. - */ - function appendComments(comments, ul) { - $.each(comments, function() { - var div = createCommentDiv(this); - ul.append($(document.createElement('li')).html(div)); - appendComments(this.children, div.find('ul.comment-children')); - // To avoid stagnating data, don't store the comments children in data. - this.children = null; - div.data('comment', this); - }); - } - - /** - * After adding a new comment, it must be inserted in the correct - * location in the comment tree. - */ - function insertComment(comment) { - var div = createCommentDiv(comment); - - // To avoid stagnating data, don't store the comments children in data. - comment.children = null; - div.data('comment', comment); - - var ul = $('#cl' + (comment.node || comment.parent)); - var siblings = getChildren(ul); - - var li = $(document.createElement('li')); - li.hide(); - - // Determine where in the parents children list to insert this comment. - for(i=0; i < siblings.length; i++) { - if (comp(comment, siblings[i]) <= 0) { - $('#cd' + siblings[i].id) - .parent() - .before(li.html(div)); - li.slideDown('fast'); - return; - } - } - - // If we get here, this comment rates lower than all the others, - // or it is the only comment in the list. - ul.append(li.html(div)); - li.slideDown('fast'); - } - - function acceptComment(id) { - $.ajax({ - type: 'POST', - url: opts.acceptCommentURL, - data: {id: id}, - success: function(data, textStatus, request) { - $('#cm' + id).fadeOut('fast'); - $('#cd' + id).removeClass('moderate'); - }, - error: function(request, textStatus, error) { - showError('Oops, there was a problem accepting the comment.'); - } - }); - } - - function deleteComment(id) { - $.ajax({ - type: 'POST', - url: opts.deleteCommentURL, - data: {id: id}, - success: function(data, textStatus, request) { - var div = $('#cd' + id); - if (data == 'delete') { - // Moderator mode: remove the comment and all children immediately - div.slideUp('fast', function() { - div.remove(); - }); - return; - } - // User mode: only mark the comment as deleted - div - .find('span.user-id:first') - .text('[deleted]').end() - .find('div.comment-text:first') - .text('[deleted]').end() - .find('#cm' + id + ', #dc' + id + ', #ac' + id + ', #rc' + id + - ', #sp' + id + ', #hp' + id + ', #cr' + id + ', #rl' + id) - .remove(); - var comment = div.data('comment'); - comment.username = '[deleted]'; - comment.text = '[deleted]'; - div.data('comment', comment); - }, - error: function(request, textStatus, error) { - showError('Oops, there was a problem deleting the comment.'); - } - }); - } - - function showProposal(id) { - $('#sp' + id).hide(); - $('#hp' + id).show(); - $('#pr' + id).slideDown('fast'); - } - - function hideProposal(id) { - $('#hp' + id).hide(); - $('#sp' + id).show(); - $('#pr' + id).slideUp('fast'); - } - - function showProposeChange(id) { - $('#pc' + id).hide(); - $('#hc' + id).show(); - var textarea = $('#pt' + id); - textarea.val(textarea.data('source')); - $.fn.autogrow.resize(textarea[0]); - textarea.slideDown('fast'); - } - - function hideProposeChange(id) { - $('#hc' + id).hide(); - $('#pc' + id).show(); - var textarea = $('#pt' + id); - textarea.val('').removeAttr('disabled'); - textarea.slideUp('fast'); - } - - function toggleCommentMarkupBox(id) { - $('#mb' + id).toggle(); - } - - /** Handle when the user clicks on a sort by link. */ - function handleReSort(link) { - var classes = link.attr('class').split(/\s+/); - for (var i=0; i<classes.length; i++) { - if (classes[i] != 'sort-option') { - by = classes[i].substring(2); - } - } - setComparator(); - // Save/update the sortBy cookie. - var expiration = new Date(); - expiration.setDate(expiration.getDate() + 365); - document.cookie= 'sortBy=' + escape(by) + - ';expires=' + expiration.toUTCString(); - $('ul.comment-ul').each(function(index, ul) { - var comments = getChildren($(ul), true); - comments = sortComments(comments); - appendComments(comments, $(ul).empty()); - }); - } - - /** - * Function to process a vote when a user clicks an arrow. - */ - function handleVote(link) { - if (!opts.voting) { - showError("You'll need to login to vote."); - return; - } - - var id = link.attr('id'); - if (!id) { - // Didn't click on one of the voting arrows. - return; - } - // If it is an unvote, the new vote value is 0, - // Otherwise it's 1 for an upvote, or -1 for a downvote. - var value = 0; - if (id.charAt(1) != 'u') { - value = id.charAt(0) == 'u' ? 1 : -1; - } - // The data to be sent to the server. - var d = { - comment_id: id.substring(2), - value: value - }; - - // Swap the vote and unvote links. - link.hide(); - $('#' + id.charAt(0) + (id.charAt(1) == 'u' ? 'v' : 'u') + d.comment_id) - .show(); - - // The div the comment is displayed in. - var div = $('div#cd' + d.comment_id); - var data = div.data('comment'); - - // If this is not an unvote, and the other vote arrow has - // already been pressed, unpress it. - if ((d.value !== 0) && (data.vote === d.value * -1)) { - $('#' + (d.value == 1 ? 'd' : 'u') + 'u' + d.comment_id).hide(); - $('#' + (d.value == 1 ? 'd' : 'u') + 'v' + d.comment_id).show(); - } - - // Update the comments rating in the local data. - data.rating += (data.vote === 0) ? d.value : (d.value - data.vote); - data.vote = d.value; - div.data('comment', data); - - // Change the rating text. - div.find('.rating:first') - .text(data.rating + ' point' + (data.rating == 1 ? '' : 's')); - - // Send the vote information to the server. - $.ajax({ - type: "POST", - url: opts.processVoteURL, - data: d, - error: function(request, textStatus, error) { - showError('Oops, there was a problem casting that vote.'); - } - }); - } - - /** - * Open a reply form used to reply to an existing comment. - */ - function openReply(id) { - // Swap out the reply link for the hide link - $('#rl' + id).hide(); - $('#cr' + id).show(); - - // Add the reply li to the children ul. - var div = $(renderTemplate(replyTemplate, {id: id})).hide(); - $('#cl' + id) - .prepend(div) - // Setup the submit handler for the reply form. - .find('#rf' + id) - .submit(function(event) { - event.preventDefault(); - addComment($('#rf' + id)); - closeReply(id); - }) - .find('input[type=button]') - .click(function() { - closeReply(id); - }); - div.slideDown('fast', function() { - $('#rf' + id).find('textarea').focus(); - }); - } - - /** - * Close the reply form opened with openReply. - */ - function closeReply(id) { - // Remove the reply div from the DOM. - $('#rd' + id).slideUp('fast', function() { - $(this).remove(); - }); - - // Swap out the hide link for the reply link - $('#cr' + id).hide(); - $('#rl' + id).show(); - } - - /** - * Recursively sort a tree of comments using the comp comparator. - */ - function sortComments(comments) { - comments.sort(comp); - $.each(comments, function() { - this.children = sortComments(this.children); - }); - return comments; - } - - /** - * Get the children comments from a ul. If recursive is true, - * recursively include childrens' children. - */ - function getChildren(ul, recursive) { - var children = []; - ul.children().children("[id^='cd']") - .each(function() { - var comment = $(this).data('comment'); - if (recursive) - comment.children = getChildren($(this).find('#cl' + comment.id), true); - children.push(comment); - }); - return children; - } - - /** Create a div to display a comment in. */ - function createCommentDiv(comment) { - if (!comment.displayed && !opts.moderator) { - return $('<div class="moderate">Thank you! Your comment will show up ' - + 'once it is has been approved by a moderator.</div>'); - } - // Prettify the comment rating. - comment.pretty_rating = comment.rating + ' point' + - (comment.rating == 1 ? '' : 's'); - // Make a class (for displaying not yet moderated comments differently) - comment.css_class = comment.displayed ? '' : ' moderate'; - // Create a div for this comment. - var context = $.extend({}, opts, comment); - var div = $(renderTemplate(commentTemplate, context)); - - // If the user has voted on this comment, highlight the correct arrow. - if (comment.vote) { - var direction = (comment.vote == 1) ? 'u' : 'd'; - div.find('#' + direction + 'v' + comment.id).hide(); - div.find('#' + direction + 'u' + comment.id).show(); - } - - if (opts.moderator || comment.text != '[deleted]') { - div.find('a.reply').show(); - if (comment.proposal_diff) - div.find('#sp' + comment.id).show(); - if (opts.moderator && !comment.displayed) - div.find('#cm' + comment.id).show(); - if (opts.moderator || (opts.username == comment.username)) - div.find('#dc' + comment.id).show(); - } - return div; - } - - /** - * A simple template renderer. Placeholders such as <%id%> are replaced - * by context['id'] with items being escaped. Placeholders such as <#id#> - * are not escaped. - */ - function renderTemplate(template, context) { - var esc = $(document.createElement('div')); - - function handle(ph, escape) { - var cur = context; - $.each(ph.split('.'), function() { - cur = cur[this]; - }); - return escape ? esc.text(cur || "").html() : cur; - } - - return template.replace(/<([%#])([\w\.]*)\1>/g, function() { - return handle(arguments[2], arguments[1] == '%' ? true : false); - }); - } - - /** Flash an error message briefly. */ - function showError(message) { - $(document.createElement('div')).attr({'class': 'popup-error'}) - .append($(document.createElement('div')) - .attr({'class': 'error-message'}).text(message)) - .appendTo('body') - .fadeIn("slow") - .delay(2000) - .fadeOut("slow"); - } - - /** Add a link the user uses to open the comments popup. */ - $.fn.comment = function() { - return this.each(function() { - var id = $(this).attr('id').substring(1); - var count = COMMENT_METADATA[id]; - var title = count + ' comment' + (count == 1 ? '' : 's'); - var image = count > 0 ? opts.commentBrightImage : opts.commentImage; - var addcls = count == 0 ? ' nocomment' : ''; - $(this) - .append( - $(document.createElement('a')).attr({ - href: '#', - 'class': 'sphinx-comment-open' + addcls, - id: 'ao' + id - }) - .append($(document.createElement('img')).attr({ - src: image, - alt: 'comment', - title: title - })) - .click(function(event) { - event.preventDefault(); - show($(this).attr('id').substring(2)); - }) - ) - .append( - $(document.createElement('a')).attr({ - href: '#', - 'class': 'sphinx-comment-close hidden', - id: 'ah' + id - }) - .append($(document.createElement('img')).attr({ - src: opts.closeCommentImage, - alt: 'close', - title: 'close' - })) - .click(function(event) { - event.preventDefault(); - hide($(this).attr('id').substring(2)); - }) - ); - }); - }; - - var opts = { - processVoteURL: '/_process_vote', - addCommentURL: '/_add_comment', - getCommentsURL: '/_get_comments', - acceptCommentURL: '/_accept_comment', - deleteCommentURL: '/_delete_comment', - commentImage: '/static/_static/comment.png', - closeCommentImage: '/static/_static/comment-close.png', - loadingImage: '/static/_static/ajax-loader.gif', - commentBrightImage: '/static/_static/comment-bright.png', - upArrow: '/static/_static/up.png', - downArrow: '/static/_static/down.png', - upArrowPressed: '/static/_static/up-pressed.png', - downArrowPressed: '/static/_static/down-pressed.png', - voting: false, - moderator: false - }; - - if (typeof COMMENT_OPTIONS != "undefined") { - opts = jQuery.extend(opts, COMMENT_OPTIONS); - } - - var popupTemplate = '\ - <div class="sphinx-comments" id="sc<%id%>">\ - <p class="sort-options">\ - Sort by:\ - <a href="#" class="sort-option byrating">best rated</a>\ - <a href="#" class="sort-option byascage">newest</a>\ - <a href="#" class="sort-option byage">oldest</a>\ - </p>\ - <div class="comment-header">Comments</div>\ - <div class="comment-loading" id="cn<%id%>">\ - loading comments... <img src="<%loadingImage%>" alt="" /></div>\ - <ul id="cl<%id%>" class="comment-ul"></ul>\ - <div id="ca<%id%>">\ - <p class="add-a-comment">Add a comment\ - (<a href="#" class="comment-markup" id="ab<%id%>">markup</a>):</p>\ - <div class="comment-markup-box" id="mb<%id%>">\ - reStructured text markup: <i>*emph*</i>, <b>**strong**</b>, \ - <code>``code``</code>, \ - code blocks: <code>::</code> and an indented block after blank line</div>\ - <form method="post" id="cf<%id%>" class="comment-form" action="">\ - <textarea name="comment" cols="80"></textarea>\ - <p class="propose-button">\ - <a href="#" id="pc<%id%>" class="show-propose-change">\ - Propose a change ▹\ - </a>\ - <a href="#" id="hc<%id%>" class="hide-propose-change">\ - Propose a change ▿\ - </a>\ - </p>\ - <textarea name="proposal" id="pt<%id%>" cols="80"\ - spellcheck="false"></textarea>\ - <input type="submit" value="Add comment" />\ - <input type="hidden" name="node" value="<%id%>" />\ - <input type="hidden" name="parent" value="" />\ - </form>\ - </div>\ - </div>'; - - var commentTemplate = '\ - <div id="cd<%id%>" class="sphinx-comment<%css_class%>">\ - <div class="vote">\ - <div class="arrow">\ - <a href="#" id="uv<%id%>" class="vote" title="vote up">\ - <img src="<%upArrow%>" />\ - </a>\ - <a href="#" id="uu<%id%>" class="un vote" title="vote up">\ - <img src="<%upArrowPressed%>" />\ - </a>\ - </div>\ - <div class="arrow">\ - <a href="#" id="dv<%id%>" class="vote" title="vote down">\ - <img src="<%downArrow%>" id="da<%id%>" />\ - </a>\ - <a href="#" id="du<%id%>" class="un vote" title="vote down">\ - <img src="<%downArrowPressed%>" />\ - </a>\ - </div>\ - </div>\ - <div class="comment-content">\ - <p class="tagline comment">\ - <span class="user-id"><%username%></span>\ - <span class="rating"><%pretty_rating%></span>\ - <span class="delta"><%time.delta%></span>\ - </p>\ - <div class="comment-text comment"><#text#></div>\ - <p class="comment-opts comment">\ - <a href="#" class="reply hidden" id="rl<%id%>">reply ▹</a>\ - <a href="#" class="close-reply" id="cr<%id%>">reply ▿</a>\ - <a href="#" id="sp<%id%>" class="show-proposal">proposal ▹</a>\ - <a href="#" id="hp<%id%>" class="hide-proposal">proposal ▿</a>\ - <a href="#" id="dc<%id%>" class="delete-comment hidden">delete</a>\ - <span id="cm<%id%>" class="moderation hidden">\ - <a href="#" id="ac<%id%>" class="accept-comment">accept</a>\ - </span>\ - </p>\ - <pre class="proposal" id="pr<%id%>">\ -<#proposal_diff#>\ - </pre>\ - <ul class="comment-children" id="cl<%id%>"></ul>\ - </div>\ - <div class="clearleft"></div>\ - </div>\ - </div>'; - - var replyTemplate = '\ - <li>\ - <div class="reply-div" id="rd<%id%>">\ - <form id="rf<%id%>">\ - <textarea name="comment" cols="80"></textarea>\ - <input type="submit" value="Add reply" />\ - <input type="button" value="Cancel" />\ - <input type="hidden" name="parent" value="<%id%>" />\ - <input type="hidden" name="node" value="" />\ - </form>\ - </div>\ - </li>'; - - $(document).ready(function() { - init(); - }); -})(jQuery); - -$(document).ready(function() { - // add comment anchors for all paragraphs that are commentable - $('.sphinx-has-comment').comment(); - - // highlight search words in search results - $("div.context").each(function() { - var params = $.getQueryParameters(); - var terms = (params.q) ? params.q[0].split(/\s+/) : []; - var result = $(this); - $.each(terms, function() { - result.highlightText(this.toLowerCase(), 'highlighted'); - }); - }); - - // directly open comment window if requested - var anchor = document.location.hash; - if (anchor.substring(0, 9) == '#comment-') { - $('#ao' + anchor.substring(9)).click(); - document.location.hash = '#s' + anchor.substring(9); - } -}); diff --git a/Documentation/conf.py b/Documentation/conf.py new file mode 100644 index 0000000000000000000000000000000000000000..b7b2af5e16c7de80e0d7c20892c6913456d59655 --- /dev/null +++ b/Documentation/conf.py @@ -0,0 +1,189 @@ +# -*- coding: utf-8 -*- +# +# Configuration file for the Sphinx documentation builder. +# +# This file does only contain a selection of the most common options. For a +# full list see the documentation: +# http://www.sphinx-doc.org/en/master/config + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import os +import sys +sys.path.insert(0, os.path.abspath('..')) + + +# -- Project information ----------------------------------------------------- + +project = 'Phymobat' +copyright = '2018, LAVENTURE Sylvio' +author1 = 'COMMANDRÉ Benjamin' +author2 = 'LAVENTURE Sylvio' + + +# The short X.Y version +version = '' +# The full version, including alpha/beta/rc tags +release = '2.2' + + +# -- General configuration --------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.intersphinx', + 'sphinx.ext.ifconfig', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'fr' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path . +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'alabaster' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} + + +# -- Options for HTMLHelp output --------------------------------------------- + +# Output file base name for HTML help builder. +htmlhelp_basename = 'Phymobatdoc' + + +# -- Options for LaTeX output ------------------------------------------------ + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'Phymobat.tex', 'Phymobat Documentation', + 'COMMANDRÉ Benjamin', 'manual'), +] + + +# -- Options for manual page output ------------------------------------------ + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'phymobat', 'Phymobat Documentation', + [author1, author2], 1) +] + + +# -- Options for Texinfo output ---------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'Phymobat', 'Phymobat Documentation', + author1, author2, 'Phymobat', 'One line description of project.', + 'Miscellaneous'), +] + + +# -- Options for Epub output ------------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = project +epub_author = author1, author2 +epub_publisher = author1, author2 +epub_copyright = copyright + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +# +# epub_identifier = '' + +# A unique identification for the text. +# +# epub_uid = '' + +# A list of files that should not be packed into the epub file. +epub_exclude_files = ['search.html'] + + +# -- Extension configuration ------------------------------------------------- + +# -- Options for intersphinx extension --------------------------------------- + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'https://docs.python.org/': None} \ No newline at end of file diff --git a/Documentation/genindex.html b/Documentation/genindex.html deleted file mode 100644 index 788f59848f5ee8c63f21df815175faed57041929..0000000000000000000000000000000000000000 --- a/Documentation/genindex.html +++ /dev/null @@ -1,564 +0,0 @@ - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - -<html xmlns="http://www.w3.org/1999/xhtml" lang="fr"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — documentation PHYMOBAT 3.0</title> - - <link rel="stylesheet" href="_static/classic.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: './', - VERSION: '3.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true, - SOURCELINK_SUFFIX: '.txt' - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/translations.js"></script> - <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> - <link rel="index" title="Index" href="#" /> - <link rel="search" title="Recherche" href="search.html" /> - </head> - <body role="document"> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="#" title="Index général" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Index des modules Python" - >modules</a> |</li> - <li class="nav-item nav-item-0"><a href="PHYMOBAT_documentation.html">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body" role="main"> - - -<h1 id="index">Index</h1> - -<div class="genindex-jumpbox"> - <a href="#A"><strong>A</strong></a> - | <a href="#B"><strong>B</strong></a> - | <a href="#C"><strong>C</strong></a> - | <a href="#D"><strong>D</strong></a> - | <a href="#E"><strong>E</strong></a> - | <a href="#F"><strong>F</strong></a> - | <a href="#G"><strong>G</strong></a> - | <a href="#H"><strong>H</strong></a> - | <a href="#I"><strong>I</strong></a> - | <a href="#L"><strong>L</strong></a> - | <a href="#M"><strong>M</strong></a> - | <a href="#O"><strong>O</strong></a> - | <a href="#P"><strong>P</strong></a> - | <a href="#R"><strong>R</strong></a> - | <a href="#S"><strong>S</strong></a> - | <a href="#T"><strong>T</strong></a> - | <a href="#U"><strong>U</strong></a> - | <a href="#V"><strong>V</strong></a> - | <a href="#Z"><strong>Z</strong></a> - -</div> -<h2 id="A">A</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.about_PHYMOBA">about_PHYMOBA() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.activate_level">activate_level() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.add_sample">add_sample() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#Segmentation.Segmentation.append_scale">append_scale() (méthode Segmentation.Segmentation)</a> -</li> - <li><a href="package.html#Archive.Archive">Archive (classe dans Archive)</a> - - <ul> - <li><a href="package.html#module-Archive">(module)</a> -</li> - </ul></li> - </ul></td> -</tr></table> - -<h2 id="B">B</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#PHYMOBAT.bin">bin() (dans le module PHYMOBAT)</a> -</li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.block_for_swh">block_for_swh() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - </ul></td> -</tr></table> - -<h2 id="C">C</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#Toolbox.Toolbox.calc_serie_stats">calc_serie_stats() (méthode Toolbox.Toolbox)</a> -</li> - <li><a href="package.html#RasterSat_by_date.RasterSat_by_date.calcul_ndvi">calcul_ndvi() (méthode RasterSat_by_date.RasterSat_by_date)</a> -</li> - <li><a href="package.html#Toolbox.Toolbox.check_proj">check_proj() (méthode Toolbox.Toolbox)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.clear_sample">clear_sample() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="package.html#Toolbox.Toolbox.clip_raster">clip_raster() (méthode Toolbox.Toolbox)</a> -</li> - <li><a href="package.html#Vector.Vector.clip_vector">clip_vector() (méthode Vector.Vector)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.close_button">close_button() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="package.html#Vector.Vector.close_data">close_data() (méthode Vector.Vector)</a> -</li> - <li><a href="API.html#PHYMOBAT.MyPopup_about.close_window">close_window() (méthode PHYMOBAT.MyPopup_about)</a> - - <ul> - <li><a href="API.html#PHYMOBAT.MyPopup_proxy_window.close_window">(méthode PHYMOBAT.MyPopup_proxy_window)</a> -</li> - <li><a href="API.html#PHYMOBAT.MyPopup_warming_forgetting.close_window">(méthode PHYMOBAT.MyPopup_warming_forgetting)</a> -</li> - <li><a href="API.html#PHYMOBAT.MyPopup_warming_study_area.close_window">(méthode PHYMOBAT.MyPopup_warming_study_area)</a> -</li> - </ul></li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#RasterSat_by_date.RasterSat_by_date.complete_raster">complete_raster() (méthode RasterSat_by_date.RasterSat_by_date)</a> -</li> - <li><a href="package.html#Segmentation.Segmentation.compute_biomass_density">compute_biomass_density() (méthode Segmentation.Segmentation)</a> -</li> - <li><a href="package.html#Archive.Archive.coord_box_dd">coord_box_dd() (méthode Archive.Archive)</a> -</li> - <li><a href="package.html#Segmentation.Segmentation.create_cartography">create_cartography() (méthode Segmentation.Segmentation)</a> -</li> - <li><a href="package.html#Rpg.Rpg.create_new_rpg_files">create_new_rpg_files() (méthode Rpg.Rpg)</a> -</li> - <li><a href="package.html#RasterSat_by_date.RasterSat_by_date.create_raster">create_raster() (méthode RasterSat_by_date.RasterSat_by_date)</a> -</li> - <li><a href="package.html#Sample.Sample.create_sample">create_sample() (méthode Sample.Sample)</a> -</li> - </ul></td> -</tr></table> - -<h2 id="D">D</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#Segmentation.Segmentation.decision_tree">decision_tree() (méthode Segmentation.Segmentation)</a> -</li> - <li><a href="package.html#Archive.Archive.decompress">decompress() (méthode Archive.Archive)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.display_all_levels">display_all_levels() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.display_one_level">display_one_level() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.display_two_levels">display_two_levels() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="package.html#Archive.Archive.download_auto">download_auto() (méthode Archive.Archive)</a> -</li> - </ul></td> -</tr></table> - -<h2 id="E">E</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.enter_sample_name">enter_sample_name() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.enter_sample_name_hl">enter_sample_name_hl() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.enter_sample_name_ll">enter_sample_name_ll() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="package.html#Slope.Slope.extract_slope">extract_slope() (méthode Slope.Slope)</a> -</li> - </ul></td> -</tr></table> - -<h2 id="F">F</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.f_output_name_moba">f_output_name_moba() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.f_path_area">f_path_area() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.f_path_folder_dpt">f_path_folder_dpt() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.f_path_mnt">f_path_mnt() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.f_path_ortho">f_path_ortho() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.f_path_segm">f_path_segm() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.f_proxy">f_proxy() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.field_display_1">field_display_1() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.field_display_2">field_display_2() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.field_display_3">field_display_3() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.field_display_4">field_display_4() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.field_display_5">field_display_5() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.field_display_6">field_display_6() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="package.html#Sample.Sample.fill_sample">fill_sample() (méthode Sample.Sample)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.forget_raster_sample">forget_raster_sample() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.forget_study_area">forget_study_area() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - </ul></td> -</tr></table> - -<h2 id="G">G</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.get_variable">get_variable() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#RasterSat_by_date.RasterSat_by_date.group_by_date">group_by_date() (méthode RasterSat_by_date.RasterSat_by_date)</a> -</li> - </ul></td> -</tr></table> - -<h2 id="H">H</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#Vhrs.Vhrs.haralick_texture_extraction">haralick_texture_extraction() (méthode Vhrs.Vhrs)</a> -</li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.help_tools">help_tools() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.hex">hex() (dans le module PHYMOBAT)</a> -</li> - </ul></td> -</tr></table> - -<h2 id="I">I</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#Processing.Processing.i_classifier_rf">i_classifier_rf() (méthode Processing.Processing)</a> -</li> - <li><a href="API.html#Processing.Processing.i_classifier_s">i_classifier_s() (méthode Processing.Processing)</a> -</li> - <li><a href="API.html#Processing.Processing.i_download">i_download() (méthode Processing.Processing)</a> -</li> - <li><a href="API.html#Processing.Processing.i_glob">i_glob() (méthode Processing.Processing)</a> -</li> - <li><a href="API.html#Processing.Processing.i_images_processing">i_images_processing() (méthode Processing.Processing)</a> -</li> - <li><a href="API.html#Processing.Processing.i_img_sat">i_img_sat() (méthode Processing.Processing)</a> -</li> - <li><a href="API.html#Processing.Processing.i_rpg">i_rpg() (méthode Processing.Processing)</a> -</li> - <li><a href="API.html#Processing.Processing.i_sample">i_sample() (méthode Processing.Processing)</a> -</li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#Processing.Processing.i_sample_rf">i_sample_rf() (méthode Processing.Processing)</a> -</li> - <li><a href="API.html#Processing.Processing.i_slope">i_slope() (méthode Processing.Processing)</a> -</li> - <li><a href="API.html#Processing.Processing.i_tree_direction">i_tree_direction() (méthode Processing.Processing)</a> -</li> - <li><a href="API.html#Processing.Processing.i_validate">i_validate() (méthode Processing.Processing)</a> -</li> - <li><a href="API.html#Processing.Processing.i_vhrs">i_vhrs() (méthode Processing.Processing)</a> -</li> - <li><a href="API.html#PHYMOBAT.MyPopup_proxy_window.id_proxy">id_proxy() (méthode PHYMOBAT.MyPopup_proxy_window)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.img_sample_name">img_sample_name() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.initUI">initUI() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - </ul></td> -</tr></table> - -<h2 id="L">L</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#Vector.Vector.layer_rasterization">layer_rasterization() (méthode Vector.Vector)</a> -</li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#Archive.Archive.listing">listing() (méthode Archive.Archive)</a> -</li> - </ul></td> -</tr></table> - -<h2 id="M">M</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.mode_expert">mode_expert() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.mode_simpli">mode_simpli() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="package.html#Rpg.Rpg.mono_rpg">mono_rpg() (méthode Rpg.Rpg)</a> -</li> - <li><a href="package.html#RasterSat_by_date.RasterSat_by_date.mosaic_by_date">mosaic_by_date() (méthode RasterSat_by_date.RasterSat_by_date)</a> -</li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#PHYMOBAT.MyPopup_about">MyPopup_about (classe dans PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.MyPopup_proxy_window">MyPopup_proxy_window (classe dans PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.MyPopup_warming_forgetting">MyPopup_warming_forgetting (classe dans PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.MyPopup_warming_study_area">MyPopup_warming_study_area (classe dans PHYMOBAT)</a> -</li> - </ul></td> -</tr></table> - -<h2 id="O">O</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#PHYMOBAT.oct">oct() (dans le module PHYMOBAT)</a> -</li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.ok_button">ok_button() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.open_backup">open_backup() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - </ul></td> -</tr></table> - -<h2 id="P">P</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#PHYMOBAT.PHYMOBAT">PHYMOBAT (classe dans PHYMOBAT)</a> - - <ul> - <li><a href="API.html#module-PHYMOBAT">(module)</a> -</li> - </ul></li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#RasterSat_by_date.RasterSat_by_date.pourc_cloud">pourc_cloud() (méthode RasterSat_by_date.RasterSat_by_date)</a> -</li> - <li><a href="API.html#Processing.Processing">Processing (classe dans Processing)</a> - - <ul> - <li><a href="API.html#module-Processing">(module)</a> -</li> - </ul></li> - </ul></td> -</tr></table> - -<h2 id="R">R</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#RasterSat_by_date.RasterSat_by_date.raster_data">raster_data() (méthode RasterSat_by_date.RasterSat_by_date)</a> -</li> - <li><a href="package.html#RasterSat_by_date.RasterSat_by_date">RasterSat_by_date (classe dans RasterSat_by_date)</a> - - <ul> - <li><a href="package.html#module-RasterSat_by_date">(module)</a> -</li> - </ul></li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#Rpg.Rpg">Rpg (classe dans Rpg)</a> - - <ul> - <li><a href="package.html#module-Rpg">(module)</a> -</li> - </ul></li> - </ul></td> -</tr></table> - -<h2 id="S">S</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#Sample.Sample">Sample (classe dans Sample)</a> - - <ul> - <li><a href="package.html#module-Sample">(module)</a> -</li> - </ul></li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.save_backup">save_backup() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="package.html#Seath.Seath">Seath (classe dans Seath)</a> - - <ul> - <li><a href="package.html#module-Seath">(module)</a> -</li> - </ul></li> - <li><a href="package.html#Segmentation.Segmentation">Segmentation (classe dans Segmentation)</a> - - <ul> - <li><a href="package.html#module-Segmentation">(module)</a> -</li> - </ul></li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#Sample.Sample.select_random_sample">select_random_sample() (méthode Sample.Sample)</a> -</li> - <li><a href="package.html#Seath.Seath.separability_and_threshold">separability_and_threshold() (méthode Seath.Seath)</a> -</li> - <li><a href="package.html#Archive.Archive.set_list_archive_to_try">set_list_archive_to_try() (méthode Archive.Archive)</a> -</li> - <li><a href="API.html#PHYMOBAT.PHYMOBAT.set_variable">set_variable() (méthode PHYMOBAT.PHYMOBAT)</a> -</li> - <li><a href="package.html#Vhrs.Vhrs.sfs_texture_extraction">sfs_texture_extraction() (méthode Vhrs.Vhrs)</a> -</li> - <li><a href="package.html#Slope.Slope">Slope (classe dans Slope)</a> - - <ul> - <li><a href="package.html#module-Slope">(module)</a> -</li> - </ul></li> - </ul></td> -</tr></table> - -<h2 id="T">T</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#Toolbox.Toolbox">Toolbox (classe dans Toolbox)</a> - - <ul> - <li><a href="package.html#module-Toolbox">(module)</a> -</li> - </ul></li> - </ul></td> -</tr></table> - -<h2 id="U">U</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#module-ui_A_propos_PHYMOBAT_window">ui_A_propos_PHYMOBAT_window (module)</a> -</li> - <li><a href="API.html#ui_A_propos_PHYMOBAT_window.Ui_About">Ui_About (classe dans ui_A_propos_PHYMOBAT_window)</a> -</li> - <li><a href="API.html#ui_PHYMOBATe_tab.Ui_PHYMOBAT">Ui_PHYMOBAT (classe dans ui_PHYMOBATe_tab)</a> - - <ul> - <li><a href="API.html#ui_PHYMOBATs_tab.Ui_PHYMOBAT">(classe dans ui_PHYMOBATs_tab)</a> -</li> - </ul></li> - <li><a href="API.html#module-ui_PHYMOBATe_tab">ui_PHYMOBATe_tab (module)</a> -</li> - <li><a href="API.html#module-ui_PHYMOBATs_tab">ui_PHYMOBATs_tab (module)</a> -</li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="API.html#ui_Proxy_window.Ui_Proxy_window">Ui_Proxy_window (classe dans ui_Proxy_window)</a> -</li> - <li><a href="API.html#module-ui_Proxy_window">ui_Proxy_window (module)</a> -</li> - <li><a href="API.html#ui_Warming_forgetting.Ui_Warming_forgetting">Ui_Warming_forgetting (classe dans ui_Warming_forgetting)</a> -</li> - <li><a href="API.html#module-ui_Warming_forgetting">ui_Warming_forgetting (module)</a> -</li> - <li><a href="API.html#ui_Warming_study_area.Ui_Warming_study_area">Ui_Warming_study_area (classe dans ui_Warming_study_area)</a> -</li> - <li><a href="API.html#module-ui_Warming_study_area">ui_Warming_study_area (module)</a> -</li> - <li><a href="package.html#Archive.Archive.utm_to_latlng">utm_to_latlng() (méthode Archive.Archive)</a> -</li> - </ul></td> -</tr></table> - -<h2 id="V">V</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#Vector.Vector">Vector (classe dans Vector)</a> - - <ul> - <li><a href="package.html#module-Vector">(module)</a> -</li> - </ul></li> - <li><a href="package.html#Vector.Vector.vector_data">vector_data() (méthode Vector.Vector)</a> -</li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#Vhrs.Vhrs">Vhrs (classe dans Vhrs)</a> - - <ul> - <li><a href="package.html#module-Vhrs">(module)</a> -</li> - </ul></li> - <li><a href="package.html#RasterSat_by_date.RasterSat_by_date.vrt_translate_gdal">vrt_translate_gdal() (méthode RasterSat_by_date.RasterSat_by_date)</a> -</li> - </ul></td> -</tr></table> - -<h2 id="Z">Z</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#Vector.Vector.zonal_stats">zonal_stats() (méthode Vector.Vector)</a> -</li> - </ul></td> - <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="package.html#Vector.Vector.zonal_stats_pp">zonal_stats_pp() (méthode Vector.Vector)</a> -</li> - </ul></td> -</tr></table> - - - - </div> - </div> - </div> - <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> - <div class="sphinxsidebarwrapper"> - - - -<div id="searchbox" style="display: none" role="search"> - <h3>Recherche rapide</h3> - <form class="search" action="search.html" method="get"> - <div><input type="text" name="q" /></div> - <div><input type="submit" value="Go" /></div> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="#" title="Index général" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Index des modules Python" - >modules</a> |</li> - <li class="nav-item nav-item-0"><a href="PHYMOBAT_documentation.html">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - <div class="footer" role="contentinfo"> - © Copyright 2017, LAVENTURE Sylvio (UMR TETIS/IRSTEA). - Créé avec <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.3. - </div> - </body> -</html> \ No newline at end of file diff --git a/Documentation/index.rst b/Documentation/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..571ae9e7ccdc43594a9eef3904b81df3db4a7452 --- /dev/null +++ b/Documentation/index.rst @@ -0,0 +1,19 @@ +.. PHYMOBAT documentation master file, created by + sphinx-quickstart on Mon Jan 4 17:26:09 2016. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Documentation de PHYMOBAT +========================= + +Chaîne de traintement du Fond blanc PHYsionomique des Milieux Ouverts de Basse Altitude par Télédétection (PHYMOBAT). + +.. note:: Outil développé sur Linux-Ubuntu 18.04. + +.. toctree:: + :maxdepth: 3 + + _sources/install.rst + _sources/methode_tuto.rst + _sources/package.rst + _sources/API.rst diff --git a/Documentation/install.html b/Documentation/install.html deleted file mode 100644 index 669dce81e675188a337fa1d8d3a53c2818648714..0000000000000000000000000000000000000000 --- a/Documentation/install.html +++ /dev/null @@ -1,216 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - -<html xmlns="http://www.w3.org/1999/xhtml" lang="fr"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Installation — documentation PHYMOBAT 3.0</title> - - <link rel="stylesheet" href="_static/classic.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: './', - VERSION: '3.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true, - SOURCELINK_SUFFIX: '.txt' - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/translations.js"></script> - <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> - <link rel="index" title="Index" href="genindex.html" /> - <link rel="search" title="Recherche" href="search.html" /> - <link rel="next" title="Processus utilisées et tutoriels API" href="methode_tuto.html" /> - <link rel="prev" title="Documentation de PHYMOBAT" href="PHYMOBAT_documentation.html" /> - </head> - <body role="document"> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="Index général" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Index des modules Python" - >modules</a> |</li> - <li class="right" > - <a href="methode_tuto.html" title="Processus utilisées et tutoriels API" - accesskey="N">suivant</a> |</li> - <li class="right" > - <a href="PHYMOBAT_documentation.html" title="Documentation de PHYMOBAT" - accesskey="P">précédent</a> |</li> - <li class="nav-item nav-item-0"><a href="PHYMOBAT_documentation.html">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body" role="main"> - - <div class="section" id="installation"> -<h1>Installation<a class="headerlink" href="#installation" title="Lien permanent vers ce titre">¶</a></h1> -<div class="section" id="installation-sig-open-source"> -<h2>Installation SIG open source<a class="headerlink" href="#installation-sig-open-source" title="Lien permanent vers ce titre">¶</a></h2> -<p>La chaîne de traitement est construite sous divers outils open-source, comme <code class="docutils literal"><span class="pre">GDAL</span></code> et <code class="docutils literal"><span class="pre">OGR</span></code>. La démarche à suivre pour installer ces outils est indiquée ci-dessous uniquement sous Linux.</p> -<ul class="simple"> -<li>Ajouter le dépôt ubuntugis-unstable</li> -</ul> -<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable -$ sudo apt-get update -</pre></div> -</div> -<ul class="simple"> -<li>Installer GDAL et OTB</li> -</ul> -<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo apt-get install gdal-bin otb-bin -</pre></div> -</div> -<p>Pour vérifier que GDAL est bien installé, taper :</p> -<div class="highlight-bash"><div class="highlight"><pre><span></span>$ gdalinfo -</pre></div> -</div> -<p>Il est bien installé, si vous avez l’aide de gdalinfo qui s’affiche (Idem pour OGR) :</p> -<div class="highlight-bash"><div class="highlight"><pre><span></span>Usage: gdalinfo <span class="o">[</span>--help-general<span class="o">]</span> <span class="o">[</span>-mm<span class="o">]</span> <span class="o">[</span>-stats<span class="o">]</span> <span class="o">[</span>-hist<span class="o">]</span> <span class="o">[</span>-nogcp<span class="o">]</span> <span class="o">[</span>-nomd<span class="o">]</span> - <span class="o">[</span>-norat<span class="o">]</span> <span class="o">[</span>-noct<span class="o">]</span> <span class="o">[</span>-nofl<span class="o">]</span> <span class="o">[</span>-checksum<span class="o">]</span> <span class="o">[</span>-proj4<span class="o">]</span> - <span class="o">[</span>-listmdd<span class="o">]</span> <span class="o">[</span>-mdd domain<span class="p">|</span><span class="sb">`</span>all<span class="sb">`</span><span class="o">]</span>* - <span class="o">[</span>-sd subdataset<span class="o">]</span> datasetname - -FAILURE: No datasource specified. -</pre></div> -</div> -<p>Vérifier que le package CURL est installé, sur certaines versions de Ubuntu il ne l’est pas :</p> -<blockquote> -<div><div class="highlight-bash"><div class="highlight"><pre><span></span>$ apt-cache search curl - -i A curl - outil en ligne de commande pour transférer des données avec une syntaxe URL -p curl:i386 - outil en ligne de commande pour transférer des données avec une syntaxe URL -p curlftpfs - Système de fichiers pour accéder à des hôtes FTP, basé sur FUSE et cURL -</pre></div> -</div> -</div></blockquote> -<p>Si il ne l’est pas :</p> -<blockquote> -<div><div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo apt-get install curl -</pre></div> -</div> -</div></blockquote> -</div> -<div class="section" id="modules-python"> -<h2>Modules python<a class="headerlink" href="#modules-python" title="Lien permanent vers ce titre">¶</a></h2> -<p>La version de Python utilisée est 2.7. Le code n’a pas encore été testé sur Python 3.</p> -<div class="section" id="installation-des-modules-python"> -<h3>Installation des modules python<a class="headerlink" href="#installation-des-modules-python" title="Lien permanent vers ce titre">¶</a></h3> -<p>Installer les deux modules Python <code class="docutils literal"><span class="pre">gdal</span></code>, <code class="docutils literal"><span class="pre">scikit-learn</span></code>, <code class="docutils literal"><span class="pre">Shapely</span></code>, <code class="docutils literal"><span class="pre">numpy</span></code>, <code class="docutils literal"><span class="pre">lxml</span></code> et <code class="docutils literal"><span class="pre">pyQt4</span></code> depuis le dépôt du système de la façon suivante :</p> -<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo apt-Âget install pythonÂ-gdal pythonÂ-sklearn python-shapely python-numpy python-lxml pyqt4-dev-tools -</pre></div> -</div> -<p>Pour installer le module Python externes <code class="docutils literal"><span class="pre">rasterstats</span></code> version 0.3.2, il faut dans un premier temps télécharger <code class="docutils literal"><span class="pre">pip</span></code> sur <a class="reference external" href="https://pip.pypa.io/en/stable/installing/#install-pip">https://pip.pypa.io/en/stable/installing/#install-pip</a> et l’installer en tapant :</p> -<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo python get-pip.py -</pre></div> -</div> -<p>Ensuite, télécharger le module <code class="docutils literal"><span class="pre">rasterstats</span></code> sur <a class="reference external" href="https://pypi.python.org">https://pypi.python.org</a>. -Si vous avez téléchargé les <strong>fichiers compréssés (.zip, .tar.gz, ...)</strong>, entrer dans le dossier du module et installer le module avec la commande :</p> -<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo python setup.py install -</pre></div> -</div> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Si vous avez téléchargé les <strong>fichiers compréssés wheel (.whl)</strong>, installer le avec cette commande : sudo pip install xxxxxx-0.00.0-py2-none-any.whl</p> -</div> -<p>Pour vérifier si les modules sont bien installé ou dèjà installé, il suffit de taper dans la console Python (Par exemple pour le module gdal):</p> -<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">osgeo</span> <span class="k">import</span> <span class="n">gdal</span> -<span class="go">>>></span> -</pre></div> -</div> -<p>Si ils ne sont pas encore installé vous aurez ces réponses. Dans ce cas il faudra les installer (voir section ci-dessus) :</p> -<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">osgeo</span> <span class="k">import</span> <span class="n">gdal</span> -<span class="go">ImportError: cannot import name gdal</span> -</pre></div> -</div> -<p>Ou</p> -<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">osgeo</span> <span class="k">import</span> <span class="n">gdal</span> -<span class="go">ImportError: No module named gdal</span> -</pre></div> -</div> -</div> -</div> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> - <div class="sphinxsidebarwrapper"> - <h3><a href="PHYMOBAT_documentation.html">Table des Matières</a></h3> - <ul> -<li><a class="reference internal" href="#">Installation</a><ul> -<li><a class="reference internal" href="#installation-sig-open-source">Installation SIG open source</a></li> -<li><a class="reference internal" href="#modules-python">Modules python</a><ul> -<li><a class="reference internal" href="#installation-des-modules-python">Installation des modules python</a></li> -</ul> -</li> -</ul> -</li> -</ul> - - <h4>Sujet précédent</h4> - <p class="topless"><a href="PHYMOBAT_documentation.html" - title="Chapitre précédent">Documentation de PHYMOBAT</a></p> - <h4>Sujet suivant</h4> - <p class="topless"><a href="methode_tuto.html" - title="Chapitre suivant">Processus utilisées et tutoriels API</a></p> - <div role="note" aria-label="source link"> - <h3>Cette page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/install.rst.txt" - rel="nofollow">Montrer le code source</a></li> - </ul> - </div> -<div id="searchbox" style="display: none" role="search"> - <h3>Recherche rapide</h3> - <form class="search" action="search.html" method="get"> - <div><input type="text" name="q" /></div> - <div><input type="submit" value="Go" /></div> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="Index général" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Index des modules Python" - >modules</a> |</li> - <li class="right" > - <a href="methode_tuto.html" title="Processus utilisées et tutoriels API" - >suivant</a> |</li> - <li class="right" > - <a href="PHYMOBAT_documentation.html" title="Documentation de PHYMOBAT" - >précédent</a> |</li> - <li class="nav-item nav-item-0"><a href="PHYMOBAT_documentation.html">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - <div class="footer" role="contentinfo"> - © Copyright 2017, LAVENTURE Sylvio (UMR TETIS/IRSTEA). - Créé avec <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.3. - </div> - </body> -</html> \ No newline at end of file diff --git a/Documentation/methode_tuto.html b/Documentation/methode_tuto.html deleted file mode 100644 index 6b7b57e3380e8bfc4f3296e0882502fa1435aa7d..0000000000000000000000000000000000000000 --- a/Documentation/methode_tuto.html +++ /dev/null @@ -1,602 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - -<html xmlns="http://www.w3.org/1999/xhtml" lang="fr"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Processus utilisées et tutoriels API — documentation PHYMOBAT 3.0</title> - - <link rel="stylesheet" href="_static/classic.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: './', - VERSION: '3.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true, - SOURCELINK_SUFFIX: '.txt' - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/translations.js"></script> - <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> - <link rel="index" title="Index" href="genindex.html" /> - <link rel="search" title="Recherche" href="search.html" /> - <link rel="next" title="CarHab Phy MOBA package" href="package.html" /> - <link rel="prev" title="Installation" href="install.html" /> - </head> - <body role="document"> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="Index général" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Index des modules Python" - >modules</a> |</li> - <li class="right" > - <a href="package.html" title="CarHab Phy MOBA package" - accesskey="N">suivant</a> |</li> - <li class="right" > - <a href="install.html" title="Installation" - accesskey="P">précédent</a> |</li> - <li class="nav-item nav-item-0"><a href="PHYMOBAT_documentation.html">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body" role="main"> - - <div class="section" id="processus-utilisees-et-tutoriels-api"> -<h1>Processus utilisées et tutoriels API<a class="headerlink" href="#processus-utilisees-et-tutoriels-api" title="Lien permanent vers ce titre">¶</a></h1> -<p>Cette chaîne de traitement répond à un objectif du programme CarHab (Cartographie des Habitats naturels) à savoir : réaliser pour les milieux ouverts de basse altitude (MOBA) un “fond blanc physionomique”, c’est-à -dire d’une carte physionomique de ces milieux à l’aide des techniques de télédétection.</p> -<p>Pour cela, une méthode de classification orientée-objet selon une approche experte a été developpée. Le détail des étapes pour aboutir aux classifications du fond blanc -physionomique est donné selon l’arbre de décision ci-dessous.</p> -<div class="figure align-center"> -<img alt="Arbre de decision" src="_images/arbreDecision_cut.png" /> -</div> -<p>La première étape consiste à discriminer les végétations (semi-)naturelles des végétations culturales et éboulis. Pour ce faire, les données de télédétection multi-temporelles Landsat8 ou Sentinel2(+PHYMOBAT 3.0) sont utilisées. L’analyse de traitement d’image s’appuie sur l’hypothèse forte selon laquelle les cultures annuelles comprennent une étape de labour et se retrouvent donc au moins une fois en sol nu dans l’année. Cette analyse a pour objectif de calculer l’indice du minimum de NDVI sur la série temporelle équivalente à l’étape de labour (ie à une végétation non-naturelle et aux éboulis).</p> -<p>Le deuxième niveau se décompose en deux parties. Dans un premier temps, le modèle numérique de terrain est utilisé pour distinguer les éboulis (>30% en pente) des surfaces agricoles (+PHYMOBAT 1.1). Dans la seconde partie de cette étape, la télédétection permet de caractériser la végétation naturelle en termes de structure et de densité c’est-à -dire du point de vue physionomique. Cette analyse se fait par l’utilisation d’images de très hautes résolutions (ici les orthophotographies BD ORTHO © IRC). Il s’agit de distinguer les surfaces herbacées des végétations ligneuses basses à l’aide de l’indice de texture SFS’SD (Structural Feature Set Standard Deviation).</p> -<p>Pour le niveau suivante, les végétations ligneuses basses sont déclinées en deux niveaux de densités : mixtes (ouverts) et denses. Ils sont également caractérisés par leur structure et leur densité. La distinction entre ces deux classes se fait en calculant cette fois-çi l’indice d’Haralick, IDM (inverse Inverse Difference).</p> -<p>Une dernière phase consiste à extraire de l’information sur la production chlorophyllienne des zones herbacées. Cette étape utilise les séries temporelles. Elle se base sur le calcul de l’indice du maximum de NDVI dans l’année.</p> -<p>(Pour plus de renseignements, voir “Rapport méthodologique pour la cartographie physionomique des milieux ouverts de basse altitude par télédétection” - <em>Samuel Alleaume 2014</em>).</p> -<p>Une autre méthode avec un temps de calcul plus longue a été implémentée pour extraire la carte de végétation physionomique. Il s’agit de la méthode Random Forest (+PHYMOBAT 2.0). Elle permet de discriminer les mêmes classes sur un plus grand jeu de donneés.</p> -<div class="section" id="processus-algorithmiques-utilisees"> -<h2>Processus algorithmiques utilisées<a class="headerlink" href="#processus-algorithmiques-utilisees" title="Lien permanent vers ce titre">¶</a></h2> -<p>Le Processus utilisé se décompose en trois parties :</p> -<ul class="simple"> -<li>Traitements des images</li> -<li>Traitements des échantillons</li> -<li>Traitements de classification</li> -</ul> -<div class="figure align-center"> -<img alt="Modèle conceptuel de la chaîne de traitement" src="_images/ChaineTraitementCarHab.png" /> -</div> -<div class="section" id="traitement-des-images"> -<h3>Traitement des images<a class="headerlink" href="#traitement-des-images" title="Lien permanent vers ce titre">¶</a></h3> -<p>Deux types d’images sont utilisés dans cette chaîne de traitement : les orthophotographies © de l’IGN en IRC (infra-rouge fausse couleur) et les images gratuites issues de la plate-forme <a class="reference external" href="https://www.theia-land.fr/fr">Theia</a> :</p> -<ul class="simple"> -<li><strong>Landsat 8 OLI</strong> (Operational Land Imager). En orbitre depuis 2013, ces images ont une résolution spatiale de 30 mètres et 9 bandes spectrales (aérosols, bleu, vert, rouge, proche infra-rouge, moyen infra-rouge 1 et 2, panchromatique-15m, cirrus).</li> -<li><strong>Sentinel 2A</strong>. En orbitre depuis Juin 2015, ces images ont 13 bandes spectrales et différentes résolutions spatiales 10, 20 et 30 mètres en fonction de ces mêmes bandes. PHYMOBAT 3.0 utilise que les bandes à 10 mètres soit le bleu, vert, rouge et proche infra-rouge.</li> -</ul> -<p>A ces images, est joint un raster de détection des nuages, figure ci-dessous b (masque des nuages), utilisé pour sélection les images dans le processus.</p> -<div class="figure align-center"> -<img alt="spectral_cloud" src="_images/spectral_cloud.png" /> -</div> -<p>Le traitement des images se décompose quant à lui en trois parties :</p> -<ol class="arabic simple"> -<li>Listing et téléchargement des images sur la plate-forme Theia</li> -<li>Traitement des images téléchargées</li> -<li>Traitement des images très haute résolution spatiales (calcul des indices de textures)</li> -</ol> -<div class="section" id="listing-et-telechargements-des-images-sur-la-plate-forme-theia"> -<h4>1. Listing et téléchargements des images sur la plate-forme Theia<a class="headerlink" href="#listing-et-telechargements-des-images-sur-la-plate-forme-theia" title="Lien permanent vers ce titre">¶</a></h4> -<p>Le listing des images disponibles se fait à travers une base de données GeoJSON via une API serveur pour Landsat8 (resp. Sentinel2): <a class="reference external" href="https://landsat-theia.cnes.fr/resto/api/collections/Landsat/search.json?lang=fr&_pretty=true&q=2013&box=4.5,43.16,5.8,43.5&maxRecord=500">https://landsat-theia.cnes.fr/resto/api/collections/Landsat/search.json?lang=fr&_pretty=true&q=2013&box=4.5,43.16,5.8,43.5&maxRecord=500</a> (resp. <a class="reference external" href="https://theia.cnes.fr/resto/api/collections/Landsat/search.json?lang=fr&_pretty=true&completionDate=2015-12-31&box=4.5,43.16,5.8,43.5&maxRecord=500&startDate=2015-01-01">https://theia.cnes.fr/resto/api/collections/Landsat/search.json?lang=fr&_pretty=true&completionDate=2015-12-31&box=4.5,43.16,5.8,43.5&maxRecord=500&startDate=2015-01-01</a>).</p> -<p><em>Avec q=2013 : Année des images disponibles</em></p> -<blockquote> -<div><p><em>startDate=2015-01-01 : Date de début de la période choisie des images disponibles</em></p> -<p><em>completionDate=2015-12-31 : Date de fin de la période choisie des images disponibles</em></p> -<p><em>box=4.5,43.16,5.8,43.5 : Zone d’emprise en degrés décimaux</em></p> -</div></blockquote> -<p>La fonction <a class="reference internal" href="package.html#Archive.Archive.listing" title="Archive.Archive.listing"><code class="xref py py-func docutils literal"><span class="pre">Archive.Archive.listing()</span></code></a> utilise cette base. Elle remplace dans l’exemple “2013” par la période ou l’année entrée par un utilisateur. Ensuite, à l’aide du shapefile de la zone d’étude, la fonction convertie les coordonnées des extrémités du fichier vecteur en degrés décimaux pour les inclure dans l’url ci-dessus (<em>box =</em>).</p> -<p>A l’issue du listing, le nom et l’identifiant des images sont stockés dans une liste. Le nom de l’image est utilisé pour nommer l’image après téléchargement et l’identifiant est utilisé pour le téléchargement <a class="reference internal" href="package.html#Archive.Archive.download_auto" title="Archive.Archive.download_auto"><code class="xref py py-func docutils literal"><span class="pre">Archive.Archive.download_auto()</span></code></a> (+PHYMOBAT 1.1). Une bouton <strong>Proxy</strong> a été ajouté à PHYMOBAT 3.0:</p> -<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1">## Source : https://github.com/olivierhagolle/theia_download</span> -<span class="c1"># Authentification</span> -<span class="n">get_token</span><span class="o">=</span><span class="s1">'curl -k -s -X POST </span><span class="si">%s</span><span class="s1"> --data-urlencode "ident=</span><span class="si">%s</span><span class="s1">" --data-urlencode "pass=</span><span class="si">%s</span><span class="s1">" </span><span class="si">%s</span><span class="s1">/services/authenticate/>token.json'</span><span class="o">%</span><span class="p">(</span><span class="n">curl_proxy</span><span class="p">,</span> <span class="n">user_theia</span><span class="p">,</span> <span class="n">password_theia</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="p">)</span> -<span class="n">os</span><span class="o">.</span><span class="n">system</span><span class="p">(</span><span class="n">get_token</span><span class="p">)</span> -<span class="c1"># .</span> -<span class="c1"># .</span> -<span class="c1"># .</span> -<span class="c1"># Téléchargement -> loop ... d in range(...)</span> -<span class="n">get_product</span><span class="o">=</span><span class="s1">'curl </span><span class="si">%s</span><span class="s1"> -o </span><span class="si">%s</span><span class="s1"> -k -H "Authorization: Bearer </span><span class="si">%s</span><span class="s1">" </span><span class="si">%s</span><span class="s1">/</span><span class="si">%s</span><span class="s1">/collections/</span><span class="si">%s</span><span class="s1">/</span><span class="si">%s</span><span class="s1">/download/?issuerId=theia'</span><span class="o">%</span><span class="p">(</span><span class="n">curl_proxy</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">list_archive</span><span class="p">[</span><span class="n">d</span><span class="p">][</span><span class="mi">1</span><span class="p">],</span> <span class="n">token</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">resto</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_captor</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">list_archive</span><span class="p">[</span><span class="n">d</span><span class="p">][</span><span class="mi">2</span><span class="p">])</span> -<span class="n">os</span><span class="o">.</span><span class="n">system</span><span class="p">(</span><span class="n">get_product</span><span class="p">)</span> -</pre></div> -</div> -<p>A la fin du téléchargement des images, <a class="reference internal" href="package.html#Archive.Archive.decompress" title="Archive.Archive.decompress"><code class="xref py py-func docutils literal"><span class="pre">Archive.Archive.decompress()</span></code></a> va décompresser les archives Landsat 8 grâce au module <code class="docutils literal"><span class="pre">tarfile</span></code>. -Pour les Sentinel 2A, les archives seront extraits à l’aide du module <code class="docutils literal"><span class="pre">zipfile</span></code> en sélectionnant que les bandes à 10m. En effet, les rasters Sentinel 2A sont fournis avec des bandes séparées qu’il faut “stacker”.</p> -</div> -<div class="section" id="traitements-des-images-telechargees"> -<h4>2. Traitements des images téléchargées<a class="headerlink" href="#traitements-des-images-telechargees" title="Lien permanent vers ce titre">¶</a></h4> -<p>Toutes les images décompréssées (images spectrales à 9 bandes pour L8 (à 4 bandes pour S2A) et masque de nuages) sont découpées <code class="xref py py-func docutils literal"><span class="pre">Toolbox.clip_raster()</span></code> en fonction de la zone d’étude. Le découpage est éffectué en ligne de commande grâce au module python <code class="docutils literal"><span class="pre">subprocess</span></code> :</p> -<div class="highlight-bash"><div class="highlight"><pre><span></span>$ gdalwarp -dstnodata -10000 -q -cutline study_area.shp -crop_to_cutline -of GTiff raster.TIF Clip_raster.TIF -</pre></div> -</div> -<p>Ensuite une sélection des images est éffectuée en fonction de la couverture nuageuse dans la zone d’étude. Pour cela, le processus regroupe <a class="reference internal" href="package.html#RasterSat_by_date.RasterSat_by_date.group_by_date" title="RasterSat_by_date.RasterSat_by_date.group_by_date"><code class="xref py py-func docutils literal"><span class="pre">RasterSat_by_date.RasterSat_by_date.group_by_date()</span></code></a> et mosaïque d’abord les rasters par date <a class="reference internal" href="package.html#RasterSat_by_date.RasterSat_by_date.mosaic_by_date" title="RasterSat_by_date.RasterSat_by_date.mosaic_by_date"><code class="xref py py-func docutils literal"><span class="pre">RasterSat_by_date.RasterSat_by_date.mosaic_by_date()</span></code></a>.</p> -<p>Le mosaïquage est réalisé en ligne de commande <a class="reference internal" href="package.html#RasterSat_by_date.RasterSat_by_date.vrt_translate_gdal" title="RasterSat_by_date.RasterSat_by_date.vrt_translate_gdal"><code class="xref py py-func docutils literal"><span class="pre">RasterSat_by_date.RasterSat_by_date.vrt_translate_gdal()</span></code></a> en utilisant le format virtuel de <cite>gdal</cite>, <em>VRT (Virtual Dataset)</em> :</p> -<div class="highlight-bash"><div class="highlight"><pre><span></span>$ gdalbuildvrt -srcnodata -10000 dst_data.VRT raster1.TIF raster2.TIF -Input file size is <span class="m">286</span>, <span class="m">467</span> -<span class="m">0</span>...10...20...30...40...50...60...70...80...90...100 - <span class="k">done</span>. -$ -$ gdal_translate -a_nodata -10000 dst_data.TIF dst_data.VRT -Input file size is <span class="m">286</span>, <span class="m">467</span> -<span class="m">0</span>...10...20...30...40...50...60...70...80...90...100 - <span class="k">done</span>. -</pre></div> -</div> -<p>La selection est faite dans <a class="reference internal" href="package.html#RasterSat_by_date.RasterSat_by_date.pourc_cloud" title="RasterSat_by_date.RasterSat_by_date.pourc_cloud"><code class="xref py py-func docutils literal"><span class="pre">RasterSat_by_date.RasterSat_by_date.pourc_cloud()</span></code></a>. Elle renvoie le pourcentage de couverture claire <strong>cl</strong> par mosaïque de la façon suivante :</p> -<ul class="simple"> -<li>Extrait l’étendue de l’image en matrice :</li> -</ul> -<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">mask_spec</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">in1d</span><span class="p">(</span><span class="n">data_spec</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="o">-</span><span class="mi">10000</span><span class="p">,</span> <span class="n">math</span><span class="o">.</span><span class="n">isnan</span><span class="p">],</span> <span class="n">invert</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span> -</pre></div> -</div> -<ul class="simple"> -<li>Extrait les pixels correspondant aux nuages :</li> -</ul> -<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">mask_cloud</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">in1d</span><span class="p">(</span><span class="n">data_cloud</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> -</pre></div> -</div> -<ul class="simple"> -<li>Détermine les pixels de nuages par rapport à l’emprise de l’image :</li> -</ul> -<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">cloud</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">choose</span><span class="p">(</span><span class="n">mask_cloud</span><span class="p">,</span> <span class="p">(</span><span class="bp">False</span><span class="p">,</span> <span class="n">mask_spec</span><span class="p">))</span> -</pre></div> -</div> -<ul class="simple"> -<li>Détermine la somme de pixels en nuages et le pourcentage dans la zone d’emprise :</li> -</ul> -<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">dist</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">cloud</span><span class="p">)</span> -<span class="n">nb0</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">dist</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">mask_spec</span><span class="p">))</span> -</pre></div> -</div> -<p>Par défaut, le pourcentage de couverture nuageuse maximum accepté est de 40%.</p> -<p>Toutes les mosaïques ayant plus de 60% de pixels clair, passeront par les fonctions <a class="reference internal" href="package.html#RasterSat_by_date.RasterSat_by_date.calcul_ndvi" title="RasterSat_by_date.RasterSat_by_date.calcul_ndvi"><code class="xref py py-func docutils literal"><span class="pre">RasterSat_by_date.RasterSat_by_date.calcul_ndvi()</span></code></a> (calcul de NDVI), <code class="xref py py-func docutils literal"><span class="pre">Toolbox.calc_serie_stats()</span></code> (calcul de minimum, maximum de ndvi et temporalité nuageuse) et <a class="reference internal" href="package.html#RasterSat_by_date.RasterSat_by_date.create_raster" title="RasterSat_by_date.RasterSat_by_date.create_raster"><code class="xref py py-func docutils literal"><span class="pre">RasterSat_by_date.RasterSat_by_date.create_raster()</span></code></a>. Cette dernière fonction crée cinq rasters : minimum ndvi, maximum ndvi, std ndvi (écart-type), MaxMin ndvi (max ndvi - min ndvi) et un dernier raster qui correspond au nombre d’image utilisé par pixel clair (exemple sur l’image ci-dessous).</p> -<div class="figure align-center"> -<img alt="temporal_cloud" src="_images/temporal_cloud.png" /> -</div> -</div> -<div class="section" id="traitements-des-images-thrs"> -<h4>3. Traitements des images THRS<a class="headerlink" href="#traitements-des-images-thrs" title="Lien permanent vers ce titre">¶</a></h4> -<p>Le traitement des images THRS est éffectué pour déterminer les ligneux et différents types de ligneux. Ligneux sont caractérisés par leur texture vis-à -vis des herbacés, et de leur type. Ces caractéristiques sont extraits à l’aide d’indices de textures issus de l’<code class="docutils literal"><span class="pre">OTB</span></code> via <a class="reference internal" href="package.html#Vhrs.Vhrs" title="Vhrs.Vhrs"><code class="xref py py-func docutils literal"><span class="pre">Vhrs.Vhrs()</span></code></a>.</p> -<p>Deux indices ont été sélectionnés pour discriminer les classes par rapport aux ligneux :</p> -<ul class="simple"> -<li>SFS’SD des indices de textures de Structural Feature Set Standard Deviation (Herbacés / Ligneux)</li> -</ul> -<div class="highlight-bash"><div class="highlight"><pre><span></span>$ otbcli_SFSTextureExtraction -in raster.tif -channel <span class="m">2</span> -parameters.spethre <span class="m">50</span>.0 -parameters.spathre <span class="m">100</span> -out out_sfs.tif -</pre></div> -</div> -<ul class="simple"> -<li>Inverse Difference Moment des indices d’Haralick (Ligneux mixtes / Ligneux denses)</li> -</ul> -<div class="highlight-bash"><div class="highlight"><pre><span></span>$ otbcli_HaralickTextureExtraction -in raster.tif -channel <span class="m">2</span> -parameters.xrad <span class="m">3</span> -parameters.yrad <span class="m">3</span> -texture simple -out out_haralick.tif -</pre></div> -</div> -<p>Pour extraire deux indices, il faut lancer les deux commandes ci-dessus qui calculent malgré tout 14 indices. Par conséquent, les traitements deviennent très long. Pour réduire ce temps de calcul, la chaîne de traitement utilise le <code class="docutils literal"><span class="pre">multiprocessing</span></code>. Il permet de lancer tous les traitements en même temps.</p> -<p>Le code Python associé au <code class="docutils literal"><span class="pre">multiprocessing</span></code> est le suivant :</p> -<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">multiprocessing</span> <span class="k">import</span> <span class="n">Process</span> -<span class="gp">>>> </span><span class="n">p_sfs</span> <span class="o">=</span> <span class="n">Process</span><span class="p">(</span><span class="n">target</span><span class="o">=</span><span class="n">sfs_function</span><span class="p">)</span> -<span class="gp">>>> </span><span class="n">p_har</span> <span class="o">=</span> <span class="n">Process</span><span class="p">(</span><span class="n">target</span><span class="o">=</span><span class="n">haralick_function</span><span class="p">)</span> -<span class="gp">>>> </span><span class="c1"># Lancement des traitements</span> -<span class="gp">>>> </span><span class="n">p_sfs</span><span class="o">.</span><span class="n">start</span><span class="p">()</span> -<span class="gp">>>> </span><span class="n">p_har</span><span class="o">.</span><span class="n">start</span><span class="p">()</span> -<span class="gp">>>> </span><span class="c1"># Attente de la fin des calculs</span> -<span class="gp">>>> </span><span class="n">p_sfs</span><span class="o">.</span><span class="n">join</span><span class="p">()</span> -<span class="gp">>>> </span><span class="n">p_har</span><span class="o">.</span><span class="n">join</span><span class="p">()</span> -</pre></div> -</div> -<div class="admonition warning"> -<p class="first admonition-title">Avertissement</p> -<p class="last">Pour utiliser le <code class="docutils literal"><span class="pre">multiprocessing</span></code>, il faut une machine avec minimum 12Go de mémoire vive. Sinon les traitements seront plus long que sans l’utilisation du <code class="docutils literal"><span class="pre">multiprocessing</span></code>!</p> -</div> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">L’image THRS utilisée est l’orthophotographie © IGN. A la base c’est un maillage de plusieurs images carrées de 5km de coté. Ces images sont en 8bit à 50cm de résolution spatiale et au format compréssé ECW (Enhanced Compression Wavelet). En dehors de la chaîne de traitement, un mosaïquage de ces images sur la zone d’étude doit être construit. Cette mosaïque doit être ré-échantillonnée à 2m car différentes études ont montré que l’image à 50cm apportait la même information. De plus, il y a un gagne-temps non négligeable sur les calculs pour une image de plus basse résolution.</p> -</div> -</div> -</div> -<div class="section" id="traitements-des-echantillons"> -<h3>Traitements des échantillons<a class="headerlink" href="#traitements-des-echantillons" title="Lien permanent vers ce titre">¶</a></h3> -<p>Il faut trois paires d’échantillons pour compléter l’arbre de décision défini plus haut. Un échantillon pour séparer : <strong>Cultures / Végétation semi-naturelle</strong>, <strong>Herbacées / Ligneux</strong> et <strong>Ligneux mixtes / Ligneux denses</strong>.</p> -<p>Les traitements des échantillons <a class="reference internal" href="API.html#Processing.Processing.i_sample" title="Processing.Processing.i_sample"><code class="xref py py-func docutils literal"><span class="pre">Processing.Processing.i_sample()</span></code></a> est le même pour les trois, soit :</p> -<ul class="simple"> -<li>En partant du principe que tous les échantillons soit dans un même shapefile, il faut indiquer le nom de la classe et le champ où il se trouve.</li> -</ul> -<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">kwargs</span><span class="p">[</span><span class="s1">'fieldname'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fieldname_args</span><span class="p">[</span><span class="n">sple</span><span class="p">]</span> -<span class="gp">>>> </span><span class="n">kwargs</span><span class="p">[</span><span class="s1">'class'</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">class_args</span><span class="p">[</span><span class="n">sple</span><span class="p">]</span> -</pre></div> -</div> -<ul class="simple"> -<li>Créer un shapefile par échantillon <a class="reference internal" href="package.html#Sample.Sample.create_sample" title="Sample.Sample.create_sample"><code class="xref py py-func docutils literal"><span class="pre">Sample.Sample.create_sample()</span></code></a> de calibration et de validation puis réaliser une statistique zonale par polygone <a class="reference internal" href="package.html#Vector.Vector.zonal_stats" title="Vector.Vector.zonal_stats"><code class="xref py py-func docutils literal"><span class="pre">Vector.Vector.zonal_stats()</span></code></a>.</li> -</ul> -<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">sample_rd</span><span class="p">[</span><span class="n">sple</span><span class="p">]</span> <span class="o">=</span> <span class="n">Sample</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sample_name</span><span class="p">[</span><span class="n">sple</span><span class="o">/</span><span class="mi">2</span><span class="p">],</span> <span class="bp">self</span><span class="o">.</span><span class="n">path_area</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">list_nb_sample</span><span class="p">[</span><span class="n">sple</span><span class="o">/</span><span class="mi">2</span><span class="p">])</span> -<span class="gp">>>> </span><span class="n">sample_rd</span><span class="p">[</span><span class="n">sple</span><span class="p">]</span><span class="o">.</span><span class="n">create_sample</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> -<span class="gp">>>> </span><span class="n">sample_rd</span><span class="p">[</span><span class="n">sple</span><span class="p">]</span><span class="o">.</span><span class="n">zonal_stats</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">raster_path</span><span class="p">[</span><span class="n">sple</span><span class="o">/</span><span class="mi">2</span><span class="p">],</span> <span class="bp">self</span><span class="o">.</span><span class="n">list_band_outraster</span><span class="p">[</span><span class="n">sple</span><span class="o">/</span><span class="mi">2</span><span class="p">]))</span> -</pre></div> -</div> -<p>La création du shapefile est fait sur un certain nombre de polygone (chiffre indiqué par l’utilisateur) tiré aléatoirement.</p> -<ul class="simple"> -<li>Et Extrait le modèle de distinction</li> -</ul> -<div class="section" id="modele-seath"> -<h4>1. Modèle Seath<a class="headerlink" href="#modele-seath" title="Lien permanent vers ce titre">¶</a></h4> -<p>A l’aide des valeurs déterminer par <a class="reference internal" href="package.html#Vector.Vector.zonal_stats" title="Vector.Vector.zonal_stats"><code class="xref py py-func docutils literal"><span class="pre">Vector.Vector.zonal_stats()</span></code></a>, la fonction <a class="reference internal" href="package.html#Seath.Seath.separability_and_threshold" title="Seath.Seath.separability_and_threshold"><code class="xref py py-func docutils literal"><span class="pre">Seath.Seath.separability_and_threshold()</span></code></a> détermine le seuil optimal (<em>SEaTH–A new tool for automated feature extraction in the context of object-based image analysis S. Nussbaum et al.</em>) pour discriminer les classes deux à deux issues de l’arbre de décision.</p> -<p>Pour l’instant, l’utilisation du RPG (Régistre Parcellaire Graphique) est insdispensable comme échantillon de <strong>Cultures</strong>. Or le RPG possède des polygones poly-culturaux. -Il se pourrait qu’un polygone renseigné soit ainsi blé, maïs et une prairie permanente. Par conséquent, ce polygones injecterait une erreur dans le calcul du seuil optimal puisque le polygone est un mélange de végétation non naturelle et semi-naturelle. Dans ce cas, <a class="reference internal" href="package.html#Rpg.Rpg" title="Rpg.Rpg"><code class="xref py py-func docutils literal"><span class="pre">Rpg.Rpg()</span></code></a> a été mis en place pour créer des échantillons mono-culturaux de cultures et de prairies permanentes.</p> -</div> -<div class="section" id="moldele-random-forest-rf"> -<h4>2. Moldèle Random Forest (RF)<a class="headerlink" href="#moldele-random-forest-rf" title="Lien permanent vers ce titre">¶</a></h4> -<p>Le RF quant à lui stocke toutes les bandes de textures contrairement à la l’utilisation méthode Seath dite experte. Cette méthode a été mise en place à l’aide du module Python <code class="docutils literal"><span class="pre">sklearn</span></code> avec un export des indices les plus significatifs et de l’arbre de décision généré :</p> -<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1"># Build a forest of trees from the samples</span> -<span class="bp">self</span><span class="o">.</span><span class="n">rf</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">rf</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">X_rf</span><span class="p">,</span> <span class="n">y_rf</span><span class="p">)</span> - -<span class="c1"># Print in a file feature important</span> -<span class="n">importance</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">rf</span><span class="o">.</span><span class="n">feature_importances_</span> -<span class="n">importance</span> <span class="o">=</span> <span class="p">[(</span><span class="n">importance</span><span class="p">[</span><span class="n">x</span><span class="p">],</span><span class="n">x</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">importance</span><span class="p">))]</span> -<span class="n">importance</span><span class="o">.</span><span class="n">sort</span><span class="p">()</span> - -<span class="n">file_feat_import</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">raster_path</span><span class="p">[</span><span class="mi">0</span><span class="p">]))</span> <span class="o">+</span> <span class="s1">'/Feature_important_RF.ft'</span> -<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">file_feat_import</span><span class="p">):</span> - <span class="n">os</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">file_feat_import</span><span class="p">)</span> -<span class="n">f_out</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">file_feat_import</span><span class="p">,</span> <span class="s2">"wb"</span><span class="p">)</span> -<span class="n">f_out</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">importance</span><span class="p">))</span> -<span class="c1"># Close the output file</span> -<span class="n">f_out</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> - -<span class="c1"># Print in a file decision tree</span> -<span class="n">file_decisiontree</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">raster_path</span><span class="p">[</span><span class="mi">0</span><span class="p">]))</span> <span class="o">+</span> <span class="s1">'/Decision_tree.dot'</span> -<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">file_decisiontree</span><span class="p">):</span> - <span class="n">os</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">file_decisiontree</span><span class="p">)</span> - -<span class="n">tree_in_forest</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">rf</span><span class="o">.</span><span class="n">estimators_</span><span class="p">[</span><span class="mi">499</span><span class="p">]</span> -<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">file_decisiontree</span><span class="p">,</span> <span class="s1">'w'</span><span class="p">)</span> <span class="k">as</span> <span class="n">my_file</span><span class="p">:</span> - <span class="n">my_file</span> <span class="o">=</span> <span class="n">tree</span><span class="o">.</span><span class="n">export_graphviz</span><span class="p">(</span><span class="n">tree_in_forest</span><span class="p">,</span> <span class="n">out_file</span> <span class="o">=</span> <span class="n">my_file</span><span class="p">)</span> -</pre></div> -</div> -<p>Le temps de calcul de ce modèle est plus long car le traitement de <a class="reference internal" href="package.html#Vector.Vector.zonal_stats" title="Vector.Vector.zonal_stats"><code class="xref py py-func docutils literal"><span class="pre">Vector.Vector.zonal_stats()</span></code></a> se fait sur 17 images. Par contre, il a l’avantage d’être plus précis.</p> -</div> -</div> -<div class="section" id="traitements-de-classification"> -<h3>Traitements de classification<a class="headerlink" href="#traitements-de-classification" title="Lien permanent vers ce titre">¶</a></h3> -<p>La classification est réalisée sur la segmentation issue de la l’orthophotographie © IGN. A chaque polygone, est affecté une valeur moyenne <a class="reference internal" href="package.html#Vector.Vector.zonal_stats" title="Vector.Vector.zonal_stats"><code class="xref py py-func docutils literal"><span class="pre">Vector.Vector.zonal_stats()</span></code></a> par image. Les statistiques zonales sur les rasters à THRS sont très long (Plus long pour la méthode RF). Le <code class="docutils literal"><span class="pre">multiprocessing</span></code> est, une nouvelle fois, utilisé par ici pour accélérer le gain de temps de calcul.</p> -<p><a class="reference internal" href="package.html#Segmentation.Segmentation.compute_biomass_density" title="Segmentation.Segmentation.compute_biomass_density"><code class="xref py py-func docutils literal"><span class="pre">Segmentation.Segmentation.compute_biomass_density()</span></code></a> extrait la distribution de la densité de ligneux et de phytomasse.</p> -<div class="figure align-center"> -<img alt="Distribution normale et pourcentage de représentation en fonction de l’écart-type" src="_images/phytomasse.png" /> -</div> -<p><a class="reference internal" href="package.html#Segmentation.Segmentation.decision_tree" title="Segmentation.Segmentation.decision_tree"><code class="xref py py-func docutils literal"><span class="pre">Segmentation.Segmentation.decision_tree()</span></code></a> (resp. <code class="docutils literal"><span class="pre">rf.predict()</span></code>) classe les polygones en fonction des seuils optimaux pré-déterminés <a class="reference internal" href="package.html#Seath.Seath.separability_and_threshold" title="Seath.Seath.separability_and_threshold"><code class="xref py py-func docutils literal"><span class="pre">Seath.Seath.separability_and_threshold()</span></code></a> (resp. <a class="reference internal" href="API.html#Processing.Processing.i_sample_rf" title="Processing.Processing.i_sample_rf"><code class="xref py py-func docutils literal"><span class="pre">Processing.Processing.i_sample_rf()</span></code></a>) et des valeurs zonales par raster.</p> -<p><a class="reference internal" href="package.html#Segmentation.Segmentation.create_cartography" title="Segmentation.Segmentation.create_cartography"><code class="xref py py-func docutils literal"><span class="pre">Segmentation.Segmentation.create_cartography()</span></code></a> va créer le shapefile final qui représentera le <strong>FB physionomique MOBA</strong>.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Le document final contient une colonne RPG qui correspond à la donnée du RPG (îlots de culture) pour un polygone de la segmentation inclut à 85%.</p> -</div> -<p><a class="reference internal" href="API.html#Processing.Processing.i_classifier_rf" title="Processing.Processing.i_classifier_rf"><code class="xref py py-func docutils literal"><span class="pre">Processing.Processing.i_classifier_rf()</span></code></a></p> -<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1"># Rasterize RPG shapefile to complete the final shapefile</span> -<span class="n">opt</span> <span class="o">=</span> <span class="p">{}</span> -<span class="n">opt</span><span class="p">[</span><span class="s1">'Remove'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">1</span> -<span class="n">rpg_tif</span> <span class="o">=</span> <span class="n">Vector</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sample_name</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="bp">self</span><span class="o">.</span><span class="n">path_area</span><span class="p">,</span> <span class="o">**</span><span class="n">opt</span><span class="p">)</span> -<span class="c1"># if not os.path.exists(str(rpg_tif.vector_used[:-3]+'TIF')):</span> -<span class="n">kwargs</span><span class="p">[</span><span class="s1">'choice_nb_b'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">1</span> -<span class="n">out_carto</span><span class="o">.</span><span class="n">stats_rpg_tif</span> <span class="o">=</span> <span class="n">out_carto</span><span class="o">.</span><span class="n">zonal_stats_pp</span><span class="p">(</span><span class="n">rpg_tif</span><span class="o">.</span><span class="n">layer_rasterization</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">path_ortho</span><span class="p">,</span> <span class="s1">'CODE_GROUP'</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">))</span> -</pre></div> -</div> -<p><a class="reference internal" href="package.html#Segmentation.Segmentation.create_cartography" title="Segmentation.Segmentation.create_cartography"><code class="xref py py-func docutils literal"><span class="pre">Segmentation.Segmentation.create_cartography()</span></code></a></p> -<div class="highlight-python"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="n">pourc_inter</span> <span class="o">>=</span> <span class="mi">85</span><span class="p">:</span> - <span class="n">recouv_crops_RPG</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">stats_rpg_tif</span><span class="p">[</span><span class="n">in_feature</span><span class="o">.</span><span class="n">GetFID</span><span class="p">()][</span><span class="s1">'Maj_count'</span><span class="p">]</span> -</pre></div> -</div> -</div> -</div> -<div class="section" id="tutoriels-interface"> -<h2>Tutoriels interface<a class="headerlink" href="#tutoriels-interface" title="Lien permanent vers ce titre">¶</a></h2> -<p>Il existe 2 interfaces : une interface simplifiée et une interface experte.</p> -<p><strong>L’interface simplifiée</strong> <a class="reference internal" href="API.html#ui_PHYMOBATs_tab.Ui_PHYMOBAT" title="ui_PHYMOBATs_tab.Ui_PHYMOBAT"><code class="xref py py-func docutils literal"><span class="pre">ui_PHYMOBATs_tab.Ui_PHYMOBAT()</span></code></a> comme son nom l’indique est assez simple, elle est représentée sur une fenêtre et est très limitée au niveau des choix à faire (selection des types d’images, méthode de classification, choix des champs pour la classification finale, etc ...)</p> -<p><strong>L’interface experte</strong> <a class="reference internal" href="API.html#ui_PHYMOBATe_tab.Ui_PHYMOBAT" title="ui_PHYMOBATe_tab.Ui_PHYMOBAT"><code class="xref py py-func docutils literal"><span class="pre">ui_PHYMOBATe_tab.Ui_PHYMOBAT()</span></code></a> est plus complexe. Elle est composée de 3 sous-onglets qui permettent de dissocier les traitements (pré-traitements images, traitements vecteur et classification) mais également de choisir les méthodes de classification et le types d’images à utiliser.</p> -<p>Le passage d’une interface à une autre se fait à travers le sur-onglet Mode (référence 1 sur la figure ci-dessous). -Il y a 3 sur-onglets : Menu, Aide et Mode</p> -<ul class="simple"> -<li><strong>Menu</strong> : cet onglet est composé quant à lui de 3 fonctions (Ouvrir, Sauver, Quitter). -Les fonctions <code class="docutils literal"><span class="pre">Ouvrir</span></code> <a class="reference internal" href="API.html#PHYMOBAT.PHYMOBAT.open_backup" title="PHYMOBAT.PHYMOBAT.open_backup"><code class="xref py py-func docutils literal"><span class="pre">PHYMOBAT.PHYMOBAT.open_backup()</span></code></a> et <code class="docutils literal"><span class="pre">Sauver</span></code> <a class="reference internal" href="API.html#PHYMOBAT.PHYMOBAT.save_backup" title="PHYMOBAT.PHYMOBAT.save_backup"><code class="xref py py-func docutils literal"><span class="pre">PHYMOBAT.PHYMOBAT.save_backup()</span></code></a>. sont utilisées pour charger ou sauvegarder dans un fichier .xml les paramètres entrés dans chaque case de l’application. -La fonction <cite>Quitter</cite> <a class="reference internal" href="API.html#PHYMOBAT.PHYMOBAT.close_button" title="PHYMOBAT.PHYMOBAT.close_button"><code class="xref py py-func docutils literal"><span class="pre">PHYMOBAT.PHYMOBAT.close_button()</span></code></a>, ferme l’application.</li> -<li><strong>Aide</strong> : <code class="docutils literal"><span class="pre">Aide</span> <span class="pre">de</span> <span class="pre">PHYMOBAT</span></code> et <code class="docutils literal"><span class="pre">A</span> <span class="pre">propos</span> <span class="pre">de</span> <span class="pre">PHYMOBAT</span></code>. -La fonction <code class="docutils literal"><span class="pre">Aide</span> <span class="pre">de</span> <span class="pre">PHYMOBAT</span></code> <a class="reference internal" href="API.html#PHYMOBAT.PHYMOBAT.help_tools" title="PHYMOBAT.PHYMOBAT.help_tools"><code class="xref py py-func docutils literal"><span class="pre">PHYMOBAT.PHYMOBAT.help_tools()</span></code></a> ouvre une page HTML décrivant les méthodes de télédétection et les scripts utilisés (Pas à jour). -La fonction <code class="docutils literal"><span class="pre">A</span> <span class="pre">propos</span> <span class="pre">de</span> <span class="pre">PHYMOBAT</span></code> <a class="reference internal" href="API.html#PHYMOBAT.MyPopup_about" title="PHYMOBAT.MyPopup_about"><code class="xref py py-func docutils literal"><span class="pre">PHYMOBAT.MyPopup_about()</span></code></a> rappelle l’objectif de l’application et la licence utilisée.</li> -<li><strong>Mode</strong> : <code class="docutils literal"><span class="pre">Mode</span> <span class="pre">Simplifié</span></code> <a class="reference internal" href="API.html#PHYMOBAT.PHYMOBAT.mode_simpli" title="PHYMOBAT.PHYMOBAT.mode_simpli"><code class="xref py py-func docutils literal"><span class="pre">PHYMOBAT.PHYMOBAT.mode_simpli()</span></code></a> et <code class="docutils literal"><span class="pre">Mode</span> <span class="pre">Expert</span></code> <a class="reference internal" href="API.html#PHYMOBAT.PHYMOBAT.mode_expert" title="PHYMOBAT.PHYMOBAT.mode_expert"><code class="xref py py-func docutils literal"><span class="pre">PHYMOBAT.PHYMOBAT.mode_expert()</span></code></a>. -Ces deux modes sont basés sur le même algorithme. Par conséquent, bien paramétrés, le résultat de la carte finale est le même.</li> -</ul> -<div class="section" id="interface-simplifiee"> -<h3>Interface Simplifiée<a class="headerlink" href="#interface-simplifiee" title="Lien permanent vers ce titre">¶</a></h3> -<p>C’est l’interface par défaut. Elle s’ouverte en tapant dans la console :</p> -<div class="highlight-bash"><div class="highlight"><pre><span></span>$ python PHYMOBAT.py -</pre></div> -</div> -<p>Elle est présenté sous cette forme :</p> -<div class="figure align-center"> -<img alt="APIs" src="_images/APIs_0.png" /> -</div> -<p>1 - Sur-onglets : <strong>Menu</strong>, <strong>Aide</strong> et <strong>Mode</strong></p> -<p>2 - <strong>Chemin du dossier principal</strong> : Chemin d’accès au dossier où sont stockées toutes les données en entrée mais également toutes les données en sortie de l’application.</p> -<p>3 - <strong>Période ou année des images</strong> : Intervalles de dates des images à télécharger et à traiter.</p> -<p>L’intervalle doit être sous cette forme <em>AAAA-MM-DD,AAAA-MM-DD</em> où A -> Année (2015), M -> Mois (05) et D -> Jour (25). -Pour plusieurs intervalles, par exemple deux (Séparer par un point virgule) : <em>AAAA-MM-DD,AAAA-MM-DD;AAAA-MM-DD,AAAA-MM-DD</em>. -Pour une année complète : <em>AAAA</em></p> -<p>4 - <strong>Emprise de la zone</strong> : Chemin d’accès au shapefile correspondant à la zone d’emprise sur laquelle le traitement sera lancé.</p> -<p>5 - <strong>Identifiant Theia</strong> : Pour télécharger les images Landsat8 sur la plateforme Theia, il faut d’abord s’inscrire sur le site : <a class="reference external" href="https://theia-landsat.cnes.fr/rocket/#/home">https://theia-landsat.cnes.fr/rocket/#/home</a>. Puis entrer le nom d’utilisateur et le mot de passe enregistré sur Theia-land dans l’application. Il y a également un bouton <code class="docutils literal"><span class="pre">Proxy</span></code> <a class="reference internal" href="API.html#ui_Proxy_window.Ui_Proxy_window" title="ui_Proxy_window.Ui_Proxy_window"><code class="xref py py-func docutils literal"><span class="pre">ui_Proxy_window.Ui_Proxy_window()</span></code></a> qui permet de rentrer les informations concernant un eventuel <strong>Proxy</strong>.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Dès que les images ont été téléchargées, l’outil ne les téléchargeront pas à nouveau.</p> -</div> -<p>6 - <strong>BD Alti</strong> (Facultatif) : Chemin d’accès à la BD Alti. Calcul de pentes (+PHYMOBAT 1.1) <a class="reference internal" href="package.html#Slope.Slope" title="Slope.Slope"><code class="xref py py-func docutils literal"><span class="pre">Slope.Slope()</span></code></a>.</p> -<p>7 - <strong>Images THRS</strong> : Chemin d’accès à l’orthographie IRC à 2m de résolution spatiale en GeoTiff. Les orthographies IRC sont distribuées par l’IGN par tuile, en ECW et à 50cm de résolution spatiale. Par conséquent, en utilisant les outils de GDAL (gdalbuildvrt, gdal_translate, gdalwarp), il faut fusionner toutes les tuiles , convertir la mosaïque finale en TIF et la dégrader à 2m de résolution spatiale (<a class="reference external" href="https://github.com/SylvioL/MosaiqueIRC.git">https://github.com/SylvioL/MosaiqueIRC.git</a>).</p> -<p>8 - <strong>Segmentation</strong> : Chemin d’accès au shapefile correspondant à la segmentation IGN.</p> -<p>9 - <strong>Echantillons RPG</strong> : Chemin d’accès au shapefile correspondant aux surfaces des îlots culturaux du RPG. Ces polygones représentent les échantillons de la végétation non naturelle (Cultures) et semi naturelle (Prairies permanentes).</p> -<p>10 - <strong>Champs</strong> : Le nom des champs où sont stockées les classes correspondantes aux grandes classes de la végétation→ Non naturelle / Semi-naturelle.</p> -<p>11 - <strong>Classes</strong> : Les classes Non naturelles (1, 2, 3, 4, ... etc) et la classe semi naturelle (18).</p> -<p>12 - <strong>Nbre de polygones</strong> : Nombre d’échantillons à extraire du shapefile surfaces RPG pour lancer l’entraînement du classifieur et valider la classification.</p> -<p>13 - <strong>Echantillons Herbacés / Ligneux</strong> : Chemin d’accès au shapefile où sont stockés les échantillons d’herbacés et de ligneux. -Même utilisation que pour les références 9, 10, 11, il faut entrer le nom des champs où sont les classes, écrire les classes et le nombres de polygones à utiliser.</p> -<p>14 - <strong>Echantillons Ligneux denses</strong> / Ligneux mixtes : Chemin d’accès au shapefile où sont stockés les échantillons de ligneux. -Même utilisation que pour les références 9, 10, 11, il faut entrer le nom des champs où sont les classes, écrire les classes et le nombres de polygones à utiliser.</p> -<p>15 - <strong>Fichier de sortie</strong> : Chemin où sera stocké le résultat final (shapefile) en sortie de PHYMOBAT.</p> -<p>16 - Lancement des traitements (OK), ou fermer l’application (Close).</p> -<p>17 - <strong>Multi-proccessing</strong> : Sélectionné par défaut. Il permet d’accélérer le calcul des traitements en utilisant plusieurs processeurs. A décocher <strong>si la machine ne possède pas minimum 12Go de mémoire vive</strong>.</p> -<div class="section" id="exemple-sur-un-jeu-de-donnees-test"> -<h4>Exemple sur un jeu de données test<a class="headerlink" href="#exemple-sur-un-jeu-de-donnees-test" title="Lien permanent vers ce titre">¶</a></h4> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Jeu de données test à demander à <a class="reference external" href="mailto:samuel.alleaume%40irstea.fr">samuel<span>.</span>alleaume<span>@</span>irstea<span>.</span>fr</a></p> -</div> -<p>L’image ci-dessous indique ce qu’il faut mettre dans chaque champs de l’application pour un jeu de données test bien précis. Il suffit juste de remplacer ‘/media/laventure/DATA/EclipseFolder/CarHab_v2/Cher18_small_zone_test’ par l’arborescence où se trouve le jeu de données test sur votre machine.</p> -<p>Bien entendu il faut, comme indiqué dans la référence 5, avoir vos propres identifiants Theia (Utilisateur et mot de passe).</p> -<p>Pour les classes de cultures (Non-naturelles) du RPG qui ne sont pas bien visible sur l’image : 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 20, 21, 24</p> -<p>Tous ces éléments sont également enregistrés dans le fichier “Save_test.xml” du dossier “data_test”.</p> -<div class="figure align-center"> -<img alt="APIs_fill" src="_images/APIs_01.png" /> -</div> -</div> -</div> -<div class="section" id="interface-experte"> -<h3>Interface experte<a class="headerlink" href="#interface-experte" title="Lien permanent vers ce titre">¶</a></h3> -<p>Pour ouvrir l’interface experte : Sur-onglet <em>Mode > Mode expert</em></p> -<div class="figure align-center"> -<img alt="APIe" src="_images/API_0.png" /> -</div> -<p>Cette interface est composé de trois onglets :</p> -<ul class="simple"> -<li>Traitement des images</li> -<li>Traitement des échantillons</li> -<li>Traitement de classification</li> -</ul> -<p>Chaque onglet représente les parties du processus algorithmique décrit plus haut.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Les traitements sont lancés en appuyant sur le bouton “OK” et si au moins une “check box” associée à chaque onglets et fonction est cochée. Si aucune “check box” n’est cochée, aucun traitement ne sera lancé.</p> -</div> -<p>Cette présentation d’API se compose suivant les trois onglets.</p> -</div> -<div class="section" id="interface-du-traitement-des-images"> -<h3>Interface du traitement des images<a class="headerlink" href="#interface-du-traitement-des-images" title="Lien permanent vers ce titre">¶</a></h3> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Cet onglet est indépendant des autres onglets.</p> -</div> -<p>Les références en rouge sur les images suivantes sont les mêmes que celles qui ont été présentées sur l’interface simplifiée.</p> -<div class="figure align-center"> -<img alt="APIe_empty" src="_images/API.png" /> -</div> -<p>Au numéro 18, le choix du <strong>capteur des images à télécharger</strong> (Landsat, Sentinel 2 et Spot Word Heritage)</p> -<p>Dans cet onglet il y a cinq traitements qui peuvent être lancés :</p> -<ol class="arabic simple" start="19"> -<li><strong>Images disponibles</strong> : Cherche le nombre d’images disponibles sur la plate-forme Theia et l’inscrit à la palce du zéro en face.</li> -<li><strong>Télécharger</strong> : Télécharge les images à partir de la plate-forme Theia. Pour cela, il faut obligatoirement remplir dans les lignes d’édition en-dessous correspondant aux identifiants Theia (Utilisateur et mot de passe).</li> -<li><strong>Traitement des images</strong> : Traitement des images satellites (mosaïque des images, calculs des indices spectraux, ...)</li> -</ol> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Pour <strong>BD Alti</strong> et <strong>Image THRS</strong> : Pour que le traitement soit réalisé, il faut absolument que ces cases soient cochées.</p> -</div> -<div class="admonition warning"> -<p class="first admonition-title">Avertissement</p> -<p class="last">Avant de lancer un traitement, il faut absolument renseigner toutes les premières lignes d’édition et sélectionner un <em>capteur</em>.</p> -</div> -<div class="figure align-center"> -<img alt="APIe_used" src="_images/API_01.png" /> -</div> -</div> -<div class="section" id="interface-du-traitement-des-echantillons"> -<h3>Interface du traitement des échantillons<a class="headerlink" href="#interface-du-traitement-des-echantillons" title="Lien permanent vers ce titre">¶</a></h3> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Cet onglet peut être indépendant des autres onglets. Il faut cocher la “check box” <strong>Image échantillonnée</strong> (22) pour signaler au processus que les traitements du premier onglet n’ont pas été lancés. Ainsi renseigner le raster associé aux échantillons dans la ligne d’édition en-dessous.</p> -</div> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Même si cet onglet peut être indépendant des autres onglets, il faut malgré tout renseigner l’<strong>emprise de la zone</strong> du premier onglet “Traitement des images”.</p> -</div> -<div class="figure align-center"> -<img alt="API 2" src="_images/API_20.png" /> -</div> -<p>Dans cet onglet il y a trois “check box” dont deux correspondent à des fonctions de traitement :</p> -<ol class="arabic simple" start="23"> -<li><strong>RPG</strong> : Création du shapefile RPG mono-cultural <a class="reference internal" href="API.html#Processing.Processing.i_vhrs" title="Processing.Processing.i_vhrs"><code class="xref py py-func docutils literal"><span class="pre">Processing.Processing.i_vhrs()</span></code></a>.</li> -</ol> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Ce traitement est lancé en appuyant sur le bouton “Ajouter”.</p> -</div> -<ol class="arabic simple" start="24"> -<li><strong>Déterminer les seuils optimaux</strong> : Calcul des seuils optimaux par paire de classes <a class="reference internal" href="package.html#Seath.Seath.separability_and_threshold" title="Seath.Seath.separability_and_threshold"><code class="xref py py-func docutils literal"><span class="pre">Seath.Seath.separability_and_threshold()</span></code></a>. Ce traitement est activé en appuyant sur “OK”.</li> -</ol> -<p>Cette dernière fonction est l’objectif principal de cet onglet. Il faut ajouter à la chaîne de traitement, les échantillons associés aux paires de classes. Les deux exemples suivants montrent la démarche à suivre pour remplir les champs associés aux échantillons.</p> -<p><strong>Exemple pour la classe 1</strong>, Végétation non naturelle (cultures) / Semi-naturelle :</p> -<div class="figure align-center"> -<img alt="API 2" src="_images/API_threshold.png" /> -</div> -<p>L’échantillon est un fichier RPG, il faut cocher la case RPG et entrer le nom du fichier, les classes à extraire (si il y en a plusieurs, les séparer d’une virgule), les champs associés aux classes et le nombre de polygones à extraire.</p> -<p>En appuyant sur “Ajouter”, une vérification des données entrées peut être éffectuée comme indiqué ci-dessous :</p> -<div class="figure align-center"> -<img alt="API 2" src="_images/API_threshold_ajout.png" /> -</div> -<p><strong>Exemple pour la classe 2</strong>, Herbacés / Ligneux :</p> -<p>Ce fichier n’est pas un fichier RPG, la case RPG reste décoché.</p> -<div class="figure align-center"> -<img alt="API 2" src="_images/API_threshold_1.png" /> -</div> -<div class="figure align-center"> -<img alt="API 2" src="_images/API_threshold_2.png" /> -</div> -<p>Le bouton <strong>Effacer</strong>, efface toutes les informations entrées par l’utilisateur.</p> -</div> -<div class="section" id="interface-du-traitement-de-classification"> -<h3>Interface du traitement de classification<a class="headerlink" href="#interface-du-traitement-de-classification" title="Lien permanent vers ce titre">¶</a></h3> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Cet onglet est dépendant des deux autres. Au préalable, il faut obligatoirement lancer tous les traitements précédents.</p> -</div> -<div class="figure align-center"> -<img alt="API 2" src="_images/API_class.png" /> -</div> -<p>Le seul traitement qui sera lancé dans cet onglet est le processus de classification <a class="reference internal" href="API.html#Processing.Processing.i_classifier_s" title="Processing.Processing.i_classifier_s"><code class="xref py py-func docutils literal"><span class="pre">Processing.Processing.i_classifier_s()</span></code></a> ou <a class="reference internal" href="API.html#Processing.Processing.i_classifier_rf" title="Processing.Processing.i_classifier_rf"><code class="xref py py-func docutils literal"><span class="pre">Processing.Processing.i_classifier_rf()</span></code></a>.</p> -<p>Un fichier shapefile sera crée à l’emplacement indiqué par l’utilisateur, <strong>fichier de sortie (15)</strong>. Il dépend du shapefile en entrée issue de la <strong>segmentation (8)</strong> IGN.</p> -<p>Il y a un choix entre deux <strong>méthodes de classification (25)</strong> : Random Forest (Plus long en calcul) et Seath.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Avec la méthode du Random Forest, la classification se fait directement sur les trois niveaux contrairement à la méthode Seath qui peut se faire sur un, deux ou trois niveaux de classe.</p> -</div> -<p>Pour activer les niveaux d’extraction, il faut cocher les cases associées. L’utilisateur peut personnaliser les champs des entités de sortie comme ceci :</p> -<p>26-1 - <strong>Pour extraire que le premier niveau (Seath)</strong></p> -<div class="figure align-center"> -<img alt="API 2" src="_images/API_class_10.png" /> -</div> -<p>26-2 - <strong>Pour extraire les deux premiers niveaux (Seath)</strong></p> -<div class="figure align-center"> -<img alt="API 2" src="_images/API_class_11.png" /> -</div> -<p>26-3 - <strong>Pour extraire tous les niveaux (RF et Seath)</strong></p> -<div class="figure align-center"> -<img alt="API 2" src="_images/API_class_12.png" /> -</div> -<p>Où :</p> -<ul class="simple"> -<li>ID : Identifiant unique</li> -<li>AREA : Superficie du polygone en ha</li> -<li>NIVEAU_1 : Non végétation semi-naturelle / Semi-naturelle</li> -<li>NIVEAU_2 : Eboulis / Agriculture | Herbacés / Ligneux</li> -<li>NIVEAU_3 : Lingeux denses / mixtes et Phytomasse faible / moyenne / forte</li> -<li>POURC : Densité de ligneux et de phytomasse</li> -</ul> -<p>Les listes déroulantes indiquent la nature des champs, il y a deux choix :</p> -<ul class="simple"> -<li>String = Chaîne de caractères</li> -<li>Real = Chiffre réel</li> -</ul> -</div> -</div> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> - <div class="sphinxsidebarwrapper"> - <h3><a href="PHYMOBAT_documentation.html">Table des Matières</a></h3> - <ul> -<li><a class="reference internal" href="#">Processus utilisées et tutoriels API</a><ul> -<li><a class="reference internal" href="#processus-algorithmiques-utilisees">Processus algorithmiques utilisées</a><ul> -<li><a class="reference internal" href="#traitement-des-images">Traitement des images</a><ul> -<li><a class="reference internal" href="#listing-et-telechargements-des-images-sur-la-plate-forme-theia">1. Listing et téléchargements des images sur la plate-forme Theia</a></li> -<li><a class="reference internal" href="#traitements-des-images-telechargees">2. Traitements des images téléchargées</a></li> -<li><a class="reference internal" href="#traitements-des-images-thrs">3. Traitements des images THRS</a></li> -</ul> -</li> -<li><a class="reference internal" href="#traitements-des-echantillons">Traitements des échantillons</a><ul> -<li><a class="reference internal" href="#modele-seath">1. Modèle Seath</a></li> -<li><a class="reference internal" href="#moldele-random-forest-rf">2. Moldèle Random Forest (RF)</a></li> -</ul> -</li> -<li><a class="reference internal" href="#traitements-de-classification">Traitements de classification</a></li> -</ul> -</li> -<li><a class="reference internal" href="#tutoriels-interface">Tutoriels interface</a><ul> -<li><a class="reference internal" href="#interface-simplifiee">Interface Simplifiée</a><ul> -<li><a class="reference internal" href="#exemple-sur-un-jeu-de-donnees-test">Exemple sur un jeu de données test</a></li> -</ul> -</li> -<li><a class="reference internal" href="#interface-experte">Interface experte</a></li> -<li><a class="reference internal" href="#interface-du-traitement-des-images">Interface du traitement des images</a></li> -<li><a class="reference internal" href="#interface-du-traitement-des-echantillons">Interface du traitement des échantillons</a></li> -<li><a class="reference internal" href="#interface-du-traitement-de-classification">Interface du traitement de classification</a></li> -</ul> -</li> -</ul> -</li> -</ul> - - <h4>Sujet précédent</h4> - <p class="topless"><a href="install.html" - title="Chapitre précédent">Installation</a></p> - <h4>Sujet suivant</h4> - <p class="topless"><a href="package.html" - title="Chapitre suivant">CarHab Phy MOBA package</a></p> - <div role="note" aria-label="source link"> - <h3>Cette page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/methode_tuto.rst.txt" - rel="nofollow">Montrer le code source</a></li> - </ul> - </div> -<div id="searchbox" style="display: none" role="search"> - <h3>Recherche rapide</h3> - <form class="search" action="search.html" method="get"> - <div><input type="text" name="q" /></div> - <div><input type="submit" value="Go" /></div> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="Index général" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Index des modules Python" - >modules</a> |</li> - <li class="right" > - <a href="package.html" title="CarHab Phy MOBA package" - >suivant</a> |</li> - <li class="right" > - <a href="install.html" title="Installation" - >précédent</a> |</li> - <li class="nav-item nav-item-0"><a href="PHYMOBAT_documentation.html">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - <div class="footer" role="contentinfo"> - © Copyright 2017, LAVENTURE Sylvio (UMR TETIS/IRSTEA). - Créé avec <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.3. - </div> - </body> -</html> \ No newline at end of file diff --git a/Documentation/objects.inv b/Documentation/objects.inv deleted file mode 100644 index 8de2f92d944aff4cbf2931aed77e35daf07ca06f..0000000000000000000000000000000000000000 Binary files a/Documentation/objects.inv and /dev/null differ diff --git a/Documentation/package.html b/Documentation/package.html deleted file mode 100644 index 11d226aa9fecacf8d19c7af77f6727f65408d159..0000000000000000000000000000000000000000 --- a/Documentation/package.html +++ /dev/null @@ -1,1075 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - -<html xmlns="http://www.w3.org/1999/xhtml" lang="fr"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>CarHab Phy MOBA package — documentation PHYMOBAT 3.0</title> - - <link rel="stylesheet" href="_static/classic.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: './', - VERSION: '3.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true, - SOURCELINK_SUFFIX: '.txt' - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/translations.js"></script> - <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> - <link rel="index" title="Index" href="genindex.html" /> - <link rel="search" title="Recherche" href="search.html" /> - <link rel="next" title="Graphical User Interface package" href="API.html" /> - <link rel="prev" title="Processus utilisées et tutoriels API" href="methode_tuto.html" /> - </head> - <body role="document"> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="Index général" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Index des modules Python" - >modules</a> |</li> - <li class="right" > - <a href="API.html" title="Graphical User Interface package" - accesskey="N">suivant</a> |</li> - <li class="right" > - <a href="methode_tuto.html" title="Processus utilisées et tutoriels API" - accesskey="P">précédent</a> |</li> - <li class="nav-item nav-item-0"><a href="PHYMOBAT_documentation.html">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body" role="main"> - - <div class="section" id="carhab-phy-moba-package"> -<h1>CarHab Phy MOBA package<a class="headerlink" href="#carhab-phy-moba-package" title="Lien permanent vers ce titre">¶</a></h1> -<p>The class diagram associated to the processing is this :</p> -<div class="figure align-center"> -<img alt="Class diagram" src="_images/ChainedeTraitementCarHab_UML_v2.png" /> -</div> -<div class="section" id="image-processing"> -<h2>Image processing<a class="headerlink" href="#image-processing" title="Lien permanent vers ce titre">¶</a></h2> -<div class="section" id="module-Archive"> -<span id="archive"></span><h3>Archive<a class="headerlink" href="#module-Archive" title="Lien permanent vers ce titre">¶</a></h3> -<dl class="class"> -<dt id="Archive.Archive"> -<em class="property">class </em><code class="descclassname">Archive.</code><code class="descname">Archive</code><span class="sig-paren">(</span><em>captor</em>, <em>list_year</em>, <em>box</em>, <em>folder</em>, <em>repertory</em>, <em>proxy_enabled</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Archive.html#Archive"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Archive.Archive" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Class to list, download and unpack Theia image archive because of a shapefile (box). -This shapefile get extent of the area.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>captor</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – <p>Name of the satellite (ex: Landsat or SpotWorldHeritage ...).</p> -<p>Name used to the url on website Theia Land</p> -</li> -<li><strong>list_year</strong> (<em>list of str</em>) – Processing’s year (string for one year)</li> -<li><strong>box</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Path of the study area</li> -<li><strong>folder</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Path of the source folder</li> -<li><strong>repertory</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Name of the archive’s folder</li> -</ul> -</td> -</tr> -</tbody> -</table> -<dl class="method"> -<dt id="Archive.Archive.coord_box_dd"> -<code class="descname">coord_box_dd</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Archive.html#Archive.coord_box_dd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Archive.Archive.coord_box_dd" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to get area’s coordinates of shapefile</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Retourne:</th><td class="field-body">str – <strong>area_coord_corner</strong> : Area coordinates corner<p>–> Left bottom on x, Left bottom on y, Right top on x, Right top on y</p> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Example:</th><td class="field-body"></td> -</tr> -</tbody> -</table> -<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">Archive</span> -<span class="gp">>>> </span><span class="n">test</span> <span class="o">=</span> <span class="n">Archive</span><span class="p">(</span><span class="n">captor</span><span class="p">,</span> <span class="n">list_year</span><span class="p">,</span> <span class="n">box</span><span class="p">,</span> <span class="n">folder</span><span class="p">,</span> <span class="n">repertory</span><span class="p">,</span> <span class="n">proxy_enabled</span><span class="p">)</span> -<span class="gp">>>> </span><span class="n">coor_test</span> <span class="o">=</span> <span class="n">test</span><span class="o">.</span><span class="n">coord_box_dd</span><span class="p">()</span> -<span class="gp">>>> </span><span class="n">coor_test</span> -<span class="go">'45.52, 2.25, 46.71, 3.27'</span> -</pre></div> -</div> -</dd></dl> - -<dl class="method"> -<dt id="Archive.Archive.decompress"> -<code class="descname">decompress</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Archive.html#Archive.decompress"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Archive.Archive.decompress" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to unpack archives and store informations of the images (date, path, ...)</p> -</dd></dl> - -<dl class="method"> -<dt id="Archive.Archive.download_auto"> -<code class="descname">download_auto</code><span class="sig-paren">(</span><em>user_theia</em>, <em>password_theia</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Archive.html#Archive.download_auto"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Archive.Archive.download_auto" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to download images archive automatically on Theia land data center. -Source : <a class="reference external" href="https://github.com/olivierhagolle/theia_download">https://github.com/olivierhagolle/theia_download</a></p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>user_theia</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Username Theia Land data center</li> -<li><strong>password_theia</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Password Theia Land data center</li> -</ul> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="Archive.Archive.listing"> -<code class="descname">listing</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Archive.html#Archive.listing"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Archive.Archive.listing" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to list available archive on plateform Theia Land, and on the area</p> -</dd></dl> - -<dl class="method"> -<dt id="Archive.Archive.set_list_archive_to_try"> -<code class="descname">set_list_archive_to_try</code><span class="sig-paren">(</span><em>few_list_archive</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Archive.html#Archive.set_list_archive_to_try"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Archive.Archive.set_list_archive_to_try" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Test function to download a few archives</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><strong>few_list_archive</strong> (<em>list dimension 2</em>) – <p>[archive_download, out_archive]</p> -<p>with :</p> -<ul class="simple"> -<li>archive_dowload : Archives downloaded</li> -<li>out_archive : Output archives path</li> -</ul> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="Archive.Archive.utm_to_latlng"> -<code class="descname">utm_to_latlng</code><span class="sig-paren">(</span><em>zone</em>, <em>easting</em>, <em>northing</em>, <em>northernHemisphere=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Archive.html#Archive.utm_to_latlng"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Archive.Archive.utm_to_latlng" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to convert UTM to geographic coordinates</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first simple"> -<li><strong>zone</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#int" title="(disponible dans Python v2.7)"><em>int</em></a>) – UTM zone</li> -<li><strong>easting</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#float" title="(disponible dans Python v2.7)"><em>float</em></a>) – Coordinates UTM in x</li> -<li><strong>northing</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#float" title="(disponible dans Python v2.7)"><em>float</em></a>) – Coordinates UTM in y</li> -<li><strong>northernHemisphere</strong> (<em>boolean</em>) – North hemisphere or not</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Retourne:</th><td class="field-body"><p class="first last">tuple – integer on the <strong>longitude</strong> and <strong>latitude</strong></p> -</td> -</tr> -</tbody> -</table> -<p>Source : <a class="reference external" href="http://www.ibm.com/developerworks/java/library/j-coordconvert/index.html">http://www.ibm.com/developerworks/java/library/j-coordconvert/index.html</a></p> -</dd></dl> - -</dd></dl> - -</div> -<div class="section" id="landsat-image-processing"> -<h3>Landsat image processing<a class="headerlink" href="#landsat-image-processing" title="Lien permanent vers ce titre">¶</a></h3> -<span class="target" id="module-RasterSat_by_date"></span><dl class="class"> -<dt id="RasterSat_by_date.RasterSat_by_date"> -<em class="property">class </em><code class="descclassname">RasterSat_by_date.</code><code class="descname">RasterSat_by_date</code><span class="sig-paren">(</span><em>class_archive</em>, <em>big_folder</em>, <em>one_date</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/RasterSat_by_date.html#RasterSat_by_date"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#RasterSat_by_date.RasterSat_by_date" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Satellite image processing’s class. This class include several processes to group images by date, mosaic images by date, -extract images information, compute ndvi, compute cloud pourcent and create new rasters.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>class_archive</strong> (<em>class</em>) – Archive class name with every information on downloaded images</li> -<li><strong>big_folder</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Image processing folder</li> -<li><strong>one_date</strong> (<em>list of str</em>) – [year, month, day] ... -This variable is modified in the function <a class="reference internal" href="#RasterSat_by_date.RasterSat_by_date.mosaic_by_date" title="RasterSat_by_date.RasterSat_by_date.mosaic_by_date"><code class="xref py py-func docutils literal"><span class="pre">mosaic_by_date()</span></code></a>. -To append mosaic image path, mosaic cloud image path, cloud pixel value table, mosaic ndvi image path and ndvi pixel value table.</li> -<li><strong>choice_nb_b</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#int" title="(disponible dans Python v2.7)"><em>int</em></a>) – A option to choice output image number of band <code class="xref py py-func docutils literal"><span class="pre">layer_rasterization()</span></code> in Vector’s class. If this option is 0, it take input band. By default 0.</li> -</ul> -</td> -</tr> -</tbody> -</table> -<dl class="method"> -<dt id="RasterSat_by_date.RasterSat_by_date.calcul_ndvi"> -<code class="descname">calcul_ndvi</code><span class="sig-paren">(</span><em>img_spec</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/RasterSat_by_date.html#RasterSat_by_date.calcul_ndvi"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#RasterSat_by_date.RasterSat_by_date.calcul_ndvi" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Computer NDVI index for a Landsat image.</p> -<p>NDVI = band4 - band3 / band4 + band3 with nb_captor = 0</p> -<p>or for Sentinel 2 image (2A) : NDVI = band3 - band2 / band3 + band2 with nb_captor = -1</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><strong>img_spec</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Spectral image path</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="RasterSat_by_date.RasterSat_by_date.complete_raster"> -<code class="descname">complete_raster</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/RasterSat_by_date.html#RasterSat_by_date.complete_raster"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#RasterSat_by_date.RasterSat_by_date.complete_raster" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>This function complete the function above <a class="reference internal" href="#RasterSat_by_date.RasterSat_by_date.create_raster" title="RasterSat_by_date.RasterSat_by_date.create_raster"><code class="xref py py-func docutils literal"><span class="pre">create_raster()</span></code></a>. It -fills the raster table and close the layer.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>out_ds</strong> (<em>gdal pointer</em>) – Raster out information</li> -<li><strong>nbband</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#int" title="(disponible dans Python v2.7)"><em>int</em></a>) – Band number of the out layer</li> -<li><strong>e</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#int" title="(disponible dans Python v2.7)"><em>int</em></a>) – Index to know if the raster existed. If it didn’t exist e = 0.</li> -<li><strong>data</strong> (<em>numpy.array</em>) – Pixel value matrix. Matrix size equal to that of a raster.</li> -</ul> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="RasterSat_by_date.RasterSat_by_date.create_raster"> -<code class="descname">create_raster</code><span class="sig-paren">(</span><em>out_raster</em>, <em>data</em>, <em>in_ds</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/RasterSat_by_date.html#RasterSat_by_date.create_raster"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#RasterSat_by_date.RasterSat_by_date.create_raster" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Create a raster empty with the input raster property</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first simple"> -<li><strong>out_raster</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Output image path</li> -<li><strong>data</strong> (<em>numpy.array</em>) – Pixel value matrix. Matrix size equal to that of a raster.</li> -<li><strong>in_ds</strong> (<em>gdal pointer</em>) – Raster information</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Retourne:</th><td class="field-body"><p class="first last"><p>gdal pointer – variable <strong>out_ds</strong>, Raster out information.</p> -<p>int – variable <strong>nbband</strong>, Band number of the out layer.</p> -<p>int – variable <strong>e</strong>, Index to know if the raster exists. If it doesn’t exists e = 0 else e = 1 (by default).</p> -</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="RasterSat_by_date.RasterSat_by_date.group_by_date"> -<code class="descname">group_by_date</code><span class="sig-paren">(</span><em>d_uni</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/RasterSat_by_date.html#RasterSat_by_date.group_by_date"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#RasterSat_by_date.RasterSat_by_date.group_by_date" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to extract images on a single date</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><strong>d_uni</strong> (<em>list of str</em>) – [year, month, day]</td> -</tr> -<tr class="field-even field"><th class="field-name">Retourne:</th><td class="field-body">list of str – variable <strong>group</strong> = [year, month, day, multispectral image path, cloud image path]</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="RasterSat_by_date.RasterSat_by_date.mosaic_by_date"> -<code class="descname">mosaic_by_date</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/RasterSat_by_date.html#RasterSat_by_date.mosaic_by_date"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#RasterSat_by_date.RasterSat_by_date.mosaic_by_date" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to merge images of the same date in a image group <a class="reference internal" href="#RasterSat_by_date.RasterSat_by_date.group_by_date" title="RasterSat_by_date.RasterSat_by_date.group_by_date"><code class="xref py py-func docutils literal"><span class="pre">group_by_date()</span></code></a>.</p> -</dd></dl> - -<dl class="method"> -<dt id="RasterSat_by_date.RasterSat_by_date.pourc_cloud"> -<code class="descname">pourc_cloud</code><span class="sig-paren">(</span><em>img_spec</em>, <em>img_cloud</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/RasterSat_by_date.html#RasterSat_by_date.pourc_cloud"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#RasterSat_by_date.RasterSat_by_date.pourc_cloud" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Return clear pixel percentage on the image <strong>img_spec</strong> because of a cloud image <strong>img_cloud</strong>.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first simple"> -<li><strong>img_spec</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Spectral image path</li> -<li><strong>img_cloud</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Cloud image path</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Retourne:</th><td class="field-body"><p class="first">float – variable <strong>nb0</strong>, clear pixel percentage.</p> -</td> -</tr> -<tr class="field-odd field"><th class="field-name">Example:</th><td class="field-body"></td> -</tr> -</tbody> -</table> -<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">RasterSat_by_date</span> -<span class="gp">>>> </span><span class="n">Landsat_test</span> <span class="o">=</span> <span class="n">RasterSat_by_date</span><span class="p">(</span><span class="n">class_archive</span><span class="p">,</span> <span class="n">big_folder</span><span class="p">,</span> <span class="n">one_date</span><span class="p">)</span> -<span class="gp">>>> </span><span class="n">nb0_test</span> <span class="o">=</span> <span class="n">Landsat_test</span><span class="o">.</span><span class="n">pourc_cloud</span><span class="p">(</span><span class="n">Landsat_test</span><span class="o">.</span><span class="n">_one_date</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="n">Landsat_test</span><span class="o">.</span><span class="n">_one_date</span><span class="p">[</span><span class="mi">4</span><span class="p">])</span> -<span class="gp">>>> </span><span class="n">nb0_test</span> -<span class="go">98</span> -</pre></div> -</div> -</dd></dl> - -<dl class="method"> -<dt id="RasterSat_by_date.RasterSat_by_date.raster_data"> -<code class="descname">raster_data</code><span class="sig-paren">(</span><em>img</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/RasterSat_by_date.html#RasterSat_by_date.raster_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#RasterSat_by_date.RasterSat_by_date.raster_data" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to extract raster information. -Return table of pixel values and raster information like line number, pixel size, ... (gdal pointer)</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><strong>img</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Raster path</td> -</tr> -<tr class="field-even field"><th class="field-name">Retourne:</th><td class="field-body">numpy.array – variable <strong>data</strong>, Pixel value matrix of a raster.<p>gdal pointer – variable <strong>_in_ds</strong>, Raster information.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="RasterSat_by_date.RasterSat_by_date.vrt_translate_gdal"> -<code class="descname">vrt_translate_gdal</code><span class="sig-paren">(</span><em>vrt_translate</em>, <em>src_data</em>, <em>dst_data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/RasterSat_by_date.html#RasterSat_by_date.vrt_translate_gdal"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#RasterSat_by_date.RasterSat_by_date.vrt_translate_gdal" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to launch gdal tools in command line. With <code class="docutils literal"><span class="pre">gdalbuildvrt</span></code> and <code class="docutils literal"><span class="pre">gdal_translate</span></code>. -This function is used <a class="reference internal" href="#RasterSat_by_date.RasterSat_by_date.mosaic_by_date" title="RasterSat_by_date.RasterSat_by_date.mosaic_by_date"><code class="xref py py-func docutils literal"><span class="pre">mosaic_by_date()</span></code></a> to mosaic image by date.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>vrt_translate</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – <code class="docutils literal"><span class="pre">vrt</span></code> or <code class="docutils literal"><span class="pre">translate</span></code></li> -<li><strong>src_data</strong> (list (process <code class="docutils literal"><span class="pre">vrt</span></code>) or str (process <code class="docutils literal"><span class="pre">translate</span></code>)) – Data source. Several data for vrt process and one data (vrt data) for gdal_translate</li> -<li><strong>dst_data</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Output path</li> -</ul> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -</div> -<div class="section" id="module-Vhrs"> -<span id="texture-index-processing"></span><h3>Texture index processing<a class="headerlink" href="#module-Vhrs" title="Lien permanent vers ce titre">¶</a></h3> -<dl class="class"> -<dt id="Vhrs.Vhrs"> -<em class="property">class </em><code class="descclassname">Vhrs.</code><code class="descname">Vhrs</code><span class="sig-paren">(</span><em>imag</em>, <em>mp</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Vhrs.html#Vhrs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Vhrs.Vhrs" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Class to compute Haralick and SFS textures because of OTB application in command line</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>imag</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – The input image path to compute texture image</li> -<li><strong>out_sfs/out_haralick</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Output path</li> -<li><strong>mp</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#int" title="(disponible dans Python v2.7)"><em>int</em></a>) – <p>Boolean variable -> 0 or 1.</p> -<ul> -<li>0 means, not multi-processing</li> -<li>1 means, launch process with multi-processing</li> -</ul> -</li> -</ul> -</td> -</tr> -</tbody> -</table> -<dl class="method"> -<dt id="Vhrs.Vhrs.haralick_texture_extraction"> -<code class="descname">haralick_texture_extraction</code><span class="sig-paren">(</span><em>texture_choice</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Vhrs.html#Vhrs.haralick_texture_extraction"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Vhrs.Vhrs.haralick_texture_extraction" title="Lien permanent vers cette définition">¶</a></dt> -<dd><dl class="docutils"> -<dt>Function to compute Haralick texture image with OTB command line.</dt> -<dd><table class="first docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Example:</th><td class="field-body">otbcli_HaralickTextureExtraction -in qb_RoadExtract.tif -channel 2 -parameters.xrad 3 -parameters.yrad 3 -texture simple -out HaralickTextures.tif</td> -</tr> -</tbody> -</table> -<ul class="simple"> -<li><dl class="first docutils"> -<dt>OTB help :</dt> -<dd><ul class="first last"> -<li>in : Input Image</li> -<li>channel : Selected Channel</li> -<li><dl class="first docutils"> -<dt>Texture feature parameters <span class="classifier-delimiter">:</span> <span class="classifier">This group of parameters allows to define texture parameters.</span></dt> -<dd><ul class="first last"> -<li>X Radius : X Radius</li> -<li>Y Radius : Y Radius</li> -<li>X Offset : X Offset</li> -<li>Y Offset : Y Offset</li> -</ul> -</dd> -</dl> -</li> -<li>Image Minimum : Image Minimum</li> -<li>Image Maximum : Image Maximum</li> -<li>Histogram number of bin : Histogram number of bin</li> -<li><dl class="first docutils"> -<dt>Texture Set Selection Choice of The Texture Set Available choices are :</dt> -<dd><ul class="first last"> -<li>Simple Haralick Texture Features: This group of parameters defines the 8 local Haralick texture feature output image. The image channels are: Energy, Entropy, Correlation, Inverse Difference Moment, Inertia, Cluster Shade, Cluster Prominence and Haralick Correlation</li> -<li>Advanced Texture Features: This group of parameters defines the 9 advanced texture feature output image. The image channels are: Mean, Variance, Sum Average, Sum Variance, Sum Entropy, Difference of Entropies, Difference of Variances, IC1 and IC2</li> -<li>Higher Order Texture Features: This group of parameters defines the 11 higher order texture feature output image. The image channels are: Short Run Emphasis, Long Run Emphasis, Grey-Level Nonuniformity, Run Length Nonuniformity, Run Percentage, Low Grey-Level Run Emphasis, High Grey-Level Run Emphasis, Short Run Low Grey-Level Emphasis, Short Run High Grey-Level Emphasis, Long Run Low Grey-Level Emphasis and Long Run High Grey-Level Emphasis</li> -</ul> -</dd> -</dl> -</li> -<li>out : Feature Output Image</li> -</ul> -</dd> -</dl> -</li> -</ul> -<p class="last">Source : <a class="reference external" href="http://otbcb.readthedocs.org/en/latest/Applications/app_HaralickTextureExtraction.html">http://otbcb.readthedocs.org/en/latest/Applications/app_HaralickTextureExtraction.html</a></p> -</dd> -</dl> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><strong>texture_choice</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Order texture choice -> Simple / Advanced / Higher</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="Vhrs.Vhrs.sfs_texture_extraction"> -<code class="descname">sfs_texture_extraction</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Vhrs.html#Vhrs.sfs_texture_extraction"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Vhrs.Vhrs.sfs_texture_extraction" title="Lien permanent vers cette définition">¶</a></dt> -<dd><dl class="docutils"> -<dt>Function to compute SFS texture image with OTB command line.</dt> -<dd><table class="first docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Example:</th><td class="field-body">otbcli_SFSTextureExtraction -in qb_RoadExtract.tif -channel 1 -parameters.spethre 50.0 -parameters.spathre 100 -out SFSTextures.tif</td> -</tr> -</tbody> -</table> -<ul class="simple"> -<li><dl class="first docutils"> -<dt>OTB help :</dt> -<dd><ul class="first last"> -<li>in : Input Image</li> -<li>channel : Selected Channel</li> -<li><dl class="first docutils"> -<dt>parameters <span class="classifier-delimiter">:</span> <span class="classifier">Texture feature parameters. This group of parameters allows to define SFS texture parameters. The available texture features are SFS’Length, SFS’Width, SFS’PSI, SFS’W-Mean, SFS’Ratio and SFS’SD. They are provided in this exact order in the output image.</span></dt> -<dd><ul class="first last"> -<li>parameters.spethre : Spectral Threshold</li> -<li>parameters.spathre : Spatial Threshold</li> -<li>parameters.nbdir : Number of Direction</li> -<li>parameters.alpha : Alpha</li> -<li>parameters.maxcons : Ratio Maximum Consideration Number</li> -</ul> -</dd> -</dl> -</li> -<li>out : Feature Output Image</li> -</ul> -</dd> -</dl> -</li> -</ul> -<p class="last">Source : <a class="reference external" href="http://otbcb.readthedocs.org/en/latest/Applications/app_SFSTextureExtraction.html">http://otbcb.readthedocs.org/en/latest/Applications/app_SFSTextureExtraction.html</a></p> -</dd> -</dl> -</dd></dl> - -</dd></dl> - -</div> -<div class="section" id="module-Slope"> -<span id="slope-processing"></span><h3>Slope processing<a class="headerlink" href="#module-Slope" title="Lien permanent vers ce titre">¶</a></h3> -<dl class="class"> -<dt id="Slope.Slope"> -<em class="property">class </em><code class="descclassname">Slope.</code><code class="descname">Slope</code><span class="sig-paren">(</span><em>mnt</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Slope.html#Slope"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Slope.Slope" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Class to compute a slope raster</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>mnt</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Digital Elevation Model (DEM) path</li> -<li><strong>out_mnt</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – slope raster path</li> -</ul> -</td> -</tr> -</tbody> -</table> -<dl class="method"> -<dt id="Slope.Slope.extract_slope"> -<code class="descname">extract_slope</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Slope.html#Slope.extract_slope"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Slope.Slope.extract_slope" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to compute slope in GDAL command line.</p> -</dd></dl> - -</dd></dl> - -</div> -<div class="section" id="module-Toolbox"> -<span id="toolbox"></span><h3>Toolbox<a class="headerlink" href="#module-Toolbox" title="Lien permanent vers ce titre">¶</a></h3> -<dl class="class"> -<dt id="Toolbox.Toolbox"> -<em class="property">class </em><code class="descclassname">Toolbox.</code><code class="descname">Toolbox</code><a class="reference internal" href="_modules/Toolbox.html#Toolbox"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Toolbox.Toolbox" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Class used to grouped small tools to cut raster or compute statistics on a raster.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>imag</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Input image (path)</li> -<li><strong>vect</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Extent shapefile (path)</li> -</ul> -</td> -</tr> -</tbody> -</table> -<dl class="method"> -<dt id="Toolbox.Toolbox.calc_serie_stats"> -<code class="descname">calc_serie_stats</code><span class="sig-paren">(</span><em>table</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Toolbox.html#Toolbox.calc_serie_stats"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Toolbox.Toolbox.calc_serie_stats" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to compute stats on temporal cloud and ndvi spectral table -Ndvi stats : min max std max-min</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><strong>table</strong> (<em>numpy.ndarray</em>) – Spectral data, cloud raster and ndvi raster</td> -</tr> -<tr class="field-even field"><th class="field-name">Retourne:</th><td class="field-body">list of numpy.ndarray – variable <strong>account_stats</strong>, list of temporal NDVI stats.<p>numpy.ndarray – variable <strong>account_cloud</strong>, pixel number clear on the area.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="Toolbox.Toolbox.check_proj"> -<code class="descname">check_proj</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Toolbox.html#Toolbox.check_proj"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Toolbox.Toolbox.check_proj" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to check if raster’s projection is RFG93. -For the moment, PHYMOBAT works with one projection only Lambert 93 EPSG:2154</p> -</dd></dl> - -<dl class="method"> -<dt id="Toolbox.Toolbox.clip_raster"> -<code class="descname">clip_raster</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Toolbox.html#Toolbox.clip_raster"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Toolbox.Toolbox.clip_raster" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to clip a raster with a vector. The raster created will be in the same folder than the input raster. -With a prefix <em>Clip_</em>.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Kwargs:</th><td class="field-body"><strong>rm_rast</strong> (int) - 0 (by default) or 1. Variable to remove the output raster. 0 to keep and 1 to remove.</td> -</tr> -<tr class="field-even field"><th class="field-name">Retourne:</th><td class="field-body">str – variable <strong>outclip</strong>, output raster clip (path).</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -</div> -</div> -<div class="section" id="vector-processing"> -<h2>Vector processing<a class="headerlink" href="#vector-processing" title="Lien permanent vers ce titre">¶</a></h2> -<div class="section" id="super-vector"> -<h3>Super vector<a class="headerlink" href="#super-vector" title="Lien permanent vers ce titre">¶</a></h3> -<span class="target" id="module-Vector"></span><dl class="class"> -<dt id="Vector.Vector"> -<em class="property">class </em><code class="descclassname">Vector.</code><code class="descname">Vector</code><span class="sig-paren">(</span><em>used</em>, <em>cut</em>, <em>**opt</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Vector.html#Vector"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Vector.Vector" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Vector class to extract a area, vector data and zonal statistic (<code class="docutils literal"><span class="pre">rasterstats</span> <span class="pre">0.3.2</span> <span class="pre">package</span></code>)</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first simple"> -<li><strong>vector_used</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Input/Output shapefile to clip (path)</li> -<li><strong>vector_cut</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Area shapefile (path)</li> -<li><strong>data_source</strong> (<em>ogr pointer</em>) – Input shapefile information</li> -<li><strong>stats_dict</strong> (<a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(disponible dans Python v2.7)"><em>dict</em></a>) – <code class="docutils literal"><span class="pre">Rasterstats</span></code> results</li> -<li><strong>raster_ds</strong> (<em>gdal pointer</em>) – Raster information for a probably rasterization</li> -<li><strong>remove_shp</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#int" title="(disponible dans Python v2.7)"><em>int</em></a>) – Remove shapefile or not. 0 : don’t remove, 1 : remove</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Opt:</th><td class="field-body"><p class="first last"><strong>Remove</strong> (int) - For the remove_shp variable</p> -</td> -</tr> -</tbody> -</table> -<dl class="method"> -<dt id="Vector.Vector.clip_vector"> -<code class="descname">clip_vector</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Vector.html#Vector.clip_vector"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Vector.Vector.clip_vector" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to clip a vector with a vector</p> -</dd></dl> - -<dl class="method"> -<dt id="Vector.Vector.close_data"> -<code class="descname">close_data</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Vector.html#Vector.close_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Vector.Vector.close_data" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to remove allocate memory</p> -</dd></dl> - -<dl class="method"> -<dt id="Vector.Vector.layer_rasterization"> -<code class="descname">layer_rasterization</code><span class="sig-paren">(</span><em>raster_head</em>, <em>attribute_r</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Vector.html#Vector.layer_rasterization"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Vector.Vector.layer_rasterization" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to rasterize a vector. Define resolution, projection of the output raster with a raster head. -And complete the gdal pointer empty properties with the layer’s information of the vector and a defined field. -If a raster has several band, in option you can choice if you want one band or more.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first simple"> -<li><strong>raster_head</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Raster path that will look like the final raster of the rasterization</li> -<li><strong>attribute_r</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Field name of the shapefile that contains class names</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Kwargs:</th><td class="field-body"><p class="first"><strong>choice_nb_b</strong> (int) - Output image number of band. If you choice 1, take first band. If you choice 2, take two first band etc...</p> -</td> -</tr> -<tr class="field-odd field"><th class="field-name">Retourne:</th><td class="field-body"><p class="first last">str – <strong>valid_raster</strong> : output raster path from the rasterization</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="Vector.Vector.vector_data"> -<code class="descname">vector_data</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Vector.html#Vector.vector_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Vector.Vector.vector_data" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to extract vector layer information</p> -</dd></dl> - -<dl class="method"> -<dt id="Vector.Vector.zonal_stats"> -<code class="descname">zonal_stats</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Vector.html#Vector.zonal_stats"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Vector.Vector.zonal_stats" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to compute the average in every polygons for a raster -because of package <code class="docutils literal"><span class="pre">rasterstats</span></code> in <em>/usr/local/lib/python2.7/dist-packages/rasterstats-0.3.2-py2.7.egg/rasterstats/</em></p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><p class="first"><strong></strong><strong>(</strong><strong>inraster</strong><strong>,</strong><strong>band</strong><strong>)</strong><strong></strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#tuple" title="(disponible dans Python v2.7)"><em>tuple</em></a>) – inraster -> Input image path, and band -> band number</p> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Kwargs:</th><td class="field-body"><p class="first"><strong>rank</strong> (int) - Zonal stats ranking launch</p> -<p class="last"><strong>nb_img</strong> (int) - Number images launched with zonal stats</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="Vector.Vector.zonal_stats_pp"> -<code class="descname">zonal_stats_pp</code><span class="sig-paren">(</span><em>inraster</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Vector.html#Vector.zonal_stats_pp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Vector.Vector.zonal_stats_pp" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>A zonal statistics ++ to dertermine pxl percent in every polygon</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><strong>inraster</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Input image path</td> -</tr> -<tr class="field-even field"><th class="field-name">Retourne:</th><td class="field-body">dict – <strong>p_stats</strong> : dictionnary with pxl percent in every polygon. Mainly ‘Maj_count’ (Majority Value) and ‘Maj_count_perc’ (Majority Percent)</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -</div> -<div class="section" id="module-Sample"> -<span id="sample"></span><h3>Sample<a class="headerlink" href="#module-Sample" title="Lien permanent vers ce titre">¶</a></h3> -<dl class="class"> -<dt id="Sample.Sample"> -<em class="property">class </em><code class="descclassname">Sample.</code><code class="descname">Sample</code><span class="sig-paren">(</span><em>used</em>, <em>cut</em>, <em>nb_sample</em>, <em>**opt</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Sample.html#Sample"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Sample.Sample" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Vector class inherits the super vector class properties. This class create training sample.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first simple"> -<li><strong>vector_used</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Input/Output shapefile to clip (path)</li> -<li><strong>vector_cut</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Area shapefile (path)</li> -<li><strong>nb_sample</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#int" title="(disponible dans Python v2.7)"><em>int</em></a>) – Number of polygons for every sample</li> -<li><strong>vector_val</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Output shapefile to validate the futur classification</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Opt:</th><td class="field-body"><p class="first last">Refer to the Vector class</p> -</td> -</tr> -</tbody> -</table> -<dl class="method"> -<dt id="Sample.Sample.create_sample"> -<code class="descname">create_sample</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Sample.html#Sample.create_sample"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Sample.Sample.create_sample" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to create a sample shapefile of a specific class</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Kwargs:</th><td class="field-body"><p class="first"><strong>fieldname</strong> (list of str) - Fieldname in the input shapefile (if the user want select polygons of the class names specific)</p> -<p class="last"><strong>class</strong> (list of str) - class names in the input shapefile (with fieldname index). -Can use one or several classes like this –> example : [classname1, classname2, ...]</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="Sample.Sample.fill_sample"> -<code class="descname">fill_sample</code><span class="sig-paren">(</span><em>output_sample</em>, <em>polygon</em>, <em>**opt</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Sample.html#Sample.fill_sample"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Sample.Sample.fill_sample" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to fill and create the output sample shapefile. This function is used in <a class="reference internal" href="#Sample.Sample.create_sample" title="Sample.Sample.create_sample"><code class="xref py py-func docutils literal"><span class="pre">create_sample()</span></code></a> -to create samples polygons and validated polygons (to the take out the precision of the classification)</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first simple"> -<li><strong>output_sample</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Path of the output shapefile</li> -<li><strong>polygon</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#list" title="(disponible dans Python v2.7)"><em>list</em></a><em> or </em><a class="reference external" href="https://docs.python.org/2/library/functions.html#int" title="(disponible dans Python v2.7)"><em>int</em></a>) – Identity of the selected random polygons. If this variable = 0, the processing will take all polygons</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Opt:</th><td class="field-body"><p class="first"><strong>add_fieldname</strong> (int) - Variable to kown if add a field. By default non (0), if it have to add (1)</p> -<p><strong>fieldname</strong> (str) - Fieldname to add in the input shapefile</p> -<p class="last"><strong>class</strong> (int) - class names in integer to add in the input shapefile</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="Sample.Sample.select_random_sample"> -<code class="descname">select_random_sample</code><span class="sig-paren">(</span><em>kw_field</em>, <em>kw_classes</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Sample.html#Sample.select_random_sample"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Sample.Sample.select_random_sample" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to select id with class name specific only. This function is used in <a class="reference internal" href="#Sample.Sample.create_sample" title="Sample.Sample.create_sample"><code class="xref py py-func docutils literal"><span class="pre">create_sample()</span></code></a></p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first simple"> -<li><strong>kw_field</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Field name in the input shapefile</li> -<li><strong>kw_classes</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Class names in the input shapefile like this –> ‘classname1, classname2’</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Retourne:</th><td class="field-body"><p class="first last">list – variable <strong>select_id</strong>, List of id with a class name specific.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -</div> -<div class="section" id="module-Rpg"> -<span id="rpg"></span><h3>RPG<a class="headerlink" href="#module-Rpg" title="Lien permanent vers ce titre">¶</a></h3> -<dl class="class"> -<dt id="Rpg.Rpg"> -<em class="property">class </em><code class="descclassname">Rpg.</code><code class="descname">Rpg</code><span class="sig-paren">(</span><em>used</em>, <em>cut</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Rpg.html#Rpg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Rpg.Rpg" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Vector class inherits the super vector class properties. This class create a new RPG shapefile -with mono-crops. It needs a basic RPG shapefile and a basic RPG CSV file <em>(...-GROUPES-CULTURE...)</em> in <a class="reference internal" href="#Rpg.Rpg.mono_rpg" title="Rpg.Rpg.mono_rpg"><code class="xref py py-func docutils literal"><span class="pre">mono_rpg()</span></code></a>.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>vector_used</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Input/Output shapefile to clip (path)</li> -<li><strong>vector_cut</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Area shapefile (path)</li> -<li><strong>rm_dupli</strong> (<a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(disponible dans Python v2.7)"><em>dict</em></a>) – Rpg table with no duplicated crops group</li> -<li><strong>head_in_read</strong> (<em>list of str</em>) – List of rgp header</li> -<li><strong>min_size</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#float" title="(disponible dans Python v2.7)"><em>float</em></a>) – Minimum size to extract a rpg polygons</li> -</ul> -</td> -</tr> -</tbody> -</table> -<dl class="method"> -<dt id="Rpg.Rpg.create_new_rpg_files"> -<code class="descname">create_new_rpg_files</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Rpg.html#Rpg.create_new_rpg_files"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Rpg.Rpg.create_new_rpg_files" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to create new rpg shapefile with <strong>rm_dpli</strong> variable. The output shapefile -will be create in the same folder than the input shapefile with prefix <em>MONO_</em>.</p> -</dd></dl> - -<dl class="method"> -<dt id="Rpg.Rpg.mono_rpg"> -<code class="descname">mono_rpg</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Rpg.html#Rpg.mono_rpg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Rpg.Rpg.mono_rpg" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to extract no duplicated crops.</p> -</dd></dl> - -</dd></dl> - -</div> -<div class="section" id="module-Seath"> -<span id="separability-and-threshold-index"></span><h3>Separability and threshold index<a class="headerlink" href="#module-Seath" title="Lien permanent vers ce titre">¶</a></h3> -<dl class="class"> -<dt id="Seath.Seath"> -<em class="property">class </em><code class="descclassname">Seath.</code><code class="descname">Seath</code><a class="reference internal" href="_modules/Seath.html#Seath"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Seath.Seath" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Get the optimal threshold and Bhattacharyya distance for a separability between two classes</p> -<p>Source article : SEaTH–A new tool for automated feature extraction in the context of object-based image analysis S. Nussbaum et al.</p> -<p>Source Info : Kenji Ose (IRSTEA) et Nathalie St-Geours (IRSTEA)</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first simple"> -<li><strong>value_1</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#list" title="(disponible dans Python v2.7)"><em>list</em></a>) – List of index mean by polygons (sample 1)</li> -<li><strong>value_2</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#list" title="(disponible dans Python v2.7)"><em>list</em></a>) – List of index mean by polygons (sample 2)</li> -<li><strong>threshold</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Optimal threshold under this form <em>>0.56</em></li> -<li><strong>J</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#list" title="(disponible dans Python v2.7)"><em>list</em></a>) – Jeffries-Matusita distance (measure separability between 2 classes on a 0 to 2 scale)</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Example:</th><td class="field-body"></td> -</tr> -</tbody> -</table> -<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">Seath</span> -<span class="gp">>>> </span><span class="n">a</span> <span class="o">=</span> <span class="n">Seath</span><span class="p">()</span> -<span class="gp">>>> </span><span class="n">a</span><span class="o">.</span><span class="n">value_1</span> <span class="o">=</span> <span class="n">b</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">stats_dict</span> -<span class="gp">>>> </span><span class="n">a</span><span class="o">.</span><span class="n">value_2</span> <span class="o">=</span> <span class="n">b</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">stats_dict</span> -<span class="gp">>>> </span><span class="n">a</span><span class="o">.</span><span class="n">separability_and_threshold</span><span class="p">()</span> -<span class="gp">>>> </span><span class="n">a</span><span class="o">.</span><span class="n">threshold</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> -<span class="go">'>0.56'</span> -<span class="gp">>>> </span><span class="n">a</span><span class="o">.</span><span class="n">J</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> -<span class="go">1.86523428</span> -</pre></div> -</div> -<dl class="method"> -<dt id="Seath.Seath.separability_and_threshold"> -<code class="descname">separability_and_threshold</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Seath.html#Seath.separability_and_threshold"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Seath.Seath.separability_and_threshold" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to extract the optimal threshold for a separability between two classes</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Kwargs:</th><td class="field-body"><strong>index</strong> (str) - The processing will prints the string</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -</div> -<div class="section" id="module-Segmentation"> -<span id="classification"></span><h3>Classification<a class="headerlink" href="#module-Segmentation" title="Lien permanent vers ce titre">¶</a></h3> -<dl class="class"> -<dt id="Segmentation.Segmentation"> -<em class="property">class </em><code class="descclassname">Segmentation.</code><code class="descname">Segmentation</code><span class="sig-paren">(</span><em>used</em>, <em>cut</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Segmentation.html#Segmentation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Segmentation.Segmentation" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Vector class inherits the super vector class properties. This class create the final shapefile : Cartography -on a input segmentation by decision tree.</p> -<dl class="docutils"> -<dt>The output classname are (<strong>out_class_name</strong> variable):</dt> -<dd><ul class="first last simple"> -<li>Vegetation non naturelle</li> -<li>Vegetation semi-naturelle</li> -<li>Herbacees</li> -<li>Ligneux</li> -<li>Ligneux mixtes</li> -<li>Ligneux denses</li> -<li>Forte phytomasse</li> -<li>Moyenne phytomasse</li> -<li>Faible phytomasse</li> -</ul> -</dd> -</dl> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>vector_used</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Input/Output shapefile to clip (path)</li> -<li><strong>vector_cut</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Area shapefile (path)</li> -<li><strong>output_file</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Output shapefile cartography. This path is the same than the segmentation path.</li> -<li><strong>out_class_name</strong> (<em>list of str</em>) – List of output class name</li> -<li><strong>out_threshold</strong> (<em>list of str</em>) – List of output threshold</li> -<li><strong>max...</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#float" title="(disponible dans Python v2.7)"><em>float</em></a>) – Biomass and density (IDM, SFS index) maximum</li> -<li><strong>class_tab_final</strong> (<a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(disponible dans Python v2.7)"><em>dict</em></a>) – Final decision tree table</li> -<li><strong>stats_rpg_tif</strong> (<a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(disponible dans Python v2.7)"><em>dict</em></a>) – Dictionnary with pxl percent in every polygon of class RPG. Mainly ‘Maj_count’ (Majority Value) and ‘Maj_count_perc’ (Majority Percent)</li> -</ul> -</td> -</tr> -</tbody> -</table> -<dl class="method"> -<dt id="Segmentation.Segmentation.append_scale"> -<code class="descname">append_scale</code><span class="sig-paren">(</span><em>select_class</em>, <em>form</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Segmentation.html#Segmentation.append_scale"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Segmentation.Segmentation.append_scale" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to complete the ‘class_tab_final’ list with density and biomass information. This list will be used to build -the final shapefile.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>select_class</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Class name to add degree</li> -<li><strong>form</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Formula to add degree</li> -</ul> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="Segmentation.Segmentation.compute_biomass_density"> -<code class="descname">compute_biomass_density</code><span class="sig-paren">(</span><em>method='SEATH'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Segmentation.html#Segmentation.compute_biomass_density"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Segmentation.Segmentation.compute_biomass_density" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to compute the biomass and density distribution. -It returns threshold of biomass level.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><strong>method</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(disponible dans Python v2.7)"><em>str</em></a>) – Classification method used. It can set ‘SEATH’ (by default) or ‘RF’</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="Segmentation.Segmentation.create_cartography"> -<code class="descname">create_cartography</code><span class="sig-paren">(</span><em>out_fieldnames</em>, <em>out_fieldtype</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Segmentation.html#Segmentation.create_cartography"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Segmentation.Segmentation.create_cartography" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to create a output shapefile. In this output file, -there is the final cartography. With output defined field names -and field type in the main process.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><ul class="first last simple"> -<li><strong>out_fieldnames</strong> (<em>list of str</em>) – List of output field names</li> -<li><strong>out_fieldtype</strong> (<em>list of str</em>) – List of outpu field type</li> -</ul> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="Segmentation.Segmentation.decision_tree"> -<code class="descname">decision_tree</code><span class="sig-paren">(</span><em>combin_tree</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Segmentation.html#Segmentation.decision_tree"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Segmentation.Segmentation.decision_tree" title="Lien permanent vers cette définition">¶</a></dt> -<dd><p>Function to build the decision tree. Taking account output threshold and input -class name.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Paramètres:</th><td class="field-body"><strong>combin_tree</strong> (<em>list of number class name</em>) – Decision tree combination</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -</div> -</div> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> - <div class="sphinxsidebarwrapper"> - <h3><a href="PHYMOBAT_documentation.html">Table des Matières</a></h3> - <ul> -<li><a class="reference internal" href="#">CarHab Phy MOBA package</a><ul> -<li><a class="reference internal" href="#image-processing">Image processing</a><ul> -<li><a class="reference internal" href="#module-Archive">Archive</a></li> -<li><a class="reference internal" href="#landsat-image-processing">Landsat image processing</a></li> -<li><a class="reference internal" href="#module-Vhrs">Texture index processing</a></li> -<li><a class="reference internal" href="#module-Slope">Slope processing</a></li> -<li><a class="reference internal" href="#module-Toolbox">Toolbox</a></li> -</ul> -</li> -<li><a class="reference internal" href="#vector-processing">Vector processing</a><ul> -<li><a class="reference internal" href="#super-vector">Super vector</a></li> -<li><a class="reference internal" href="#module-Sample">Sample</a></li> -<li><a class="reference internal" href="#module-Rpg">RPG</a></li> -<li><a class="reference internal" href="#module-Seath">Separability and threshold index</a></li> -<li><a class="reference internal" href="#module-Segmentation">Classification</a></li> -</ul> -</li> -</ul> -</li> -</ul> - - <h4>Sujet précédent</h4> - <p class="topless"><a href="methode_tuto.html" - title="Chapitre précédent">Processus utilisées et tutoriels API</a></p> - <h4>Sujet suivant</h4> - <p class="topless"><a href="API.html" - title="Chapitre suivant">Graphical User Interface package</a></p> - <div role="note" aria-label="source link"> - <h3>Cette page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/package.rst.txt" - rel="nofollow">Montrer le code source</a></li> - </ul> - </div> -<div id="searchbox" style="display: none" role="search"> - <h3>Recherche rapide</h3> - <form class="search" action="search.html" method="get"> - <div><input type="text" name="q" /></div> - <div><input type="submit" value="Go" /></div> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="Index général" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Index des modules Python" - >modules</a> |</li> - <li class="right" > - <a href="API.html" title="Graphical User Interface package" - >suivant</a> |</li> - <li class="right" > - <a href="methode_tuto.html" title="Processus utilisées et tutoriels API" - >précédent</a> |</li> - <li class="nav-item nav-item-0"><a href="PHYMOBAT_documentation.html">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - <div class="footer" role="contentinfo"> - © Copyright 2017, LAVENTURE Sylvio (UMR TETIS/IRSTEA). - Créé avec <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.3. - </div> - </body> -</html> \ No newline at end of file diff --git a/Documentation/py-modindex.html b/Documentation/py-modindex.html deleted file mode 100644 index 676c5d8cf2fb12539058cabcd1566b195bcaad99..0000000000000000000000000000000000000000 --- a/Documentation/py-modindex.html +++ /dev/null @@ -1,222 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - -<html xmlns="http://www.w3.org/1999/xhtml" lang="fr"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index des modules Python — documentation PHYMOBAT 3.0</title> - - <link rel="stylesheet" href="_static/classic.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: './', - VERSION: '3.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true, - SOURCELINK_SUFFIX: '.txt' - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/translations.js"></script> - <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> - <link rel="index" title="Index" href="genindex.html" /> - <link rel="search" title="Recherche" href="search.html" /> - - - <script type="text/javascript"> - DOCUMENTATION_OPTIONS.COLLAPSE_INDEX = true; - </script> - - - </head> - <body role="document"> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="Index général" - accesskey="I">index</a></li> - <li class="right" > - <a href="#" title="Index des modules Python" - >modules</a> |</li> - <li class="nav-item nav-item-0"><a href="PHYMOBAT_documentation.html">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body" role="main"> - - - <h1>Index des modules Python</h1> - - <div class="modindex-jumpbox"> - <a href="#cap-a"><strong>a</strong></a> | - <a href="#cap-p"><strong>p</strong></a> | - <a href="#cap-r"><strong>r</strong></a> | - <a href="#cap-s"><strong>s</strong></a> | - <a href="#cap-t"><strong>t</strong></a> | - <a href="#cap-u"><strong>u</strong></a> | - <a href="#cap-v"><strong>v</strong></a> - </div> - - <table class="indextable modindextable"> - <tr class="pcap"><td></td><td> </td><td></td></tr> - <tr class="cap" id="cap-a"><td></td><td> - <strong>a</strong></td><td></td></tr> - <tr> - <td></td> - <td> - <a href="package.html#module-Archive"><code class="xref">Archive</code></a></td><td> - <em></em></td></tr> - <tr class="pcap"><td></td><td> </td><td></td></tr> - <tr class="cap" id="cap-p"><td></td><td> - <strong>p</strong></td><td></td></tr> - <tr> - <td></td> - <td> - <a href="API.html#module-PHYMOBAT"><code class="xref">PHYMOBAT</code></a></td><td> - <em></em></td></tr> - <tr> - <td></td> - <td> - <a href="API.html#module-Processing"><code class="xref">Processing</code></a></td><td> - <em></em></td></tr> - <tr class="pcap"><td></td><td> </td><td></td></tr> - <tr class="cap" id="cap-r"><td></td><td> - <strong>r</strong></td><td></td></tr> - <tr> - <td></td> - <td> - <a href="package.html#module-RasterSat_by_date"><code class="xref">RasterSat_by_date</code></a></td><td> - <em></em></td></tr> - <tr> - <td></td> - <td> - <a href="package.html#module-Rpg"><code class="xref">Rpg</code></a></td><td> - <em></em></td></tr> - <tr class="pcap"><td></td><td> </td><td></td></tr> - <tr class="cap" id="cap-s"><td></td><td> - <strong>s</strong></td><td></td></tr> - <tr> - <td></td> - <td> - <a href="package.html#module-Sample"><code class="xref">Sample</code></a></td><td> - <em></em></td></tr> - <tr> - <td></td> - <td> - <a href="package.html#module-Seath"><code class="xref">Seath</code></a></td><td> - <em></em></td></tr> - <tr> - <td></td> - <td> - <a href="package.html#module-Segmentation"><code class="xref">Segmentation</code></a></td><td> - <em></em></td></tr> - <tr> - <td></td> - <td> - <a href="package.html#module-Slope"><code class="xref">Slope</code></a></td><td> - <em></em></td></tr> - <tr class="pcap"><td></td><td> </td><td></td></tr> - <tr class="cap" id="cap-t"><td></td><td> - <strong>t</strong></td><td></td></tr> - <tr> - <td></td> - <td> - <a href="package.html#module-Toolbox"><code class="xref">Toolbox</code></a></td><td> - <em></em></td></tr> - <tr class="pcap"><td></td><td> </td><td></td></tr> - <tr class="cap" id="cap-u"><td></td><td> - <strong>u</strong></td><td></td></tr> - <tr> - <td></td> - <td> - <a href="API.html#module-ui_A_propos_PHYMOBAT_window"><code class="xref">ui_A_propos_PHYMOBAT_window</code></a></td><td> - <em></em></td></tr> - <tr> - <td></td> - <td> - <a href="API.html#module-ui_PHYMOBATe_tab"><code class="xref">ui_PHYMOBATe_tab</code></a></td><td> - <em></em></td></tr> - <tr> - <td></td> - <td> - <a href="API.html#module-ui_PHYMOBATs_tab"><code class="xref">ui_PHYMOBATs_tab</code></a></td><td> - <em></em></td></tr> - <tr> - <td></td> - <td> - <a href="API.html#module-ui_Proxy_window"><code class="xref">ui_Proxy_window</code></a></td><td> - <em></em></td></tr> - <tr> - <td></td> - <td> - <a href="API.html#module-ui_Warming_forgetting"><code class="xref">ui_Warming_forgetting</code></a></td><td> - <em></em></td></tr> - <tr> - <td></td> - <td> - <a href="API.html#module-ui_Warming_study_area"><code class="xref">ui_Warming_study_area</code></a></td><td> - <em></em></td></tr> - <tr class="pcap"><td></td><td> </td><td></td></tr> - <tr class="cap" id="cap-v"><td></td><td> - <strong>v</strong></td><td></td></tr> - <tr> - <td></td> - <td> - <a href="package.html#module-Vector"><code class="xref">Vector</code></a></td><td> - <em></em></td></tr> - <tr> - <td></td> - <td> - <a href="package.html#module-Vhrs"><code class="xref">Vhrs</code></a></td><td> - <em></em></td></tr> - </table> - - - </div> - </div> - </div> - <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> - <div class="sphinxsidebarwrapper"> -<div id="searchbox" style="display: none" role="search"> - <h3>Recherche rapide</h3> - <form class="search" action="search.html" method="get"> - <div><input type="text" name="q" /></div> - <div><input type="submit" value="Go" /></div> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="Index général" - >index</a></li> - <li class="right" > - <a href="#" title="Index des modules Python" - >modules</a> |</li> - <li class="nav-item nav-item-0"><a href="PHYMOBAT_documentation.html">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - <div class="footer" role="contentinfo"> - © Copyright 2017, LAVENTURE Sylvio (UMR TETIS/IRSTEA). - Créé avec <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.3. - </div> - </body> -</html> \ No newline at end of file diff --git a/Documentation/search.html b/Documentation/search.html deleted file mode 100644 index f6282a4d184379e9016989a1e162cdcdcb6b6549..0000000000000000000000000000000000000000 --- a/Documentation/search.html +++ /dev/null @@ -1,108 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - -<html xmlns="http://www.w3.org/1999/xhtml" lang="fr"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Recherche — documentation PHYMOBAT 3.0</title> - - <link rel="stylesheet" href="_static/classic.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: './', - VERSION: '3.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true, - SOURCELINK_SUFFIX: '.txt' - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/translations.js"></script> - <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> - <script type="text/javascript" src="_static/searchtools.js"></script> - <link rel="index" title="Index" href="genindex.html" /> - <link rel="search" title="Recherche" href="#" /> - <script type="text/javascript"> - jQuery(function() { Search.loadIndex("searchindex.js"); }); - </script> - - <script type="text/javascript" id="searchindexloader"></script> - - - </head> - <body role="document"> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="Index général" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Index des modules Python" - >modules</a> |</li> - <li class="nav-item nav-item-0"><a href="PHYMOBAT_documentation.html">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body" role="main"> - - <h1 id="search-documentation">Recherche</h1> - <div id="fallback" class="admonition warning"> - <script type="text/javascript">$('#fallback').hide();</script> - <p> - Veuillez activer le JavaScript pour que la recherche fonctionne. - </p> - </div> - <p> - Vous pouvez effectuer une recherche au sein des documents. Saisissez les termes -de votre recherche dans le champs ci-dessous et cliquez sur "rechercher". Notez que la fonctionnalité de recherche -va automatiquement chercher l'ensemble des mots. Les pages -contenant moins de mots n'apparaîtront pas dans la liste des résultats. - </p> - <form action="" method="get"> - <input type="text" name="q" value="" /> - <input type="submit" value="rechercher" /> - <span id="search-progress" style="padding-left: 10px"></span> - </form> - - <div id="search-results"> - - </div> - - </div> - </div> - </div> - <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> - <div class="sphinxsidebarwrapper"> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related" role="navigation" aria-label="related navigation"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="Index général" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Index des modules Python" - >modules</a> |</li> - <li class="nav-item nav-item-0"><a href="PHYMOBAT_documentation.html">documentation PHYMOBAT 3.0</a> »</li> - </ul> - </div> - <div class="footer" role="contentinfo"> - © Copyright 2017, LAVENTURE Sylvio (UMR TETIS/IRSTEA). - Créé avec <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.3. - </div> - </body> -</html> \ No newline at end of file diff --git a/Documentation/searchindex.js b/Documentation/searchindex.js deleted file mode 100644 index 7cf864f00a67cda2798b1b45efa8690b70ca6542..0000000000000000000000000000000000000000 --- a/Documentation/searchindex.js +++ /dev/null @@ -1 +0,0 @@ -Search.setIndex({docnames:["API","PHYMOBAT_documentation","install","methode_tuto","package"],envversion:50,filenames:["API.rst","PHYMOBAT_documentation.rst","install.rst","methode_tuto.rst","package.rst"],objects:{"":{Archive:[4,0,0,"-"],PHYMOBAT:[0,0,0,"-"],Processing:[0,0,0,"-"],RasterSat_by_date:[4,0,0,"-"],Rpg:[4,0,0,"-"],Sample:[4,0,0,"-"],Seath:[4,0,0,"-"],Segmentation:[4,0,0,"-"],Slope:[4,0,0,"-"],Toolbox:[4,0,0,"-"],Vector:[4,0,0,"-"],Vhrs:[4,0,0,"-"],ui_A_propos_PHYMOBAT_window:[0,0,0,"-"],ui_PHYMOBATe_tab:[0,0,0,"-"],ui_PHYMOBATs_tab:[0,0,0,"-"],ui_Proxy_window:[0,0,0,"-"],ui_Warming_forgetting:[0,0,0,"-"],ui_Warming_study_area:[0,0,0,"-"]},"Archive.Archive":{coord_box_dd:[4,2,1,""],decompress:[4,2,1,""],download_auto:[4,2,1,""],listing:[4,2,1,""],set_list_archive_to_try:[4,2,1,""],utm_to_latlng:[4,2,1,""]},"PHYMOBAT.MyPopup_about":{close_window:[0,2,1,""]},"PHYMOBAT.MyPopup_proxy_window":{close_window:[0,2,1,""],id_proxy:[0,2,1,""]},"PHYMOBAT.MyPopup_warming_forgetting":{close_window:[0,2,1,""]},"PHYMOBAT.MyPopup_warming_study_area":{close_window:[0,2,1,""]},"PHYMOBAT.PHYMOBAT":{about_PHYMOBA:[0,2,1,""],activate_level:[0,2,1,""],add_sample:[0,2,1,""],block_for_swh:[0,2,1,""],clear_sample:[0,2,1,""],close_button:[0,2,1,""],display_all_levels:[0,2,1,""],display_one_level:[0,2,1,""],display_two_levels:[0,2,1,""],enter_sample_name:[0,2,1,""],enter_sample_name_hl:[0,2,1,""],enter_sample_name_ll:[0,2,1,""],f_output_name_moba:[0,2,1,""],f_path_area:[0,2,1,""],f_path_folder_dpt:[0,2,1,""],f_path_mnt:[0,2,1,""],f_path_ortho:[0,2,1,""],f_path_segm:[0,2,1,""],f_proxy:[0,2,1,""],field_display_1:[0,2,1,""],field_display_2:[0,2,1,""],field_display_3:[0,2,1,""],field_display_4:[0,2,1,""],field_display_5:[0,2,1,""],field_display_6:[0,2,1,""],forget_raster_sample:[0,2,1,""],forget_study_area:[0,2,1,""],get_variable:[0,2,1,""],help_tools:[0,2,1,""],img_sample_name:[0,2,1,""],initUI:[0,2,1,""],mode_expert:[0,2,1,""],mode_simpli:[0,2,1,""],ok_button:[0,2,1,""],open_backup:[0,2,1,""],save_backup:[0,2,1,""],set_variable:[0,2,1,""]},"Processing.Processing":{i_classifier_rf:[0,2,1,""],i_classifier_s:[0,2,1,""],i_download:[0,2,1,""],i_glob:[0,2,1,""],i_images_processing:[0,2,1,""],i_img_sat:[0,2,1,""],i_rpg:[0,2,1,""],i_sample:[0,2,1,""],i_sample_rf:[0,2,1,""],i_slope:[0,2,1,""],i_tree_direction:[0,2,1,""],i_validate:[0,2,1,""],i_vhrs:[0,2,1,""]},"RasterSat_by_date.RasterSat_by_date":{calcul_ndvi:[4,2,1,""],complete_raster:[4,2,1,""],create_raster:[4,2,1,""],group_by_date:[4,2,1,""],mosaic_by_date:[4,2,1,""],pourc_cloud:[4,2,1,""],raster_data:[4,2,1,""],vrt_translate_gdal:[4,2,1,""]},"Rpg.Rpg":{create_new_rpg_files:[4,2,1,""],mono_rpg:[4,2,1,""]},"Sample.Sample":{create_sample:[4,2,1,""],fill_sample:[4,2,1,""],select_random_sample:[4,2,1,""]},"Seath.Seath":{separability_and_threshold:[4,2,1,""]},"Segmentation.Segmentation":{append_scale:[4,2,1,""],compute_biomass_density:[4,2,1,""],create_cartography:[4,2,1,""],decision_tree:[4,2,1,""]},"Slope.Slope":{extract_slope:[4,2,1,""]},"Toolbox.Toolbox":{calc_serie_stats:[4,2,1,""],check_proj:[4,2,1,""],clip_raster:[4,2,1,""]},"Vector.Vector":{clip_vector:[4,2,1,""],close_data:[4,2,1,""],layer_rasterization:[4,2,1,""],vector_data:[4,2,1,""],zonal_stats:[4,2,1,""],zonal_stats_pp:[4,2,1,""]},"Vhrs.Vhrs":{haralick_texture_extraction:[4,2,1,""],sfs_texture_extraction:[4,2,1,""]},Archive:{Archive:[4,1,1,""]},PHYMOBAT:{MyPopup_about:[0,1,1,""],MyPopup_proxy_window:[0,1,1,""],MyPopup_warming_forgetting:[0,1,1,""],MyPopup_warming_study_area:[0,1,1,""],PHYMOBAT:[0,1,1,""],bin:[0,3,1,""],hex:[0,3,1,""],oct:[0,3,1,""]},Processing:{Processing:[0,1,1,""]},RasterSat_by_date:{RasterSat_by_date:[4,1,1,""]},Rpg:{Rpg:[4,1,1,""]},Sample:{Sample:[4,1,1,""]},Seath:{Seath:[4,1,1,""]},Segmentation:{Segmentation:[4,1,1,""]},Slope:{Slope:[4,1,1,""]},Toolbox:{Toolbox:[4,1,1,""]},Vector:{Vector:[4,1,1,""]},Vhrs:{Vhrs:[4,1,1,""]},ui_A_propos_PHYMOBAT_window:{Ui_About:[0,1,1,""]},ui_PHYMOBATe_tab:{Ui_PHYMOBAT:[0,1,1,""]},ui_PHYMOBATs_tab:{Ui_PHYMOBAT:[0,1,1,""]},ui_Proxy_window:{Ui_Proxy_window:[0,1,1,""]},ui_Warming_forgetting:{Ui_Warming_forgetting:[0,1,1,""]},ui_Warming_study_area:{Ui_Warming_study_area:[0,1,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python classe"],"2":["py","method","Python m\u00e9thode"],"3":["py","function","Python fonction"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:function"},terms:{"10m":3,"12go":[0,3],"15m":3,"50cm":3,"5km":3,"8bit":3,"D\u00e8s":3,"\u00e9boul":3,"\u00e9cart":3,"\u00e9crir":3,"\u00e9dit":3,"\u00e9ffectu":3,"\u00e9gal":3,"\u00e9l\u00e9ment":3,"\u00e9quivalent":3,"\u00e9tap":3,"\u00e9tendu":3,"\u00e9tud":3,"\u00eatre":3,"\u00eelot":3,"\u03c9":3,"\u215b":3,"\u215c":3,"\u215d":3,"\u215e":3,"a\u00e9rosol":3,"acc\u00e9ler":3,"al\u00e9atoir":3,"ann\u00e9":3,"bl\u00e9":3,"boolean":[0,4],"caract\u00e9ris":3,"caract\u00e9rist":3,"cha\u00een":[1,2,3],"class":[0,3,4],"cons\u00e9quent":3,"contr\u00f4l":[],"cr\u00e9":3,"cr\u00e9ation":3,"d\u00e8j\u00e0":2,"d\u00e9but":3,"d\u00e9cimal":3,"d\u00e9cis":3,"d\u00e9clin":3,"d\u00e9coch":3,"d\u00e9compos":3,"d\u00e9compress":3,"d\u00e9coup":3,"d\u00e9coupag":3,"d\u00e9criv":3,"d\u00e9faut":3,"d\u00e9fin":3,"d\u00e9grad":3,"d\u00e9march":[2,3],"d\u00e9marr":[],"d\u00e9p\u00f4t":2,"d\u00e9pend":3,"d\u00e9roul":3,"d\u00e9tail":3,"d\u00e9tect":3,"d\u00e9termin":3,"default":[0,4],"diff\u00e9rent":3,"else":[0,4],"entr\u00e9":3,"entra\u00een":3,"ex\u00e9cu":[],"export":3,"fa\u00e7on":[2,3],"fen\u00eatr":3,"final":[0,3,4],"float":[3,4],"for":[0,3,4],"function":[0,4],"g\u00e9ner":3,"g\u00e9o":[],"g\u00e9ospatial":[],"gr\u00e2c":3,"h\u00f4t":2,"impl\u00e9ment":3,"import":[0,2,3,4],"ind\u00e9pend":3,"int":[0,4],"long":[3,4],"m\u00e9lang":3,"m\u00e9moir":3,"m\u00e9thod":3,"m\u00e9thodolog":3,"m\u00eam":3,"ma\u00ef":3,"mosa\u00efqu":3,"mosa\u00efquag":3,"n\u00e9glige":3,"new":[0,3,4],"num\u00e9ro":3,"p\u00e9riod":3,"pr\u00e9":3,"pr\u00e9alabl":3,"pr\u00e9c\u00e9dent":3,"pr\u00e9cis":[],"pr\u00e9sent":3,"r\u00e9alis":3,"r\u00e9duir":3,"r\u00e9el":3,"r\u00e9f\u00e9rent":3,"r\u00e9gistr":3,"r\u00e9pond":3,"r\u00e9pons":2,"r\u00e9solu":3,"r\u00e9sultat":3,"repr\u00e9sent":3,"repr\u00e9sentent":3,"return":4,"s\u00e9lect":3,"s\u00e9lection":3,"s\u00e9par":3,"short":4,"t\u00e9l\u00e9charg":2,"t\u00e9l\u00e9d\u00e9tect":[0,1,3],"this":[0,4],"v\u00e9get":3,"v\u00e9rif":3,"v\u00e9rifi":2,"with":[0,3,4],"z\u00e9ro":3,Avec:3,Ces:3,Cet:3,Cette:3,Elle:3,Ils:3,Les:3,Par:[2,3],Pas:3,Pour:[2,3],Sur:3,Une:3,Via:[],__author__:0,__date__:0,__license__:0,__name__:0,__version__:0,_captor:3,_in_d:4,_one_dat:4,_pretty:3,a_nodat:3,aaaa:3,abord:3,about:[1,3],about_phymoba:0,abov:4,absolu:3,acced:2,accept:3,acces:3,account:[0,4],account_cloud:4,account_stat:4,activ:3,activat:0,activate_level:0,add:[0,2,4],add_fieldnam:4,add_sampl:0,advanced:4,affect:3,affich:2,after:0,agit:3,agricol:3,agricultur:3,aid:[2,3],ains:3,ajout:[2,3],alert:0,algorithm:1,all:[0,2,4],alleaum:3,allocat:4,allow:[0,4],alpha:4,also:0,alti:3,altitud:[0,1,3],alway:0,analys:[3,4],annuel:3,annul:[],any:2,api:1,app_haralicktextureextract:4,app_sfstextureextract:4,append:[0,4],append_scal:4,applicat:4,appliqu:[3,4],apport:3,approch:3,appui:3,apres:3,apt:2,arborescent:3,arbre:3,archiv:[0,3],archive_dowload:4,archive_download:4,are:[0,4],area:3,area_coord_corn:4,array:4,arrier:[],articl:4,assez:3,associ:3,associated:[0,4],attent:3,attribute_r:4,aucun:3,aur:2,authenticat:3,authentif:3,authoriz:3,automat:[],automated:[3,4],automatically:4,autr:3,avail:[0,4],availabl:4,avanc:[],avant:3,avantag:3,averag:4,avoir:3,backup:0,band2:4,band3:4,band4:4,band:[0,3,4],bar:0,barr:[],bas:[2,3],based:[3,4],bash:[],basic:4,bass:[0,1,3],bear:3,becaus:[0,4],been:0,best:0,between:4,bhattacharyi:4,bibliothequ:[],bien:[2,3],big_fold:[0,4],bin:[0,2,4],biomass:4,blanc:[1,3],bleu:3,block:0,block_for_swh:0,bon:[],bottom:4,bouton:3,box:[0,3,4],broken:0,brows:0,build:[0,3,4],built:0,button:0,cach:2,calc_serie_stat:[0,3,4],calcul:3,calcul_ndv:[0,3,4],calculent:3,calibr:3,can:[0,4],cannot:2,capteur:3,captor:[0,4],captor_project:0,car:3,caracter:3,carhab:[0,1,3],carhab_v2:3,carr:3,cart:3,cartograph:3,cartography:4,cas:[2,3],cec:3,cel:3,cent:4,certain:[2,3],champ:3,changed:0,channel:[3,4],chaqu:3,charg:3,check:[0,3,4],check_proj:4,checkbox:0,checked:0,checksum:2,chemin:3,cher18_small_zone_test:3,cherch:3,chiffr:3,childprocess:[],chlorophyllien:3,choic:4,choice_nb_b:[3,4],chois:3,choix:3,choos:3,chromedriv:[],chromium:[],cinq:3,cirrus:3,cit:[],clair:3,class_arch:[0,4],class_arg:[0,3],class_tab_final:4,classif:0,classif_year:0,classifi:0,classifieur:3,classnam:4,classname1:4,classname2:4,clear:[0,4],clear_sampl:0,click:0,clip:[0,4],clip_:4,clip_rast:[0,3,4],clip_vector:4,cliqu:[],clos:[0,3,4],close_button:[0,3],close_dat:4,close_window:0,cloud:[0,3,4],clust:4,cne:3,coch:3,cod:[2,3],code_group:3,collect:3,colon:3,com:[3,4],combin:4,combin_tre:4,combo:0,combobox:0,comboxbox:0,comm:[2,3],command:[1,2,3,4],compar:0,compatibl:1,complet:[0,3,4],complete_rast:[0,4],completiondat:3,complex:3,compos:3,comprennent:3,compress:[2,3],comput:[0,4],compute_biomass_density:[3,4],computed:0,concern:3,condit:0,confus:0,connect:0,connexion:0,consider:4,consist:3,consol:[2,3],construit:[2,3],contain:4,content:1,context:[3,4],contient:3,contr:3,contrair:3,control:1,convert:[3,4],coor_test:4,coord_box_dd:4,coordconvert:4,coordinat:4,coordon:3,copy:[],corn:4,correl:4,correspond:3,correspondent:3,cot:3,couleur:3,cour:[],couvertur:3,creat:[0,4],create_cartography:[3,4],create_new_rpg_fil:4,create_rast:[0,3,4],create_sampl:[0,3,4],created:4,crop:[0,4],crop_to_cutlin:3,csv:[0,4],cultur:3,cultural:3,culture:4,curl:[2,3],curl_proxy:3,curlftpf:2,current:[],cut:4,cutlin:3,d_un:4,dan:[2,3],dat:[3,4],data:3,data_cloud:3,data_sourc:4,data_spec:3,data_test:3,dataset:3,datasetnam:2,datasourc:2,day:4,decis:[0,3,4],decision_tre:[3,4],declar:0,declared:0,decompress:[0,3,4],decr:3,defin:4,defined:4,degr:3,degre:[0,4],dehor:3,dem:4,demand:3,dens:[3,4],densit:3,density:4,depuis:[2,3],derni:3,dertermin:4,described:0,dessous:[2,3],dessus:[2,3],determined:0,deux:[2,3],deuxiem:3,dev:2,developerwork:4,developp:3,deviat:3,deviennent:3,diagram:[0,4],dict:4,dictionnary:4,didn:4,different:[0,3,4],digital:4,dimens:4,dir:3,direct:[3,4],dirnam:3,discrimin:3,discriminat:0,display:0,display_all_level:0,display_one_level:0,display_two_level:0,disponibl:3,dissoci:3,dist:[3,4],distanc:4,distinct:3,distingu:3,distribu:[3,4],dit:3,diver:2,docu:3,document:[],does:0,doesn:4,doit:3,domain:2,don:[2,4],donc:3,donne:3,dont:3,dossi:[2,3],dot:3,down:0,download:[0,3,4],download_auto:[3,4],downloaded:[0,4],downloading:0,droit:[],dsd:[],dst_dat:[3,4],dstnodat:3,duplicated:[0,4],each:0,easting:4,eboul:3,echantillon:3,echantillone:0,eclipsefold:3,ecw:3,edit:0,effac:3,effet:3,egg:4,element:1,elevat:4,emphas:4,emplac:3,empris:3,empty:4,encor:2,end:0,energy:4,engin:[],enhanced:3,enregistr:3,ensuit:[2,3],entendu:3,enter:0,enter_sample_nam:0,enter_sample_name_hl:0,enter_sample_name_ll:0,entit:3,entre:3,entrer:[2,3],entrop:4,entropy:4,epsg:4,equal:4,erreur:3,estimators_:3,etc:[3,4],eval:0,eventuel:3,every:[0,4],exact:4,exampl:4,exe:[],exempl:2,exist:[3,4],existed:4,existent:0,existing:0,expert:0,export_graphviz:3,extent:4,extern:2,extract:[0,3,4],extract_slop:4,extrair:3,extrait:3,extrem:3,f_out:3,f_output_name_mob:0,f_path_ar:0,f_path_folder_dpt:0,f_path_mnt:0,f_path_ortho:0,f_path_segm:0,f_proxy:0,fac:3,facult:3,faibl:[3,4],failure:2,fair:3,fait:3,fals:3,faudr:2,fauss:3,faut:[2,3],featur:[3,4],feature_importances_:3,feature_important_rf:3,ferm:3,few:[0,4],few_list_arch:4,fichi:[2,3],field:[0,4],field_display_1:0,field_display_2:0,field_display_3:0,field_display_4:0,field_display_5:0,field_display_6:0,fieldnam:[0,3,4],fieldname_arg:[0,3],figur:3,fil:[0,3,4],file_decisiontre:3,file_feat_import:3,fill:[0,4],fill_sampl:4,fin:3,first:[0,4],fit:3,fogotten:0,fois:3,fold:[0,4],folder_arch:0,folder_processing:0,fonction:3,fond:[1,3],forest:0,forget_raster_sampl:0,forget_study_ar:0,forgotten:0,form:4,format:3,formul:4,fort:[3,4],fourn:3,framework:[],from:[0,2,3,4],ftp:2,func:[],fuse:2,fusion:3,futur:4,gagn:3,gain:3,gdal:[0,2,3,4],gdal_translat:[3,4],gdalbuildvrt:[3,4],gdalinfo:2,gdalwarp:3,general:2,geographic:4,geojson:[0,3],geotiff:3,geour:4,get:[0,2,4],get_product:3,get_token:3,get_vari:0,getfid:3,git:3,github:[3,4],going:0,gpl:0,grand:3,graphical:1,graphiqu:3,grass:0,gratuit:3,great:0,grey:4,group:4,group_by_dat:[3,4],grouped:4,groupes:4,gtiff:3,habitat:3,haralick:[0,3,4],haralick_funct:3,haralick_texture_extract:4,haralicktextur:4,has:[0,4],hasn:0,haut:3,hav:4,head:4,head_in_read:4,help:[0,2,4],help_tool:[0,3],hemispher:4,herbac:3,herbace:4,heritag:3,hex:0,high:4,hist:2,histogram:4,hom:3,hor:[],html:[0,3,4],http:[2,3,4],hypothes:3,i386:2,i_classifi:[],i_classifier_:[0,3],i_classifier_rf:[0,3],i_download:0,i_glob:0,i_images_processing:0,i_img_sat:0,i_rpg:0,i_sampl:[0,3],i_sample_rf:[0,3],i_slop:0,i_tree_direct:0,i_validat:0,i_vhr:[0,3],ibm:4,ic1:4,ic2:4,ice:[],id_proxy:0,idem:2,ident:3,identifi:3,identity:4,idm:[3,4],ign:3,imag:[0,1],img:4,img_cloud:4,img_sample_nam:0,img_spec:4,importerror:2,in1d:3,in_d:[0,4],in_featur:3,in_rast:0,includ:4,inclur:3,inclut:3,index:[0,1],indic:3,indiqu:[2,3],indiquent:3,inerti:4,info:4,inform:[0,3,4],infra:3,inherit:4,initial:0,initializ:0,initui:0,inject:3,input:[0,3,4],inrast:4,inscrir:3,inscrit:3,insdispens:3,install:2,installat:1,installing:2,instant:3,integ:4,integr:[],integrat:0,interfac:1,intervall:3,into:0,invers:[3,4],invert:3,invit:[],irc:3,irste:3,irstea:[0,4],isn:0,isnan:3,issu:3,issuerid:3,issus:3,jav:4,jeffr:4,jeu:[],join:3,joint:3,jour:3,json:3,juin:3,just:3,keep:4,kenj:4,know:4,kown:4,kw_class:4,kw_field:4,kwarg:[0,3,4],labour:3,lai:[0,4],lambert:4,lanc:3,land:[0,3,4],landsat8:3,landsat:3,landsat_test:4,lang:3,laquel:3,last:0,latest:4,latitud:4,launch:[0,4],launched:[0,4],laventur:3,laventure:0,layer_rasteriz:[0,3,4],learn:2,least:0,left:4,len:3,length:4,level:[0,4],liaison:[],lib:4,library:4,libtest:[],licenc:3,licens:0,lign:[2,3],ligneux:[3,4],lik:[0,4],limit:3,lin:[0,4],lingeux:3,link:0,linux:[1,2],list:[0,3,4],list_arch:3,list_band_outrast:3,list_nb_sampl:[0,3],list_year:4,listing:[0,4],listmdd:2,load:0,local:4,locat:0,logiciel:[],login:0,longitud:4,longu:3,look:4,loop:3,low:4,lxml:2,machin:3,maillag:3,main:[0,4],mainly:4,maj_count:[3,4],maj_count_perc:4,majority:4,mak:0,malgr:3,mar:0,mask_cloud:3,mask_spec:3,masqu:3,math:3,matric:3,matrix:[0,4],matusit:4,max:[0,3,4],maxcon:4,maximum:[3,4],maxmin:3,maxrecord:3,mdd:2,mean:[0,4],measur:4,medi:3,memory:[0,4],menu:[0,3],merg:4,messag:0,method:[0,4],metr:3,mettr:3,milieux:[0,1,3],min:[0,3,4],min_siz:4,minimum:[0,3,4],mis:3,mixt:[3,4],mnt:[0,4],moba:[0,1,3],mod:[0,3],mode_expert:[0,3],mode_simpl:[0,3],model:[0,4],modified:4,modify:0,modul:[0,1,3],moin:3,mois:3,moment:[3,4],mono:[0,3,4],mono_:4,mono_rpg:4,month:4,montr:3,montrent:3,mor:[0,4],mosaic:4,mosaic_by_dat:[3,4],mosaiqueirc:3,mot:3,moyen:[3,4],mult:[0,3,4],multiprocessing:3,multispectral:4,must:0,my_fil:3,mypopup_about:[0,3],mypopup_proxy_window:0,mypopup_warming_forgetting:0,mypopup_warming_study_ar:0,nam:[0,2,4],named:2,nathal:4,natur:3,naturel:[3,4],navig:[],nb0:[3,4],nb0_test:4,nb_avalaible_imag:0,nb_captor:4,nb_img:4,nb_sampl:4,nbband:4,nbdir:4,nbre:3,ndarray:4,ndvi:[0,3,4],need:[0,4],next:0,niveau:3,niveau_1:3,niveau_2:3,niveau_3:3,noct:2,nofl:2,nogcp:2,nom:3,nombr:3,nomd:2,nomm:3,non:[0,2,3,4],nonuniformity:4,norat:2,normal:[],north:4,northernhemispher:4,northing:4,not:[0,3,4],nouveau:3,nouvel:3,nuag:3,nuageux:3,numb:[0,4],numer:3,numpy:[2,4],nussbaum:[3,4],object:[3,4],objet:3,obligatoir:3,oct:0,offset:4,ogr:[0,2,4],ok_button:0,oli:3,olivierhagoll:[3,4],one:[0,4],one_dat:[0,4],onglet:3,only:4,open:[0,1,3],open_backup:[0,3],operational:3,opt:[3,4],optimal:[0,3,4],option:[0,4],orbitr:3,order:[0,4],org:[2,4],orient:3,ortho:3,orthograph:3,orthophotograph:3,ose:4,osgeo4w:[],osgeo:2,otb:[0,2,3,4],otbcb:4,otbcli_haralicktextureextract:[3,4],otbcli_sfstextureextract:[3,4],other:0,out:[3,4],out_arch:4,out_carto:3,out_class_nam:4,out_d:4,out_fieldnam:4,out_fieldname_carto:0,out_fieldtyp:4,out_fieldtype_carto:0,out_fil:3,out_haralick:[3,4],out_mnt:4,out_rast:4,out_sf:[3,4],out_threshold:[0,4],outclip:4,outil:[1,2,3],outpu:4,output:[0,3,4],output_fil:4,output_name_mob:0,output_sampl:4,ouvert:[0,1,3],ouvr:3,oxideqt:[],p_har:3,p_sf:3,p_stat:4,packag:[1,2],pag:[1,3],pair:3,palc:3,panchromat:3,parameter:[0,3,4],parametr:[0,3,4],parcellair:3,parent:0,part:[0,3],pass:3,passag:3,password:[0,4],password_thei:[3,4],path:[0,3,4],path_ar:[0,3],path_folder_dpt:0,path_mnt:0,path_ortho:[0,3],path_rpg:0,path_segm:0,pent:3,percent:4,percentag:[0,4],perl:[],permanent:3,permet:3,permettent:3,personnalis:3,peut:3,peuvent:3,phas:3,phpun:[],phpunit:[],phy:1,phymobat:[0,3,4],phymobate:0,physionom:[1,3],physionomiqued:0,phytom:[3,4],pilot:[],pip:2,pixel:[0,3,4],plac:3,plain:0,plan:[],plateform:[3,4],platform:0,plus:3,plusieur:3,point:[0,3,4],poly:3,polygon:[0,3,4],popup:1,possed:3,post:3,pourc:3,pourc_cloud:[0,3,4],pourc_int:3,pourcent:4,pourcentag:3,pourr:3,ppa:2,prair:3,prec:3,precis:[0,4],predict:3,prefix:4,premi:[2,3],princip:3,principal:[0,3],print:[0,3,4],probably:4,proccessing:3,process:[0,3,4],processeur:3,processing:[1,3],processus:1,proch:3,product:3,programm:3,proj4:2,project:4,prominent:4,propert:4,property:4,propos:[0,3],propr:3,provided:4,proxy:[0,3],proxy_enabled:4,psi:4,puis:3,puisqu:3,pushing:0,pxl:4,py2:[2,4],pyp:2,pyqt4:2,python2:4,python:[1,3],qb_roadextract:4,qtextstream:0,quality:0,quant:3,quitt:3,radio:0,radius:4,random:[0,4],rang:3,rank:4,ranking:4,rappel:3,rapport:3,rast:[0,3,4],raster1:3,raster2:3,raster:[0,3,4],raster_d:4,raster_dat:4,raster_head:4,raster_path:3,rasteriz:[0,3,4],rastersat_by_dat:[0,3,4],rasterstat:[2,4],ratio:4,reach:0,readthedoc:4,real:3,recherch:1,record:0,recouv_crops_rpg:3,ref:4,regroup:3,remot:[],remov:[3,4],remove_shp:4,rempl:3,remplac:3,renseign:3,rentr:3,renvoi:3,repertory:4,repository:2,resolu:4,resp:3,rest:3,resto:3,result:4,retourn:[0,4],retranslateu:[],retrouvent:3,rfg93:4,rgp:4,right:4,rm_dpli:4,rm_dupl:4,rm_rast:4,rocket:3,roug:3,rpg:[0,3],rpg_tif:3,ruby:[],run:4,s2a:3,sam:[0,4],sampl:[0,3],sample_nam:[0,3],sample_rd:3,samuel:3,san:3,satellit:[0,3,4],sauv:3,sauvegard:3,sav:0,save_backup:[0,3],save_test:3,savoir:3,say:0,scal:4,scik:2,script:3,search:[0,2,3],seath:[0,4],second:3,section:2,segment:[0,3,4],select:[0,3,4],select_class:4,select_id:4,select_random_sampl:4,selected:[0,4],selenium:[],self:3,selon:3,sem:[3,4],sentinel2:3,sentinel:[3,4],separability_and_threshold:[0,3,4],ser:3,serv:[0,3],serveur:3,servic:3,set:[0,3,4],set_list_archive_to_try:4,set_vari:0,setup:2,seuil:3,seul:3,several:4,sfs:[0,3,4],sfs_function:3,sfs_texture_extract:4,sfstextur:4,shad:4,shapefil:[0,3,4],shapely:2,shel:[],shp:3,sig:1,signal:3,signif:3,simpl:[0,3,4],simplifi:[],simplify:0,simply:0,singl:4,sinon:3,sit:3,siz:[3,4],skip:[],sklearn:[0,2,3],slop:[0,3],small:4,sol:3,somm:3,sort:3,sourc:[0,1,3,4],sous:[2,3],spathr:[3,4],spatial:[3,4],spatialis:[],specific:4,specified:2,spectral:[0,3,4],spethr:[3,4],sple:3,sportworldheritag:0,spot:3,spotworldheritag:4,src_dat:4,srcnodat:3,stabl:2,stack:3,standard:3,start:3,startdat:3,stat:[0,2,4],statist:3,statistic:[0,4],stats_dat:0,stats_dict:4,stats_rpg_tif:[3,4],stats_test:0,std:[0,3,4],stock:3,stor:[0,4],stored:0,str:[0,3,4],string:[3,4],structur:3,structural:3,study:[0,4],study_ar:3,subdataset:2,subprocess:3,sudo:2,suff:[2,3],suiv:[2,3],suivr:[2,3],sum:[3,4],superfic:3,surfac:3,sylvio:0,sylviol:3,syntax:2,system:[0,2,3],tab:0,tabl:4,tableau:[],tak:[0,4],taking:4,tap:[2,3],tar:2,tarfil:3,target:3,techniqu:3,tel:0,temp:[2,3],temporal:[0,3,4],temporel:3,ten:0,term:3,terrain:3,test:[2,4],tetis:0,text:0,textur:[0,3],texture_choic:4,than:[0,4],that:[0,4],the:[0,3,4],thei:[0,4],theia_download:[3,4],then:0,ther:[0,4],they:4,threshold:0,tif:[3,4],tim:0,tir:3,token:3,tool:[2,3,4],toolbox:[0,3],top:4,tous:3,tout:3,trac:[],training:4,traint:1,trait:[0,2],transfer:2,translat:4,traver:3,tre:[0,3,4],tree_in_forest:3,tres:3,trois:3,trouv:3,tru:[3,4],tuil:3,tupl:4,tutoriel:1,two:[0,4],typ:[0,3,4],ubuntu:2,ubuntug:2,ui_a_propos_phymobat_window:0,ui_about:0,ui_phymobat:[0,3],ui_phymobat_tab:0,ui_phymobate_tab:[0,3],ui_phymobats_tab:[0,3],ui_proxy_window:[0,3],ui_warming_forgetting:0,ui_warming_study_ar:0,umr:0,under:4,uniqu:[2,3],unpack:4,unstabl:2,until:0,unzip:0,updat:2,url:[2,3,4],urlencod:3,usag:2,use:[0,4],used:[0,4],user:[1,4],user_thei:[3,4],usernam:[0,4],using:0,usr:4,utilis:[1,2],utm:4,utm_to_latlng:4,valeur:3,valid:[0,3],valid_rast:4,validat:[0,4],validated:4,valu:[0,4],value_1:4,value_2:4,variabl:[0,4],varianc:4,various:0,vect:4,vecteur:3,vector:[0,1,3],vector_cut:4,vector_dat:4,vector_used:[0,3,4],vector_val:4,veget:4,verr:[],version:[0,2],vert:3,vhr:[0,3,4],vhrs:0,via:3,virgul:3,virtual:3,virtuel:3,vis:3,visibl:3,viv:3,voir:[2,3],votr:3,vrt:[3,4],vrt_translat:4,vrt_translate_gdal:[3,4],vue:3,want:4,warming:1,wavelet:3,way:0,web:[],webdriv:[],websit:[0,4],wheel:2,when:0,whl:2,widget:0,width:4,will:[0,4],window:0,wooden:0,word:3,work:4,writ:3,www:4,x86_64:[],x_rf:3,xml:[0,3],xrad:[3,4],xxxxxx:2,y_rf:3,year:[0,4],you:[0,4],yrad:[3,4],zip:2,zipfil:3,zon:[3,4],zonal:[0,3,4],zonal_stat:[0,3,4],zonal_stats_pp:[3,4]},titles:["Graphical User Interface package","Documentation de PHYMOBAT","Installation","Processus utilis\u00e9es et tutoriels API","CarHab Phy MOBA package"],titleterms:{"64bit":[],"\u00e9chantillon":3,"cha\u00een":[],"t\u00e9l\u00e9charg":3,about:0,algorithm:3,and:[0,1,4],api:3,archiv:4,carhab:4,classif:[3,4],command:0,control:0,document:1,don:3,element:0,exempl:3,expert:3,forest:3,form:3,graphical:0,imag:[3,4],index:4,indic:1,installat:2,interfac:[0,3],jeu:3,landsat:4,linux:[],listing:3,moba:4,model:3,modul:2,moldel:3,open:2,packag:[0,4],phy:4,phymobat:1,plat:3,popup:0,processing:[0,4],processus:3,python:2,random:3,rpg:4,sampl:4,seath:3,separability:4,sig:2,simplifi:3,slop:4,sourc:2,sous:[],sup:4,tabl:1,test:3,textur:4,thei:3,threshold:4,thrs:3,toolbox:4,trait:3,trusty:[],tutoriel:3,ubuntu:[],user:0,utilis:3,vector:4,warming:0,window:[]}}) \ No newline at end of file diff --git a/Log/.gitkeep b/Log/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Outils.py b/Outils.py new file mode 100644 index 0000000000000000000000000000000000000000..7b8f835c9146dedf8183017c8fcdd2b30327fc99 --- /dev/null +++ b/Outils.py @@ -0,0 +1,103 @@ +#!/bin/env python +# -*- coding: utf-8 -*- + +import argparse +import logging +from logging.handlers import RotatingFileHandler +import signal +from contextlib import contextmanager +import inspect +import traceback + +try: + import Constantes +except : + pass + + +class Fusion(argparse.Action): + def __init__(self, option_strings, dest, nargs=None, **kwargs): + super(Fusion, self).__init__(option_strings, dest, nargs, **kwargs) + def __call__(self, parser, namespace, values, option_string=None): + setattr(namespace, self.dest, ' '.join(values).lower()) + +class Log(object): + + def __init__(self, dossier, nomFichier, niveau=None): + + super(Log, self).__init__() + + stack = inspect.stack() + nom_classe = stack[1][0].f_locals["self"].__class__.__name__ + + self.__logger__ = logging.getLogger(nomFichier) + + if niveau is None: + try: + niveau = Constantes.NIVEAU_DEFAUT + except : + niveau = logging.DEBUG + + self.__logger__.setLevel(niveau) + + format_fichier = logging.Formatter('%(asctime)s :: %(levelname)s :: %(message)s', datefmt='%d-%m-%Y %H:%M:%S') + fichierLog = RotatingFileHandler("{0}/{1}.log".format(dossier, nomFichier), 'a', 1000000, 1) + + fichierLog.setLevel(niveau) + fichierLog.setFormatter(format_fichier) + self.__logger__.addHandler(fichierLog) + + format_console = logging.Formatter('%(asctime)s :: {0} :: %(levelname)s :: %(message)s'.format(nom_classe), datefmt='%d-%m-%Y %H:%M:%S') + + console = logging.StreamHandler() + console.setLevel(niveau) + console.setFormatter(format_console) + self.__logger__.addHandler(console) + + def info(self, message): + self.__logger__.info(message) + + def debug(self, message): + self.__logger__.debug(message) + + def warning(self, message): + self.__logger__.warning(message) + + def error(self, message): + self.__logger__.error(message) + + def critical(self, message): + self.__logger__.critical(message) + + def exception(self, message): + self.__logger__.exception(message) + + def close(self): + for handler in self.__logger__.handlers[:] : + handler.close() + self.__logger__.removeHandler(handler) + + +class TimeoutException(Exception): pass + +@contextmanager +def limitation_temporelle(secondes): + + def signal_handler(signum, frame): + raise TimeoutException + + signal.signal(signal.SIGALRM, signal_handler) + signal.alarm(secondes) + + try: + yield + finally: + signal.alarm(0) + +# Utilisation : +# +# try: +# with limitation_temporelle(temps_en_seconde): +# appel_fonction() +# except TimeoutException: +# pass \ No newline at end of file diff --git a/PHYMOBAT.py b/PHYMOBAT.py index 30296f4ec93b8740a88bf1119e874d89cf6bcd58..39dbf390f55b282bc3ef7e72cdf30610a5a21355 100644 --- a/PHYMOBAT.py +++ b/PHYMOBAT.py @@ -1,18 +1,18 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# +# # Copyright 2016 Sylvio Laventure (IRSTEA - UMR TETIS) # # PHYMOBAT 3.0 is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # PHYMOBAT 3.0 is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with PHYMOBAT 3.0. If not, see <http://www.gnu.org/licenses/>. @@ -31,1512 +31,1399 @@ __date__ = "Mars 2016" """ import os, sys, time -from PyQt4.QtCore import * -from PyQt4.QtGui import * +from PyQt5 import QtWidgets, QtCore + from _collections import defaultdict try : - import ogr + import ogr except : - from osgeo import ogr - -try: - _fromUtf8 = QString.fromUtf8 -except AttributeError: - def _fromUtf8(s): - return s - + from osgeo import ogr + import webbrowser import lxml.etree as ET -from ui_A_propos_PHYMOBAT_window import Ui_About -from ui_Warming_study_area import Ui_Warming_study_area -from ui_Warming_forgetting import Ui_Warming_forgetting -from ui_Proxy_window import Ui_Proxy_window +import Popup from Processing import Processing +import Constantes +import Outils + +class PHYMOBAT(QtWidgets.QMainWindow, Processing): + """ + Interface main class. It makes to link ``ui_PHYMOBAT_tab`` and ``Processing``. + """ + + def __init__(self, mode = Constantes.SIMPLE_MODE, parent=None): + super(PHYMOBAT, self).__init__(parent) + Processing.__init__(self) + + self.apropos = Popup.about() # For the "About PHYMOBAT" window + self.w_study_area = Popup.warming_study_area() # For the "Warming : forget study area" window + self.w_forget = Popup.warming_forgetting() # For the "Warming : forgetting" window + + self.window = None # The "PHYMOBAT" window + self.current_mode = mode + + self.logger = Outils.Log("Log", "Phymobat") + + # To select interface's parameters + if self.current_mode == Constantes.EXPERT_MODE: + self.logger.info("Expert mode.") + global Ui_PHYMOBAT, _translate + from ui_PHYMOBATe_tab import Ui_PHYMOBAT, _translate + elif self.current_mode == Constantes.SIMPLE_MODE: + self.logger.info("Simple mode.") + global Ui_PHYMOBAT, _translate + from ui_PHYMOBATs_tab import Ui_PHYMOBAT, _translate + + self.initUI() + + def initUI(self): + + """ + Get initial values from interface after a click button. + + There is : + + - Connect browser button to search a path + * Main folder path + * Study area shapefile path + * VHRS image path + * MNT image path + * Segmentation shapefile path + * Output classification shapefile path + * Sample shapefile path + * Image path for samples if the first processing image hasn't been launched + + - Connect button to add sample in the memory list + - Connect button to clear sample record. Clear in the interface and in the memory list + - Connect close|ok button + - Connect menu bar tab (Open backup, save in a xml file, close, help, About PHYMOBAT, mode) + - Initialize backup variable + + """ + + # Initial interface + self.ui = Ui_PHYMOBAT() + self.ui.setupUi(self) + + # Connect browser button to search a path + ########################################## + # Main folder path + self.ui.lineEdit_principal_folder.clear() + self.ui.pushButton_browser_principal_folder.clicked.connect(self.f_path_folder_dpt) + + # Block other function if SpotWorldHeritage is chose + try : + self.ui.comboBox_captor.currentIndexChanged.connect(self.block_for_swh) + except AttributeError: + pass + + # VHRS image path + self.ui.lineEdit_VHRS.clear() + self.ui.pushButton_browser_VHRS.clicked.connect(self.f_path_ortho) + + # Study area shapefile path + self.ui.lineEdit_area_path.clear() + self.ui.pushButton_browser_area_path.clicked.connect(self.f_path_area) + + # Proxy + self.ui.proxy.clicked.connect(self.f_proxy) + + # Segmentation shapefile path + self.ui.lineEdit_segmentation.clear() + self.ui.pushButton_browser_segmentation.clicked.connect(self.f_path_segm) + + # MNT image path + self.ui.lineEdit_MNT.clear() + self.ui.pushButton_browser_MNT.clicked.connect(self.f_path_mnt) + + # Output classification shapefile path + self.ui.lineEdit_output.clear() + self.ui.pushButton_browser_output.clicked.connect(self.f_output_name_moba) + + # Sample shapefile path. + # For the simply mode, RPG file sample. + self.ui.lineEdit_sample_path.clear() + self.ui.pushButton_browser_sample_path.clicked.connect(self.enter_sample_name) + + if self.current_mode == Constantes.SIMPLE_MODE: + # For the simply mode, grass/wooden file sample. + self.ui.lineEdit_sample_path_2.clear() + self.ui.pushButton_browser_sample_path_2.clicked.connect(self.enter_sample_name_hl) + # For the simply mode, wooden file sample. + self.ui.lineEdit_sample_path_3.clear() + self.ui.pushButton_browser_sample_path_3.clicked.connect(self.enter_sample_name_ll) + + # Image path for samples if the first processing image hasn't been launched + try: + self.ui.pushButton_img_sample.clicked.connect(self.img_sample_name) + except AttributeError: + pass # Simple mode + ########################################## + + # Connect button to add sample in the memory list + try: + self.ui.pushButton_add_sample.clicked.connect(self.add_sample) + except AttributeError: + pass # Simple mode + + # Connect button to clear sample record. Clear in the interface and in the memory list + try: + self.ui.pushButton_clear_sample.clicked.connect(self.clear_sample) + except AttributeError: + pass # Simple mode + + # Connect close|ok button + # self.ui.buttonBox.button(QtWidgets.QDialogButtonBox.Close).clicked.connect(self.close_button) + self.ui.buttonBox.button(QtWidgets.QDialogButtonBox.Close).clicked.connect(self.close_button) + self.ui.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).clicked.connect(self.ok_button) + + # Connect Menu bar + self.ui.actionOuvrir.triggered.connect(self.open_backup) # Open backup + self.ui.actionSauver.triggered.connect(self.save_backup) # Save field name on the interface + self.ui.actionQuiter.triggered.connect(self.close_button) # Close + self.ui.actionAide_de_PHYMOBAT.triggered.connect(self.help_tools) # Help + self.ui.actionA_propos_de_PHYMOBAT.triggered.connect(self.about_PHYMOBA) # About PHYMOBA + self.ui.actionMode_Simplifi.triggered.connect(lambda checked, mode=Constantes.SIMPLE_MODE: self.change_mode(mode)) # To open the simple apply + self.ui.actionMode_expert.triggered.connect(lambda checked, mode=Constantes.EXPERT_MODE: self.change_mode(mode)) # To open the expert apply + + self.rpg_tchek = [] # To backup rpg mode + self.img_sample = [] # To backup + + # Connect change line edit on sample path to extract fieldnames. For the simply mode, this + # is with RPG sample + self.ui.lineEdit_select_sample_fieldname_1.textChanged.connect(self.field_display_1) + self.ui.lineEdit_select_sample_fieldname_2.textChanged.connect(self.field_display_2) + + # To choose the classification method + if self.current_mode == Constantes.EXPERT_MODE: + if self.ui.radioButton_rf.isChecked(): + self.ui.checkBox_classifier_1.setEnabled(False) + self.ui.checkBox_classifier_2.setEnabled(False) + + self.ui.radioButton_rf.toggled.connect(self.activate_level) + self.ui.radioButton_s.toggled.connect(self.activate_level) + + if self.current_mode == Constantes.SIMPLE_MODE: + # Connect change line edit to grass/wooden sample + self.ui.lineEdit_select_sample_fieldname_3.textChanged.connect(self.field_display_3) + self.ui.lineEdit_select_sample_fieldname_4.textChanged.connect(self.field_display_4) + self.ui.lineEdit_select_sample_fieldname_5.textChanged.connect(self.field_display_5) + self.ui.lineEdit_select_sample_fieldname_6.textChanged.connect(self.field_display_6) + + # Change connect for classification checkboxes + try: + self.ui.checkBox_classifier_1.stateChanged.connect(self.display_one_level) + self.ui.checkBox_classifier_2.stateChanged.connect(self.display_two_levels) + self.ui.checkBox_classifier_3.stateChanged.connect(self.display_all_levels) + except AttributeError: + pass # Simple mode + + def get_variable(self): + """ + Add a all system value like : + + - Main folder path by line edit + - Satellite captor name by combo box + - Classification year by line edit + - Study area shapefile path by line edit + - Connexion username and password by line edit + - VHRS image path by line edit + - MNT image path by line edit + - Segmentation shapefile path path by line edit + - Output classification shapefile path by line edit + - Output shapefile field name by line edit and field type by combo box + + """ + # Main folder path by line edit. + self.path_folder_dpt = "%s" % self.ui.lineEdit_principal_folder.text() + + # Satellite captor name by combo box + try: + self.captor_project = self.ui.comboBox_captor.currentText() + except AttributeError: + self.captor_project = "Landsat" + + # Classification year by line edit + self.classif_year = "%s" % self.ui.lineEdit_year_images.text() + + # Study area shapefile path by line edit + self.path_area = "%s" % self.ui.lineEdit_area_path.text() + + # Connexion username and password by line edit + self.user = "%s" % self.ui.lineEdit_user.text() + self.password = "%s" % self.ui.lineEdit_password.text() + + # VHRS image path by line edit + self.path_ortho = "%s" % self.ui.lineEdit_VHRS.text() + + # MNT image path by line edit + self.path_mnt = self.ui.lineEdit_MNT.text() + + # Output shapefile field name by line edit and field type by combo box + try: + if self.ui.checkBox_classifier_1.isChecked() and self.ui.lineEdit_fieldname_1.text() != '': + self.out_fieldname_carto.append("%s" % self.ui.lineEdit_fieldname_1.text()) + self.out_fieldtype_carto.append(eval("ogr.OFT%s" % self.ui.comboBox_fieldname_1.currentText())) + + if self.ui.checkBox_classifier_2.isChecked() and self.ui.lineEdit_fieldname_12.text() != '': + self.out_fieldname_carto.append("%s" % self.ui.lineEdit_fieldname_12.text()) + self.out_fieldtype_carto.append(eval("ogr.OFT%s" % self.ui.comboBox_fieldname_12.currentText())) + + if self.ui.lineEdit_fieldname_2.text() != '': + self.out_fieldname_carto.append("%s" % self.ui.lineEdit_fieldname_2.text()) + self.out_fieldtype_carto.append(eval("ogr.OFT%s" % self.ui.comboBox_fieldname_2.currentText())) + + if self.ui.checkBox_classifier_3.isChecked() and self.ui.lineEdit_fieldname_13.text() != '': + self.out_fieldname_carto.append("%s" % self.ui.lineEdit_fieldname_13.text()) + self.out_fieldtype_carto.append(eval("ogr.OFT%s" % self.ui.comboBox_fieldname_13.currentText())) + + if self.ui.lineEdit_fieldname_23.text() != '': + self.out_fieldname_carto.append("%s" % self.ui.lineEdit_fieldname_23.text()) + self.out_fieldtype_carto.append(eval("ogr.OFT%s" % self.ui.comboBox_fieldname_23.currentText())) + + if self.ui.lineEdit_fieldname_3.text() != '': + self.out_fieldname_carto.append("%s" % self.ui.lineEdit_fieldname_3.text()) + self.out_fieldtype_carto.append(eval("ogr.OFT%s" % self.ui.comboBox_fieldname_3.currentText())) + + if self.ui.lineEdit_fieldname_4.text() != '': + self.out_fieldname_carto.append("%s" % self.ui.lineEdit_fieldname_4.text()) + self.out_fieldtype_carto.append(eval("ogr.OFT%s" % self.ui.comboBox_fieldname_4.currentText())) + except AttributeError: + modes_fieldname = ["NIVEAU_1", "NIVEAU_2", "NIVEAU_3", "POURC"] + modes_fieldtype = [eval("ogr.OFTString"), eval("ogr.OFTString"), eval("ogr.OFTString"), eval("ogr.OFTReal")] + + for mf in range(len(modes_fieldname)): + + self.out_fieldname_carto.append(modes_fieldname[mf]) + self.out_fieldtype_carto.append(modes_fieldtype[mf]) + + # Segmentation shapefile path path by line edit + self.path_segm = "%s" % self.ui.lineEdit_segmentation.text() + + # Output shapefile field name by line edit and field type by combo box + self.output_name_moba = "%s" % self.ui.lineEdit_output.text() + + def set_variable(self): + """ + Print number of available image from Theia's GeoJSON . + """ + + # self.ui.lineEdit_listing.setText(str(self.nb_avalaible_images)) + try: + self.ui.label_listing.setText(str(self.nb_avalaible_images)) + except AttributeError: + pass # Simple mode + + def f_path_folder_dpt(self): + """ + Open a input browser box to select the main folder path by line edit. + """ + infoldername = QtWidgets.QFileDialog.getExistingDirectory(self, "Principal folder path", os.getcwd(), QtWidgets.QFileDialog.ShowDirsOnly) + self.ui.lineEdit_principal_folder.setText(str(infoldername).replace('[','').replace(']','').replace(' ','')) + + def block_for_swh(self): + """ + Function to block others function when SportWorldHeritage is selected in the comboxbox captor. + """ + ind_captor = int(self.ui.comboBox_captor.currentIndex()) + if ind_captor == 2: + self.ui.checkBox_processing.setEnabled(False) + self.ui.checkBox_MNT.setEnabled(False) + self.ui.lineEdit_MNT.setEnabled(False) + self.ui.pushButton_browser_MNT.setEnabled(False) + self.ui.checkBox_VHRS.setEnabled(False) + self.ui.lineEdit_VHRS.setEnabled(False) + self.ui.pushButton_browser_VHRS.setEnabled(False) + self.ui.tabWidget.setTabEnabled(1, False) + self.ui.tabWidget.setTabEnabled(2, False) + # If the user want, on the same moment, come back on other captor that SWH. + else: + self.ui.checkBox_processing.setEnabled(True) + self.ui.checkBox_MNT.setEnabled(True) + self.ui.lineEdit_MNT.setEnabled(True) + self.ui.pushButton_browser_MNT.setEnabled(True) + self.ui.checkBox_VHRS.setEnabled(True) + self.ui.lineEdit_VHRS.setEnabled(True) + self.ui.pushButton_browser_VHRS.setEnabled(True) + self.ui.tabWidget.setTabEnabled(1, True) + self.ui.tabWidget.setTabEnabled(2, True) + + def f_path_ortho(self): + """ + Open a input browser box to select the VHRS image path by line edit. + """ + orthofilename = QtWidgets.QFileDialog.getOpenFileName(self, "THRS image", self.ui.lineEdit_principal_folder.text(), '*.TIF *.tif')[0] + self.ui.lineEdit_VHRS.setText(str(orthofilename).replace('[','').replace(']','').replace(' ','')) + + def f_path_mnt(self): + """ + Open a input browser box to select the MNT image path by line edit. + """ + mntfilename = QtWidgets.QFileDialog.getOpenFileName(self, "MNT image", self.ui.lineEdit_principal_folder.text(), '*.TIF *.tif')[0] + self.ui.lineEdit_MNT.setText(str(mntfilename).replace('[','').replace(']','').replace(' ','')) + + def f_path_area(self): + """ + Open a input browser box to select the study area shapefile path by line edit. + """ + areafilename = QtWidgets.QFileDialog.getOpenFileName(self, "Area shapefile", self.ui.lineEdit_principal_folder.text(), '*.shp')[0] + self.ui.lineEdit_area_path.setText(str(areafilename).replace('[','').replace(']','').replace(' ','')) + + def f_proxy(self): + """ + Function to open a popup in order to enter proxy ID + """ + if self.w_proxy is None: + self.w_proxy = Popup.proxy_window() + self.w_proxy.show() + + def f_path_segm(self): + """ + Open a input browser box to select segmentation shapefile path path by line edit. + """ + segmfilename = QtWidgets.QFileDialog.getOpenFileName(self, "Segmentation shapefile", self.ui.lineEdit_principal_folder.text(), '*.shp')[0] + self.ui.lineEdit_segmentation.setText(str(segmfilename).replace('[','').replace(']','').replace(' ','')) + + def f_output_name_moba(self): + """ + Set the output classification shapefile path by line edit. + """ + outfilename = QtWidgets.QFileDialog.getSaveFileName(self, "FB file", self.ui.lineEdit_principal_folder.text(), '*.shp')[0] + # if the user has forgotten to put .shp at the end of the output shapefile + if outfilename[-4:] != '.shp': + outfilename = outfilename + '.shp' + self.ui.lineEdit_output.setText(outfilename) + + def enter_sample_name(self): + """ + Open a input browser box to select the sample shapefile path by line edit. With :func:`add_sample` conditions for the expert mode. + For the simply mode, this function is used for the RPG shapefile. + """ + samplefilename = QtWidgets.QFileDialog.getOpenFileName(self, "Sample shapefile", self.ui.lineEdit_principal_folder.text(), '*.shp')[0] + self.ui.lineEdit_sample_path.setText(str(samplefilename).replace('[','').replace(']','').replace(' ','')) + + def enter_sample_name_hl(self): + """ + Open a input browser box to select the grass and wooden sample shapefile path by line edit. With :func:`add_sample` conditions + for the simply mode. + """ + samplefilename_hl = QtWidgets.QFileDialog.getOpenFileName(self, "Grass/Wooden sample shapefile", self.ui.lineEdit_principal_folder.text(), '*.shp')[0] + self.ui.lineEdit_sample_path_2.setText(str(samplefilename_hl).replace('[','').replace(']','').replace(' ','')) + + def enter_sample_name_ll(self): + """ + Open a input browser box to select the wooden sample shapefile path by line edit. With :func:`add_sample` conditions for the simply mode. + """ + samplefilename_ll = QtWidgets.QFileDialog.getOpenFileName(self, "Wooden sample shapefile", self.ui.lineEdit_principal_folder.text(), '*.shp')[0] + self.ui.lineEdit_sample_path_3.setText(str(samplefilename_ll).replace('[','').replace(']','').replace(' ','')) + + def img_sample_name(self): + """ + Open a input browser box to select the image for samples path by line edit. With :func:`add_sample` conditions. + """ + imgsamplefilename = QtWidgets.QFileDialog.getOpenFileName(self, "Sample image", self.ui.lineEdit_principal_folder.text(), '*.TIF')[0] + self.ui.lineEdit_img_sample.setText(str(imgsamplefilename).replace('[','').replace(']','').replace(' ','')) + + def add_sample(self): + """ + Add sample information and location to compute optimal threshold : + + For the expert mode (mode=1) : + + - Append a sample name by line Edit. *This is a check box* ``RPG``, *if the sample is RPG file. It launch the Rpg class. And append a other sample from Rpg class*. + - Append two existent sample field names by combobox. It will be the same. + - Append sample class names by line edit. One or more for every sample. + - Append number of polygons for every samples by line edit. + - Print in a plain text edit : sample name, two sample field names, sample class names and number of polygons. + - *This check box* ``Image echantillonee``, *image path for samples if the first processing image hasn't been launched*. + .. note:: This is for a image with one spectral band + - Clear all widget field at the end. + + For the simply mode (mode=0): + + - Append a sample name by a different line Edit (a line Edit for each sample). + - Append sample class names, existing sample fields and number of polygons (a different line Edit for each sample) + """ + + nb_sample = len(self.sample_name)# Compute number of samples added. Condition : max three. + + # Study area shapefile path by line edit if no processing other + # Because the function "Vector" need study area + self.path_area = self.ui.lineEdit_area_path.text() + + if not self.path_area : + self.forget_study_area() + + if self.current_mode == Constantes.EXPERT_MODE: + # Expert mode + if nb_sample < 3 and not self.ui.lineEdit_sample_path.text().isEmpty() and \ + not self.ui.lineEdit_select_sample_fieldname_1.text().isEmpty() and not self.ui.lineEdit_select_sample_fieldname_2.text().isEmpty() and \ + not self.ui.lineEdit_select_sample_class_1.text().isEmpty() and not self.ui.lineEdit_select_sample_class_2.text().isEmpty() and \ + not self.ui.lineEdit_select_sample_nb_poly.text().isEmpty() and not self.ui.lineEdit_area_path.text().isEmpty(): + + # Append a sample name by line Edit. + if self.ui.checkBox_RPG.isChecked(): + # Check box, if the sample of the RPG file. It launch the Rpg class. And append a other sample from Rpg class + self.sample_name.append(self.i_rpg("%s" % self.ui.lineEdit_sample_path.text())) + self.rpg_tchek.append(1) # To backup + self.ui.checkBox_RPG.setChecked(False) + else: + self.sample_name.append("%s" % self.ui.lineEdit_sample_path.text()) + self.rpg_tchek.append(0) + + # Append two sample field names by line edit. It must be the same. + self.fieldname_args.append("%s" % self.ui.lineEdit_select_sample_fieldname_1.text()) + self.fieldname_args.append("%s" % self.ui.lineEdit_select_sample_fieldname_2.text()) + # Append sample class names by line edit. One or more for every sample + self.class_args.append("%s" % self.ui.lineEdit_select_sample_class_1.text()) + self.class_args.append("%s" % self.ui.lineEdit_select_sample_class_2.text()) + # Append number of polygons for every samples by line edit. + self.list_nb_sample.append("%s" % self.ui.lineEdit_select_sample_nb_poly.text()) + + nb_sample = len(self.sample_name) # Number of samples added + # Print in a plain text edit : sample name, two sample field names, sample class names and number of polygons. + cursor = self.ui.plainTextEdit_sample.textCursor() + cursor.movePosition(QTextCursor.End, QTextCursor.MoveAnchor) + self.ui.plainTextEdit_sample.setTextCursor(cursor) + self.ui.plainTextEdit_sample.insertPlainText(str(self.sample_name[nb_sample-1]) + "\n") + cursor.movePosition(QTextCursor.Down, QTextCursor.MoveAnchor) + self.ui.plainTextEdit_sample.setTextCursor(cursor) + self.ui.plainTextEdit_sample.insertPlainText(str(self.fieldname_args[(nb_sample-1)*2]) + ' ' + str(self.fieldname_args[((nb_sample-1)*2)+1]) + "\n") + cursor.movePosition(QTextCursor.Down, QTextCursor.MoveAnchor) + self.ui.plainTextEdit_sample.setTextCursor(cursor) + self.ui.plainTextEdit_sample.insertPlainText(str(self.class_args[(nb_sample-1)*2]) + ' ' + str(self.class_args[(nb_sample-1)*2+1]) + "\n") + cursor.movePosition(QTextCursor.Down, QTextCursor.MoveAnchor) + self.ui.plainTextEdit_sample.setTextCursor(cursor) + self.ui.plainTextEdit_sample.insertPlainText(str(self.list_nb_sample[nb_sample-1]) + "\n") + + # Check box, image path for samples if the first processing image hasn't been launched + # Warming : This is for a image with one spectral band + if self.ui.checkBox_img_sample.isChecked(): + self.raster_path.append("%s" % self.ui.lineEdit_img_sample.text()) + self.list_band_outraster.append(1) + self.ui.lineEdit_img_sample.clear() + self.ui.checkBox_img_sample.setChecked(False) + self.img_sample.append(1) + else: # To backup + self.img_sample.append(0) + + # Clear all line edit after addition, ie after click add button. + self.ui.lineEdit_sample_path.clear() + self.ui.lineEdit_select_sample_fieldname_1.clear() + self.ui.lineEdit_select_sample_fieldname_2.clear() + self.ui.lineEdit_select_sample_class_1.clear() + self.ui.lineEdit_select_sample_class_2.clear() + self.ui.lineEdit_select_sample_nb_poly.clear() + + elif self.current_mode == Constantes.SIMPLE_MODE: + # Simple mode + + # Append a sample name by line Edit. + # For the sample of the RPG file. It launch the Rpg class. And append a other sample from Rpg class + self.sample_name.append(self.i_rpg(self.ui.lineEdit_sample_path.text())) + + # Append two sample field names by line edit. It must be the same. + self.fieldname_args.append(self.ui.lineEdit_select_sample_fieldname_1.text()) + self.fieldname_args.append(self.ui.lineEdit_select_sample_fieldname_2.text()) + + # Append sample class names by line edit. One or more for every sample + self.class_args.append(self.ui.lineEdit_select_sample_class_1.text()) + self.class_args.append(self.ui.lineEdit_select_sample_class_2.text()) + + # Append number of polygons for every samples by line edit. + self.list_nb_sample.append(self.ui.lineEdit_select_sample_nb_poly.text()) + + # Same process that the RPG process except the start of the RPG class. + # To Grass/wooden + self.sample_name.append(self.ui.lineEdit_sample_path_2.text()) + self.fieldname_args.append(self.ui.lineEdit_select_sample_fieldname_3.text()) + self.fieldname_args.append(self.ui.lineEdit_select_sample_fieldname_4.text()) + self.class_args.append(self.ui.lineEdit_select_sample_class_3.text()) + self.class_args.append(self.ui.lineEdit_select_sample_class_4.text()) + self.list_nb_sample.append(self.ui.lineEdit_select_sample_nb_poly_2.text()) + + # To wooden + self.sample_name.append(self.ui.lineEdit_sample_path_3.text()) + self.fieldname_args.append(self.ui.lineEdit_select_sample_fieldname_5.text()) + self.fieldname_args.append(self.ui.lineEdit_select_sample_fieldname_6.text()) + self.class_args.append(self.ui.lineEdit_select_sample_class_5.text()) + self.class_args.append(self.ui.lineEdit_select_sample_class_6.text()) + self.list_nb_sample.append(self.ui.lineEdit_select_sample_nb_poly_3.text()) + + def clear_sample(self): + """ + Function to clear sample record. Clear in the interface and in the memory list. + """ + self.sample_name = [] + self.fieldname_args = [] + self.class_args = [] + self.list_nb_sample = [] + self.rpg_tchek = [] + self.img_sample = [] + + self.ui.lineEdit_sample_path.clear() + self.ui.lineEdit_select_sample_fieldname_1.clear() + self.ui.lineEdit_select_sample_fieldname_2.clear() + self.ui.lineEdit_select_sample_class_1.clear() + self.ui.lineEdit_select_sample_class_2.clear() + self.ui.lineEdit_select_sample_nb_poly.clear() + self.ui.checkBox_RPG.setChecked(False) + self.ui.lineEdit_img_sample.clear() + self.ui.checkBox_img_sample.setChecked(False) + self.ui.plainTextEdit_sample.clear() + self.ui.plainTextEdit_sample.insertPlainText("1 - Végétation non naturelle / Semi-naturelle\n") + self.ui.plainTextEdit_sample.insertPlainText("2 - Herbacés / Ligneux\n") + self.ui.plainTextEdit_sample.insertPlainText("3 - Lingeux mixtes / denses\n") + self.ui.plainTextEdit_sample.insertPlainText("\n") + self.ui.plainTextEdit_sample.insertPlainText("\n") + self.ui.plainTextEdit_sample.insertPlainText("") + + def field_display_1(self): + """ + Function to display fieldname class 1 in the other fieldname class 2 when text changed. + For the simply mode, this is RPG sample. + """ + self.ui.lineEdit_select_sample_fieldname_2.setText("%s" % self.ui.lineEdit_select_sample_fieldname_1.text()) + + def field_display_2(self): + """ + Function to display fieldname class 2 in the other fieldname class 2 when text changed. + For the simply mode, this is RPG sample. + """ + self.ui.lineEdit_select_sample_fieldname_1.setText("%s" % self.ui.lineEdit_select_sample_fieldname_2.text()) + + def field_display_3(self): + """ + For the grass/wooden sample, a function to display fieldname class 1 in the other fieldname class 2 when text changed. + """ + self.ui.lineEdit_select_sample_fieldname_4.setText("%s" % self.ui.lineEdit_select_sample_fieldname_3.text()) + + def field_display_4(self): + """ + For the grass/wooden sample, a function to display fieldname class 2 in the other fieldname class 2 when text changed. + """ + self.ui.lineEdit_select_sample_fieldname_3.setText("%s" % self.ui.lineEdit_select_sample_fieldname_4.text()) + + def field_display_5(self): + """ + For the wooden sample, a function to display fieldname class 1 in the other fieldname class 2 when text changed. + """ + self.ui.lineEdit_select_sample_fieldname_6.setText("%s" % self.ui.lineEdit_select_sample_fieldname_5.text()) + + def field_display_6(self): + """ + For the wooden sample, a function to display fieldname class 2 in the other fieldname class 2 when text changed. + """ + self.ui.lineEdit_select_sample_fieldname_5.setText("%s" % self.ui.lineEdit_select_sample_fieldname_6.text()) + + def activate_level(self): + """ + To activate the first levels with seath method. This is in pushing on the decision tree radio button. + Else it activates the last level to random forest method. + """ + if self.ui.radioButton_s.isChecked() and not self.ui.radioButton_rf.isChecked(): + self.ui.checkBox_classifier_1.setEnabled(True) + self.ui.checkBox_classifier_2.setEnabled(True) + else: + self.ui.checkBox_classifier_1.setEnabled(False) + self.ui.checkBox_classifier_2.setEnabled(False) + self.ui.checkBox_classifier_3.setChecked(True) + + def display_one_level(self): + """ + Function to display fieldnames option to classifier one level + """ + if self.ui.checkBox_classifier_1.isChecked(): + + # Don't checked others checkboxes + self.ui.checkBox_classifier_2.setChecked(False) + self.ui.checkBox_classifier_3.setChecked(False) + + # Display options filednames + self.ui.label_chps_1 = QtWidgets.QLabel(self.ui.tab_3) + self.ui.label_chps_1.setObjectName("label_chps_1") + self.ui.gridLayout_2.addWidget(self.ui.label_chps_1, 10, 0, 2, 2) + self.ui.label_chps_name_1 = QtWidgets.QLabel(self.ui.tab_3) + self.ui.label_chps_name_1.setObjectName("label_chps_name_1") + self.ui.gridLayout_2.addWidget(self.ui.label_chps_name_1, 10, 2, 1, 1) + self.ui.label_chps_type_1 = QtWidgets.QLabel(self.ui.tab_3) + self.ui.label_chps_type_1.setObjectName("label_chps_type_1") + self.ui.gridLayout_2.addWidget(self.ui.label_chps_type_1, 11, 2, 1, 1) + self.ui.lineEdit_fieldname_1 = QtWidgets.QLineEdit(self.ui.tab_3) + self.ui.lineEdit_fieldname_1.setObjectName("lineEdit_fieldname_1") + self.ui.gridLayout_2.addWidget(self.ui.lineEdit_fieldname_1, 10, 3, 1, 1) + self.ui.comboBox_fieldname_1 = QtWidgets.QComboBox(self.ui.tab_3) + self.ui.comboBox_fieldname_1.setObjectName("comboBox_fieldname_1") + self.ui.gridLayout_2.addWidget(self.ui.comboBox_fieldname_1, 11, 3, 1, 1) + + self.ui.lineEdit_fieldname_1.setText(_translate("PHYMOBAT", "NIVEAU_1", None)) + self.ui.comboBox_fieldname_1.addItem("String") + self.ui.comboBox_fieldname_1.addItem("Real") + + self.ui.label_chps_1.setText(_translate("PHYMOBAT", " Champs\n"+" des entités", None)) + self.ui.label_chps_name_1.setText(_translate("PHYMOBAT", "Nom :", None)) + self.ui.label_chps_type_1.setText(_translate("PHYMOBAT", "Type :", None)) + + if not self.ui.checkBox_classifier_1.isChecked(): + # Clear options filednames + try: + self.ui.label_chps_1.deleteLater() + self.ui.label_chps_name_1.deleteLater() + self.ui.label_chps_type_1.deleteLater() + self.ui.lineEdit_fieldname_1.deleteLater() + self.ui.comboBox_fieldname_1.deleteLater() + except AttributeError: + pass + + def display_two_levels(self): + """ + Function to display fieldnames option to classifier two first levels + """ + if self.ui.checkBox_classifier_2.isChecked(): + + # Don't checked others checkboxes + self.ui.checkBox_classifier_1.setChecked(False) + self.ui.checkBox_classifier_3.setChecked(False) + + self.ui.label_chps_2 = QtWidgets.QLabel(self.ui.tab_3) + self.ui.label_chps_2.setObjectName("label_chps_2") + self.ui.gridLayout_2.addWidget(self.ui.label_chps_2, 13, 0, 2, 2) + self.ui.lineEdit_fieldname_12 = QtWidgets.QLineEdit(self.ui.tab_3) + self.ui.lineEdit_fieldname_12.setObjectName("lineEdit_fieldname_12") + self.ui.gridLayout_2.addWidget(self.ui.lineEdit_fieldname_12, 13, 3, 1, 1) + self.ui.lineEdit_fieldname_2 = QtWidgets.QLineEdit(self.ui.tab_3) + self.ui.lineEdit_fieldname_2.setObjectName("lineEdit_fieldname_2") + self.ui.gridLayout_2.addWidget(self.ui.lineEdit_fieldname_2, 13, 4, 1, 1) + self.ui.label_chps_type_2 = QtWidgets.QLabel(self.ui.tab_3) + self.ui.label_chps_type_2.setObjectName("label_chps_type_2") + self.ui.gridLayout_2.addWidget(self.ui.label_chps_type_2, 14, 2, 1, 1) + self.ui.comboBox_fieldname_12 = QtWidgets.QComboBox(self.ui.tab_3) + self.ui.comboBox_fieldname_12.setObjectName("comboBox_fieldname_12") + self.ui.gridLayout_2.addWidget(self.ui.comboBox_fieldname_12, 14, 3, 1, 1) + self.ui.comboBox_fieldname_2 = QtWidgets.QComboBox(self.ui.tab_3) + self.ui.comboBox_fieldname_2.setObjectName("comboBox_fieldname_2") + self.ui.gridLayout_2.addWidget(self.ui.comboBox_fieldname_2, 14, 4, 1, 1) + self.ui.label_chps_name_2 = QtWidgets.QLabel(self.ui.tab_3) + self.ui.label_chps_name_2.setObjectName("label_chps_name_2") + self.ui.gridLayout_2.addWidget(self.ui.label_chps_name_2, 13, 2, 1, 1) + + self.ui.lineEdit_fieldname_12.setText(_translate("PHYMOBAT", "NIVEAU_1", None)) + self.ui.comboBox_fieldname_12.addItem("String") + self.ui.comboBox_fieldname_12.addItem("Real") + self.ui.lineEdit_fieldname_2.setText(_translate("PHYMOBAT", "NIVEAU_2", None)) + self.ui.comboBox_fieldname_2.addItem("String") + self.ui.comboBox_fieldname_2.addItem("Real") + + self.ui.label_chps_type_2.setText(_translate("PHYMOBAT", "Type :", None)) + self.ui.label_chps_2.setText(_translate("PHYMOBAT", " Champs\n"+" des entités", None)) + self.ui.label_chps_name_2.setText(_translate("PHYMOBAT", "Nom :", None)) + + if not self.ui.checkBox_classifier_2.isChecked(): + # Clear options filednames + try: + self.ui.label_chps_2.deleteLater() + self.ui.label_chps_name_2.deleteLater() + self.ui.label_chps_type_2.deleteLater() + self.ui.lineEdit_fieldname_12.deleteLater() + self.ui.comboBox_fieldname_12.deleteLater() + self.ui.lineEdit_fieldname_2.deleteLater() + self.ui.comboBox_fieldname_2.deleteLater() + except AttributeError: + pass + + def display_all_levels(self): + """ + Function to display fieldnames option to launch complete classification + """ + if self.ui.checkBox_classifier_3.isChecked(): + + # Don't checked others checkboxes + self.ui.checkBox_classifier_1.setChecked(False) + self.ui.checkBox_classifier_2.setChecked(False) + self.ui.label_chps_name_3 = QtWidgets.QLabel(self.ui.tab_3) + self.ui.label_chps_name_3.setObjectName("label_chps_name_3") + self.ui.gridLayout_2.addWidget(self.ui.label_chps_name_3, 16, 2, 1, 1) + self.ui.label_chps_3 = QtWidgets.QLabel(self.ui.tab_3) + self.ui.label_chps_3.setObjectName("label_chps_3") + self.ui.gridLayout_2.addWidget(self.ui.label_chps_3, 16, 0, 2, 2) + self.ui.label_chps_type_3 = QtWidgets.QLabel(self.ui.tab_3) + self.ui.label_chps_type_3.setObjectName("label_chps_type_3") + self.ui.gridLayout_2.addWidget(self.ui.label_chps_type_3, 17, 2, 1, 1) + self.ui.lineEdit_fieldname_13 = QtWidgets.QLineEdit(self.ui.tab_3) + self.ui.lineEdit_fieldname_13.setObjectName("lineEdit_fieldname_13") + self.ui.gridLayout_2.addWidget(self.ui.lineEdit_fieldname_13, 16, 3, 1, 1) + self.ui.lineEdit_fieldname_23 = QtWidgets.QLineEdit(self.ui.tab_3) + self.ui.lineEdit_fieldname_23.setObjectName("lineEdit_fieldname_23") + self.ui.gridLayout_2.addWidget(self.ui.lineEdit_fieldname_23, 16, 4, 1, 1) + self.ui.lineEdit_fieldname_3 = QtWidgets.QLineEdit(self.ui.tab_3) + self.ui.lineEdit_fieldname_3.setObjectName("lineEdit_fieldname_3") + self.ui.gridLayout_2.addWidget(self.ui.lineEdit_fieldname_3, 16, 5, 1, 1) + self.ui.lineEdit_fieldname_4 = QtWidgets.QLineEdit(self.ui.tab_3) + self.ui.lineEdit_fieldname_4.setObjectName("lineEdit_fieldname_4") + self.ui.gridLayout_2.addWidget(self.ui.lineEdit_fieldname_4, 16, 6, 1, 1) + self.ui.comboBox_fieldname_13 = QtWidgets.QComboBox(self.ui.tab_3) + self.ui.comboBox_fieldname_13.setObjectName("comboBox_fieldname_13") + self.ui.gridLayout_2.addWidget(self.ui.comboBox_fieldname_13, 17, 3, 1, 1) + self.ui.comboBox_fieldname_23 = QtWidgets.QComboBox(self.ui.tab_3) + self.ui.comboBox_fieldname_23.setObjectName("comboBox_fieldname_23") + self.ui.gridLayout_2.addWidget(self.ui.comboBox_fieldname_23, 17, 4, 1, 1) + self.ui.comboBox_fieldname_3 = QtWidgets.QComboBox(self.ui.tab_3) + self.ui.comboBox_fieldname_3.setObjectName("comboBox_fieldname_3") + self.ui.gridLayout_2.addWidget(self.ui.comboBox_fieldname_3, 17, 5, 1, 1) + self.ui.comboBox_fieldname_4 = QtWidgets.QComboBox(self.ui.tab_3) + self.ui.comboBox_fieldname_4.setObjectName("comboBox_fieldname_4") + self.ui.gridLayout_2.addWidget(self.ui.comboBox_fieldname_4, 17, 6, 1, 1) + self.ui.lineEdit_fieldname_13.setText(_translate("PHYMOBAT", "NIVEAU_1", None)) + self.ui.comboBox_fieldname_13.addItem("String") + self.ui.comboBox_fieldname_13.addItem("Real") + self.ui.lineEdit_fieldname_23.setText(_translate("PHYMOBAT", "NIVEAU_2", None)) + self.ui.comboBox_fieldname_23.addItem("String") + self.ui.comboBox_fieldname_23.addItem("Real") + self.ui.lineEdit_fieldname_3.setText(_translate("PHYMOBAT", "NIVEAU_3", None)) + self.ui.comboBox_fieldname_3.addItem("String") + self.ui.comboBox_fieldname_3.addItem("Real") + self.ui.lineEdit_fieldname_4.setText(_translate("PHYMOBAT", "POURC", None)) + self.ui.comboBox_fieldname_4.addItem("Real") + self.ui.comboBox_fieldname_4.addItem("String") + + self.ui.label_chps_3.setText(_translate("PHYMOBAT", " Champs\n"+" des entités", None)) + self.ui.label_chps_type_3.setText(_translate("PHYMOBAT", "Type :", None)) + self.ui.label_chps_name_3.setText(_translate("PHYMOBAT", "Nom :", None)) + + if not self.ui.checkBox_classifier_3.isChecked(): + # Clear options filednames + try: + self.ui.label_chps_3.deleteLater() + self.ui.label_chps_name_3.deleteLater() + self.ui.label_chps_type_3.deleteLater() + self.ui.lineEdit_fieldname_13.deleteLater() + self.ui.comboBox_fieldname_13.deleteLater() + self.ui.lineEdit_fieldname_23.deleteLater() + self.ui.comboBox_fieldname_23.deleteLater() + self.ui.lineEdit_fieldname_3.deleteLater() + self.ui.comboBox_fieldname_3.deleteLater() + self.ui.lineEdit_fieldname_4.deleteLater() + self.ui.comboBox_fieldname_4.deleteLater() + except AttributeError: + pass + + def ok_button(self): + """ + Function to launch the processing. This function take account : + + - The ``Multi-processing`` check box if the processing has launched with multi process. + By default, this is checked. It need a computer with minimum 12Go memory. + - Append a few system value with :func:`get_variable`. + - There are 3 principal check boxes : + - to get number download available images + - for downloading and processing on theia platform + - to compute optimal threshold. + - to compute slope raster + - for classification processing. + """ + # Start the processus + startTime = time.time() + + # To know if the processing must be launch on several thread + self.mp = Constantes.MULTIPROCESSING_ENABLE if self.ui.checkBox_multiprocess.isChecked() else Constantes.MULTIPROCESSING_DISABLE + + self.get_variable() # Append a few system value + vs = 0 # Variable to launch VHRS texture processing + dd = 0 # Variable to launch image downloading + ok = 1 # Variable to verify informations -> 0 not ok, 1 ok + + if self.current_mode == Constantes.EXPERT_MODE: + # if download check box is checked only + if not self.ui.checkBox_listing.isChecked() and self.ui.checkBox_download.isChecked(): + self.ui.checkBox_listing.setChecked(True) + + if ok == 1 : + # Compute a output slope raster + if self.ui.checkBox_MNT.isChecked(): + self.i_slope() + + # Downloading and processing on theia platform + # A check box to get number download available images + if self.ui.checkBox_listing.isChecked(): + + if self.ui.checkBox_download.isChecked(): + # To launch the downloading + dd = 1 + + self.i_download(dd) # Launch image listing and downloading if dd = 1 + self.set_variable() # to write in the line edit about number download available images + + # Check box to launch the image processing + if self.ui.checkBox_processing.isChecked(): + # Another check box to launch VHRS texture processing. If checked, vs = 1. + if self.ui.checkBox_VHRS.isChecked(): + vs = 1 + self.i_images_processing(vs) # function to launch the image processing + + # To launch the image processing without dowloading but with the images in a main folder + # Without internet connection + if not self.ui.checkBox_download.isChecked() and self.ui.checkBox_processing.isChecked(): + + # Launch pre-processing without downloading + self.i_glob() + # Another check box to launch VHRS texture processing. If checked, vs = 1. + if self.ui.checkBox_VHRS.isChecked(): + vs = 1 + + self.i_images_processing(vs) # function to launch the image processing + + # To launch texture processing only + if not self.ui.checkBox_listing.isChecked() and not self.ui.checkBox_processing.isChecked() and self.ui.checkBox_VHRS.isChecked(): + + self.i_vhrs() + + # Compute optimal threshold + if self.ui.checkBox_threshold.isChecked(): + + if self.ui.radioButton_rf.isChecked(): + self.i_sample_rf() + elif self.ui.radioButton_s.isChecked(): + self.i_sample() + + # Classification processing + if self.ui.radioButton_rf.isChecked(): + + if self.ui.checkBox_classifier_3.isChecked(): + + self.out_fieldname_carto = self.out_fieldname_carto + self.out_fieldtype_carto = self.out_fieldtype_carto + self.i_classifier_rf() + self.i_validate() + + elif self.ui.radioButton_s.isChecked(): + + if self.ui.checkBox_classifier_1.isChecked() : + + self.out_fieldname_carto = self.out_fieldname_carto[:3] + self.out_fieldtype_carto = self.out_fieldtype_carto[:3] + self.i_classifier_s() + self.i_validate() + + if self.ui.checkBox_classifier_2.isChecked() : + + self.out_fieldname_carto = self.out_fieldname_carto[:4] + self.out_fieldtype_carto = self.out_fieldtype_carto[:4] + self.i_classifier_s() + self.i_validate() + + if self.ui.checkBox_classifier_3.isChecked(): + + self.out_fieldname_carto = self.out_fieldname_carto + self.out_fieldtype_carto = self.out_fieldtype_carto + self.i_classifier_s() + self.i_validate() + + if self.current_mode == Constantes.SIMPLE_MODE: + + # Compute a output slope raster + if self.path_mnt : + self.i_slope() + + # Save the sample features + self.add_sample() + + # Look at if the the images has been already downloaded, download them otherwise + self.i_download(self.ui.ignore_download.isChecked()) + + # function to launch the image processing + self.i_images_processing() + + os.system("clear") + + self.logger.debug("Début sample") + + # Compute optimal threshold + self.i_sample_rf() + + self.logger.debug("Fin sample") + + os.system("clear") + + self.logger.debug("Début classifier") + + # Classification processing + self.i_classifier_rf() + + self.logger.debug("Fin classifier") + + os.system("clear") + + self.logger.debug("Début validation") + + self.i_validate() + + self.logger.debug("Fin validation") + + # Clear variables after processing + #self.clear_sample() + self.out_fieldname_carto = ['ID', 'AREA'] + self.out_fieldtype_carto = [ogr.OFTString, ogr.OFTReal] + + # Images after processing images + self.out_ndvistats_folder_tab = defaultdict(list) + + Processing.__init__(self)# Initialize variable without to close and launch again the application + + # End of the processus + endTime = time.time() + self.logger.info('Outputted to File in {0} secondes'.format(endTime - startTime)) + nb_day_processing = int(time.strftime('%d', time.gmtime(endTime - startTime))) - 1 + self.logger.info("That is {0} day(s) {1}".format(nb_day_processing, time.strftime('%Hh %Mmin%S', time.gmtime(endTime - startTime)))) + + def open_backup(self, test=None): + """ + Function to load input text in every fields. The input file must be a XML file. + """ + + # in_backup = QtWidgets.QFileDialog.getOpenFileName(self, "Open backup", os.getcwd(), '*.xml')[0] + + if test is False : + in_backup = QtWidgets.QFileDialog.getOpenFileName(self, "Open backup", os.getcwd(), '*.xml')[0] + else : + in_backup = test + + if in_backup and len(in_backup) > 0 : + + # Parse the xml file if the user choose a file + tree = ET.parse(str(in_backup)) + + if tree.find("Multi_process").text == '1': + self.ui.checkBox_multiprocess.setChecked(True) + else: + self.ui.checkBox_multiprocess.setChecked(False) + + pr = tree.find("Tab[@id='Processing_raster']") + + try: + self.ui.lineEdit_principal_folder.setText(pr.find("Principal_folder").text) + except: + self.info.debug('Not principal folder') + + if self.current_mode == Constantes.EXPERT_MODE: + index_captor = self.ui.comboBox_captor.findText(pr.find("Captor").text) # To find combo box index + self.ui.comboBox_captor.setCurrentIndex(index_captor) + + try: + self.ui.lineEdit_year_images.setText(pr.find("Year_images").text) + except: + self.logger.debug('Not year images') + + self.ui.lineEdit_area_path.setText(pr.find("Area_path").text) + + if self.current_mode == Constantes.EXPERT_MODE: + if pr.find("Images_available").text == '1': + self.ui.checkBox_listing.setChecked(True) + else: + self.ui.checkBox_listing.setChecked(False) + if pr.find("Download").text == '1': + self.ui.checkBox_download.setChecked(True) + else: + self.ui.checkBox_download.setChecked(False) + + try: + self.ui.lineEdit_user.setText(pr.find("Username").text) + self.ui.lineEdit_password.setText(pr.find("Password").text) + except: + self.logger.debug('Not username or password Theia') + + self.f_proxy() + try: + pp = pr.find("Proxy[@id='Proxy']") + self.w_proxy.w_proxy.lineEdit_proxy.setText(pp.find("Proxy_adress").text) + try: + self.w_proxy.w_proxy.lineEdit_password_proxy.setText(pp.find("Proxy_login").text) + except TypeError: + pass + try: + self.w_proxy.w_proxy.lineEdit_login_proxy.setText(pp.find("Proxy_password").text) + except TypeError: + pass + self.w_proxy.id_proxy() + except AttributeError: + self.logger.debug('Not proxy') + self.w_proxy.close_window() + + if self.current_mode == Constantes.EXPERT_MODE: + if pr.find("Img_processing").text == '1': + self.ui.checkBox_processing.setChecked(True) + else: + self.ui.checkBox_processing.setChecked(False) + if pr.find("VHRS_checked").text == '1': + self.ui.checkBox_VHRS.setChecked(True) + else: + self.ui.checkBox_VHRS.setChecked(False) + + try: + self.ui.lineEdit_VHRS.setText(pr.find("VHRS").text) + except: + self.logger.debug('Not VHRS image') + + if self.current_mode == Constantes.EXPERT_MODE: + if pr.find("MNT_checked").text == '1': + self.ui.checkBox_MNT.setChecked(True) + else: + self.ui.checkBox_MNT.setChecked(False) + + try: + self.ui.lineEdit_MNT.setText(pr.find("MNT").text) + except: + self.logger.debug('Not MNT') + + ps = tree.find("Tab[@id='Processing_sample']") + if self.current_mode == Constantes.EXPERT_MODE: + try: + for sple_n in ps.iter("Sample"): + self.ui.lineEdit_sample_path.setText(sple_n.find("Sample_path").text) + self.ui.lineEdit_select_sample_fieldname_1.setText(sple_n.find("Fieldname_1").text) + self.ui.lineEdit_select_sample_fieldname_2.setText(sple_n.find("Fieldname_2").text) + self.ui.lineEdit_select_sample_class_1.setText(sple_n.find("Classname_1").text) + self.ui.lineEdit_select_sample_class_2.setText(sple_n.find("Classname_2").text) + self.ui.lineEdit_select_sample_nb_poly.setText(sple_n.find("Nb_polygones").text) + # Launch rpg method if the box is checked and if the shapefile hasn't go through rpg method (with prefix MONO_) + if sple_n.find("RPG").text == '1' and os.path.split(sple_n.find("Sample_path").text)[1][:5] != 'MONO_': + self.ui.checkBox_RPG.setChecked(True) + try: + if sple_n.find("Img_sample").text != "": + self.ui.lineEdit_img_sample.setText(sple_n.find("Img_sample").text) + self.ui.checkBox_img_sample.setChecked(True) + except: + self.logger.debug('Not sample raster only !') + + self.add_sample() + except: + self.logger.debug('Not sample') + + elif self.current_mode == Constantes.SIMPLE_MODE: + # RPG + sple_n = ps[0] + self.ui.lineEdit_sample_path.setText(sple_n.find("Sample_path").text) + self.ui.lineEdit_select_sample_fieldname_1.setText(sple_n.find("Fieldname_1").text) + self.ui.lineEdit_select_sample_fieldname_2.setText(sple_n.find("Fieldname_2").text) + self.ui.lineEdit_select_sample_class_1.setText(sple_n.find("Classname_1").text) + self.ui.lineEdit_select_sample_class_2.setText(sple_n.find("Classname_2").text) + self.ui.lineEdit_select_sample_nb_poly.setText(sple_n.find("Nb_polygones").text) + + # To Grass/wooden + sple_n = ps[1] + self.ui.lineEdit_sample_path_2.setText(sple_n.find("Sample_path").text) + self.ui.lineEdit_select_sample_fieldname_3.setText(sple_n.find("Fieldname_1").text) + self.ui.lineEdit_select_sample_fieldname_4.setText(sple_n.find("Fieldname_2").text) + self.ui.lineEdit_select_sample_class_3.setText(sple_n.find("Classname_1").text) + self.ui.lineEdit_select_sample_class_4.setText(sple_n.find("Classname_2").text) + self.ui.lineEdit_select_sample_nb_poly_2.setText(sple_n.find("Nb_polygones").text) + + # To wooden + sple_n = ps[2] + self.ui.lineEdit_sample_path_3.setText(sple_n.find("Sample_path").text) + self.ui.lineEdit_select_sample_fieldname_5.setText(sple_n.find("Fieldname_1").text) + self.ui.lineEdit_select_sample_fieldname_6.setText(sple_n.find("Fieldname_2").text) + self.ui.lineEdit_select_sample_class_5.setText(sple_n.find("Classname_1").text) + self.ui.lineEdit_select_sample_class_6.setText(sple_n.find("Classname_2").text) + self.ui.lineEdit_select_sample_nb_poly_3.setText(sple_n.find("Nb_polygones").text) + + if self.current_mode == Constantes.EXPERT_MODE: + if ps.find("Threshold_checked").text == '1': + self.ui.checkBox_threshold.setChecked(True) + else: + self.ui.checkBox_threshold.setChecked(False) + + c = tree.find("Tab[@id='Classification']") + + try: + self.ui.lineEdit_segmentation.setText(c.find("Segmentation_path").text) + except: + self.logger.debug('Not segmentation') + + try: + self.ui.lineEdit_output.setText(c.find("Output_path").text) + except: + self.logger.debug('Not output file') + + if self.current_mode == Constantes.EXPERT_MODE: + if len(c) == 5: + self.ui.checkBox_classifier_1.setChecked(True) + self.ui.lineEdit_fieldname_1.setText(c.find("Output_fieldname_1").text) + index_fieldname_1 = self.ui.comboBox_fieldname_1.findText(c.find("Output_type_1").text) + self.ui.comboBox_fieldname_1.setCurrentIndex(index_fieldname_1) + elif len(c) == 7: + self.ui.checkBox_classifier_2.setChecked(True) + self.ui.lineEdit_fieldname_12.setText(c.find("Output_fieldname_1").text) + self.ui.lineEdit_fieldname_2.setText(c.find("Output_fieldname_2").text) + index_fieldname_12 = self.ui.comboBox_fieldname_12.findText(c.find("Output_type_1").text) + self.ui.comboBox_fieldname_12.setCurrentIndex(index_fieldname_12) + index_fieldname_2 = self.ui.comboBox_fieldname_2.findText(c.find("Output_type_2").text) + self.ui.comboBox_fieldname_2.setCurrentIndex(index_fieldname_2) + elif len(c) == 11: + self.ui.checkBox_classifier_3.setChecked(True) + self.ui.lineEdit_fieldname_13.setText(c.find("Output_fieldname_1").text) + self.ui.lineEdit_fieldname_23.setText(c.find("Output_fieldname_2").text) + self.ui.lineEdit_fieldname_3.setText(c.find("Output_fieldname_3").text) + self.ui.lineEdit_fieldname_4.setText(c.find("Output_fieldname_4").text) + index_fieldname_13 = self.ui.comboBox_fieldname_13.findText(c.find("Output_type_1").text) + self.ui.comboBox_fieldname_13.setCurrentIndex(index_fieldname_13) + index_fieldname_23 = self.ui.comboBox_fieldname_23.findText(c.find("Output_type_2").text) + self.ui.comboBox_fieldname_23.setCurrentIndex(index_fieldname_23) + index_fieldname_3 = self.ui.comboBox_fieldname_3.findText(c.find("Output_type_3").text) + self.ui.comboBox_fieldname_3.setCurrentIndex(index_fieldname_3) + index_fieldname_4 = self.ui.comboBox_fieldname_4.findText(c.find("Output_type_4").text) + self.ui.comboBox_fieldname_4.setCurrentIndex(index_fieldname_4) + + # Classification mode + if c.find("Classification_method").text == '1': + self.ui.radioButton_rf.setChecked(True) + else: + self.ui.radioButton_s.setChecked(True) + + def save_backup(self): + """ + Function to save input text in every fields. + The output file must be a XML file. + """ + + out_backup = QtWidgets.QFileDialog.getSaveFileName(self, "Save backup", os.getcwd(), '*.xml')[0] + + # if the user has forgotten to put .shp at the end of the output xml + if not out_backup.endswith('.xml'): + out_backup = out_backup + '.xml' + + root = ET.Element("Data_filled") + + if self.ui.checkBox_multiprocess.isChecked(): + ET.SubElement(root, "Multi_process", type = "int").text = str(1) + else: + ET.SubElement(root, "Multi_process", type = "int").text = str(0) + + doc = ET.SubElement(root, "Tab", id="Processing_raster") + ET.SubElement(doc, "Principal_folder", type = "str").text = "%s" % self.ui.lineEdit_principal_folder.text() + + if self.current_mode == Constantes.EXPERT_MODE: + ET.SubElement(doc, "Captor", type = "str").text = "%s" % self.ui.comboBox_captor.currentText() + else: + ET.SubElement(doc, "Captor", type = "str").text = "Landsat" + + ET.SubElement(doc, "Year_images", type = "str").text = "%s" % self.ui.lineEdit_year_images.text() + ET.SubElement(doc, "Area_path", type = "str").text = "%s" % self.ui.lineEdit_area_path.text() + + if self.current_mode == Constantes.EXPERT_MODE: + if self.ui.checkBox_listing.isChecked(): + ET.SubElement(doc, "Images_available", type = "int").text = str(1) + else: + ET.SubElement(doc, "Images_available", type = "int").text = str(0) + if self.ui.checkBox_download.isChecked(): + ET.SubElement(doc, "Download", type = "int").text = str(1) + else: + ET.SubElement(doc, "Download", type = "int").text = str(0) + else: + ET.SubElement(doc, "Images_available", type = "int").text = str(0) + ET.SubElement(doc, "Download", type = "int").text = str(0) + + ET.SubElement(doc, "Username", type = "str").text = "%s" % self.ui.lineEdit_user.text() + ET.SubElement(doc, "Password", type = "str").text = "%s" % self.ui.lineEdit_password.text() + if self.w_proxy is None: + sub_proxy = ET.SubElement(doc, "Proxy", id="No_proxy") + ET.SubElement(sub_proxy, "Proxy_adress", type = "str").text = "" + ET.SubElement(sub_proxy, "Proxy_login", type = "str").text = "" + ET.SubElement(sub_proxy, "Proxy_password", type = "str").text = "" + elif self.w_proxy.proxy == "": + sub_proxy = ET.SubElement(doc, "Proxy", id="No_proxy") + ET.SubElement(sub_proxy, "Proxy_adress", type = "str").text = "" + ET.SubElement(sub_proxy, "Proxy_login", type = "str").text = "" + ET.SubElement(sub_proxy, "Proxy_password", type = "str").text = "" + else: + sub_proxy = ET.SubElement(doc, "Proxy", id="Proxy") + ET.SubElement(sub_proxy, "Proxy_adress", type = "str").text = "%s" % self.w_proxy.proxy + ET.SubElement(sub_proxy, "Proxy_login", type = "str").text = "%s" % self.w_proxy.login_proxy + ET.SubElement(sub_proxy, "Proxy_password", type = "str").text = "%s" % self.w_proxy.password_proxy + + if self.current_mode == Constantes.EXPERT_MODE: + if self.ui.checkBox_processing.isChecked(): + ET.SubElement(doc, "Img_processing", type = "int").text = str(1) + else: + ET.SubElement(doc, "Img_processing", type = "int").text = str(0) + + if self.ui.checkBox_VHRS.isChecked(): + ET.SubElement(doc, "VHRS_checked", type = "int").text = str(1) + else: + ET.SubElement(doc, "VHRS_checked", type = "int").text = str(0) + else: + ET.SubElement(doc, "Img_processing", type = "int").text = str(1) + ET.SubElement(doc, "VHRS_checked", type = "int").text = str(1) + + ET.SubElement(doc, "VHRS", type = "str").text = "%s" % self.ui.lineEdit_VHRS.text() + + if self.current_mode == Constantes.EXPERT_MODE: + if self.ui.checkBox_MNT.isChecked(): + ET.SubElement(doc, "MNT_checked", type = "int").text = str(1) + else: + ET.SubElement(doc, "MNT_checked", type = "int").text = str(0) + else: + if "%s" % self.ui.lineEdit_MNT.text() != '': + ET.SubElement(doc, "MNT_checked", type = "int").text = str(1) + else: + ET.SubElement(doc, "MNT_checked", type = "int").text = str(0) + + ET.SubElement(doc, "MNT", type = "str").text = "%s" % self.ui.lineEdit_MNT.text() + + doc = ET.SubElement(root, "Tab", id="Processing_sample") + if self.current_mode == Constantes.EXPERT_MODE: + for sa in range(len(self.sample_name)): + sub_doc = ET.SubElement(doc, "Sample", id="Sample_" + str(sa)) + ET.SubElement(sub_doc, "Sample_path", type = "str").text = self.sample_name[sa] + ET.SubElement(sub_doc, "Fieldname_1", type = "str").text = self.fieldname_args[2*sa] + ET.SubElement(sub_doc, "Fieldname_2", type = "str").text = self.fieldname_args[2*sa+1] + ET.SubElement(sub_doc, "Classname_1", type = "str").text = self.class_args[2*sa] + ET.SubElement(sub_doc, "Classname_2", type = "str").text = self.class_args[2*sa+1] + ET.SubElement(sub_doc, "Nb_polygones", type = "str").text = self.list_nb_sample[sa] + ET.SubElement(sub_doc, "RPG", type = "int").text = str(self.rpg_tchek[sa]) + try: + # To enter a sample raster if the first tab doesn't launch before + if self.img_sample[sa] == 1: + ET.SubElement(sub_doc, "Img_sample", type = "str").text = self.raster_path[sa] + except: + self.logger.debug('Not sample raster only !') + else: + # RPG + sub_doc = ET.SubElement(doc, "Sample", id="Sample_0") + ET.SubElement(sub_doc, "Sample_path", type = "str").text = "%s" % self.ui.lineEdit_sample_path.text() + ET.SubElement(sub_doc, "Fieldname_1", type = "str").text = "%s" % self.ui.lineEdit_select_sample_fieldname_1.text() + ET.SubElement(sub_doc, "Fieldname_2", type = "str").text = "%s" % self.ui.lineEdit_select_sample_fieldname_2.text() + ET.SubElement(sub_doc, "Classname_1", type = "str").text = "%s" % self.ui.lineEdit_select_sample_class_1.text() + ET.SubElement(sub_doc, "Classname_2", type = "str").text = "%s" % self.ui.lineEdit_select_sample_class_2.text() + ET.SubElement(sub_doc, "Nb_polygones", type = "str").text = "%s" % self.ui.lineEdit_select_sample_nb_poly.text() + ET.SubElement(sub_doc, "RPG", type = "int").text = str(1) + + # To Grass/wooden + sub_doc = ET.SubElement(doc, "Sample", id="Sample_1") + ET.SubElement(sub_doc, "Sample_path", type = "str").text = "%s" % self.ui.lineEdit_sample_path_2.text() + ET.SubElement(sub_doc, "Fieldname_1", type = "str").text = "%s" % self.ui.lineEdit_select_sample_fieldname_3.text() + ET.SubElement(sub_doc, "Fieldname_2", type = "str").text = "%s" % self.ui.lineEdit_select_sample_fieldname_4.text() + ET.SubElement(sub_doc, "Classname_1", type = "str").text = "%s" % self.ui.lineEdit_select_sample_class_3.text() + ET.SubElement(sub_doc, "Classname_2", type = "str").text = "%s" % self.ui.lineEdit_select_sample_class_4.text() + ET.SubElement(sub_doc, "Nb_polygones", type = "str").text = "%s" % self.ui.lineEdit_select_sample_nb_poly_2.text() + ET.SubElement(sub_doc, "RPG", type = "int").text = str(0) + + # To wooden + sub_doc = ET.SubElement(doc, "Sample", id="Sample_2") + ET.SubElement(sub_doc, "Sample_path", type = "str").text = "%s" % self.ui.lineEdit_sample_path_3.text() + ET.SubElement(sub_doc, "Fieldname_1", type = "str").text = "%s" % self.ui.lineEdit_select_sample_fieldname_5.text() + ET.SubElement(sub_doc, "Fieldname_2", type = "str").text = "%s" % self.ui.lineEdit_select_sample_fieldname_6.text() + ET.SubElement(sub_doc, "Classname_1", type = "str").text = "%s" % self.ui.lineEdit_select_sample_class_5.text() + ET.SubElement(sub_doc, "Classname_2", type = "str").text = "%s" % self.ui.lineEdit_select_sample_class_6.text() + ET.SubElement(sub_doc, "Nb_polygones", type = "str").text = "%s" % self.ui.lineEdit_select_sample_nb_poly_3.text() + ET.SubElement(sub_doc, "RPG", type = "int").text = str(0) + + if self.current_mode == Constantes.EXPERT_MODE: + if self.ui.checkBox_threshold.isChecked(): + ET.SubElement(doc, "Threshold_checked", type = "int").text = str(1) + else: + ET.SubElement(doc, "Threshold_checked", type = "int").text = str(0) + else: + ET.SubElement(doc, "Threshold_checked", type = "int").text = str(1) + + doc = ET.SubElement(root, "Tab", id="Classification") + ET.SubElement(doc, "Segmentation_path", type = "str").text = "%s" % self.ui.lineEdit_segmentation.text() + ET.SubElement(doc, "Output_path", type = "str").text = "%s" % self.ui.lineEdit_output.text() + + if self.current_mode == Constantes.EXPERT_MODE: + + if self.ui.checkBox_classifier_1.isChecked(): + ET.SubElement(doc, "Output_fieldname_1", type = "str").text = "%s" % self.ui.lineEdit_fieldname_1.text() + ET.SubElement(doc, "Output_type_1", type = "str").text = "%s" % self.ui.comboBox_fieldname_1.currentText() + + if self.ui.checkBox_classifier_2.isChecked(): + ET.SubElement(doc, "Output_fieldname_1", type = "str").text = "%s" % self.ui.lineEdit_fieldname_12.text() + ET.SubElement(doc, "Output_type_1", type = "str").text = "%s" % self.ui.comboBox_fieldname_12.currentText() + ET.SubElement(doc, "Output_fieldname_2", type = "str").text = "%s" % self.ui.lineEdit_fieldname_2.text() + ET.SubElement(doc, "Output_type_2", type = "str").text = "%s" % self.ui.comboBox_fieldname_2.currentText() + + if self.ui.checkBox_classifier_3.isChecked(): + ET.SubElement(doc, "Output_fieldname_1", type = "str").text = "%s" % self.ui.lineEdit_fieldname_13.text() + ET.SubElement(doc, "Output_type_1", type = "str").text = "%s" % self.ui.comboBox_fieldname_13.currentText() + ET.SubElement(doc, "Output_fieldname_2", type = "str").text = "%s" % self.ui.lineEdit_fieldname_23.text() + ET.SubElement(doc, "Output_type_2", type = "str").text = "%s" % self.ui.comboBox_fieldname_23.currentText() + ET.SubElement(doc, "Output_fieldname_3", type = "str").text = "%s" % self.ui.lineEdit_fieldname_3.text() + ET.SubElement(doc, "Output_type_3", type = "str").text = "%s" % self.ui.comboBox_fieldname_3.currentText() + ET.SubElement(doc, "Output_fieldname_4", type = "str").text = "%s" % self.ui.lineEdit_fieldname_4.text() + ET.SubElement(doc, "Output_type_4", type = "str").text = "%s" % self.ui.comboBox_fieldname_4.currentText() + + # Classification mode + if self.ui.radioButton_rf.isChecked(): + ET.SubElement(doc, "Classification_method", type = "int").text = str(1) + elif self.ui.radioButton_s.isChecked(): + ET.SubElement(doc, "Classification_method", type = "int").text = str(0) + else: + ET.SubElement(doc, "Output_fieldname_1", type = "str").text = "NIVEAU_1" + ET.SubElement(doc, "Output_type_1", type = "str").text = "String" + ET.SubElement(doc, "Output_fieldname_2", type = "str").text = "NIVEAU_2" + ET.SubElement(doc, "Output_type_2", type = "str").text = "String" + ET.SubElement(doc, "Output_fieldname_3", type = "str").text = "NIVEAU_3" + ET.SubElement(doc, "Output_type_3", type = "str").text = "String" + ET.SubElement(doc, "Output_fieldname_4", type = "str").text = "POURC" + ET.SubElement(doc, "Output_type_4", type = "str").text = "Real" + ET.SubElement(doc, "Classification_method", type = "int").text = str(1) + + tree = ET.ElementTree(root) + # Write in a xml file + tree.write(str(out_backup), encoding="UTF-8",xml_declaration=True, pretty_print=True) + + def help_tools(self): + """ + Function to open html help + """ + webbrowser.open('file://' + os.getcwd() + '/Documentation/methode_tuto.html#tutoriels-interface') + + + def change_mode(self, new_mode): + """ + Function to switch between SIMPLE and EXPERT mode of "PHYMOBAT" + """ + if new_mode != self.current_mode : + if new_mode == Constantes.SIMPLE_MODE : + self.logger.info("Simplify mode") + self.close() + self.window = PHYMOBAT(mode = Constantes.SIMPLE_MODE) + else : + self.logger.info("Expert mode") + self.close() + self.window = PHYMOBAT(mode = Constantes.EXPERT_MODE) + + self.window.show() + + def about_PHYMOBA(self): + """ + Function to open a new window "About PHYMOBAT" + """ + self.apropos.show() + + def forget_study_area(self): + """ + Function to open a new window 'Alert' because user forgotten to declare study area. + """ + self.w_study_area.show() + + def forget_raster_sample(self): + """ + Function to open a new window 'Alert' because user forgotten to declare rasters or samples. + """ + self.w_forget.show() + + def close_button(self): + """ + Function to close the interface. + """ + self.close() -class PHYMOBAT(QMainWindow, Processing): - """ - Interface main class. It makes to link ``ui_PHYMOBAT_tab`` and ``Processing``. - """ - - def __init__(self, mode = 0, parent=None): - super(PHYMOBAT, self).__init__(parent) - Processing.__init__(self) - - self.apropos = None # For the "About PHYMOBAT" window - self.w_study_area = None # For the "Warming : forget study area" window - self.w_forget = None # For the "Warming : forgetting" window - - self.simpli = None # For the "PHYMOBATs" window - self.expert = None # For the "PHYMOBATe" window - self.mode = mode # For the mode simple (0 by default) or expert (1) - - # To select interface's parameters - if self.mode == 1: - print "Expert" - global Ui_PHYMOBAT, _translate - from ui_PHYMOBATe_tab import Ui_PHYMOBAT, _translate - elif self.mode == 0: - print "Simple" - global Ui_PHYMOBAT, _translate - from ui_PHYMOBATs_tab import Ui_PHYMOBAT, _translate - - self.initUI() - - def initUI(self): - - """ - Get initial values from interface after a click button. - - There is : - - - Connect browser button to search a path - * Main folder path - * Study area shapefile path - * VHRS image path - * MNT image path - * Segmentation shapefile path - * Output classification shapefile path - * Sample shapefile path - * Image path for samples if the first processing image hasn't been launched - - - Connect button to add sample in the memory list - - Connect button to clear sample record. Clear in the interface and in the memory list - - Connect close|ok button - - Connect menu bar tab (Open backup, save in a xml file, close, help, About PHYMOBAT, mode) - - Initialize backup variable - - """ - - # Initial interface - self.ui = Ui_PHYMOBAT() - self.ui.setupUi(self) - - # Connect browser button to search a path - ########################################## - # Main folder path - self.ui.lineEdit_principal_folder.clear() - self.connect(self.ui.pushButton_browser_principal_folder, SIGNAL('clicked()'), self.f_path_folder_dpt) - - # Block other function if SpotWorldHeritage is chose - try : - self.ui.comboBox_captor.currentIndexChanged.connect(self.block_for_swh) - except AttributeError: - pass - - # VHRS image path - self.ui.lineEdit_VHRS.clear() - self.connect(self.ui.pushButton_browser_VHRS, SIGNAL('clicked()'), self.f_path_ortho) - - # Study area shapefile path - self.ui.lineEdit_area_path.clear() - self.connect(self.ui.pushButton_browser_area_path, SIGNAL('clicked()'), self.f_path_area) - - # Proxy - self.connect(self.ui.proxy, SIGNAL('clicked()'), self.f_proxy) - - # Segmentation shapefile path - self.ui.lineEdit_segmentation.clear() - self.connect(self.ui.pushButton_browser_segmentation, SIGNAL('clicked()'), self.f_path_segm) - - # MNT image path - self.ui.lineEdit_MNT.clear() - self.connect(self.ui.pushButton_browser_MNT, SIGNAL('clicked()'), self.f_path_mnt) - - # Output classification shapefile path - self.ui.lineEdit_output.clear() - self.ui.pushButton_browser_output.clicked.connect(self.f_output_name_moba) - - # Sample shapefile path. - # For the simply mode, RPG file sample. - self.ui.lineEdit_sample_path.clear() - self.ui.pushButton_browser_sample_path.clicked.connect(self.enter_sample_name) - - if self.mode == 0: - # For the simply mode, grass/wooden file sample. - self.ui.lineEdit_sample_path_2.clear() - self.ui.pushButton_browser_sample_path_2.clicked.connect(self.enter_sample_name_hl) - # For the simply mode, wooden file sample. - self.ui.lineEdit_sample_path_3.clear() - self.ui.pushButton_browser_sample_path_3.clicked.connect(self.enter_sample_name_ll) - - # Image path for samples if the first processing image hasn't been launched - try: - self.connect(self.ui.pushButton_img_sample, SIGNAL('clicked()'), self.img_sample_name) - except AttributeError: - pass # Simple mode - ########################################## - - # Connect button to add sample in the memory list - try: - self.connect(self.ui.pushButton_add_sample, SIGNAL('clicked()'), self.add_sample) - except AttributeError: - pass # Simple mode - - # Connect button to clear sample record. Clear in the interface and in the memory list - try: - self.connect(self.ui.pushButton_clear_sample, SIGNAL('clicked()'), self.clear_sample) - except AttributeError: - pass # Simple mode - - # Connect close|ok button - self.ui.buttonBox.button(QDialogButtonBox.Close).clicked.connect(self.close_button) - self.ui.buttonBox.button(QDialogButtonBox.Ok).clicked.connect(self.ok_button) - - # Connect Menu bar - self.ui.actionOuvrir.triggered.connect(self.open_backup) # Open backup - self.ui.actionSauver.triggered.connect(self.save_backup) # Save field name on the interface - self.ui.actionQuiter.triggered.connect(self.close_button) # Close - self.ui.actionAide_de_PHYMOBAT.triggered.connect(self.help_tools) # Help - self.ui.actionA_propos_de_PHYMOBAT.triggered.connect(self.about_PHYMOBA) # About PHYMOBA - self.ui.actionMode_Simplifi.triggered.connect(self.mode_simpli) # To open the simple apply - self.ui.actionMode_expert.triggered.connect(self.mode_expert) # To open the expert apply - - self.rpg_tchek = [] # To backup rpg mode - self.img_sample = [] # To backup - - # Connect change line edit on sample path to extract fieldnames. For the simply mode, this - # is with RPG sample - self.ui.lineEdit_select_sample_fieldname_1.textChanged.connect(self.field_display_1) - self.ui.lineEdit_select_sample_fieldname_2.textChanged.connect(self.field_display_2) - - # To choose the classification method - if self.mode == 1: - if self.ui.radioButton_rf.isChecked(): - self.ui.checkBox_classifier_1.setEnabled(False) - self.ui.checkBox_classifier_2.setEnabled(False) - - self.ui.radioButton_rf.toggled.connect(self.activate_level) - self.ui.radioButton_s.toggled.connect(self.activate_level) - - if self.mode == 0: - # Connect change line edit to grass/wooden sample - self.ui.lineEdit_select_sample_fieldname_3.textChanged.connect(self.field_display_3) - self.ui.lineEdit_select_sample_fieldname_4.textChanged.connect(self.field_display_4) - self.ui.lineEdit_select_sample_fieldname_5.textChanged.connect(self.field_display_5) - self.ui.lineEdit_select_sample_fieldname_6.textChanged.connect(self.field_display_6) - - # Change connect for classification checkboxes - try: - self.ui.checkBox_classifier_1.stateChanged.connect(self.display_one_level) - self.ui.checkBox_classifier_2.stateChanged.connect(self.display_two_levels) - self.ui.checkBox_classifier_3.stateChanged.connect(self.display_all_levels) - except AttributeError: - pass # Simple mode - - def get_variable(self): - - """ - Add a all system value like : - - - Main folder path by line edit - - Satellite captor name by combo box - - Classification year by line edit - - Study area shapefile path by line edit - - Connexion username and password by line edit - - VHRS image path by line edit - - MNT image path by line edit - - Segmentation shapefile path path by line edit - - Output classification shapefile path by line edit - - Output shapefile field name by line edit and field type by combo box - - """ - # Main folder path by line edit. - self.path_folder_dpt = "%s" % self.ui.lineEdit_principal_folder.text() - - # Satellite captor name by combo box - try: - self.captor_project = self.ui.comboBox_captor.currentText() - except AttributeError: - self.captor_project = "Landsat" - - # Classification year by line edit - self.classif_year = "%s" % self.ui.lineEdit_year_images.text() - - # Study area shapefile path by line edit - self.path_area = "%s" % self.ui.lineEdit_area_path.text() - - # Connexion username and password by line edit - self.user = "%s" % self.ui.lineEdit_user.text() - self.password = "%s" % self.ui.lineEdit_password.text() - - # VHRS image path by line edit - self.path_ortho = "%s" % self.ui.lineEdit_VHRS.text() - - # MNT image path by line edit - self.path_mnt = "%s" % self.ui.lineEdit_MNT.text() - - # Output shapefile field name by line edit and field type by combo box - try: - if self.ui.checkBox_classifier_1.isChecked() and self.ui.lineEdit_fieldname_1.text() != '': - self.out_fieldname_carto.append("%s" % self.ui.lineEdit_fieldname_1.text()) - self.out_fieldtype_carto.append(eval("ogr.OFT%s" % self.ui.comboBox_fieldname_1.currentText())) - - if self.ui.checkBox_classifier_2.isChecked() and self.ui.lineEdit_fieldname_12.text() != '': - self.out_fieldname_carto.append("%s" % self.ui.lineEdit_fieldname_12.text()) - self.out_fieldtype_carto.append(eval("ogr.OFT%s" % self.ui.comboBox_fieldname_12.currentText())) - - if self.ui.lineEdit_fieldname_2.text() != '': - self.out_fieldname_carto.append("%s" % self.ui.lineEdit_fieldname_2.text()) - self.out_fieldtype_carto.append(eval("ogr.OFT%s" % self.ui.comboBox_fieldname_2.currentText())) - - if self.ui.checkBox_classifier_3.isChecked() and self.ui.lineEdit_fieldname_13.text() != '': - self.out_fieldname_carto.append("%s" % self.ui.lineEdit_fieldname_13.text()) - self.out_fieldtype_carto.append(eval("ogr.OFT%s" % self.ui.comboBox_fieldname_13.currentText())) - - if self.ui.lineEdit_fieldname_23.text() != '': - self.out_fieldname_carto.append("%s" % self.ui.lineEdit_fieldname_23.text()) - self.out_fieldtype_carto.append(eval("ogr.OFT%s" % self.ui.comboBox_fieldname_23.currentText())) - - if self.ui.lineEdit_fieldname_3.text() != '': - self.out_fieldname_carto.append("%s" % self.ui.lineEdit_fieldname_3.text()) - self.out_fieldtype_carto.append(eval("ogr.OFT%s" % self.ui.comboBox_fieldname_3.currentText())) - - if self.ui.lineEdit_fieldname_4.text() != '': - self.out_fieldname_carto.append("%s" % self.ui.lineEdit_fieldname_4.text()) - self.out_fieldtype_carto.append(eval("ogr.OFT%s" % self.ui.comboBox_fieldname_4.currentText())) - except AttributeError: - modes_fieldname = ["NIVEAU_1", "NIVEAU_2", "NIVEAU_3", "POURC"] - modes_fieldtype = [eval("ogr.OFTString"), eval("ogr.OFTString"), eval("ogr.OFTString"), eval("ogr.OFTReal")] - - for mf in range(len(modes_fieldname)): - - self.out_fieldname_carto.append(modes_fieldname[mf]) - self.out_fieldtype_carto.append(modes_fieldtype[mf]) - - # Segmentation shapefile path path by line edit - self.path_segm = "%s" % self.ui.lineEdit_segmentation.text() - - # Output shapefile field name by line edit and field type by combo box - self.output_name_moba = "%s" % self.ui.lineEdit_output.text() - - def set_variable(self): - """ - Print number of available image from Theia's GeoJSON . - """ - # self.ui.lineEdit_listing.setText(str(self.nb_avalaible_images)) - try: - self.ui.label_listing.setText(str(self.nb_avalaible_images)) - except AttributeError: - pass # Simple mode - - def f_path_folder_dpt(self): - """ - Open a input browser box to select the main folder path by line edit. - """ - infoldername = QFileDialog.getExistingDirectory(self, "Principal folder path", os.getcwd(), QFileDialog.ShowDirsOnly) - self.ui.lineEdit_principal_folder.setText(str(infoldername).replace('[','').replace(']','').replace(' ','')) - - def block_for_swh(self): - """ - Function to block others function when SportWorldHeritage is selected in the comboxbox captor. - """ - ind_captor = int(self.ui.comboBox_captor.currentIndex()) - if ind_captor == 2: - self.ui.checkBox_processing.setEnabled(False) - self.ui.checkBox_MNT.setEnabled(False) - self.ui.lineEdit_MNT.setEnabled(False) - self.ui.pushButton_browser_MNT.setEnabled(False) - self.ui.checkBox_VHRS.setEnabled(False) - self.ui.lineEdit_VHRS.setEnabled(False) - self.ui.pushButton_browser_VHRS.setEnabled(False) - self.ui.tabWidget.setTabEnabled(1, False) - self.ui.tabWidget.setTabEnabled(2, False) - # If the user want, on the same moment, come back on other captor that SWH. - else: - self.ui.checkBox_processing.setEnabled(True) - self.ui.checkBox_MNT.setEnabled(True) - self.ui.lineEdit_MNT.setEnabled(True) - self.ui.pushButton_browser_MNT.setEnabled(True) - self.ui.checkBox_VHRS.setEnabled(True) - self.ui.lineEdit_VHRS.setEnabled(True) - self.ui.pushButton_browser_VHRS.setEnabled(True) - self.ui.tabWidget.setTabEnabled(1, True) - self.ui.tabWidget.setTabEnabled(2, True) - - def f_path_ortho(self): - """ - Open a input browser box to select the VHRS image path by line edit. - """ - orthofilename = QFileDialog.getOpenFileName(self, "THRS image", self.ui.lineEdit_principal_folder.text(), '*.TIF *.tif') - self.ui.lineEdit_VHRS.setText(str(orthofilename).replace('[','').replace(']','').replace(' ','')) - - def f_path_mnt(self): - """ - Open a input browser box to select the MNT image path by line edit. - """ - mntfilename = QFileDialog.getOpenFileName(self, "MNT image", self.ui.lineEdit_principal_folder.text(), '*.TIF *.tif') - self.ui.lineEdit_MNT.setText(str(mntfilename).replace('[','').replace(']','').replace(' ','')) - - def f_path_area(self): - """ - Open a input browser box to select the study area shapefile path by line edit. - """ - areafilename = QFileDialog.getOpenFileName(self, "Area shapefile", self.ui.lineEdit_principal_folder.text(), '*.shp') - self.ui.lineEdit_area_path.setText(str(areafilename).replace('[','').replace(']','').replace(' ','')) - - def f_proxy(self): - """ - Function to open a popup in order to enter proxy ID - """ - if self.w_proxy is None: - self.w_proxy = MyPopup_proxy_window() - self.w_proxy.show() - - def f_path_segm(self): - """ - Open a input browser box to select segmentation shapefile path path by line edit. - """ - segmfilename = QFileDialog.getOpenFileName(self, "Segmentation shapefile", self.ui.lineEdit_principal_folder.text(), '*.shp') - self.ui.lineEdit_segmentation.setText(str(segmfilename).replace('[','').replace(']','').replace(' ','')) - - def f_output_name_moba(self): - """ - Set the output classification shapefile path by line edit. - """ - outfilename = QFileDialog.getSaveFileName(self, "FB file", self.ui.lineEdit_principal_folder.text(), '*.shp') - # if the user has forgotten to put .shp at the end of the output shapefile - if outfilename[-4:] != '.shp': - outfilename = outfilename + '.shp' - self.ui.lineEdit_output.setText(outfilename) - - def enter_sample_name(self): - """ - Open a input browser box to select the sample shapefile path by line edit. With :func:`add_sample` conditions for the expert mode. - For the simply mode, this function is used for the RPG shapefile. - """ - samplefilename = QFileDialog.getOpenFileName(self, "Sample shapefile", self.ui.lineEdit_principal_folder.text(), '*.shp') - self.ui.lineEdit_sample_path.setText(str(samplefilename).replace('[','').replace(']','').replace(' ','')) - - def enter_sample_name_hl(self): - """ - Open a input browser box to select the grass and wooden sample shapefile path by line edit. With :func:`add_sample` conditions - for the simply mode. - """ - samplefilename_hl = QFileDialog.getOpenFileName(self, "Grass/Wooden sample shapefile", self.ui.lineEdit_principal_folder.text(), '*.shp') - self.ui.lineEdit_sample_path_2.setText(str(samplefilename_hl).replace('[','').replace(']','').replace(' ','')) - - def enter_sample_name_ll(self): - """ - Open a input browser box to select the wooden sample shapefile path by line edit. With :func:`add_sample` conditions for the simply mode. - """ - samplefilename_ll = QFileDialog.getOpenFileName(self, "Wooden sample shapefile", self.ui.lineEdit_principal_folder.text(), '*.shp') - self.ui.lineEdit_sample_path_3.setText(str(samplefilename_ll).replace('[','').replace(']','').replace(' ','')) - - def img_sample_name(self): - """ - Open a input browser box to select the image for samples path by line edit. With :func:`add_sample` conditions. - """ - imgsamplefilename = QFileDialog.getOpenFileName(self, "Sample image", self.ui.lineEdit_principal_folder.text(), '*.TIF') - self.ui.lineEdit_img_sample.setText(str(imgsamplefilename).replace('[','').replace(']','').replace(' ','')) - - def add_sample(self): - """ - Add sample information and location to compute optimal threshold : - - For the expert mode (mode=1) : - - - Append a sample name by line Edit. *This is a check box* ``RPG``, *if the sample is RPG file. It launch the Rpg class. And append a other sample from Rpg class*. - - Append two existent sample field names by combobox. It will be the same. - - Append sample class names by line edit. One or more for every sample. - - Append number of polygons for every samples by line edit. - - Print in a plain text edit : sample name, two sample field names, sample class names and number of polygons. - - *This check box* ``Image echantillonee``, *image path for samples if the first processing image hasn't been launched*. - .. note:: This is for a image with one spectral band - - Clear all widget field at the end. - - For the simply mode (mode=0): - - - Append a sample name by a different line Edit (a line Edit for each sample). - - Append sample class names, existing sample fields and number of polygons (a different line Edit for each sample) - """ - - nb_sample = len(self.sample_name)# Compute number of samples added. Condition : max three. - # Study area shapefile path by line edit if no processing other - # Because the function "Vector" need study area - self.path_area = "%s" % self.ui.lineEdit_area_path.text() - if self.path_area == '': - self.forget_study_area() - - if self.mode == 1: - # Expert mode - if nb_sample < 3 and not self.ui.lineEdit_sample_path.text().isEmpty() and \ - not self.ui.lineEdit_select_sample_fieldname_1.text().isEmpty() and not self.ui.lineEdit_select_sample_fieldname_2.text().isEmpty() and \ - not self.ui.lineEdit_select_sample_class_1.text().isEmpty() and not self.ui.lineEdit_select_sample_class_2.text().isEmpty() and \ - not self.ui.lineEdit_select_sample_nb_poly.text().isEmpty() and not self.ui.lineEdit_area_path.text().isEmpty(): - - # Append a sample name by line Edit. - if self.ui.checkBox_RPG.isChecked(): - # Check box, if the sample of the RPG file. It launch the Rpg class. And append a other sample from Rpg class - self.sample_name.append(self.i_rpg("%s" % self.ui.lineEdit_sample_path.text())) - self.rpg_tchek.append(1) # To backup - self.ui.checkBox_RPG.setChecked(False) - else: - self.sample_name.append("%s" % self.ui.lineEdit_sample_path.text()) - self.rpg_tchek.append(0) - - # Append two sample field names by line edit. It must be the same. - self.fieldname_args.append("%s" % self.ui.lineEdit_select_sample_fieldname_1.text()) - self.fieldname_args.append("%s" % self.ui.lineEdit_select_sample_fieldname_2.text()) - # Append sample class names by line edit. One or more for every sample - self.class_args.append("%s" % self.ui.lineEdit_select_sample_class_1.text()) - self.class_args.append("%s" % self.ui.lineEdit_select_sample_class_2.text()) - # Append number of polygons for every samples by line edit. - self.list_nb_sample.append("%s" % self.ui.lineEdit_select_sample_nb_poly.text()) - - nb_sample = len(self.sample_name) # Number of samples added - # Print in a plain text edit : sample name, two sample field names, sample class names and number of polygons. - cursor = self.ui.plainTextEdit_sample.textCursor() - cursor.movePosition(QTextCursor.End, QTextCursor.MoveAnchor) - self.ui.plainTextEdit_sample.setTextCursor(cursor) - self.ui.plainTextEdit_sample.insertPlainText(str(self.sample_name[nb_sample-1]) + "\n") - cursor.movePosition(QTextCursor.Down, QTextCursor.MoveAnchor) - self.ui.plainTextEdit_sample.setTextCursor(cursor) - self.ui.plainTextEdit_sample.insertPlainText(str(self.fieldname_args[(nb_sample-1)*2]) + ' ' + str(self.fieldname_args[((nb_sample-1)*2)+1]) + "\n") - cursor.movePosition(QTextCursor.Down, QTextCursor.MoveAnchor) - self.ui.plainTextEdit_sample.setTextCursor(cursor) - self.ui.plainTextEdit_sample.insertPlainText(str(self.class_args[(nb_sample-1)*2]) + ' ' + str(self.class_args[(nb_sample-1)*2+1]) + "\n") - cursor.movePosition(QTextCursor.Down, QTextCursor.MoveAnchor) - self.ui.plainTextEdit_sample.setTextCursor(cursor) - self.ui.plainTextEdit_sample.insertPlainText(str(self.list_nb_sample[nb_sample-1]) + "\n") - - # Check box, image path for samples if the first processing image hasn't been launched - # Warming : This is for a image with one spectral band - if self.ui.checkBox_img_sample.isChecked(): - self.raster_path.append("%s" % self.ui.lineEdit_img_sample.text()) - self.list_band_outraster.append(1) - self.ui.lineEdit_img_sample.clear() - self.ui.checkBox_img_sample.setChecked(False) - self.img_sample.append(1) - else: # To backup - self.img_sample.append(0) - - # Clear all line edit after addition, ie after click add button. - self.ui.lineEdit_sample_path.clear() - self.ui.lineEdit_select_sample_fieldname_1.clear() - self.ui.lineEdit_select_sample_fieldname_2.clear() - self.ui.lineEdit_select_sample_class_1.clear() - self.ui.lineEdit_select_sample_class_2.clear() - self.ui.lineEdit_select_sample_nb_poly.clear() - - elif self.mode == 0: - - # Simple mode - # Append a sample name by line Edit. - # For the sample of the RPG file. It launch the Rpg class. And append a other sample from Rpg class - self.sample_name.append(self.i_rpg("%s" % self.ui.lineEdit_sample_path.text())) - - # Append two sample field names by line edit. It must be the same. - self.fieldname_args.append("%s" % self.ui.lineEdit_select_sample_fieldname_1.text()) - self.fieldname_args.append("%s" % self.ui.lineEdit_select_sample_fieldname_2.text()) - # Append sample class names by line edit. One or more for every sample - self.class_args.append("%s" % self.ui.lineEdit_select_sample_class_1.text()) - self.class_args.append("%s" % self.ui.lineEdit_select_sample_class_2.text()) - # Append number of polygons for every samples by line edit. - self.list_nb_sample.append("%s" % self.ui.lineEdit_select_sample_nb_poly.text()) - - # Same process that the RPG process except the start of the RPG class. - # To Grass/wooden - self.sample_name.append("%s" % self.ui.lineEdit_sample_path_2.text()) - self.fieldname_args.append("%s" % self.ui.lineEdit_select_sample_fieldname_3.text()) - self.fieldname_args.append("%s" % self.ui.lineEdit_select_sample_fieldname_4.text()) - self.class_args.append("%s" % self.ui.lineEdit_select_sample_class_3.text()) - self.class_args.append("%s" % self.ui.lineEdit_select_sample_class_4.text()) - self.list_nb_sample.append("%s" % self.ui.lineEdit_select_sample_nb_poly_2.text()) - - # To wooden - self.sample_name.append("%s" % self.ui.lineEdit_sample_path_3.text()) - self.fieldname_args.append("%s" % self.ui.lineEdit_select_sample_fieldname_5.text()) - self.fieldname_args.append("%s" % self.ui.lineEdit_select_sample_fieldname_6.text()) - self.class_args.append("%s" % self.ui.lineEdit_select_sample_class_5.text()) - self.class_args.append("%s" % self.ui.lineEdit_select_sample_class_6.text()) - self.list_nb_sample.append("%s" % self.ui.lineEdit_select_sample_nb_poly_3.text()) - - nb_sample = 3 - - def clear_sample(self): - """ - Function to clear sample record. Clear in the interface and in the memory list. - """ - self.sample_name = [] - self.fieldname_args = [] - self.class_args = [] - self.list_nb_sample = [] - self.rpg_tchek = [] - self.img_sample = [] - - self.ui.lineEdit_sample_path.clear() - self.ui.lineEdit_select_sample_fieldname_1.clear() - self.ui.lineEdit_select_sample_fieldname_2.clear() - self.ui.lineEdit_select_sample_class_1.clear() - self.ui.lineEdit_select_sample_class_2.clear() - self.ui.lineEdit_select_sample_nb_poly.clear() - self.ui.checkBox_RPG.setChecked(False) - self.ui.lineEdit_img_sample.clear() - self.ui.checkBox_img_sample.setChecked(False) - self.ui.plainTextEdit_sample.clear() - self.ui.plainTextEdit_sample.insertPlainText(_fromUtf8("1 - Végétation non naturelle / Semi-naturelle\n")) - self.ui.plainTextEdit_sample.insertPlainText(_fromUtf8("2 - Herbacés / Ligneux\n")) - self.ui.plainTextEdit_sample.insertPlainText("3 - Lingeux mixtes / denses\n") - self.ui.plainTextEdit_sample.insertPlainText("\n") - self.ui.plainTextEdit_sample.insertPlainText("\n") - self.ui.plainTextEdit_sample.insertPlainText("") - - def field_display_1(self): - """ - Function to display fieldname class 1 in the other fieldname class 2 when text changed. - For the simply mode, this is RPG sample. - """ - - self.ui.lineEdit_select_sample_fieldname_2.setText("%s" % self.ui.lineEdit_select_sample_fieldname_1.text()) - - def field_display_2(self): - """ - Function to display fieldname class 2 in the other fieldname class 2 when text changed. - For the simply mode, this is RPG sample. - """ - - self.ui.lineEdit_select_sample_fieldname_1.setText("%s" % self.ui.lineEdit_select_sample_fieldname_2.text()) - - def field_display_3(self): - """ - For the grass/wooden sample, a function to display fieldname class 1 in the other fieldname class 2 when text changed. - """ - - self.ui.lineEdit_select_sample_fieldname_4.setText("%s" % self.ui.lineEdit_select_sample_fieldname_3.text()) - - def field_display_4(self): - """ - For the grass/wooden sample, a function to display fieldname class 2 in the other fieldname class 2 when text changed. - """ - - self.ui.lineEdit_select_sample_fieldname_3.setText("%s" % self.ui.lineEdit_select_sample_fieldname_4.text()) - - def field_display_5(self): - """ - For the wooden sample, a function to display fieldname class 1 in the other fieldname class 2 when text changed. - """ - - self.ui.lineEdit_select_sample_fieldname_6.setText("%s" % self.ui.lineEdit_select_sample_fieldname_5.text()) - - def field_display_6(self): - """ - For the wooden sample, a function to display fieldname class 2 in the other fieldname class 2 when text changed. - """ - - self.ui.lineEdit_select_sample_fieldname_5.setText("%s" % self.ui.lineEdit_select_sample_fieldname_6.text()) - - def activate_level(self): - """ - To activate the first levels with seath method. This is in pushing on the decision tree radio button. - Else it activates the last level to random forest method. - """ - if self.ui.radioButton_s.isChecked() and not self.ui.radioButton_rf.isChecked(): - self.ui.checkBox_classifier_1.setEnabled(True) - self.ui.checkBox_classifier_2.setEnabled(True) - else: - self.ui.checkBox_classifier_1.setEnabled(False) - self.ui.checkBox_classifier_2.setEnabled(False) - self.ui.checkBox_classifier_3.setChecked(True) - - - def display_one_level(self): - """ - Function to display fieldnames option to classifier one level - """ - if self.ui.checkBox_classifier_1.isChecked(): - - # Don't checked others checkboxes - self.ui.checkBox_classifier_2.setChecked(False) - self.ui.checkBox_classifier_3.setChecked(False) - - # Display options filednames - self.ui.label_chps_1 = QLabel(self.ui.tab_3) - self.ui.label_chps_1.setObjectName(_fromUtf8("label_chps_1")) - self.ui.gridLayout_2.addWidget(self.ui.label_chps_1, 10, 0, 2, 2) - self.ui.label_chps_name_1 = QLabel(self.ui.tab_3) - self.ui.label_chps_name_1.setObjectName(_fromUtf8("label_chps_name_1")) - self.ui.gridLayout_2.addWidget(self.ui.label_chps_name_1, 10, 2, 1, 1) - self.ui.label_chps_type_1 = QLabel(self.ui.tab_3) - self.ui.label_chps_type_1.setObjectName(_fromUtf8("label_chps_type_1")) - self.ui.gridLayout_2.addWidget(self.ui.label_chps_type_1, 11, 2, 1, 1) - self.ui.lineEdit_fieldname_1 = QLineEdit(self.ui.tab_3) - self.ui.lineEdit_fieldname_1.setObjectName(_fromUtf8("lineEdit_fieldname_1")) - self.ui.gridLayout_2.addWidget(self.ui.lineEdit_fieldname_1, 10, 3, 1, 1) - self.ui.comboBox_fieldname_1 = QComboBox(self.ui.tab_3) - self.ui.comboBox_fieldname_1.setObjectName(_fromUtf8("comboBox_fieldname_1")) - self.ui.gridLayout_2.addWidget(self.ui.comboBox_fieldname_1, 11, 3, 1, 1) - - self.ui.lineEdit_fieldname_1.setText(_translate("PHYMOBAT", "NIVEAU_1", None)) - self.ui.comboBox_fieldname_1.addItem("String") - self.ui.comboBox_fieldname_1.addItem("Real") - - self.ui.label_chps_1.setText(_translate("PHYMOBAT", " Champs\n"+" des entités", None)) - self.ui.label_chps_name_1.setText(_translate("PHYMOBAT", "Nom :", None)) - self.ui.label_chps_type_1.setText(_translate("PHYMOBAT", "Type :", None)) - - if not self.ui.checkBox_classifier_1.isChecked(): - # Clear options filednames - try: - self.ui.label_chps_1.deleteLater() - self.ui.label_chps_name_1.deleteLater() - self.ui.label_chps_type_1.deleteLater() - self.ui.lineEdit_fieldname_1.deleteLater() - self.ui.comboBox_fieldname_1.deleteLater() - except AttributeError: - pass - - def display_two_levels(self): - """ - Function to display fieldnames option to classifier two first levels - """ - - if self.ui.checkBox_classifier_2.isChecked(): - - # Don't checked others checkboxes - self.ui.checkBox_classifier_1.setChecked(False) - self.ui.checkBox_classifier_3.setChecked(False) - - self.ui.label_chps_2 = QLabel(self.ui.tab_3) - self.ui.label_chps_2.setObjectName(_fromUtf8("label_chps_2")) - self.ui.gridLayout_2.addWidget(self.ui.label_chps_2, 13, 0, 2, 2) - self.ui.lineEdit_fieldname_12 = QLineEdit(self.ui.tab_3) - self.ui.lineEdit_fieldname_12.setObjectName(_fromUtf8("lineEdit_fieldname_12")) - self.ui.gridLayout_2.addWidget(self.ui.lineEdit_fieldname_12, 13, 3, 1, 1) - self.ui.lineEdit_fieldname_2 = QLineEdit(self.ui.tab_3) - self.ui.lineEdit_fieldname_2.setObjectName(_fromUtf8("lineEdit_fieldname_2")) - self.ui.gridLayout_2.addWidget(self.ui.lineEdit_fieldname_2, 13, 4, 1, 1) - self.ui.label_chps_type_2 = QLabel(self.ui.tab_3) - self.ui.label_chps_type_2.setObjectName(_fromUtf8("label_chps_type_2")) - self.ui.gridLayout_2.addWidget(self.ui.label_chps_type_2, 14, 2, 1, 1) - self.ui.comboBox_fieldname_12 = QComboBox(self.ui.tab_3) - self.ui.comboBox_fieldname_12.setObjectName(_fromUtf8("comboBox_fieldname_12")) - self.ui.gridLayout_2.addWidget(self.ui.comboBox_fieldname_12, 14, 3, 1, 1) - self.ui.comboBox_fieldname_2 = QComboBox(self.ui.tab_3) - self.ui.comboBox_fieldname_2.setObjectName(_fromUtf8("comboBox_fieldname_2")) - self.ui.gridLayout_2.addWidget(self.ui.comboBox_fieldname_2, 14, 4, 1, 1) - self.ui.label_chps_name_2 = QLabel(self.ui.tab_3) - self.ui.label_chps_name_2.setObjectName(_fromUtf8("label_chps_name_2")) - self.ui.gridLayout_2.addWidget(self.ui.label_chps_name_2, 13, 2, 1, 1) - - self.ui.lineEdit_fieldname_12.setText(_translate("PHYMOBAT", "NIVEAU_1", None)) - self.ui.comboBox_fieldname_12.addItem("String") - self.ui.comboBox_fieldname_12.addItem("Real") - self.ui.lineEdit_fieldname_2.setText(_translate("PHYMOBAT", "NIVEAU_2", None)) - self.ui.comboBox_fieldname_2.addItem("String") - self.ui.comboBox_fieldname_2.addItem("Real") - - self.ui.label_chps_type_2.setText(_translate("PHYMOBAT", "Type :", None)) - self.ui.label_chps_2.setText(_translate("PHYMOBAT", " Champs\n"+" des entités", None)) - self.ui.label_chps_name_2.setText(_translate("PHYMOBAT", "Nom :", None)) - - if not self.ui.checkBox_classifier_2.isChecked(): - # Clear options filednames - try: - self.ui.label_chps_2.deleteLater() - self.ui.label_chps_name_2.deleteLater() - self.ui.label_chps_type_2.deleteLater() - self.ui.lineEdit_fieldname_12.deleteLater() - self.ui.comboBox_fieldname_12.deleteLater() - self.ui.lineEdit_fieldname_2.deleteLater() - self.ui.comboBox_fieldname_2.deleteLater() - except AttributeError: - pass - - def display_all_levels(self): - """ - Function to display fieldnames option to launch complete classification - """ - - if self.ui.checkBox_classifier_3.isChecked(): - - # Don't checked others checkboxes - self.ui.checkBox_classifier_1.setChecked(False) - self.ui.checkBox_classifier_2.setChecked(False) - - self.ui.label_chps_name_3 = QLabel(self.ui.tab_3) - self.ui.label_chps_name_3.setObjectName(_fromUtf8("label_chps_name_3")) - self.ui.gridLayout_2.addWidget(self.ui.label_chps_name_3, 16, 2, 1, 1) - self.ui.label_chps_3 = QLabel(self.ui.tab_3) - self.ui.label_chps_3.setObjectName(_fromUtf8("label_chps_3")) - self.ui.gridLayout_2.addWidget(self.ui.label_chps_3, 16, 0, 2, 2) - self.ui.label_chps_type_3 = QLabel(self.ui.tab_3) - self.ui.label_chps_type_3.setObjectName(_fromUtf8("label_chps_type_3")) - self.ui.gridLayout_2.addWidget(self.ui.label_chps_type_3, 17, 2, 1, 1) - self.ui.lineEdit_fieldname_13 = QLineEdit(self.ui.tab_3) - self.ui.lineEdit_fieldname_13.setObjectName(_fromUtf8("lineEdit_fieldname_13")) - self.ui.gridLayout_2.addWidget(self.ui.lineEdit_fieldname_13, 16, 3, 1, 1) - self.ui.lineEdit_fieldname_23 = QLineEdit(self.ui.tab_3) - self.ui.lineEdit_fieldname_23.setObjectName(_fromUtf8("lineEdit_fieldname_23")) - self.ui.gridLayout_2.addWidget(self.ui.lineEdit_fieldname_23, 16, 4, 1, 1) - self.ui.lineEdit_fieldname_3 = QLineEdit(self.ui.tab_3) - self.ui.lineEdit_fieldname_3.setObjectName(_fromUtf8("lineEdit_fieldname_3")) - self.ui.gridLayout_2.addWidget(self.ui.lineEdit_fieldname_3, 16, 5, 1, 1) - self.ui.lineEdit_fieldname_4 = QLineEdit(self.ui.tab_3) - self.ui.lineEdit_fieldname_4.setObjectName(_fromUtf8("lineEdit_fieldname_4")) - self.ui.gridLayout_2.addWidget(self.ui.lineEdit_fieldname_4, 16, 6, 1, 1) - self.ui.comboBox_fieldname_13 = QComboBox(self.ui.tab_3) - self.ui.comboBox_fieldname_13.setObjectName(_fromUtf8("comboBox_fieldname_13")) - self.ui.gridLayout_2.addWidget(self.ui.comboBox_fieldname_13, 17, 3, 1, 1) - self.ui.comboBox_fieldname_23 = QComboBox(self.ui.tab_3) - self.ui.comboBox_fieldname_23.setObjectName(_fromUtf8("comboBox_fieldname_23")) - self.ui.gridLayout_2.addWidget(self.ui.comboBox_fieldname_23, 17, 4, 1, 1) - self.ui.comboBox_fieldname_3 = QComboBox(self.ui.tab_3) - self.ui.comboBox_fieldname_3.setObjectName(_fromUtf8("comboBox_fieldname_3")) - self.ui.gridLayout_2.addWidget(self.ui.comboBox_fieldname_3, 17, 5, 1, 1) - self.ui.comboBox_fieldname_4 = QComboBox(self.ui.tab_3) - self.ui.comboBox_fieldname_4.setObjectName(_fromUtf8("comboBox_fieldname_4")) - self.ui.gridLayout_2.addWidget(self.ui.comboBox_fieldname_4, 17, 6, 1, 1) - - self.ui.lineEdit_fieldname_13.setText(_translate("PHYMOBAT", "NIVEAU_1", None)) - self.ui.comboBox_fieldname_13.addItem("String") - self.ui.comboBox_fieldname_13.addItem("Real") - self.ui.lineEdit_fieldname_23.setText(_translate("PHYMOBAT", "NIVEAU_2", None)) - self.ui.comboBox_fieldname_23.addItem("String") - self.ui.comboBox_fieldname_23.addItem("Real") - self.ui.lineEdit_fieldname_3.setText(_translate("PHYMOBAT", "NIVEAU_3", None)) - self.ui.comboBox_fieldname_3.addItem("String") - self.ui.comboBox_fieldname_3.addItem("Real") - self.ui.lineEdit_fieldname_4.setText(_translate("PHYMOBAT", "POURC", None)) - self.ui.comboBox_fieldname_4.addItem("Real") - self.ui.comboBox_fieldname_4.addItem("String") - - self.ui.label_chps_3.setText(_translate("PHYMOBAT", " Champs\n"+" des entités", None)) - self.ui.label_chps_type_3.setText(_translate("PHYMOBAT", "Type :", None)) - self.ui.label_chps_name_3.setText(_translate("PHYMOBAT", "Nom :", None)) - - if not self.ui.checkBox_classifier_3.isChecked(): - # Clear options filednames - try: - self.ui.label_chps_3.deleteLater() - self.ui.label_chps_name_3.deleteLater() - self.ui.label_chps_type_3.deleteLater() - self.ui.lineEdit_fieldname_13.deleteLater() - self.ui.comboBox_fieldname_13.deleteLater() - self.ui.lineEdit_fieldname_23.deleteLater() - self.ui.comboBox_fieldname_23.deleteLater() - self.ui.lineEdit_fieldname_3.deleteLater() - self.ui.comboBox_fieldname_3.deleteLater() - self.ui.lineEdit_fieldname_4.deleteLater() - self.ui.comboBox_fieldname_4.deleteLater() - except AttributeError: - pass - - def ok_button(self): - - """ - Function to launch the processing. This function take account : - - - The ``Multi-processing`` check box if the processing has launched with multi process. By default, this is checked. It need a computer with minimum 12Go memory. - - Append a few system value with :func:`get_variable`. - - There are 3 principal check boxes : - - to get number download available images - - for downloading and processing on theia platform - - to compute optimal threshold. - - to compute slope raster - - for classification processing. - """ - - # Start the processus - startTime = time.time() - - # To know if the processing must be launch on several thread - if self.ui.checkBox_multiprocess.isChecked(): - self.mp = 1 - else: - self.mp = 0 - - self.get_variable() # Append a few system value - vs = 0 # Variable to launch VHRS texture processing - dd = 0 # Variable to launch image downloading - ok = 1 # Variable to verify informations -> 0 not ok, 1 ok - - if self.mode == 1: - # if download check box is checked only - if not self.ui.checkBox_listing.isChecked() and self.ui.checkBox_download.isChecked(): - - self.ui.checkBox_listing.setChecked(True) - - # # if processing check box is checked only - # if not self.ui.checkBox_listing.isChecked() and not self.ui.checkBox_download.isChecked() and self.ui.checkBox_processing.isChecked(): - # - # self.ui.checkBox_listing.setChecked(True) - # self.ui.checkBox_download.setChecked(True) - - # Verify raster or sample to launch a good processing classification tab - # If not ok, there will appear a message windows to enter the miss information - # if self.ui.checkBox_classifier_1.isChecked(): - # if not self.ui.checkBox_processing.isChecked() or (len(self.raster_path) < 1 and len(self.sample_name) > 0) or \ - # len(self.sample_name) < 1: - # self.forget_raster_sample() - # ok = 0 - # if self.ui.checkBox_classifier_2.isChecked(): - # if (not self.ui.checkBox_processing.isChecked() and not self.ui.checkBox_MNT.isChecked() and \ - # not self.ui.checkBox_VHRS.isChecked()) or (len(self.raster_path) < 2 and len(self.sample_name) > 0) or \ - # len(self.sample_name) < 2: - # self.forget_raster_sample() - # ok = 0 - # if self.ui.checkBox_classifier_3.isChecked(): - # if (not self.ui.checkBox_processing.isChecked() and not self.ui.checkBox_MNT.isChecked() and \ - # not self.ui.checkBox_VHRS.isChecked()) or (len(self.raster_path) != 6 and len(self.sample_name) > 0) or \ - # len(self.sample_name) != 3: - # self.forget_raster_sample() - # ok = 0 - - if ok == 1: - # Compute a output slope raster - if self.ui.checkBox_MNT.isChecked(): - - self.i_slope() - - # Downloading and processing on theia platform - # A check box to get number download available images - if self.ui.checkBox_listing.isChecked(): - - if self.ui.checkBox_download.isChecked(): - # To launch the downloading - dd = 1 - - self.i_download(dd) # Launch image listing and downloading if dd = 1 - self.set_variable() # to write in the line edit about number download available images - - # Check box to launch the image processing - if self.ui.checkBox_processing.isChecked(): - # Another check box to launch VHRS texture processing. If checked, vs = 1. - if self.ui.checkBox_VHRS.isChecked(): - vs = 1 - self.i_images_processing(vs) # function to launch the image processing - - # To launch the image processing without dowloading but with the images in a main folder - # Without internet connection - if not self.ui.checkBox_download.isChecked() and self.ui.checkBox_processing.isChecked(): - - # Launch pre-processing without downloading - self.i_glob() - # Another check box to launch VHRS texture processing. If checked, vs = 1. - if self.ui.checkBox_VHRS.isChecked(): - vs = 1 - self.i_images_processing(vs) # function to launch the image processing - - # To launch texture processing only - if not self.ui.checkBox_listing.isChecked() and not self.ui.checkBox_processing.isChecked() and self.ui.checkBox_VHRS.isChecked(): - - self.i_vhrs() - - # Compute optimal threshold - if self.ui.checkBox_threshold.isChecked(): - - if self.ui.radioButton_rf.isChecked(): - self.i_sample_rf() - elif self.ui.radioButton_s.isChecked(): - self.i_sample() - - # Classification processing - if self.ui.radioButton_rf.isChecked(): - - if self.ui.checkBox_classifier_3.isChecked(): - - self.out_fieldname_carto = self.out_fieldname_carto - self.out_fieldtype_carto = self.out_fieldtype_carto - self.i_classifier_rf() - self.i_validate() - - elif self.ui.radioButton_s.isChecked(): - - if self.ui.checkBox_classifier_1.isChecked() : - - self.out_fieldname_carto = self.out_fieldname_carto[:3] - self.out_fieldtype_carto = self.out_fieldtype_carto[:3] - self.i_classifier_s() - self.i_validate() - - if self.ui.checkBox_classifier_2.isChecked() : - - self.out_fieldname_carto = self.out_fieldname_carto[:4] - self.out_fieldtype_carto = self.out_fieldtype_carto[:4] - self.i_classifier_s() - self.i_validate() - - if self.ui.checkBox_classifier_3.isChecked(): - - self.out_fieldname_carto = self.out_fieldname_carto - self.out_fieldtype_carto = self.out_fieldtype_carto - self.i_classifier_s() - self.i_validate() - - if self.mode == 0: - - # Compute a output slope raster - if self.path_mnt != '': - self.i_slope() - - # Save the sample features - self.add_sample() - try: - # Look at if the the images has been already downlaoded - self.i_glob() - except: - # Else the processus download it - self.i_download(1) - - # function to launch the image processing - self.i_images_processing(1) - # To launch texture processing only - self.i_vhrs() - # Compute optimal threshold - self.i_sample_rf() - - # Classification processing - self.out_fieldname_carto = self.out_fieldname_carto - self.out_fieldtype_carto = self.out_fieldtype_carto - self.i_classifier_rf() - self.i_validate() - - -# # Clear variables after processing -# self.clear_sample() - self.out_fieldname_carto = ['ID', 'AREA'] - self.out_fieldtype_carto = [ogr.OFTString, ogr.OFTReal] - # Images after processing images - self.out_ndvistats_folder_tab = defaultdict(list) - - Processing.__init__(self)# Initialize variable without to close and launch again the application - - # End of the processus - endTime = time.time() # Tps : Terminé - print '...........' + ' Outputted to File in ' + str(endTime - startTime) + ' secondes' - nb_day_processing = int(time.strftime('%d', time.gmtime(endTime - startTime))) - 1 - print "That is, " + str(nb_day_processing) + ' day(s) ' + time.strftime('%Hh %Mmin%S', time.gmtime(endTime - startTime)) - - def open_backup(self): - """ - Function to load input text in every fields. The input file must be a XML file. - """ - - in_backup = QFileDialog.getOpenFileName(self, "Open backup", os.getcwd(), '*.xml') - - if in_backup != None and len(in_backup) > 0: - # Parse the xml file if the user choose a file - tree = ET.parse(str(in_backup)) - - if tree.find("Multi_process").text == '1': - self.ui.checkBox_multiprocess.setChecked(True) - else: - self.ui.checkBox_multiprocess.setChecked(False) - - pr = tree.find("Tab[@id='Processing_raster']") - try: - self.ui.lineEdit_principal_folder.setText(pr.find("Principal_folder").text) - except: - print('Not principal folder') - if self.mode == 1: - index_captor = self.ui.comboBox_captor.findText(pr.find("Captor").text) # To find combo box index - self.ui.comboBox_captor.setCurrentIndex(index_captor) - try: - self.ui.lineEdit_year_images.setText(pr.find("Year_images").text) - except: - print('Not year images') - self.ui.lineEdit_area_path.setText(pr.find("Area_path").text) - - if self.mode == 1: - if pr.find("Images_available").text == '1': - self.ui.checkBox_listing.setChecked(True) - else: - self.ui.checkBox_listing.setChecked(False) - if pr.find("Download").text == '1': - self.ui.checkBox_download.setChecked(True) - else: - self.ui.checkBox_download.setChecked(False) - - try: - self.ui.lineEdit_user.setText(pr.find("Username").text) - self.ui.lineEdit_password.setText(pr.find("Password").text) - except: - print('Not username or password Theia') - - self.f_proxy() - try: - pp = pr.find("Proxy[@id='Proxy']") - self.w_proxy.w_proxy.lineEdit_proxy.setText(pp.find("Proxy_adress").text) - try: - self.w_proxy.w_proxy.lineEdit_password_proxy.setText(pp.find("Proxy_login").text) - except TypeError: - pass - try: - self.w_proxy.w_proxy.lineEdit_login_proxy.setText(pp.find("Proxy_password").text) - except TypeError: - pass - self.w_proxy.id_proxy() - except AttributeError: - print('Not proxy') - self.w_proxy.close_window() - - if self.mode == 1: - if pr.find("Img_processing").text == '1': - self.ui.checkBox_processing.setChecked(True) - else: - self.ui.checkBox_processing.setChecked(False) - if pr.find("VHRS_checked").text == '1': - self.ui.checkBox_VHRS.setChecked(True) - else: - self.ui.checkBox_VHRS.setChecked(False) - - try: - self.ui.lineEdit_VHRS.setText(pr.find("VHRS").text) - except: - print('Not VHRS image') - - if self.mode == 1: - if pr.find("MNT_checked").text == '1': - self.ui.checkBox_MNT.setChecked(True) - else: - self.ui.checkBox_MNT.setChecked(False) - - try: - self.ui.lineEdit_MNT.setText(pr.find("MNT").text) - except: - print('Not MNT') - - ps = tree.find("Tab[@id='Processing_sample']") - if self.mode == 1: - try: - for sple_n in ps.iter("Sample"): - self.ui.lineEdit_sample_path.setText(sple_n.find("Sample_path").text) - self.ui.lineEdit_select_sample_fieldname_1.setText(sple_n.find("Fieldname_1").text) - self.ui.lineEdit_select_sample_fieldname_2.setText(sple_n.find("Fieldname_2").text) - self.ui.lineEdit_select_sample_class_1.setText(sple_n.find("Classname_1").text) - self.ui.lineEdit_select_sample_class_2.setText(sple_n.find("Classname_2").text) - self.ui.lineEdit_select_sample_nb_poly.setText(sple_n.find("Nb_polygones").text) - # Launch rpg method if the box is checked and if the shapefile hasn't go through rpg method (with prefix MONO_) - if sple_n.find("RPG").text == '1' and os.path.split(sple_n.find("Sample_path").text)[1][:5] != 'MONO_': - self.ui.checkBox_RPG.setChecked(True) - try: - if sple_n.find("Img_sample").text != "": - self.ui.lineEdit_img_sample.setText(sple_n.find("Img_sample").text) - self.ui.checkBox_img_sample.setChecked(True) - except: - print('Not sample raster only !') - self.add_sample() - except: - print('Not sample') - elif self.mode ==0: - # RPG - sple_n = ps[0] - self.ui.lineEdit_sample_path.setText(sple_n.find("Sample_path").text) - self.ui.lineEdit_select_sample_fieldname_1.setText(sple_n.find("Fieldname_1").text) - self.ui.lineEdit_select_sample_fieldname_2.setText(sple_n.find("Fieldname_2").text) - self.ui.lineEdit_select_sample_class_1.setText(sple_n.find("Classname_1").text) - self.ui.lineEdit_select_sample_class_2.setText(sple_n.find("Classname_2").text) - self.ui.lineEdit_select_sample_nb_poly.setText(sple_n.find("Nb_polygones").text) - - # To Grass/wooden - sple_n = ps[1] - self.ui.lineEdit_sample_path_2.setText(sple_n.find("Sample_path").text) - self.ui.lineEdit_select_sample_fieldname_3.setText(sple_n.find("Fieldname_1").text) - self.ui.lineEdit_select_sample_fieldname_4.setText(sple_n.find("Fieldname_2").text) - self.ui.lineEdit_select_sample_class_3.setText(sple_n.find("Classname_1").text) - self.ui.lineEdit_select_sample_class_4.setText(sple_n.find("Classname_2").text) - self.ui.lineEdit_select_sample_nb_poly_2.setText(sple_n.find("Nb_polygones").text) - - # To wooden - sple_n = ps[2] - self.ui.lineEdit_sample_path_3.setText(sple_n.find("Sample_path").text) - self.ui.lineEdit_select_sample_fieldname_5.setText(sple_n.find("Fieldname_1").text) - self.ui.lineEdit_select_sample_fieldname_6.setText(sple_n.find("Fieldname_2").text) - self.ui.lineEdit_select_sample_class_5.setText(sple_n.find("Classname_1").text) - self.ui.lineEdit_select_sample_class_6.setText(sple_n.find("Classname_2").text) - self.ui.lineEdit_select_sample_nb_poly_3.setText(sple_n.find("Nb_polygones").text) - - if self.mode == 1: - if ps.find("Threshold_checked").text == '1': - self.ui.checkBox_threshold.setChecked(True) - else: - self.ui.checkBox_threshold.setChecked(False) - - c = tree.find("Tab[@id='Classification']") - try: - self.ui.lineEdit_segmentation.setText(c.find("Segmentation_path").text) - except: - print('Not segmentation') - try: - self.ui.lineEdit_output.setText(c.find("Output_path").text) - except: - print('Not output file') - if self.mode == 1: - if len(c) == 5: - self.ui.checkBox_classifier_1.setChecked(True) - self.ui.lineEdit_fieldname_1.setText(c.find("Output_fieldname_1").text) - index_fieldname_1 = self.ui.comboBox_fieldname_1.findText(c.find("Output_type_1").text) - self.ui.comboBox_fieldname_1.setCurrentIndex(index_fieldname_1) - elif len(c) == 7: - self.ui.checkBox_classifier_2.setChecked(True) - self.ui.lineEdit_fieldname_12.setText(c.find("Output_fieldname_1").text) - self.ui.lineEdit_fieldname_2.setText(c.find("Output_fieldname_2").text) - index_fieldname_12 = self.ui.comboBox_fieldname_12.findText(c.find("Output_type_1").text) - self.ui.comboBox_fieldname_12.setCurrentIndex(index_fieldname_12) - index_fieldname_2 = self.ui.comboBox_fieldname_2.findText(c.find("Output_type_2").text) - self.ui.comboBox_fieldname_2.setCurrentIndex(index_fieldname_2) - elif len(c) == 11: - self.ui.checkBox_classifier_3.setChecked(True) - self.ui.lineEdit_fieldname_13.setText(c.find("Output_fieldname_1").text) - self.ui.lineEdit_fieldname_23.setText(c.find("Output_fieldname_2").text) - self.ui.lineEdit_fieldname_3.setText(c.find("Output_fieldname_3").text) - self.ui.lineEdit_fieldname_4.setText(c.find("Output_fieldname_4").text) - index_fieldname_13 = self.ui.comboBox_fieldname_13.findText(c.find("Output_type_1").text) - self.ui.comboBox_fieldname_13.setCurrentIndex(index_fieldname_13) - index_fieldname_23 = self.ui.comboBox_fieldname_23.findText(c.find("Output_type_2").text) - self.ui.comboBox_fieldname_23.setCurrentIndex(index_fieldname_23) - index_fieldname_3 = self.ui.comboBox_fieldname_3.findText(c.find("Output_type_3").text) - self.ui.comboBox_fieldname_3.setCurrentIndex(index_fieldname_3) - index_fieldname_4 = self.ui.comboBox_fieldname_4.findText(c.find("Output_type_4").text) - self.ui.comboBox_fieldname_4.setCurrentIndex(index_fieldname_4) - - # Classification mode - if c.find("Classification_method").text == '1': - self.ui.radioButton_rf.setChecked(True) - else: - self.ui.radioButton_s.setChecked(True) - - print("Load input text !") - - def save_backup(self): - """ - Function to save input text in every fields. The output file must be a XML file. - """ - - out_backup = QFileDialog.getSaveFileName(self, "Save backup", os.getcwd(), '*.xml') - # if the user has forgotten to put .shp at the end of the output xml - if out_backup[-4:] != '.xml': - out_backup = out_backup + '.xml' - - root = ET.Element("Data_filled") - - if self.ui.checkBox_multiprocess.isChecked(): - ET.SubElement(root, "Multi_process", type = "int").text = str(1) - else: - ET.SubElement(root, "Multi_process", type = "int").text = str(0) - - doc = ET.SubElement(root, "Tab", id="Processing_raster") - ET.SubElement(doc, "Principal_folder", type = "str").text = "%s" % self.ui.lineEdit_principal_folder.text() - if self.mode == 1: - ET.SubElement(doc, "Captor", type = "str").text = "%s" % self.ui.comboBox_captor.currentText() - else: - ET.SubElement(doc, "Captor", type = "str").text = "Landsat" - ET.SubElement(doc, "Year_images", type = "str").text = "%s" % self.ui.lineEdit_year_images.text() - ET.SubElement(doc, "Area_path", type = "str").text = "%s" % self.ui.lineEdit_area_path.text() - - if self.mode == 1: - if self.ui.checkBox_listing.isChecked(): - ET.SubElement(doc, "Images_available", type = "int").text = str(1) - else: - ET.SubElement(doc, "Images_available", type = "int").text = str(0) - if self.ui.checkBox_download.isChecked(): - ET.SubElement(doc, "Download", type = "int").text = str(1) - else: - ET.SubElement(doc, "Download", type = "int").text = str(0) - else: - ET.SubElement(doc, "Images_available", type = "int").text = str(0) - ET.SubElement(doc, "Download", type = "int").text = str(0) - - ET.SubElement(doc, "Username", type = "str").text = "%s" % self.ui.lineEdit_user.text() - ET.SubElement(doc, "Password", type = "str").text = "%s" % self.ui.lineEdit_password.text() - if self.w_proxy is None: - sub_proxy = ET.SubElement(doc, "Proxy", id="No_proxy") - ET.SubElement(sub_proxy, "Proxy_adress", type = "str").text = "" - ET.SubElement(sub_proxy, "Proxy_login", type = "str").text = "" - ET.SubElement(sub_proxy, "Proxy_password", type = "str").text = "" - elif self.w_proxy.proxy == "": - sub_proxy = ET.SubElement(doc, "Proxy", id="No_proxy") - ET.SubElement(sub_proxy, "Proxy_adress", type = "str").text = "" - ET.SubElement(sub_proxy, "Proxy_login", type = "str").text = "" - ET.SubElement(sub_proxy, "Proxy_password", type = "str").text = "" - else: - sub_proxy = ET.SubElement(doc, "Proxy", id="Proxy") - ET.SubElement(sub_proxy, "Proxy_adress", type = "str").text = "%s" % self.w_proxy.proxy - ET.SubElement(sub_proxy, "Proxy_login", type = "str").text = "%s" % self.w_proxy.login_proxy - ET.SubElement(sub_proxy, "Proxy_password", type = "str").text = "%s" % self.w_proxy.password_proxy - - if self.mode == 1: - if self.ui.checkBox_processing.isChecked(): - ET.SubElement(doc, "Img_processing", type = "int").text = str(1) - else: - ET.SubElement(doc, "Img_processing", type = "int").text = str(0) - - if self.ui.checkBox_VHRS.isChecked(): - ET.SubElement(doc, "VHRS_checked", type = "int").text = str(1) - else: - ET.SubElement(doc, "VHRS_checked", type = "int").text = str(0) - else: - ET.SubElement(doc, "Img_processing", type = "int").text = str(1) - ET.SubElement(doc, "VHRS_checked", type = "int").text = str(1) - - ET.SubElement(doc, "VHRS", type = "str").text = "%s" % self.ui.lineEdit_VHRS.text() - - if self.mode == 1: - if self.ui.checkBox_MNT.isChecked(): - ET.SubElement(doc, "MNT_checked", type = "int").text = str(1) - else: - ET.SubElement(doc, "MNT_checked", type = "int").text = str(0) - else: - if "%s" % self.ui.lineEdit_MNT.text() != '': - ET.SubElement(doc, "MNT_checked", type = "int").text = str(1) - else: - ET.SubElement(doc, "MNT_checked", type = "int").text = str(0) - - ET.SubElement(doc, "MNT", type = "str").text = "%s" % self.ui.lineEdit_MNT.text() - - doc = ET.SubElement(root, "Tab", id="Processing_sample") - if self.mode == 1: - for sa in range(len(self.sample_name)): - sub_doc = ET.SubElement(doc, "Sample", id="Sample_" + str(sa)) - ET.SubElement(sub_doc, "Sample_path", type = "str").text = self.sample_name[sa] - ET.SubElement(sub_doc, "Fieldname_1", type = "str").text = self.fieldname_args[2*sa] - ET.SubElement(sub_doc, "Fieldname_2", type = "str").text = self.fieldname_args[2*sa+1] - ET.SubElement(sub_doc, "Classname_1", type = "str").text = self.class_args[2*sa] - ET.SubElement(sub_doc, "Classname_2", type = "str").text = self.class_args[2*sa+1] - ET.SubElement(sub_doc, "Nb_polygones", type = "str").text = self.list_nb_sample[sa] - ET.SubElement(sub_doc, "RPG", type = "int").text = str(self.rpg_tchek[sa]) - try: - # To enter a sample raster if the first tab doesn't launch before - if self.img_sample[sa] == 1: - ET.SubElement(sub_doc, "Img_sample", type = "str").text = self.raster_path[sa] - except: - print('Not sample raster only !') - else: - # RPG - sub_doc = ET.SubElement(doc, "Sample", id="Sample_0") - ET.SubElement(sub_doc, "Sample_path", type = "str").text = "%s" % self.ui.lineEdit_sample_path.text() - ET.SubElement(sub_doc, "Fieldname_1", type = "str").text = "%s" % self.ui.lineEdit_select_sample_fieldname_1.text() - ET.SubElement(sub_doc, "Fieldname_2", type = "str").text = "%s" % self.ui.lineEdit_select_sample_fieldname_2.text() - ET.SubElement(sub_doc, "Classname_1", type = "str").text = "%s" % self.ui.lineEdit_select_sample_class_1.text() - ET.SubElement(sub_doc, "Classname_2", type = "str").text = "%s" % self.ui.lineEdit_select_sample_class_2.text() - ET.SubElement(sub_doc, "Nb_polygones", type = "str").text = "%s" % self.ui.lineEdit_select_sample_nb_poly.text() - ET.SubElement(sub_doc, "RPG", type = "int").text = str(1) - - # To Grass/wooden - sub_doc = ET.SubElement(doc, "Sample", id="Sample_1") - ET.SubElement(sub_doc, "Sample_path", type = "str").text = "%s" % self.ui.lineEdit_sample_path_2.text() - ET.SubElement(sub_doc, "Fieldname_1", type = "str").text = "%s" % self.ui.lineEdit_select_sample_fieldname_3.text() - ET.SubElement(sub_doc, "Fieldname_2", type = "str").text = "%s" % self.ui.lineEdit_select_sample_fieldname_4.text() - ET.SubElement(sub_doc, "Classname_1", type = "str").text = "%s" % self.ui.lineEdit_select_sample_class_3.text() - ET.SubElement(sub_doc, "Classname_2", type = "str").text = "%s" % self.ui.lineEdit_select_sample_class_4.text() - ET.SubElement(sub_doc, "Nb_polygones", type = "str").text = "%s" % self.ui.lineEdit_select_sample_nb_poly_2.text() - ET.SubElement(sub_doc, "RPG", type = "int").text = str(0) - - # To wooden - sub_doc = ET.SubElement(doc, "Sample", id="Sample_2") - ET.SubElement(sub_doc, "Sample_path", type = "str").text = "%s" % self.ui.lineEdit_sample_path_3.text() - ET.SubElement(sub_doc, "Fieldname_1", type = "str").text = "%s" % self.ui.lineEdit_select_sample_fieldname_5.text() - ET.SubElement(sub_doc, "Fieldname_2", type = "str").text = "%s" % self.ui.lineEdit_select_sample_fieldname_6.text() - ET.SubElement(sub_doc, "Classname_1", type = "str").text = "%s" % self.ui.lineEdit_select_sample_class_5.text() - ET.SubElement(sub_doc, "Classname_2", type = "str").text = "%s" % self.ui.lineEdit_select_sample_class_6.text() - ET.SubElement(sub_doc, "Nb_polygones", type = "str").text = "%s" % self.ui.lineEdit_select_sample_nb_poly_3.text() - ET.SubElement(sub_doc, "RPG", type = "int").text = str(0) - - if self.mode == 1: - if self.ui.checkBox_threshold.isChecked(): - ET.SubElement(doc, "Threshold_checked", type = "int").text = str(1) - else: - ET.SubElement(doc, "Threshold_checked", type = "int").text = str(0) - else: - ET.SubElement(doc, "Threshold_checked", type = "int").text = str(1) - - doc = ET.SubElement(root, "Tab", id="Classification") - ET.SubElement(doc, "Segmentation_path", type = "str").text = "%s" % self.ui.lineEdit_segmentation.text() - ET.SubElement(doc, "Output_path", type = "str").text = "%s" % self.ui.lineEdit_output.text() - - if self.mode == 1: - - if self.ui.checkBox_classifier_1.isChecked(): - ET.SubElement(doc, "Output_fieldname_1", type = "str").text = "%s" % self.ui.lineEdit_fieldname_1.text() - ET.SubElement(doc, "Output_type_1", type = "str").text = "%s" % self.ui.comboBox_fieldname_1.currentText() - - if self.ui.checkBox_classifier_2.isChecked(): - ET.SubElement(doc, "Output_fieldname_1", type = "str").text = "%s" % self.ui.lineEdit_fieldname_12.text() - ET.SubElement(doc, "Output_type_1", type = "str").text = "%s" % self.ui.comboBox_fieldname_12.currentText() - ET.SubElement(doc, "Output_fieldname_2", type = "str").text = "%s" % self.ui.lineEdit_fieldname_2.text() - ET.SubElement(doc, "Output_type_2", type = "str").text = "%s" % self.ui.comboBox_fieldname_2.currentText() - - if self.ui.checkBox_classifier_3.isChecked(): - ET.SubElement(doc, "Output_fieldname_1", type = "str").text = "%s" % self.ui.lineEdit_fieldname_13.text() - ET.SubElement(doc, "Output_type_1", type = "str").text = "%s" % self.ui.comboBox_fieldname_13.currentText() - ET.SubElement(doc, "Output_fieldname_2", type = "str").text = "%s" % self.ui.lineEdit_fieldname_23.text() - ET.SubElement(doc, "Output_type_2", type = "str").text = "%s" % self.ui.comboBox_fieldname_23.currentText() - ET.SubElement(doc, "Output_fieldname_3", type = "str").text = "%s" % self.ui.lineEdit_fieldname_3.text() - ET.SubElement(doc, "Output_type_3", type = "str").text = "%s" % self.ui.comboBox_fieldname_3.currentText() - ET.SubElement(doc, "Output_fieldname_4", type = "str").text = "%s" % self.ui.lineEdit_fieldname_4.text() - ET.SubElement(doc, "Output_type_4", type = "str").text = "%s" % self.ui.comboBox_fieldname_4.currentText() - - # Classification mode - if self.ui.radioButton_rf.isChecked(): - ET.SubElement(doc, "Classification_method", type = "int").text = str(1) - elif self.ui.radioButton_s.isChecked(): - ET.SubElement(doc, "Classification_method", type = "int").text = str(0) - else: - ET.SubElement(doc, "Output_fieldname_1", type = "str").text = "NIVEAU_1" - ET.SubElement(doc, "Output_type_1", type = "str").text = "String" - ET.SubElement(doc, "Output_fieldname_2", type = "str").text = "NIVEAU_2" - ET.SubElement(doc, "Output_type_2", type = "str").text = "String" - ET.SubElement(doc, "Output_fieldname_3", type = "str").text = "NIVEAU_3" - ET.SubElement(doc, "Output_type_3", type = "str").text = "String" - ET.SubElement(doc, "Output_fieldname_4", type = "str").text = "POURC" - ET.SubElement(doc, "Output_type_4", type = "str").text = "Real" - ET.SubElement(doc, "Classification_method", type = "int").text = str(1) - - tree = ET.ElementTree(root) - # Write in a xml file - tree.write(str(out_backup), encoding="UTF-8",xml_declaration=True, pretty_print=True) - if out_backup != '.xml': - print("Save input text !") - - def about_PHYMOBA(self): - """ - Function to open a new window "About PHYMOBAT" - """ - if self.apropos is None: - self.apropos = MyPopup_about() - self.apropos.show() - - def help_tools(self): - """ - Function to open html help - """ - - webbrowser.open('file://' + os.getcwd() + '/Documentation/methode_tuto.html#tutoriels-interface') - - def mode_simpli(self): - """ - Function to open a new window in simple mode "PHYMOBATs" - """ - if self.simpli is None: - print "Simplify mode" - self.close() - self.simpli = PHYMOBAT(mode = 0) - - self.simpli.show() - - def mode_expert(self): - """ - Function to open a new window in expert mode "PHYMOBATe" - """ - if self.expert is None: - print "Expert mode" - self.close() - self.expert = PHYMOBAT(mode = 1) - - self.expert.show() - - def forget_study_area(self): - """ - Function to open a new window 'Alert' because user forgotten to declare study area. - """ - if self.w_study_area is None: - self.w_study_area = MyPopup_warming_study_area() - self.w_study_area.show() - - def forget_raster_sample(self): - """ - Function to open a new window 'Alert' because user forgotten to declare rasters or samples. - """ - if self.w_forget is None: - self.w_forget = MyPopup_warming_forgetting() - self.w_forget.show() - - def close_button(self): - """ - Function to close the interface. - """ - self.close() - -class MyPopup_about(QWidget): - """ - Popup to display "About PHYMOBAT". In this windows, it prints informations on the processing, license - and version. - """ - def __init__(self, parent=None): - QWidget.__init__(self, parent) - self.prop = Ui_About() - self.prop.setupUi(self) - - self.connect(self.prop.close_newWindow, SIGNAL('clicked()'), self.close_window) - - def close_window(self): - """ - Function to close the "A propos PHYMOBAT". - """ - self.close() - -class MyPopup_warming_study_area(QWidget): - """ - Popup to display a message to say there isn't declared study area file. - """ - def __init__(self, parent=None): - QWidget.__init__(self, parent) - self.w_study_a = Ui_Warming_study_area() - self.w_study_a.setupUi(self) - - self.connect(self.w_study_a.pushButton_ok_window_warning_study_area, SIGNAL('clicked()'), self.close_window) - - def close_window(self): - """ - Function to close the popup. - """ - self.close() - -class MyPopup_warming_forgetting(QWidget): - """ - Popup to display a message to tell you if you fogotten to enter a raster or a sample. - """ - def __init__(self, parent=None): - QWidget.__init__(self, parent) - self.w_forget = Ui_Warming_forgetting() - self.w_forget.setupUi(self) - - self.connect(self.w_forget.pushButton_ok_forget, SIGNAL('clicked()'), self.close_window) - - def close_window(self): - """ - Function to close the popup. - """ - self.close() - -class MyPopup_proxy_window(QWidget): - """ - Popup to display a message to tell you if you fogotten to enter a raster or a sample. - """ - def __init__(self, parent=None): - QWidget.__init__(self, parent) - self.w_proxy = Ui_Proxy_window() - self.w_proxy.setupUi(self) - - # Proxy ID - self.proxy = "" - self.login_proxy = "" - self.password_proxy = "" - - # Connect Apply|Close button - self.w_proxy.buttonBox_proxy.button(QDialogButtonBox.Close).clicked.connect(self.close_window) - self.w_proxy.buttonBox_proxy.button(QDialogButtonBox.Apply).clicked.connect(self.id_proxy) - - def id_proxy(self): - """ - Function to use input proxy id - """ - self.login_proxy = "%s" % self.w_proxy.lineEdit_login_proxy.text() - self.password_proxy = "%s" % self.w_proxy.lineEdit_password_proxy.text() - self.proxy = "%s" % self.w_proxy.lineEdit_proxy.text() - - def close_window(self): - """ - Function to close the popup. - """ - self.close() - if __name__ == "__main__": - - app = QApplication(sys.argv) - myapp = PHYMOBAT() - myapp.show() - - sys.exit(app.exec_()) + + app = QtWidgets.QApplication(sys.argv) + myapp = PHYMOBAT() + myapp.show() + + sys.exit(app.exec_()) diff --git a/Phymobat.pdf b/Phymobat.pdf new file mode 100644 index 0000000000000000000000000000000000000000..869445596508a6f0a859bf2226901751b1ee6a10 Binary files /dev/null and b/Phymobat.pdf differ diff --git a/Popup.py b/Popup.py new file mode 100644 index 0000000000000000000000000000000000000000..be533013bba17a44e94acfd6425ac2d5e6b827f1 --- /dev/null +++ b/Popup.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os, sys, time +from PyQt5 import QtWidgets, QtCore + +from ui_A_propos_PHYMOBAT_window import Ui_About +from ui_Warming_study_area import Ui_Warming_study_area +from ui_Warming_forgetting import Ui_Warming_forgetting +from ui_Proxy_window import Ui_Proxy_window + +class about(QtWidgets.QWidget): + """ + Popup to display "About PHYMOBAT". In this windows, it prints informations on the processing, license + and version. + """ + def __init__(self, parent=None): + QtWidgets.QWidget.__init__(self, parent) + self.prop = Ui_About() + self.prop.setupUi(self) + + self.prop.close_newWindow.clicked.connect(self.close_window) + + def close_window(self): + """ + Function to close the "A propos PHYMOBAT". + """ + self.close() + +class warming_study_area(QtWidgets.QWidget): + """ + Popup to display a message to say there isn't declared study area file. + """ + def __init__(self, parent=None): + QtWidgets.QWidget.__init__(self, parent) + self.w_study_a = Ui_Warming_study_area() + self.w_study_a.setupUi(self) + + self.w_study_a.pushButton_ok_window_warning_study_area.clicked.connect(self.close_window) + + def close_window(self): + """ + Function to close the popup. + """ + self.close() + +class warming_forgetting(QtWidgets.QWidget): + """ + Popup to display a message to tell you if you fogotten to enter a raster or a sample. + """ + def __init__(self, parent=None): + QtWidgets.QWidget.__init__(self, parent) + self.w_forget = Ui_Warming_forgetting() + self.w_forget.setupUi(self) + + self.w_forget.pushButton_ok_forget.clicked.connect(self.close_window) + + def close_window(self): + """ + Function to close the popup. + """ + self.close() + +class proxy_window(QtWidgets.QWidget): + """ + Popup to display a message to tell you if you fogotten to enter a raster or a sample. + """ + def __init__(self, parent=None): + QtWidgets.QWidget.__init__(self, parent) + self.w_proxy = Ui_Proxy_window() + self.w_proxy.setupUi(self) + + # Proxy ID + self.proxy = "" + self.login_proxy = "" + self.password_proxy = "" + + # Connect Apply|Close button + self.w_proxy.buttonBox_proxy.button(QtWidgets.QDialogButtonBox.Close).clicked.connect(self.close_window) + self.w_proxy.buttonBox_proxy.button(QtWidgets.QDialogButtonBox.Apply).clicked.connect(self.id_proxy) + + def id_proxy(self): + """ + Function to use input proxy id + """ + self.login_proxy = "{0}".format(self.w_proxy.lineEdit_login_proxy.text()) + self.password_proxy = "{0}".format(self.w_proxy.lineEdit_password_proxy.text()) + self.proxy = "{0}".format(self.w_proxy.lineEdit_proxy.text()) + + self.close_window() + + def close_window(self): + """ + Function to close the popup. + """ + self.close() diff --git a/Precision_moba.py b/Precision_moba.py index 65b96449fdbc9d25216cbb8f667fbd9bda9e7f61..f54e63a590cecb5ada1d31be4b56ba22f241f2b1 100644 --- a/Precision_moba.py +++ b/Precision_moba.py @@ -21,6 +21,7 @@ import os, subprocess import numpy as np from Toolbox import Toolbox +import Outils from Vector import Vector from RasterSat_by_date import RasterSat_by_date @@ -37,176 +38,190 @@ from sklearn.metrics import precision_score from sklearn.metrics import f1_score class Precision_moba(): - """ - Classification precision class. This class build the whole of processing to extract the precision - of the classification from the MOBA method. - - :param path_cut: Study area shapefile - :type path_cut: str - :param path_save: Main folder path. To save precision file in txt - :type path_save: str - :param complete_validation_shp: Shapefile path of the validation - :type complete_validation_shp: str - :param ex_raster: Raster model path to the rasterization - :type ex_raster: str - :param img_pr: To store the rasterization path of the classification [0] and the validation [1] - :type img_pr: list - :param complete_img: To store info raster of the classification [0] and the validation [1] - :type complete_img: list - - """ - - def __init__(self, path_cut, path_save): - """Create a new 'Precision' instance - - """ - - self.path_cut = path_cut - self.path_save = path_save - - self.complete_validation_shp = '' - self.ex_raster = '' - - self.img_pr = [] - self.complete_img = [] - - def preprocess_to_raster_precision(self, shp_pr, field_pr): - """ - Function to extract data in pixel of vectors. For that, it need to - save a shapefile, then rasterize it and get a final data matrix. - - :param shp_pr: Input shapefile path - :type shp_pr: str - :param field_pr: Field name of the shapefile to rasterize - :type field_pr: str - """ - - kwargs = {} - kwargs['rm_rast'] = 1 # To remove existing raster in the clip_raster function - opt = {} - opt['Remove'] = 1 # To remove existing vector - # Define vector - vector_pr = Vector(shp_pr, self.path_cut, **opt) - # Define Toolbox used - current_img = Toolbox() - # Create the raster output path - img_pr = vector_pr.layer_rasterization(self.ex_raster, field_pr) - current_img.imag = img_pr - current_img.vect = self.complete_validation_shp - self.img_pr.append(current_img.clip_raster(**kwargs)) - - # Call the raster class to extract the image data - self.complete_img.append(RasterSat_by_date('', '', [0])) - - def confus_matrix(self, data_class, data_val): - """ - Function to compute and save a confusion matrix, precision, recall, - f_scrore and overall accuracy of the classification. - It compute all statistics because of sklearn module. - At the final step, it save in the principal folder. - - :param data_class: Classification data - :type data_class: matrix array - :param data_val: Validation data - :type data_val: matrix array - """ - - data_class = data_class.flatten() # to convert a matrix array in list array - data_val = data_val.flatten() - - # Add pixel value in a list without no data - fb_stats_2 = [[data_class[x],data_val[x]] for x in range(len(data_val)) if data_val[x] != -10000] - fb_stats_2 = map(list, zip(*fb_stats_2))# transpose list - fb_stats_in = fb_stats_2[0] - fb_stats_val = fb_stats_2[1] - - # Open a file (txt) to save results - f = open(self.path_save + "/ConfusionMatrix.txt", "wb") - - # Compute statistics on the classification - cm = confusion_matrix(fb_stats_val, fb_stats_in) - f.write("Confusion Matrix :\n") - for out in cm: - f.write(str(out) + "\n") - - all_pr = classification_report(fb_stats_val, fb_stats_in) - f.write("\n") - f.write(all_pr) - - accur = accuracy_score(fb_stats_val, fb_stats_in) - f.write("\n") - f.write("Accuracy : " + str(accur) + "\n") - - recall = recall_score(fb_stats_val, fb_stats_in) - f.write("\n") - f.write("Recall : " + str(recall) + "\n") - - pr = precision_score(fb_stats_val, fb_stats_in) - f.write("\n") - f.write("Precision : " + str(pr) + "\n") - - f_scor = f1_score(fb_stats_val, fb_stats_in) - f.write("\n") - f.write("F_score : " + str(f_scor) + "\n") - - kappa = self.cohen_kappa_score(fb_stats_val, fb_stats_in) - f.write("\n") - f.write("Kappa : " + str(kappa) + "\n") - print('') - print('') - print('Accuracy : %f, Kappa : %f, Recall : %f, Precision : %f, F_score : %f' % (accur, kappa, recall, pr, f_scor)) - print('') - print all_pr - print('') - print('Confusion matrix :') - print cm - - f.close() - - def cohen_kappa_score(self, y1, y2, labels=None): - """ - Ref : https://github.com/scikit-learn/scikit-learn/blob/51a765a/sklearn/metrics/classification.py#L260 - - Cohen's kappa: a statistic that measures inter-annotator agreement. - This function computes Cohen's kappa [1], a score that expresses the level - of agreement between two annotators on a classification problem. It is - defined as - .. math:: - \kappa = (p_o - p_e) / (1 - p_e) - where :math:`p_o` is the empirical probability of agreement on the label - assigned to any sample (the observed agreement ratio), and :math:`p_e` is - the expected agreement when both annotators assign labels randomly. - :math:`p_e` is estimated using a per-annotator empirical prior over the - class labels [2]. - Parameters - ---------- - y1 : array, shape = [n_samples] - Labels assigned by the first annotator. - y2 : array, shape = [n_samples] - Labels assigned by the second annotator. The kappa statistic is - symmetric, so swapping ``y1`` and ``y2`` doesn't change the value. - labels : array, shape = [n_classes], optional - List of labels to index the matrix. This may be used to select a - subset of labels. If None, all labels that appear at least once in - ``y1`` or ``y2`` are used. - Returns - ------- - kappa : float - The kappa statistic, which is a number between -1 and 1. The maximum - value means complete agreement; zero or lower means chance agreement. - References - ---------- - .. [1] J. Cohen (1960). "A coefficient of agreement for nominal scales". - Educational and Psychological Measurement 20(1):37-46. - doi:10.1177/001316446002000104. - .. [2] R. Artstein and M. Poesio (2008). "Inter-coder agreement for - computational linguistics". Computational Linguistic 34(4):555-596. - """ - - confusion = confusion_matrix(y1, y2, labels=labels) - P = confusion / float(confusion.sum()) - p_observed = np.trace(P) - p_expected = np.dot(P.sum(axis=0), P.sum(axis=1)) - - return (p_observed - p_expected) / (1 - p_expected) - \ No newline at end of file + """ + Classification precision class. This class build the whole of processing to extract the precision + of the classification from the MOBA method. + + @param path_cut: Study area shapefile + @type path_cut: str + + @param path_save: Main folder path. To save precision file in txt + @type path_save: str + + @param complete_validation_shp: Shapefile path of the validation + @type complete_validation_shp: str + + @param ex_raster: Raster model path to the rasterization + @type ex_raster: str + + @param img_pr: To store the rasterization path of the classification [0] and the validation [1] + @type img_pr: list + + @param complete_img: To store info raster of the classification [0] and the validation [1] + @type complete_img: list + """ + + def __init__(self, path_cut, path_save): + """ + Create a new 'Precision' instance + """ + + self.path_cut = path_cut + self.path_save = path_save + + self.complete_validation_shp = '' + self.ex_raster = '' + + self.img_pr = [] + self.complete_img = [] + + self.logger = Outils.Log("Log", "Precision_moba") + + def preprocess_to_raster_precision(self, shp_pr, field_pr): + """ + Function to extract data in pixel of vectors. For that, it need to + save a shapefile, then rasterize it and get a final data matrix. + + @param shp_pr: Input shapefile path + @type shp_pr: str + + @param field_pr: Field name of the shapefile to rasterize + @type field_pr: str + """ + + kwargs = {} + kwargs['rm_rast'] = 1 # To remove existing raster in the clip_raster function + + opt = {} + opt['Remove'] = 1 # To remove existing vector + + # Define vector + vector_pr = Vector(shp_pr, self.path_cut, **opt) + + # self.logger.debug(shp_pr) + # self.logger.debug(self.path_cut) + # raise(BaseException("Precision_moba")) + + # vector_pr.clip_vector() + vector_pr.vector_data() + + # Define Toolbox used + current_img = Toolbox() + + # Create the raster output path + img_pr = vector_pr.layer_rasterization(self.ex_raster, field_pr) + current_img.image = img_pr + current_img.vect = self.complete_validation_shp + self.img_pr.append(current_img.clip_raster(**kwargs)) + + # Call the raster class to extract the image data + self.complete_img.append(RasterSat_by_date('', '')) + + vector_pr.logger.close() + current_img.logger.close() + self.complete_img[-1].logger.close() + + def confus_matrix(self, data_class, data_val): + """ + Function to compute and save a confusion matrix, precision, recall, + f_scrore and overall accuracy of the classification. + It compute all statistics because of sklearn module. + At the final step, it save in the principal folder. + + @param data_class: Classification data + @type data_class: matrix array + + @param data_val: Validation data + @type data_val: matrix array + """ + + data_class = data_class.flatten() # to convert a matrix array in list array + data_val = data_val.flatten() + + # Add pixel value in a list without no data + fb_stats_2 = [[int(data_class[x]),int(data_val[x])] for x in range(len(data_val)) if data_val[x] != -10000] + fb_stats_2 = list(map(list, zip(*fb_stats_2)))# transpose list + + fb_stats_in = fb_stats_2[0] + fb_stats_val = fb_stats_2[1] + + self.logger.debug(self.path_save) + + # Open a file (txt) to save results + with open("{0}/ConfusionMatrix.txt".format(self.path_save), "w") as f : + # Compute statistics on the classification + cm = confusion_matrix(fb_stats_val, fb_stats_in) + + f.write("Confusion Matrix :\n") + + for out in cm: + f.write("{0}\n".format(out)) + + all_pr = classification_report(fb_stats_val, fb_stats_in) + f.write("\n{0}".format(all_pr)) + + accur = accuracy_score(fb_stats_val, fb_stats_in) + f.write("\nAccuracy : {0}\n".format(accur)) + + recall = recall_score(fb_stats_val, fb_stats_in, average=None) + f.write("\nRecall : {0}\n".format(recall)) + + pr = precision_score(fb_stats_val, fb_stats_in, average=None) + f.write("\nPrecision : {0}\n".format(pr)) + + f_scor = f1_score(fb_stats_val, fb_stats_in, average=None) + f.write("\nF_score : {0}\n".format(f_scor)) + + kappa = self.cohen_kappa_score(fb_stats_val, fb_stats_in) + f.write("\nKappa : {0}\n".format(kappa)) + + self.logger.info('\n\n Accuracy : {0}, Kappa : {1}, Recall : {2}, Precision : {3}, F_score : {4}\n\ + {5} \n Confusion matrix : \n {6}'.format(accur, kappa, recall, pr, f_scor, all_pr, cm)) + + def cohen_kappa_score(self, y1, y2, labels=None): + """ + Ref : https://github.com/scikit-learn/scikit-learn/blob/51a765a/sklearn/metrics/classification.py#L260 + + Cohen's kappa: a statistic that measures inter-annotator agreement. + This function computes Cohen's kappa [1], a score that expresses the level + of agreement between two annotators on a classification problem. It is + defined as + .. math:: + \kappa = (p_o - p_e) / (1 - p_e) + where :math:`p_o` is the empirical probability of agreement on the label + assigned to any sample (the observed agreement ratio), and :math:`p_e` is + the expected agreement when both annotators assign labels randomly. + :math:`p_e` is estimated using a per-annotator empirical prior over the + class labels [2]. + Parameters + ---------- + y1 : array, shape = [n_samples] + Labels assigned by the first annotator. + y2 : array, shape = [n_samples] + Labels assigned by the second annotator. The kappa statistic is symmetric, + so swapping ``y1`` and ``y2`` doesn't change the value. + labels : array, shape = [n_classes], optional + List of labels to index the matrix. This may be used to select a + subset of labels. If None, all labels that appear at least once in + ``y1`` or ``y2`` are used. + Returns + ------- + kappa : float + The kappa statistic, which is a number between -1 and 1. The maximum + value means complete agreement; zero or lower means chance agreement. + References + ---------- + .. [1] J. Cohen (1960). "A coefficient of agreement for nominal scales". + Educational and Psychological Measurement 20(1):37-46. + doi:10.1177/001316446002000104. + .. [2] R. Artstein and M. Poesio (2008). "Inter-coder agreement for + computational linguistics". Computational Linguistic 34(4):555-596. + """ + + confusion = confusion_matrix(y1, y2, labels=labels) + P = confusion / float(confusion.sum()) + p_observed = np.trace(P) + p_expected = np.dot(P.sum(axis=0), P.sum(axis=1)) + + return (p_observed - p_expected) / (1 - p_expected) + \ No newline at end of file diff --git a/Processing.py b/Processing.py index 640e7dd399ea160bee879d5da37b091ab8ffaacf..218d330042ba4f6f9177f93785f1414cccd872c9 100644 --- a/Processing.py +++ b/Processing.py @@ -3,33 +3,36 @@ # # This file is part of PHYMOBAT 2.0. # Copyright 2016 Sylvio Laventure (IRSTEA - UMR TETIS) -# +# # PHYMOBAT 2.0 is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # PHYMOBAT 2.0 is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with PHYMOBAT 2.0. If not, see <http://www.gnu.org/licenses/>. -import os, sys, math +import os, sys, math, glob import numpy as np import subprocess from sklearn.ensemble import RandomForestClassifier from sklearn import tree +import pydot + try : - import ogr, gdal + import ogr, gdal except : - from osgeo import ogr, gdal + from osgeo import ogr, gdal from Toolbox import Toolbox from Seath import Seath from Precision_moba import Precision_moba + # Class group image from Archive import Archive from RasterSat_by_date import RasterSat_by_date @@ -39,838 +42,891 @@ from Slope import Slope # Class group vector from Vector import Vector from Sample import Sample -from Segmentation import Segmentation +import Segmentation from Rpg import Rpg +import time + +import Constantes from collections import defaultdict from multiprocessing import Process from multiprocessing.managers import BaseManager, DictProxy -class Processing(): - - """ - Main processing. This class launch the others system classes. It take into account - CarHab classification method MOBA. - - This way is broken down into 3 parts : - - Image Processing (Search, download and processing) - - Vector Processing (Optimal threshold, Sample processing) - - Classification - - Validation - - **Main parameters** - - :param captor_project: Satellite captor name - :type captor_project: str - :param classif_year: Classification year - :type classif_year: str - :param nb_avalaible_images: Number download available images - :type nb_avalaible_images: int - :param path_folder_dpt: Main folder path - :type path_folder_dpt: str - :param folder_archive: Archive downloaded folder path - :type folder_archive: str - :param folder_processing: Processing folder name. By default : 'Traitement' - :type folder_processing: str - :param path_area: Study area shapefile - :type path_area: str - :param path_ortho: VHRS image path - :type path_ortho: str - :param path_mnt: MNT image path - :type path_mnt: str - :param path_segm: Segmentation shapefile - :type path_segm: str - - **Id information to download on theia platform** - - :param user: Connexion Username - :type user: str - :param password: Connexion Password - :type password: str - - **Output parameters** - - :param output_name_moba: Output classification shapefile - :type output_name_moba: str - :param out_fieldname_carto: Output shapefile field name - :type out_fieldname_carto: list of str - :param out_fieldtype_carto: Output shapefile field type - :type out_fieldtype_carto: list of str (eval ogr pointer) - - **Sample parameters** - - :param fieldname_args: Sample field names 2 by 2 - :type fieldname_args: list of str - :param class_args: Sample class names 2 by 2 - :type class_args: list of str - :param sample_name: List of sample name (path) - :type sample_name: list of str - :param list_nb_sample: Number of polygons for every sample - :type list_nb_sample: list of int - - **Multi-processing parameters** - - :param mp: Boolean variable -> 0 or 1. - - - 0 means, not multi-processing - - 1 means, launch process with multi-processing - :type mp: int - """ - - def __init__(self): - - # Used variables - self.captor_project = '' - self.classif_year = '' - self.path_folder_dpt = '' - self.folder_archive = '' - self.folder_processing = 'Traitement' - self.path_area = '' - self.path_ortho = '' - self.path_mnt = '' - self.path_segm = '' - self.output_name_moba = '' - - self.w_proxy = None # For the "Proxy window" - - # Id information to download on theia platform - self.user = '' - self.password = '' - - # List of output raster path - self.raster_path = [] - self.list_band_outraster = [] - - # Class name - - # TODO : Change index of the classes -> Harbacées 6 / Ligneux 7 by Agriculuture 4 / Eboulis 5 - - self.in_class_name = ['Non Vegetation semi-naturelle', 'Vegetation semi-naturelle',\ - 'Herbacees', 'Ligneux', \ - 'Ligneux mixtes', 'Ligneux denses',\ - 'Agriculture', 'Eboulis', \ - 'Forte phytomasse', 'Moyenne phytomasse', 'Faible phytomasse'] - # Sample field names 2 by 2 - self.fieldname_args = [] -# 'CODE_GROUP', 'CODE_GROUP',\ -# 'echant', 'echant',\ -# 'echant', 'echant'] - # Sample class names 2 by 2 - self.class_args = [] -# '1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 15, 20, 21, 22, 23, 24, 26, 28', '18',\ -# 'H','LF, LO',\ -# 'LF', 'LO'] - - # Decision tree combination - self.tree_direction = [[0],\ - [0],\ - [1, 3, 4],\ - [1, 3, 5],\ - [1, 2, 8],\ - [1, 2, 9],\ - [1, 2, 10]] # [['Cultures'],['Semi-naturelles', 'Herbacees', 'Forte phytomasse'], ... - # ..., ['Semi-naturelles', 'Ligneux', 'Ligneux denses']] - # Slope degrees - self.slope_degree = 30 - - # Output shapefile field name - self.out_fieldname_carto = ['ID', 'AREA'] #, 'NIVEAU_1', 'NIVEAU_2', 'NIVEAU_3', 'POURC'] - # Output shapefile field type - self.out_fieldtype_carto = [ogr.OFTString, ogr.OFTReal] #, ogr.OFTString, ogr.OFTString, ogr.OFTString, ogr.OFTReal] - - # List of sample name path - self.sample_name = [] - # List of number sample - self.list_nb_sample = [] - # Number download available images - self.nb_avalaible_images = 0 - # Multi-processing variable - self.mp = 1 - - # Function followed - self.check_download = '' - self.decis = {} - # Images after processing images - self.out_ndvistats_folder_tab = defaultdict(list) - - # Validation shapefiles information - self.valid_shp = [] - - # Radom Forest Model - # Set the parameters of this random forest from the estimator - self.rf = RandomForestClassifier(n_estimators=500, criterion='gini', max_depth=None, min_samples_split=2, \ - min_samples_leaf=1, max_features='auto', \ - bootstrap=True, oob_score=True) - - def i_tree_direction(self): - - """ - Interface function to can extract one level or two levels of the final classification - """ - - if len(self.out_fieldname_carto) == 3: - self.tree_direction = [[0], [1]] - - if len(self.out_fieldname_carto) == 4: - self.tree_direction = [[0], [0], [1, 2], [1, 3]] - - def i_download(self, dd): - - """ - Interface function to download archives on the website Theia Land. This function extract - the number of downloadable image with :func:`Archive.Archive.listing`. - - Then, this function download :func:`Archive.Archive.download` and unzip :func:`Archive.Archive.decompress` images - in the archive folder (**folder_archive**). - - :param dd: Boolean variable to launch download images -> 0 or 1. - - - 0 means, not downloading - - 1 means, launch downloading - :type dd: int - """ - - self.folder_archive = self.captor_project + '_PoleTheia' - self.check_download = Archive(self.captor_project, self.classif_year, self.path_area, self.path_folder_dpt, self.folder_archive, self.w_proxy) - self.check_download.listing() - self.nb_avalaible_images = len(self.check_download.list_archive) - # check_download.set_list_archive_to_try(check_download.list_archive[:3]) - if dd == 1: -# self.check_download.download_auto(self.user, self.password) - self.check_download.download_auto(self.user, self.password) - self.check_download.decompress() - - def i_glob(self): - """ - Function to load existing images to launch the processing. - It need to archives. Then, to select processing images, select archives - - """ - - self.folder_archive = self.captor_project + '_PoleTheia' - self.check_download = Archive(self.captor_project, self.classif_year, self.path_area, self.path_folder_dpt, self.folder_archive, self.w_proxy) - self.check_download.decompress() - - def i_img_sat(self): - - """ - Interface function to processing satellite images: - - 1. Clip archive images and modify Archive class to integrate clip image path. - With :func:`Toolbox.clip_raster` in ``Toolbox`` module. - - 2. Search cloud's percentage :func:`RasterSat_by_date.RasterSat_by_date.pourc_cloud`, select - image and compute ndvi index :func:`RasterSat_by_date.RasterSat_by_date.calcul_ndvi`. If cloud's percentage is - greater than 40%, then not select and compute ndvi index. - - 3. Compute temporal stats on ndvi index [min, max, std, min-max]. With :func:`Toolbox.calc_serie_stats` - in ``Toolbox`` module. - - 4. Create stats ndvi raster and stats cloud raster. - - >>> import RasterSat_by_date - >>> stats_test = RasterSat_by_date(class_archive, big_folder, one_date) - >>> stats_test.complete_raster(stats_test.create_raster(in_raster, stats_data, in_ds), stats_data) - """ - - # Clip archive images and modify Archive class to integrate clip image path - for clip in self.check_download.list_img: - clip_index = self.check_download.list_img.index(clip) - - current_list = Toolbox() - current_list.imag = clip[3] - current_list.vect = self.path_area - current_list.check_proj() # Check if projection is RFG93 - self.check_download.list_img[clip_index][3] = current_list.clip_raster() # Multispectral images - - current_list.imag = clip[4] - current_list.check_proj() # Check if projection is RFG93 - self.check_download.list_img[clip_index][4] = current_list.clip_raster() # Cloud images - - # Images pre-processing - spectral_out = [] - for date in self.check_download.single_date: - - check_L8 = RasterSat_by_date(self.check_download, self.folder_processing, date) - check_L8.mosaic_by_date() - - # Search cloud's percentage, select image and compute ndvi index if > cl - cl = check_L8.pourc_cloud(check_L8._one_date[3], check_L8._one_date[4]) - if cl > 0.60: - check_L8.calcul_ndvi(check_L8._one_date[3]) - spectral_out.append(check_L8._one_date) - - # Compute temporal stats on ndvi index [min, max, std, min-max] - spectral_trans = np.transpose(np.array(spectral_out, dtype=object)) - stats_name = ['Min', 'Date', 'Max', 'Std', 'MaxMin'] - stats_ndvi, stats_cloud = current_list.calc_serie_stats(spectral_trans) - - # Create stats ndvi raster and stats cloud raster - stats_L8 = RasterSat_by_date(self.check_download, self.folder_processing, [0]) - # Stats cloud raster - out_cloud_folder = stats_L8._class_archive._folder + '/' + stats_L8._big_folder + '/' + self.captor_project + \ - '/Cloud_number_' + self.captor_project + '.TIF' - stats_L8.complete_raster(stats_L8.create_raster(out_cloud_folder, stats_cloud, \ - stats_L8.raster_data(self.check_download.list_img[0][4])[1]), \ - stats_cloud) - - # Stats ndvi rasters - for stats_index in range(len(stats_ndvi)): - out_ndvistats_folder = stats_L8._class_archive._folder + '/' + stats_L8._big_folder + '/' + self.captor_project + \ - '/' + stats_name[stats_index] + '_' + self.captor_project + '.TIF' - self.out_ndvistats_folder_tab[stats_index] = out_ndvistats_folder - stats_L8.complete_raster(stats_L8.create_raster(out_ndvistats_folder, stats_ndvi[stats_index], \ - stats_L8.raster_data(self.check_download.list_img[0][4])[1]), \ - stats_ndvi[stats_index]) - - def i_slope(self): - """ - Interface function to processing slope raster. From a MNT, and with a command line gdal, - this function compute slope in degrees :func:`Slope.Slope`. - - """ - - current_path_mnt = Toolbox() - current_path_mnt.imag = self.path_mnt - current_path_mnt.vect = self.path_area - path_mnt = current_path_mnt.clip_raster() - - study_slope = Slope(path_mnt) - study_slope.extract_slope()# Call this function to compute slope raster - self.path_mnt = study_slope.out_mnt - - def i_vhrs(self):#, vs): - """ - Interface function to processing VHRS images. It create two OTB texture images :func:`Vhrs.Vhrs` : SFS Texture and Haralick Texture - - """ - - # Create texture image - # Clip orthography image - current_path_ortho = Toolbox() - current_path_ortho.imag = self.path_ortho - current_path_ortho.vect = self.path_area - path_ortho = current_path_ortho.clip_raster() - - texture_irc = Vhrs(path_ortho, self.mp) - self.out_ndvistats_folder_tab['sfs'] = texture_irc.out_sfs - self.out_ndvistats_folder_tab['haralick'] = texture_irc.out_haralick - - def i_images_processing(self, vs): - - """ - Interface function to launch processing VHRS images :func:`i_vhrs` and satellite images :func:`i_img_sat` in multi-processing. - - :param vs: Boolean variable to launch processing because of interface checkbox -> 0 or 1. - - - 0 means, not texture processing - - 1 means, launch texture processing - :type vs: int - """ - - # Multiprocessing - mgr = BaseManager() - mgr.register('defaultdict', defaultdict, DictProxy) - mgr.start() - self.out_ndvistats_folder_tab = mgr.defaultdict(list) - - p_img_sat = Process(target=self.i_img_sat) - p_img_sat.start() - if self.mp == 0: - p_img_sat.join() - - if vs == 1: - p_vhrs = Process(target=self.i_vhrs)#, args=(vs, )) - p_vhrs.start() - p_vhrs.join() - - if self.mp == 1: - p_img_sat.join() - - # List of output raster path - self.raster_path.append(self.out_ndvistats_folder_tab[0]) - # List of output raster band - self.list_band_outraster.append(1) - - if vs == 1: - self.raster_path.append(self.out_ndvistats_folder_tab['sfs']) - self.list_band_outraster.append(4) - self.raster_path.append(self.out_ndvistats_folder_tab['haralick']) - self.list_band_outraster.append(2) - - # To slope, to extract scree - if self.path_mnt != '': - self.raster_path.append(self.path_mnt) - self.list_band_outraster.append(1) - - self.raster_path.append(self.out_ndvistats_folder_tab[2]) - # example raster path tab : - # [path_folder_dpt + '/' + folder_processing + '/' + classif_year + '/Min_2014.TIF',\ - # os.path.dirname(path_ortho) + '/Clip_buffer_surface_dep_18_IRCOrtho65_2m_sfs.TIF',\ - # os.path.dirname(path_ortho) + '/Clip_buffer_surface_dep_18_IRCOrtho65_2m_haralick.TIF',\ - # path_folder_dpt + '/' + folder_processing + '/' + classif_year + '/Max_2014.TIF'] - - # List of output raster band - self.list_band_outraster.append(1) #[1, 4, 2, 1] - - print("End of images processing !") - - def i_rpg(self, path_rpg): - """ - Interface function to extract mono rpg crops. - - :param path_rpg: Input RPG shapefile. - :type path_rpg: str - - :returns: str -- variable **Rpg.vector_used**, output no duplicated crops shapefile (path). - """ - - # Extract mono rpg crops - mono_sample = Rpg(path_rpg, self.path_area) - # If exists, do not create a mono rpg file - if os.path.basename(str(path_rpg))[:5]!='MONO_': - mono_sample.mono_rpg() - mono_sample.create_new_rpg_files() - else: - print('MONO RPG file exists already !!!') - print('End of RPG processing') - - return mono_sample.vector_used - - def i_sample(self): - """ - Interface function to compute threshold with various sample. It also extract a list of validation layer (shapefile) - to compute the precision of the next classification :func:`i_validate`. - - It create samples 2 by 2 with kwargs field names and class :func:`Sample.Sample.create_sample`. - Then, it compute zonal statistics by polygons :func:`Vector.Sample.zonal_stats`. - - With zonal statistics computed, a optimal threshold is determined :func:`Seath.Seath.separability_and_threshold` that - will print in a text file .lg in the main folder. - - .. warning:: :func:`Seath.Seath.separability_and_threshold` does not always allow to discriminate optimal threshold. - Then, this function will be launch at least ten time until it reaches a optimal threshold. - """ - - # Compute threshold with various sample - i_s = 0 - while i_s < 10: - try : - self.valid_shp = [] - sample_rd = {} - for sple in range(len(self.sample_name) * 2): - kwargs = {} - kwargs['fieldname'] = self.fieldname_args[sple] - kwargs['class'] = self.class_args[sple] - sample_rd[sple] = Sample(self.sample_name[sple/2], self.path_area, self.list_nb_sample[sple/2]) - sample_rd[sple].create_sample(**kwargs) - sample_rd[sple].zonal_stats((self.raster_path[sple/2], self.list_band_outraster[sple/2])) - - # Add the validation shapefile - self.valid_shp.append([sample_rd[sple].vector_val, kwargs['fieldname'], kwargs['class']]) - - # Search the optimal threshold by class - # Open a text file to print stats of Seath method - file_J = self.path_folder_dpt + '/log_J.lg' - f = open(file_J, "wb") - for th_seath in range(len(self.sample_name)): - self.decis[th_seath] = Seath() - self.decis[th_seath].value_1 = sample_rd[th_seath*2].stats_dict - self.decis[th_seath].value_2 = sample_rd[th_seath*2 + 1].stats_dict - self.decis[th_seath].separability_and_threshold() - - # Print the J value in the text file .lg - f.write('For ' + str(self.sample_name[th_seath]) + ' :\n') - f.write('J = ' + str(self.decis[th_seath].J[0]) +'\n') - f.write('The class 1 ' + str(self.decis[th_seath].threshold[0]) +'\n') - - f.close() - i_s = 20 - except: - i_s = i_s + 1 - # Method to stop the processus if there is not found a valid threshold - if i_s != 20: - print 'Problem in the sample processing !!!' - sys.exit(1) - - def i_sample_rf(self): - """ - This function build a random forest trees like model to create a final classification. - All of This using the method described in the :func:`i_validate` function and because - of sklearn module. - """ - - X_rf = [] - y_rf = [] - sample_rd = {} - # Tricks to add all textural indexes - rm_index = 1 - self.raster_path.remove(self.raster_path[rm_index]) # Remove SFS layer - self.raster_path.remove(self.raster_path[rm_index]) # Remove Haralick layer - self.list_band_outraster.remove(self.list_band_outraster[rm_index]) # Remove band of the layer - self.list_band_outraster.remove(self.list_band_outraster[rm_index]) # Remove band of the layer - # Add all layers in the simple index haralick - for add_layer in range(8): - self.raster_path.insert(add_layer+1, self.out_ndvistats_folder_tab['haralick']) - self.list_band_outraster.insert(add_layer+1, add_layer+1) - # Add all layers in the SFS index - for add_layer in range(6): - self.raster_path.insert(add_layer+1, self.out_ndvistats_folder_tab['sfs']) - self.list_band_outraster.insert(add_layer+1, add_layer+1) - - # Extract value mean from polygons - for sple in range(len(self.sample_name) * 2): - kwargs = {} - kwargs['fieldname'] = self.fieldname_args[sple] - kwargs['class'] = self.class_args[sple] - sample_rd[sple] = Sample(self.sample_name[sple/2], self.path_area, self.list_nb_sample[sple/2]) - sample_rd[sple].create_sample(**kwargs) - - # Add the validation shapefile - self.valid_shp.append([sample_rd[sple].vector_val, kwargs['fieldname'], kwargs['class']]) - - for lbo in range(len(self.raster_path)): - kwargs['rank'] = lbo - kwargs['nb_img'] = len(self.raster_path) - sample_rd[sple].zonal_stats((self.raster_path[lbo], self.list_band_outraster[lbo]), **kwargs) - - # To convert the dictionnary in a list - for key, value in sample_rd[sple].stats_dict.iteritems(): -# X_rf.append([-10000 if (math.isnan(x) or math.isinf(x)) else x for x in value]) - # To set the grassland class of the RPG and PIAO (same class) - if sple == 2: -# y_rf.append(1) - pass - elif sple == 3: -# y_rf.append(4) - pass - else: - y_rf.append(sple) - X_rf.append([-10000 if (math.isnan(x) or math.isinf(x)) else x for x in value]) - - # Build a forest of trees from the samples - self.rf = self.rf.fit(X_rf, y_rf) - - # Print in a file feature important - importance = self.rf.feature_importances_ - importance = [(importance[x],x+1) for x in range(len(importance))] - importance.sort() - - file_feat_import = os.path.dirname(str(self.raster_path[0])) + '/Feature_important_RF.ft' - if os.path.exists(file_feat_import): - os.remove(file_feat_import) - f_out = open(file_feat_import, "wb") - f_out.write(str(importance)) - # Close the output file - f_out.close() - - # Print in a file decision tree - file_decisiontree = os.path.dirname(str(self.raster_path[0])) + '/Decision_tree.dot' - if os.path.exists(file_decisiontree): - os.remove(file_decisiontree) - - tree_in_forest = self.rf.estimators_[499] - with open(file_decisiontree, 'w') as my_file: - my_file = tree.export_graphviz(tree_in_forest, out_file = my_file) - - def i_classifier_rf(self): - """ - Interface function to launch random forest classification with a input segmentation :func:`Segmentation.Segmentation`. - - This function use the sklearn module to build the best of decision tree to extract classes. - The optimal threshold are stored by class **rf** variable in :func:`Processing.i_sample_rf`. Then it computes zonal statistics by polygons - for every images in multi-processing (if **mp** = 1). - """ - - # Multiprocessing - mgr = BaseManager() - mgr.register('defaultdict', defaultdict, DictProxy) - mgr.start() - multi_process_var = [] # Multi processing variable - - # Extract final cartography - out_carto = Segmentation(self.path_segm, self.path_area) - out_carto.output_file = self.output_name_moba - out_carto.out_class_name = self.in_class_name -# out_carto.out_threshold = [] - for ind_th in range(len(self.raster_path)): - multi_process_var.append([self.raster_path[ind_th], self.list_band_outraster[ind_th]]) - - # Compute zonal stats with multi processing - exist_stats = 1 # By default, the stats file exists already - file_stats = os.path.dirname(str(self.raster_path[0])) + '/Stats_raster_spectral_texture.stats' # Stats backup file - if not os.path.exists(file_stats): - exist_stats = 0 # The sats file doesn't exist - # Open a stats backup to avoid computing again (Gain of time) - f_out = open(file_stats, "wb") - - p = [] - kwargs = {} - X_out_rf = [] # Variable list to compute decision tree with random forest method - if exist_stats == 0: - out_carto.stats_dict = mgr.defaultdict(list) - for i in range(len(multi_process_var)): - kwargs['rank'] = i - kwargs['nb_img'] = len(multi_process_var) - p.append(Process(target=out_carto.zonal_stats, args=(multi_process_var[i], ), kwargs=kwargs)) - p[i].start() - - if self.mp == 0: - p[i].join() - - if self.mp == 1: - for i in range(len(multi_process_var)): - p[i].join() - - for key, value_seg in out_carto.stats_dict.items(): - true_value = [-10000 if (math.isnan(x) or math.isinf(x)) else x for x in value_seg] - X_out_rf.append(true_value) - - # Print rasters stats value in the text file .lg - f_out.write(str(true_value) + '\n') - - # Close the output file - f_out.close() - - else: - # If the stats file exists already, open this file and append in the stats_dict variable - out_carto.stats_dict = defaultdict(list) - with open(file_stats, "r") as f_in: - index_in_stats=-1 - for x_in in f_in.readlines(): - index_in_stats = index_in_stats + 1 - out_carto.stats_dict[index_in_stats] = eval(x_in.strip('\n')) - X_out_rf.append(eval(x_in.strip('\n'))) - - predicted_rf = self.rf.predict(X_out_rf) - - # For the higher than level 1 - if len(self.sample_name) > 2: - # Compute the biomass and density distribution - # Use 'out_carto.out_threshold' to konw predicted in the segmentation class - out_carto.out_threshold = predicted_rf - # In the compute_biomass_density function, this variable used normally to define - # threshold of the classification with SEATH method is initialized - out_carto.compute_biomass_density('RF') - - out_carto.class_tab_final = defaultdict(list) - for i_polyg in range(len(predicted_rf)): - i_final = 0 - class_final = [] - # Initialize the predicted output format - # For example : predicted => 4, formatted => [1,3,4] - while i_final < len(self.tree_direction): - if self.tree_direction[i_final][len(self.tree_direction[i_final])-1] == predicted_rf[i_polyg]: - class_final = self.tree_direction[i_final] - i_final = len(self.tree_direction) - i_final = i_final + 1 - - if class_final == []: - class_final = [1, 2] - # Set the class name because of predicted output formatted - out_carto.class_tab_final[i_polyg] = [self.in_class_name[f] for f in class_final] + \ - [predicted_rf[i_polyg]] + [predicted_rf[i_polyg]] - - # For the output line with one level, add a phantom level - # TODO : Replace constant by a variable in the condition 'while' - while len(out_carto.class_tab_final[i_polyg]) < 5: - out_carto.class_tab_final[i_polyg].insert(len(out_carto.class_tab_final[i_polyg])-2,'') - - # If there is more one fieldnames line edit fulled in classification tab - if len(self.sample_name) > 2: - # Compute biomass and density scale - out_carto.append_scale(self.in_class_name[2], 'self.stats_dict[ind_stats][3]/self.max_bio') - out_carto.append_scale(self.in_class_name[3], 'self.stats_dict[ind_stats][2]/self.max_wood_idm') - - # Rasterize RPG shapefile to complete the final shapefile - opt = {} - opt['Remove'] = 1 - rpg_tif = Vector(self.sample_name[0], self.path_area, **opt) -# if not os.path.exists(str(rpg_tif.vector_used[:-3]+'TIF')): - kwargs['choice_nb_b'] = 1 - out_carto.stats_rpg_tif = out_carto.zonal_stats_pp(rpg_tif.layer_rasterization(self.path_ortho, 'CODE_GROUP', **kwargs)) - - # Final cartography - out_carto.create_cartography(self.out_fieldname_carto, self.out_fieldtype_carto) - - def i_classifier_s(self): - """ - Interface function to launch decision tree classification with a input segmentation :func:`Segmentation.Segmentation`. - - This function store optimal threshold by class **Segmentation.out_threshold**. Then it computes zonal statistics by polygons - for every images in multi-processing (if **mp** = 1). - """ - - # Multiprocessing - mgr = BaseManager() - mgr.register('defaultdict', defaultdict, DictProxy) - mgr.start() - multi_process_var = [] # Multi processing variable - - # Extract final cartography - out_carto = Segmentation(self.path_segm, self.path_area) - out_carto.output_file = self.output_name_moba - out_carto.out_class_name = self.in_class_name - out_carto.out_threshold = [] - for ind_th in range(len(self.sample_name)): - out_carto.out_threshold.append(self.decis[ind_th].threshold[0]) - if '>' in self.decis[ind_th].threshold[0]: - out_carto.out_threshold.append(self.decis[ind_th].threshold[0].replace('>', '<=')) - elif '<' in self.decis[ind_th].threshold[0]: - out_carto.out_threshold.append(self.decis[ind_th].threshold[0].replace('<', '>=')) - # out_carto.zonal_stats((raster_path[ind_th], list_band_outraster[ind_th])) - multi_process_var.append([self.raster_path[ind_th], self.list_band_outraster[ind_th]]) - - # Compute zonal stats on slope raster - multi_process_var.append([self.raster_path[ind_th+1], self.list_band_outraster[ind_th+1]]) - out_carto.out_threshold.append('<'+str(self.slope_degree)) # To agriculture - out_carto.out_threshold.append('>='+str(self.slope_degree)) # To scree - if self.path_mnt != '': - # Add class indexes - self.tree_direction[0].append(6) - self.tree_direction[0].append(7) - - # Compute zonal stats on Max NDVI raster - try: - # out_carto.zonal_stats((raster_path[ind_th+1], list_band_outraster[ind_th+1])) - multi_process_var.append([self.raster_path[ind_th+2], self.list_band_outraster[ind_th+2]]) - # Compute stats twice, because there is 3 classes and not 2 - # out_carto.zonal_stats((raster_path[ind_th+1], list_band_outraster[ind_th+1])) - multi_process_var.append([self.raster_path[ind_th+2], self.list_band_outraster[ind_th+2]]) - except: - print('Not MNT on the 3rd step') - multi_process_var.append([self.raster_path[ind_th+1], self.list_band_outraster[ind_th+1]]) - multi_process_var.append([self.raster_path[ind_th+1], self.list_band_outraster[ind_th+1]]) - - # Compute zonal stats with multi processing - exist_stats = 1 # By default, the stats file exists already - file_stats = os.path.dirname(str(self.raster_path[0])) + '/Stats_raster_spectral_texture.stats' # Stats backup file - if not os.path.exists(file_stats): - exist_stats = 0 # The sats file doesn't exist - # Open a stats backup to avoid computing again (Gain of time) - f_out = open(file_stats, "wb") - - p = [] - kwargs = {} - X_out_rf = [] # Variable list to compute decision tree with random forest method - if exist_stats == 0: - out_carto.stats_dict = mgr.defaultdict(list) - for i in range(len(multi_process_var)): - kwargs['rank'] = i - kwargs['nb_img'] = len(multi_process_var) - p.append(Process(target=out_carto.zonal_stats, args=(multi_process_var[i], ), kwargs=kwargs)) - p[i].start() - - if self.mp == 0: - p[i].join() - - if self.mp == 1: - for i in range(len(multi_process_var)): - p[i].join() - - for key, value_seg in out_carto.stats_dict.items(): - - true_value = [-10000 if (math.isnan(x) or math.isinf(x)) else x for x in value_seg] - # Print rasters stats value in the text file .lg - f_out.write(str(true_value) + '\n') - - # Close the output file - f_out.close() - - else: - # If the stats file exists already, open this file and append in the stats_dict variable - out_carto.stats_dict = defaultdict(list) - with open(file_stats, "r") as f_in: - index_in_stats=-1 - for x_in in f_in.readlines(): - index_in_stats = index_in_stats + 1 - out_carto.stats_dict[index_in_stats] = eval(x_in.strip('\n')) - X_out_rf.append(eval(x_in.strip('\n'))) - - # For the higher than level 1 - if len(self.sample_name) > 2: - # Compute the biomass and density distribution - out_carto.compute_biomass_density() - - out_carto.class_tab_final = defaultdict(list) - self.i_tree_direction() - out_carto.decision_tree(self.tree_direction) - - # If there is more one fieldnames line edit fulled in classification tab - if len(self.sample_name) > 2: - # Compute biomass and density scale - out_carto.append_scale(self.in_class_name[2], 'self.stats_dict[ind_stats][3]/self.max_bio') - out_carto.append_scale(self.in_class_name[3], 'self.stats_dict[ind_stats][2]/self.max_wood_idm') - - # Rasterize RPG shapefile to complete the final shapefile - opt = {} - opt['Remove'] = 1 - rpg_tif = Vector(self.sample_name[0], self.path_area, **opt) - rpg_tif.layer_rasterization(self.path_ortho, 'CODE_GROUP') - - # Final cartography - out_carto.mono_rpg_tif = self.sample_name[0][:-4] + '.TIF' - out_carto.create_cartography(self.out_fieldname_carto, self.out_fieldtype_carto) - - def i_validate(self): - """ - Interface to validate a classification. It going to rasterize the validation shapefile and the - classification shapefile with :func:`layer_rasterization`. Next, to compare pixel by pixel, the classification - quality to built a confusion matrix in a csv file. - - """ - # Variable to convert the input classname to an individual interger - # Only for the validate sample - class_validate = 0 - complete_validate_shp = os.path.dirname(str(self.valid_shp[0][0])) + '/validate.shp' - - # TODO: Set this method in the Precision_moba class - - - # Processing to rasterize the validate shapefile. 1) Merge sahpefiles 2) Rasterization - for val in self.valid_shp: - if class_validate != 2: - # Grassland to 1 - if (class_validate !=3 and len(self.out_fieldname_carto) != 4+2) or len(self.out_fieldname_carto) == 4+2: - # To the level 3 with woodeen to 4 and 5 - # - # Self.valid_shp is a list of list. In this variable there is : - # [Shapefile path, fieldname classes, classnames] - opt = {} - opt['Remove'] = 1 # To overwrite - - # Create a raster to valide the classification - # First time, create a new shapefile with a new field integer - sample_val = Sample(val[0], self.path_area, 1, **opt) - opt['add_fieldname'] = 1 - opt['fieldname'] = 'CLASS_CODE' - opt['class'] = str(class_validate) # Add integer classes - # Set the new shapefile - val[0] = val[0][:-4] + '_.shp' - val[1] = opt['fieldname'] - val[2] = opt['class'] - # Complete the new shapefile - sample_val.fill_sample(val[0], 0, **opt) - # Second time, merge the validate shapefile - if class_validate == 0: - process_tocall_merge = ['ogr2ogr', '-overwrite', complete_validate_shp, val[0]] - elif class_validate > 0: - process_tocall_merge = ['ogr2ogr', '-update', '-append', complete_validate_shp, \ - val[0], '-nln', os.path.basename(str(complete_validate_shp[:-4]))] - subprocess.call(process_tocall_merge) - # Increrment variable - class_validate = self.valid_shp.index(val) + 1 - - # Compute precision of the classification - valid = Precision_moba(self.path_area, self.path_folder_dpt) - valid.complete_validation_shp = complete_validate_shp - valid.ex_raster = self.raster_path[0] - - # TODO: Call the RasterSat_by_Date class here instead of the Precision_moba class - - valid.preprocess_to_raster_precision(self.output_name_moba, 'FBPHY_CODE') # To the classification's data - valid.preprocess_to_raster_precision(complete_validate_shp, val[1]) # To the validation's data - - # Compute precision on the output classification - valid.confus_matrix(valid.complete_img[0].raster_data(valid.img_pr[0])[0], \ - valid.complete_img[1].raster_data(valid.img_pr[1])[0]) +class Processing(object): + """ + Main processing. This class launch the others system classes. It take into account + CarHab classification method MOBA. + + This way is broken down into 3 parts : + - Image Processing (Search, download and processing) + - Vector Processing (Optimal threshold, Sample processing) + - Classification + - Validation + + **Main parameters** + + :param captor_project: Satellite captor name + :type captor_project: str + :param classif_year: Classification year + :type classif_year: str + :param nb_avalaible_images: Number download available images + :type nb_avalaible_images: int + :param path_folder_dpt: Main folder path + :type path_folder_dpt: str + :param folder_processing: Processing folder name. By default : 'Traitement' + :type folder_processing: str + :param path_area: Study area shapefile + :type path_area: str + :param path_ortho: VHRS image path + :type path_ortho: str + :param path_mnt: MNT image path + :type path_mnt: str + :param path_segm: Segmentation shapefile + :type path_segm: str + + **Id information to download on theia platform** + + :param user: Connexion Username + :type user: str + :param password: Connexion Password + :type password: str + + **Output parameters** + + :param output_name_moba: Output classification shapefile + :type output_name_moba: str + :param out_fieldname_carto: Output shapefile field name + :type out_fieldname_carto: list of str + :param out_fieldtype_carto: Output shapefile field type + :type out_fieldtype_carto: list of str (eval ogr pointer) + + **Sample parameters** + + :param fieldname_args: Sample field names 2 by 2 + :type fieldname_args: list of str + :param class_args: Sample class names 2 by 2 + :type class_args: list of str + :param sample_name: List of sample name (path) + :type sample_name: list of str + :param list_nb_sample: Number of polygons for every sample + :type list_nb_sample: list of int + + **Multi-processing parameters** + + :param mp: Boolean variable -> 0 or 1. + + - 0 means, not multi-processing + - 1 means, launch process with multi-processing + :type mp: int + """ + + def __init__(self): + + # Used variables + self.captor_project = '' + self.classif_year = '' + self.path_folder_dpt = '' + self.folder_processing = 'Traitement' + self.path_area = '' + self.path_ortho = '' + self.path_mnt = '' + self.path_segm = '' + self.output_name_moba = '' + + self.w_proxy = None # For the "Proxy window" + + # Id information to download on theia platform + self.user = '' + self.password = '' + + # List of output raster path + self.raster_path = defaultdict(dict) + + # TODO : Change index of the classes -> Harbacées 6 / Ligneux 7 by Agriculuture 4 / Eboulis 5 + # Class name + self.in_class_name = ['Non Vegetation semi-naturelle', 'Vegetation semi-naturelle',\ + 'Herbacees', 'Ligneux', \ + 'Ligneux mixtes', 'Ligneux denses',\ + 'Agriculture', 'Eboulis', \ + 'Forte phytomasse', 'Moyenne phytomasse', 'Faible phytomasse'] + + # Sample field names 2 by 2 + self.fieldname_args = [] + # 'CODE_GROUP', 'CODE_GROUP',\ + # 'echant', 'echant',\ + # 'echant', 'echant'] + + # Sample class names 2 by 2 + self.class_args = [] + # '1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 15, 20, 21, 22, 23, 24, 26, 28', '18',\ + # 'H','LF, LO',\ + # 'LF', 'LO'] + + # Decision tree combination + self.tree_direction = [[0],\ + [0],\ + [1, 3, 4],\ + [1, 3, 5],\ + [1, 2, 8],\ + [1, 2, 9],\ + [1, 2, 10]] # [['Cultures'],['Semi-naturelles', 'Herbacees', 'Forte phytomasse'], ... + # ..., ['Semi-naturelles', 'Ligneux', 'Ligneux denses']] + # Slope degrees + self.slope_degree = 30 + + # Output shapefile field name + self.out_fieldname_carto = ['ID', 'AREA'] #, 'NIVEAU_1', 'NIVEAU_2', 'NIVEAU_3', 'POURC'] + # Output shapefile field type + self.out_fieldtype_carto = [ogr.OFTString, ogr.OFTReal] #, ogr.OFTString, ogr.OFTString, ogr.OFTString, ogr.OFTReal] + + # List of sample name path + self.sample_name = [] + # List of number sample + self.list_nb_sample = [] + # Number download available images + self.nb_avalaible_images = 0 + + # Multi-processing variable + self.mp = Constantes.MULTIPROCESSING_DISABLE + + # Function followed + self.check_download = None + self.decis = {} + + # Images after processing images + self.out_ndvistats_folder_tab = defaultdict(list) + + # Validation shapefiles information + self.valid_shp = [] + + # Radom Forest Model + # Set the parameters of this random forest from the estimator + self.rf = RandomForestClassifier(n_estimators=500, criterion='gini', max_depth=None, min_samples_split=2, \ + min_samples_leaf=1, max_features='auto', \ + bootstrap=True, oob_score=True) + + def i_tree_direction(self): + """ + Interface function to can extract one level or two levels of the final classification + """ + + if len(self.out_fieldname_carto) == 3: + self.tree_direction = [[0], [1]] + + if len(self.out_fieldname_carto) == 4: + self.tree_direction = [[0], [0], [1, 2], [1, 3]] + + def i_download(self, ignore_download=False): + """ + Interface function to download archives on the website Theia Land. This function extract + the number of downloadable image with :func:`Archive.Archive.listing`. + + Then, this function download :func:`Archive.Archive.download` and unzip :func:`Archive.Archive.decompress` images + in the archive folder (**folder_archive**). + """ + + folder_archive = "{0}/{1}_PoleTheia".format(self.folder_processing, self.captor_project) + + if not os.path.exists(folder_archive) : + os.makedirs(folder_archive) + + self.check_download = Archive(self.captor_project, self.classif_year, self.path_area, folder_archive, self.w_proxy) + + if not ignore_download : + self.nb_avalaible_images = self.check_download.listing() + self.check_download.download_auto(self.user, self.password) + + self.check_download.decompress() + + def i_img_sat(self): + """ + Interface function to processing satellite images: + + 1. Clip archive images and modify Archive class to integrate clip image path. + With :func:`Toolbox.clip_raster` in ``Toolbox`` module. + + 2. Search cloud's percentage :func:`RasterSat_by_date.RasterSat_by_date.pourc_cloud`, + select image and compute ndvi index :func:`RasterSat_by_date.RasterSat_by_date.calcul_ndvi`. + If cloud's percentage is greater than 40%, then not select and compute ndvi index. + + 3. Compute temporal stats on ndvi index [min, max, std, min-max]. With :func:`Toolbox.calc_serie_stats` + in ``Toolbox`` module. + 4. Create stats ndvi raster and stats cloud raster. + + >>> import RasterSat_by_date + >>> stats_test = RasterSat_by_date(class_archive, big_folder, one_date) + >>> stats_test.complete_raster(stats_test.create_raster(in_raster, stats_data, in_ds), stats_data) + """ + + current_list = Toolbox() + current_list.vect = self.path_area + + # Map projection of the image and the cloud mask + for clip_index, clip in enumerate(self.check_download.list_img): + + current_list.image = clip[3] + + current_list.check_proj() # Check if projection is RFG93 + self.check_download.list_img[clip_index][3] = current_list.clip_raster() # Multispectral images + + current_list.image = clip[4] + current_list.check_proj() # Check if projection is RFG93 + + self.check_download.list_img[clip_index][4] = current_list.clip_raster() # Cloud images + + # Images pre-processing + spectral_out = [] + + check_L8 = RasterSat_by_date(self.check_download, self.folder_processing) + + for date in self.check_download.single_date: + + check_L8.mosaic_by_date(date) + + # Search cloud's percentage, select image and compute ndvi index + if check_L8.pourc_cloud() < Constantes.CLOUD_THRESHOLD : + tmp = date + check_L8.calcul_ndvi() + tmp.extend(check_L8.cloudiness_pourcentage) + spectral_out.append(tmp) + + # Compute temporal stats on ndvi index [min, max, std, min-max] + spectral_trans = np.transpose(np.array(spectral_out, dtype=object)) + + del spectral_out + + # stats_name = ['Min', 'Date', 'Max', 'Std', 'MaxMin'] + stats_name = ['Min', 'Max'] + path_stat = current_list.calc_serie_stats(spectral_trans, stats_name, self.folder_processing) + + for idx, i in enumerate(stats_name): + self.out_ndvistats_folder_tab[i] = path_stat[idx] + + check_L8.logger.close() + current_list.logger.close() + + def i_slope(self): + """ + Interface function to processing slope raster. From a MNT, and with a command line gdal, + this function compute slope in degrees :func:`Slope.Slope`. + """ + + current_path_mnt = Toolbox() + current_path_mnt.image = self.path_mnt + current_path_mnt.vect = self.path_area + path_mnt = current_path_mnt.clip_raster() + + study_slope = Slope(path_mnt) + + # Call this function to compute slope raster + study_slope.extract_slope() + self.path_mnt = study_slope.out_mnt + + current_path_mnt.logger.close() + + def i_vhrs(self): + """ + Interface function to processing VHRS images. + It create two OTB texture images : + func: `Vhrs.Vhrs` : SFS Texture and Haralick Texture + """ + + ############################## Create texture image ############################## + + # Clip orthography image + + current_path_ortho = Toolbox() + + current_path_ortho.image = self.path_ortho + current_path_ortho.vect = self.path_area + current_path_ortho.output = "{0}/MosaiqueOrtho/Clip_{1}".format(self.folder_processing, os.path.basename(self.path_ortho)) + + self.path_ortho = current_path_ortho.output + path_ortho = current_path_ortho.clip_raster() + + texture_irc = Vhrs(path_ortho, self.mp) + self.out_ndvistats_folder_tab['sfs'] = texture_irc.out_sfs + self.out_ndvistats_folder_tab['haralick'] = texture_irc.out_haralick + + current_path_ortho.logger.close() + texture_irc.logger.close() + + + def i_images_processing(self): + """ + Interface function to launch processing VHRS images : func:`i_vhrs` + and satellite images :func:`i_img_sat` in multi-processing. + """ + + ######################### Multiprocessing ? ######################### + + mgr = BaseManager() + mgr.register('defaultdict', defaultdict, DictProxy) + mgr.start() + + self.out_ndvistats_folder_tab = mgr.defaultdict(list) + + p_img_sat = Process(target=self.i_img_sat) + p_vhrs = Process(target=self.i_vhrs) + + self.logger.debug("Multiprocessing : {0}".format(self.mp)) + + if self.mp == Constantes.MULTIPROCESSING_DISABLE: + p_img_sat.start() + p_img_sat.join() + p_vhrs.start() + p_vhrs.join() + else : + p_img_sat.start() + p_vhrs.start() + p_img_sat.join() + p_vhrs.join() + + ################################################################### + + self.raster_path["Min"]["PATH"] = self.out_ndvistats_folder_tab['Min'] + self.raster_path["Min"]["BAND"] = 1 + + for i in range(1,7) : + self.raster_path["SFS_{0}".format(i)]["PATH"] = self.out_ndvistats_folder_tab['sfs'] + self.raster_path["SFS_{0}".format(i)]["BAND"] = i + + for i in range(1,9) : + self.raster_path["HARALICK_{0}".format(i)]["PATH"] = self.out_ndvistats_folder_tab['haralick'] + self.raster_path["HARALICK_{0}".format(i)]["BAND"] = i + + # To slope, to extract scree + if self.path_mnt : + self.raster_path["MNT"]["PATH"] = self.path_mnt + self.raster_path["MNT"]["BAND"] = 1 + + self.raster_path["MAX"]["PATH"] = self.out_ndvistats_folder_tab['Max'] + self.raster_path["MAX"]["BAND"] = 1 + + self.logger.info("End of images processing !") + + def i_rpg(self, path_rpg): + """ + Interface function to extract mono rpg crops. + + @param path_rpg: Input RPG shapefile. + @type path_rpg: str + + @returns: str -- variable **Rpg.vector_used**, output no duplicated crops shapefile (path). + """ + + self.folder_processing = "{0}/{1}/{2}".\ + format(self.path_folder_dpt, self.folder_processing, self.captor_project) + + dossier_rpg = "{0}/RPG".format(self.folder_processing) + + # Extract rpg crops + mono_sample = Rpg(path_rpg, self.path_area) + + mono_sample.clip_vector(dossier_rpg) + mono_sample.vector_data() + + # If exists, do not create a mono rpg file + if not os.path.exists("{0}/MONO_{1}".format(dossier_rpg, mono_sample.vector_name)): + mono_sample.mono_rpg(path_rpg) + mono_sample.create_new_rpg_files() + else: + self.logger.info('MONO RPG file exists already.') + mono_sample.vector_used = "{0}/MONO_{1}".format(dossier_rpg, mono_sample.vector_name) + + self.logger.info('End of RPG processing') + + mono_sample.logger.close() + + return mono_sample.vector_used + + def i_sample(self): + """ + Interface function to compute threshold with various sample. + It also extract a list of validation layer (shapefile) + to compute the precision of the next classification : func:`i_validate`. + + It create samples 2 by 2 with kwargs field names and class :func:`Sample.Sample.create_sample`. + Then, it compute zonal statistics by polygons :func:`Vector.Sample.zonal_stats`. + + With zonal statistics computed, a optimal threshold is determined : + func:`Seath.Seath.separability_and_threshold` that will print in a text file .lg + in the main folder. + + .. warning:: :func:`Seath.Seath.separability_and_threshold` does not always + allow to discriminate optimal threshold. Then, this function will be launch + at least ten time until it reaches a optimal threshold. + """ + + # Compute threshold with various sample + i_s = 0 + while i_s < 10: + + try : + self.valid_shp = [] + sample_rd = {} + + for sple in range(len(self.sample_name) * 2): + kwargs = {} + kwargs['fieldname'] = self.fieldname_args[sple] + kwargs['class'] = self.class_args[sple] + sample_rd[sple] = Sample(self.sample_name[round(sple/2)], self.path_area,\ + self.list_nb_sample[round(sple/2)]) + + sample_rd[sple].clip_vector("{0}/{1}".format(self.folder_processing, os.path.basename(\ + os.path.dirname(self.sample_name[round(sple/2)])))) + + sample_rd[sple].vector_data() + sample_rd[sple].output_folder = self.folder_processing + + sample_rd[sple].create_sample(**kwargs) + sample_rd[sple].zonal_stats((self.raster_path[round(sple/2)],\ + self.list_band_outraster[round(sple/2)])) + + # Add the validation shapefile + self.valid_shp.append([sample_rd[sple].vector_val, kwargs['fieldname'], kwargs['class']]) + + # Search the optimal threshold by class + # Open a text file to print stats of Seath method + with open("{0}/log_J.lg".format(self.path_folder_dpt), "wb") as f : + for th_seath in range(len(self.sample_name)): + self.decis[th_seath] = Seath() + self.decis[th_seath].value_1 = sample_rd[th_seath*2].stats_dict + self.decis[th_seath].value_2 = sample_rd[th_seath*2 + 1].stats_dict + self.decis[th_seath].separability_and_threshold() + + # Print the J value in the text file .lg + f.write('For {0} :\n'.format(self.sample_name[th_seath])) + f.write('J = {0}\n'.format(self.decis[th_seath].J[0])) + f.write('The class 1 {0}\n'.format(self.decis[th_seath].threshold[0])) + + i_s = 20 + except Exception as e: + self.logger.error("Error 519 : {0}".format(e)) + i_s = i_s + 1 + + # Stop the processus if there is not found a valid threshold + if i_s != 20 or True: + self.logger.error('Problem during the sample processing.') + sys.exit(1) + + def i_sample_rf(self): + """ + This function build a random forest trees like model to create a final classification. + All of this using the method described in the : func:`i_validate` function and because + of sklearn module. + """ + + X_rf = [] + y_rf = [] + + self.liste_chemin = [self.out_ndvistats_folder_tab['Min'], self.out_ndvistats_folder_tab['sfs'],\ + self.out_ndvistats_folder_tab['haralick'], self.out_ndvistats_folder_tab['Max'] ] + + # Extract value mean from polygons + for sple in range(len(self.sample_name) * 2): + kwargs = {} + kwargs['fieldname'] = self.fieldname_args[sple] + kwargs['class'] = self.class_args[sple] + + self.logger.debug("Creation Sample : {0} - {1} - {2}".format(\ + self.sample_name[round(sple/2)], self.path_area, self.list_nb_sample[round(sple/2)]) ) + + sample_rd = Sample(self.sample_name[round(sple/2)], self.path_area,\ + self.list_nb_sample[round(sple/2)]) + + sample_rd.clip_vector("{0}/{1}".format(self.folder_processing, os.path.basename(\ + os.path.dirname(self.sample_name[round(sple/2)])))) + + sample_rd.vector_data() + sample_rd.output_folder = self.folder_processing + + self.logger.debug("kwargs : {0}".format(kwargs)) + + sample_rd.create_sample(**kwargs) + + # Add the validation shapefile + self.valid_shp.append([sample_rd.vector_val, kwargs['fieldname'], kwargs['class']]) + + items = list(self.raster_path.items()) + + self.logger.debug("Raster path items: {0}".format(self.raster_path.items())) + + sample_rd.zonal_stats(self.liste_chemin) + + # To convert the dictionnary in a list + for key, value in sample_rd.stats_dict.items(): + # X_rf.append([-10000 if (math.isnan(x) or math.isinf(x)) else x for x in value]) + # To set the grassland class of the RPG and PIAO (same class) + if sple == 2 : + # y_rf.append(1) + pass + elif sple == 3 : + # y_rf.append(4) + pass + else : + y_rf.append(sple) + # X_rf.append([-10000 if (x is None or math.isnan(x) or math.isinf(x)) else x for x in value]) + X_rf.append([x for x in value if (x is not None and not math.isnan(x) and not math.isinf(x))]) + + sample_rd.logger.close() + sample_rd = None + + # Build a forest of trees from the samples + self.rf = self.rf.fit(X_rf, y_rf) + + X_rf = None + y_rf = None + + # Print in a file feature important + importance = self.rf.feature_importances_ + importance = [(importance[x],x+1) for x in range(len(importance))] + importance.sort() + + file_feat_import = "{0}/Feature_important_RF.ft".format(self.folder_processing) + + if os.path.exists(file_feat_import): + os.remove(file_feat_import) + + with open(file_feat_import, "w") as f_out : + f_out.write("{0}".format(importance)) + + # Print in a file decision tree + file_decisiontree = "{0}/Decision_tree.dot".format(self.folder_processing) + image_decisiontree = "{0}/Decision_tree.png".format(self.folder_processing) + + if os.path.exists(file_decisiontree): + os.remove(file_decisiontree) + + tree_in_forest = self.rf.estimators_[499] + + with open(file_decisiontree, 'w') as my_file: + my_file = tree.export_graphviz(tree_in_forest, out_file = my_file) + + (graph,) = pydot.graph_from_dot_file(file_decisiontree) + graph.write_png(image_decisiontree) + + def i_classifier_rf(self): + """ + Interface function to launch random forest classification with a input segmentation : + func:`Segmentation.Segmentation`. + + This function use the sklearn module to build the best of decision tree to extract classes. + The optimal threshold are stored by class **rf** variable in :func:`Processing.i_sample_rf`. + Then it computes zonal statistics by polygons for every images in multi-processing (if **mp** = 1). + """ + + # Multiprocessing + mgr = BaseManager() + mgr.register('defaultdict', defaultdict, DictProxy) + mgr.start() + + # Extract final cartography + out_carto = Segmentation.Segmentation(self.path_segm, self.path_area) + + self.logger.debug(self.path_segm) + self.logger.debug(self.path_area) + + out_carto.clip_vector("{0}/{1}".format(\ + self.folder_processing, os.path.basename(os.path.dirname(self.path_segm)))) + + out_carto.vector_data() + + out_carto.output_file = self.output_name_moba + out_carto.out_class_name = self.in_class_name + + items = list(self.raster_path.items()) + + # Stats backup file + file_stats = "{0}/Stats_raster_spectral_texture.stats".format(self.folder_processing) + + p = [] + kwargs = {} + X_out_rf = [] # Variable list to compute decision tree with random forest method + + # Open a stats backup to avoid computing again (Gain of time) + if not os.path.exists(file_stats) or os.stat(file_stats).st_size == 0: + with open(file_stats, "w") as f_out : + out_carto.stats_dict = mgr.defaultdict(list) + + out_carto.zonal_stats(self.liste_chemin) + + for key, value_seg in out_carto.stats_dict.items(): + # true_value = [-10000 if (x is None or math.isnan(x) or math.isinf(x)) else x for x in value_seg] + true_value = [x for x in value_seg if (x is not None and not math.isnan(x) and not math.isinf(x))] + + X_out_rf.append(true_value) + + f_out.write("{0}\n".format(true_value)) + + else: + # If the stats file exists already, open this file and append in the stats_dict variable + out_carto.stats_dict = defaultdict(list) + with open(file_stats, "r") as f_in: + index_in_stats=-1 + for x_in in f_in.readlines(): + index_in_stats = index_in_stats + 1 + out_carto.stats_dict[index_in_stats] = eval(x_in.strip('\n')) + X_out_rf.append(eval(x_in.strip('\n'))) + + predicted_rf = self.rf.predict(X_out_rf) + X_out_rf = None + + self.logger.debug("Taille sample_name : {0}".format(len(self.sample_name))) + + # For the higher than level 1 + if len(self.sample_name) > 2: + # Compute the biomass and density distribution + # Use 'out_carto.out_threshold' to know predicted in the segmentation class + out_carto.out_threshold["PREDICTION"] = predicted_rf + + # In the compute_biomass_density function, this variable used normally to define + # threshold of the classification with SEATH method is initialized + out_carto.compute_biomass_density('RF') + + out_carto.class_tab_final = defaultdict(list) + for i_polyg in range(len(predicted_rf)): + i_final = 0 + class_final = [] + # Initialize the predicted output format + # For example : predicted => 4, formatted => [1,3,4] + while i_final < len(self.tree_direction): + if self.tree_direction[i_final][len(self.tree_direction[i_final])-1] == predicted_rf[i_polyg]: + class_final = self.tree_direction[i_final] + i_final = len(self.tree_direction) + i_final = i_final + 1 + + if class_final == []: + class_final = [1, 2] + # Set the class name because of predicted output formatted + out_carto.class_tab_final[i_polyg] = [self.in_class_name[f] for f in class_final] + \ + [predicted_rf[i_polyg]] + [predicted_rf[i_polyg]] + + # For the output line with one level, add a phantom level + # TODO : Replace constant by a variable in the condition 'while' + while len(out_carto.class_tab_final[i_polyg]) < 5: + out_carto.class_tab_final[i_polyg].insert(len(out_carto.class_tab_final[i_polyg])-2,'') + + predicted_rf = None + # If there is more one fieldnames line edit fulled in classification tab + if len(self.sample_name) > 2: + # Compute biomass and density scale + out_carto.append_scale(self.in_class_name[2], 'self.stats_dict[ind_stats][3]/self.max_bio') + out_carto.append_scale(self.in_class_name[3], 'self.stats_dict[ind_stats][2]/self.max_wood_idm') + + out_carto.stats_dict = None + + # Rasterize RPG shapefile to complete the final shapefile + opt = {} + opt['Remove'] = 1 + rpg_tif = Vector(self.sample_name[0], self.path_area, **opt) + + rpg_tif.clip_vector(os.path.dirname(self.sample_name[0])) + rpg_tif.vector_data() + + self.logger.debug("path_ortho : {0}".format(self.path_ortho)) + out_carto.stats_rpg_tif = out_carto.zonal_stats_pp(rpg_tif.layer_rasterization(self.path_ortho, 'CODE_GROUP')) + + # Final cartography + out_carto.create_cartography(self.out_fieldname_carto, self.out_fieldtype_carto) + out_carto = None + + def i_classifier_s(self): + """ + Interface function to launch decision tree classification with a input + segmentation :func:`Segmentation.Segmentation`. + + This function store optimal threshold by class **Segmentation.out_threshold**. + Then it computes zonal statistics by polygons for every images in multi-processing (if **mp** = 1). + """ + + # Multiprocessing + mgr = BaseManager() + mgr.register('defaultdict', defaultdict, DictProxy) + mgr.start() + multi_process_var = [] # Multi processing variable + + # Extract final cartography + out_carto = Segmentation(self.path_segm, self.path_area) + out_carto.output_file = self.output_name_moba + out_carto.out_class_name = self.in_class_name + + for ind_th in range(len(self.sample_name)): + out_carto.out_threshold.append(self.decis[ind_th].threshold[0]) + if '>' in self.decis[ind_th].threshold[0]: + out_carto.out_threshold.append(self.decis[ind_th].threshold[0].replace('>', '<=')) + elif '<' in self.decis[ind_th].threshold[0]: + out_carto.out_threshold.append(self.decis[ind_th].threshold[0].replace('<', '>=')) + # out_carto.zonal_stats((raster_path[ind_th], list_band_outraster[ind_th])) + + multi_process_var.append([self.raster_path[ind_th], self.list_band_outraster[ind_th]]) + + # Compute zonal stats on slope raster + multi_process_var.append([self.raster_path[ind_th+1], self.list_band_outraster[ind_th+1]]) + out_carto.out_threshold.append('<'+str(self.slope_degree)) # To agriculture + out_carto.out_threshold.append('>='+str(self.slope_degree)) # To scree + if self.path_mnt != '': + # Add class indexes + self.tree_direction[0].append(6) + self.tree_direction[0].append(7) + + # Compute zonal stats on Max NDVI raster + try: + # out_carto.zonal_stats((raster_path[ind_th+1], list_band_outraster[ind_th+1])) + multi_process_var.append([self.raster_path[ind_th+2], self.list_band_outraster[ind_th+2]]) + # Compute stats twice, because there is 3 classes and not 2 + # out_carto.zonal_stats((raster_path[ind_th+1], list_band_outraster[ind_th+1])) + multi_process_var.append([self.raster_path[ind_th+2], self.list_band_outraster[ind_th+2]]) + except: + self.logger.info('Not MNT on the 3rd step') + multi_process_var.append([self.raster_path[ind_th+1], self.list_band_outraster[ind_th+1]]) + multi_process_var.append([self.raster_path[ind_th+1], self.list_band_outraster[ind_th+1]]) + + # Compute zonal stats with multi processing + exist_stats = 1 # By default, the stats file exists already + file_stats = os.path.dirname(str(self.raster_path[0])) + '/Stats_raster_spectral_texture.stats' # Stats backup file + if not os.path.exists(file_stats): + exist_stats = 0 # The sats file doesn't exist + # Open a stats backup to avoid computing again (Gain of time) + f_out = open(file_stats, "wb") + + p = [] + kwargs = {} + X_out_rf = [] # Variable list to compute decision tree with random forest method + if exist_stats == 0: + out_carto.stats_dict = mgr.defaultdict(list) + for i in range(len(multi_process_var)): + kwargs['rank'] = i + kwargs['nb_img'] = len(multi_process_var) + p.append(Process(target=out_carto.zonal_stats, args=(multi_process_var[i], ), kwargs=kwargs)) + p[i].start() + + if self.mp == Constantes.MULTIPROCESSING_DISABLE: + p[i].join() + + if self.mp == Constantes.MULTIPROCESSING_ENABLE: + for i in range(len(multi_process_var)): + p[i].join() + + for key, value_seg in out_carto.stats_dict.items(): + + # true_value = [-10000 if (math.isnan(x) or math.isinf(x)) else x for x in value_seg] + true_value = [x for x in value_seg if (not math.isnan(x) and not math.isinf(x))] + # Print rasters stats value in the text file .lg + f_out.write(str(true_value) + '\n') + + # Close the output file + f_out.close() + + else: + # If the stats file exists already, open this file and append in the stats_dict variable + out_carto.stats_dict = defaultdict(list) + with open(file_stats, "r") as f_in: + index_in_stats=-1 + for x_in in f_in.readlines(): + index_in_stats = index_in_stats + 1 + out_carto.stats_dict[index_in_stats] = eval(x_in.strip('\n')) + X_out_rf.append(eval(x_in.strip('\n'))) + + # For the higher than level 1 + if len(self.sample_name) > 2: + # Compute the biomass and density distribution + out_carto.compute_biomass_density() + + out_carto.class_tab_final = defaultdict(list) + self.i_tree_direction() + out_carto.decision_tree(self.tree_direction) + + # If there is more one fieldnames line edit fulled in classification tab + if len(self.sample_name) > 2: + # Compute biomass and density scale + out_carto.append_scale(self.in_class_name[2], 'self.stats_dict[ind_stats][3]/self.max_bio') + out_carto.append_scale(self.in_class_name[3], 'self.stats_dict[ind_stats][2]/self.max_wood_idm') + + # Rasterize RPG shapefile to complete the final shapefile + opt = {} + opt['Remove'] = 1 + rpg_tif = Vector(self.sample_name[0], self.path_area, **opt) + rpg_tif.layer_rasterization(self.path_ortho, 'CODE_GROUP') + + # Final cartography + out_carto.mono_rpg_tif = "{0}.TIF".format(self.sample_name[0][:-4]) + out_carto.create_cartography(self.out_fieldname_carto, self.out_fieldtype_carto) + + def i_validate(self): + """ + Interface to validate a classification. It going to rasterize the validation shapefile and the + classification shapefile with :func:`layer_rasterization`. + Next, to compare pixel by pixel, the classification quality to built a confusion matrix in a csv file. + """ + + self.logger.info('Validation') + + # Variable to convert the input classname to an individual interger + # Only for the validate sample + class_validate = 0 + + complete_validate_shp = "{0}/validate.shp".format(os.path.dirname(self.valid_shp[0][0])) + + # TODO: Set this method in the Precision_moba class + + # Processing to rasterize the validate shapefile. 1) Merge sahpefiles 2) Rasterization + for val in self.valid_shp: + if class_validate != 2: + # Grassland to 1 + if (class_validate !=3 and len(self.out_fieldname_carto) != 4+2) or len(self.out_fieldname_carto) == 4+2: + # To the level 3 with woodeen to 4 and 5 + # + # Self.valid_shp is a list of list. In this variable there is : + # [Shapefile path, fieldname classes, classnames] + opt = {} + opt['Remove'] = 1 # To overwrite + + # Create a raster to valide the classification + # First time, create a new shapefile with a new field integer + sample_val = Sample(val[0], self.path_area, 1, **opt) + opt['add_fieldname'] = 1 + opt['fieldname'] = 'CLASS_CODE' + opt['class'] = str(class_validate) # Add integer classes + + # Set the new shapefile + val[0] = "{0}_.shp".format(val[0][:-4]) + val[1] = opt['fieldname'] + val[2] = opt['class'] + + sample_val.clip_vector(sample_val.vector_folder) + sample_val.vector_data() + + # Complete the new shapefile + sample_val.fill_sample(val[0], 0, **opt) + + # Second time, merge the validate shapefile + if class_validate == 0 : + process_tocall_merge = ['ogr2ogr', '-overwrite', complete_validate_shp, val[0]] + elif class_validate > 0 : + process_tocall_merge = ['ogr2ogr', '-update', '-append', complete_validate_shp, \ + val[0], '-nln', os.path.basename(str(complete_validate_shp[:-4]))] + + subprocess.call(process_tocall_merge) + + sample_val.logger.close() + + # Increment variable + class_validate = self.valid_shp.index(val) + 1 + + # Compute precision of the classification + valid = Precision_moba(self.path_area, self.path_folder_dpt) + valid.complete_validation_shp = complete_validate_shp + + valid.ex_raster = list(self.raster_path.items())[0][1]["PATH"] + + # TODO: Call the RasterSat_by_Date class here instead of the Precision_moba class + self.logger.debug("Name moba : {0}".format(self.output_name_moba)) + + valid.preprocess_to_raster_precision(self.output_name_moba, 'FBPHY_CODE') # To the classification's data + valid.preprocess_to_raster_precision(complete_validate_shp, val[1]) # To the validation's data + + # Compute precision on the output classification + valid.confus_matrix(valid.complete_img[0].raster_data(valid.img_pr[0])[0], valid.complete_img[1].raster_data(valid.img_pr[1])[0]) + + valid.logger.close() diff --git a/RasterSat_by_date.py b/RasterSat_by_date.py index a271068dcfc0a2da32936f11e5f422fd37f90e20..bb32a0364c51146a01d7965d337f7315fab46184 100644 --- a/RasterSat_by_date.py +++ b/RasterSat_by_date.py @@ -19,390 +19,291 @@ import os, sys import math, subprocess -try : - import gdal -except : - from osgeo import gdal +import osgeo.gdal +import otbApplication as otb + +import Outils +import Satellites import numpy as np -class RasterSat_by_date(): - """ - Satellite image processing's class. This class include several processes to group images by date, mosaic images by date, - extract images information, compute ndvi, compute cloud pourcent and create new rasters. - - :param class_archive: Archive class name with every information on downloaded images - :type class_archive: class - :param big_folder: Image processing folder - :type big_folder: str - :param one_date: [year, month, day] ... - This variable is modified in the function :func:`mosaic_by_date()`. - To append mosaic image path, mosaic cloud image path, cloud pixel value table, mosaic ndvi image path and ndvi pixel value table. - :type one_date: list of str - :param choice_nb_b: A option to choice output image number of band :func:`layer_rasterization` in Vector's class. If this option is 0, it take input band. By default 0. - :type choice_nb_b: int - - """ - def __init__(self, class_archive, big_folder, one_date): - """Create a new 'Landsat_by_date' instance - - """ - - self._class_archive = class_archive - self._big_folder = big_folder - self._one_date = one_date - # Verify list of list of str - if one_date == []: - print "Enter dates to mosaic images like [[str(year), str(month), str(day)], [str(year), str(month), str(day)], ...]" - sys.exit(1) - else: - self._one_date = one_date - - self.out_ds = None - self.choice_nb_b = 0 - - def group_by_date(self, d_uni): - """ - Function to extract images on a single date - - :param d_uni: [year, month, day] - :type d_uni: list of str - - :returns: list of str -- variable **group** = [year, month, day, multispectral image path, cloud image path] - """ - - # Group of images with the same date - group = [] - - # Take images with the same date - for d_dup in self._class_archive.list_img: - if d_dup[:3] == d_uni: - group.append(d_dup) - - return group - - def vrt_translate_gdal(self, vrt_translate, src_data, dst_data): - """ - Function to launch gdal tools in command line. With ``gdalbuildvrt`` and ``gdal_translate``. - This function is used :func:`mosaic_by_date` to mosaic image by date. - - :param vrt_translate: ``vrt`` or ``translate`` - :type vrt_translate: str - :param src_data: Data source. Several data for vrt process and one data (vrt data) for gdal_translate - :type src_data: list (process ``vrt``) or str (process ``translate``) - :param dst_data: Output path - :type dst_data: str - """ - - if os.path.exists(dst_data): - os.remove(dst_data) - - # Select process - if vrt_translate == 'vrt': - # Verify input data - if type(src_data) is not np.ndarray and type(src_data) is not list: - print 'VRT file ! The data source should be composed of several data. A list minimal of 2 dimensions' - sys.exit(1) - - print 'Build VRT file' - if not os.path.exists(dst_data): - process_tocall = ['gdalbuildvrt', '-srcnodata', '-10000', dst_data] - - # Copy rasters - for cp_image in src_data: - process_tocall.append(cp_image) - - elif vrt_translate == 'translate': - # Verify input data - try : - src_data = str(src_data) - except:# if type(src_data) is not str: - print 'Geotiff file ! The data source should be composed of path file. A character string !' - sys.exit(1) - - print 'Build Geotiff file' - if not os.path.exists(dst_data): - process_tocall = ['gdal_translate', '-a_nodata', '-10000', src_data, dst_data] - - # Launch vrt process - subprocess.call(process_tocall) - - def mosaic_by_date(self): - """ - Function to merge images of the same date in a image group :func:`group_by_date`. - """ - - # Create the processing images folder if not exists - if not os.path.exists(self._class_archive._folder + '/' + self._big_folder): - os.mkdir(self._class_archive._folder + '/' + self._big_folder) - - # Matrix multi images for a single date - group = self.group_by_date(self._one_date) # Every images [year, month, day, multispectral image, cloud image] - group_ = np.transpose(np.array(group)) # Transpose matrix to extract path of images - - # Create a folder with images year if it doesn't exist - index_repertory_img = self._class_archive._captor - if not os.path.exists(self._class_archive._folder + '/' + self._big_folder + '/' + index_repertory_img): - os.mkdir(self._class_archive._folder + '/' + self._big_folder + '/' + index_repertory_img) - - index_repertory_img = index_repertory_img + '/' - # Create a folder with images date if it doesn't exist - for d_ in self._one_date: - index_repertory_img = index_repertory_img + d_ - - if not os.path.exists(self._class_archive._folder + '/' + self._big_folder + '/' + index_repertory_img): - os.mkdir(self._class_archive._folder + '/' + self._big_folder + '/' + index_repertory_img) - - # Build VRT file with data images required - vrt_out = self._class_archive._folder + '/' + self._big_folder + '/' + index_repertory_img + '/' \ - + self._class_archive._captor + index_repertory_img.split("/")[1] + '.VRT' # Multispectral VRT outfile - if not os.path.exists(vrt_out): - self.vrt_translate_gdal('vrt', group_[3], vrt_out) - - vrtcloud_out = self._class_archive._folder + '/' + self._big_folder + '/' + index_repertory_img + '/' \ - + self._class_archive._captor + index_repertory_img.split("/")[1] + '_' + group_[4][0][-7:-4] + '.VRT' # Cloud TIF outfile - if not os.path.exists(vrtcloud_out): - self.vrt_translate_gdal('vrt', group_[4], vrtcloud_out) - - # Build Geotiff file with data images required - gtif_out = vrt_out[:-4] + '.TIF' # Multispectral VRT outfile - if not os.path.exists(gtif_out): - self.vrt_translate_gdal('translate', vrt_out, gtif_out) - self._one_date.append(gtif_out) - - gtifcloud_out = vrtcloud_out[:-4] + '.TIF' # Cloud TIF outfile - if not os.path.exists(gtifcloud_out): - self.vrt_translate_gdal('translate', vrtcloud_out, gtifcloud_out) - self._one_date.append(gtifcloud_out) - - def raster_data(self, img): - """ - Function to extract raster information. - Return table of pixel values and raster information like line number, pixel size, ... (gdal pointer) - - :param img: Raster path - :type img: str - - :returns: numpy.array -- variable **data**, Pixel value matrix of a raster. - - gdal pointer -- variable **_in_ds**, Raster information. - """ - - # Load Gdal's drivers - gdal.AllRegister() - - # Loading input raster - print 'Loading input raster :', os.path.split(str(img))[1][:-4] - in_ds = gdal.Open(str(img), gdal.GA_ReadOnly) - - # if it doesn't exist - if in_ds is None: - print('could not open ') - sys.exit(1) - - # Information on the input raster - if self.choice_nb_b == 0: - nbband = in_ds.RasterCount # Spectral band number - else: - nbband = self.choice_nb_b - rows = in_ds.RasterYSize # Rows number - cols = in_ds.RasterXSize # Columns number - - # Table's declaration - data = [] # np.float32([[0]*cols for i in xrange(rows)]) - for band in range(nbband): - - canal = in_ds.GetRasterBand(band + 1) # Select a band - if nbband == 1: - data = canal.ReadAsArray(0, 0, cols, rows).astype(np.float32) # Assign pixel values at the data - else: - data.append(canal.ReadAsArray(0, 0, cols, rows).astype(np.float32)) -# print('Copie des pixels du raster ! Bande :', (band + 1)) - - ################################### - # Close input raster - _in_ds = in_ds - in_ds = None - - return data, _in_ds - - def pourc_cloud(self, img_spec, img_cloud): - """ - Return clear pixel percentage on the image **img_spec** because of a cloud image **img_cloud**. - - :param img_spec: Spectral image path - :type img_spec: str - :param img_cloud: Cloud image path - :type img_cloud: str - - :returns: float -- variable **nb0**, clear pixel percentage. - :Example: - - >>> import RasterSat_by_date - >>> Landsat_test = RasterSat_by_date(class_archive, big_folder, one_date) - >>> nb0_test = Landsat_test.pourc_cloud(Landsat_test._one_date[3], Landsat_test._one_date[4]) - >>> nb0_test - 98 - """ - - # Extract raster's information - data_spec, info_spec = self.raster_data(img_spec) - data_cloud, info_cloud = self.raster_data(img_cloud) - self._one_date.append(data_cloud) # Add cloud pixel value table - - # Extent of the images - mask_spec = np.in1d(data_spec[0], [-10000, math.isnan], invert=True) # ex : array([ True, True, True, True, False, True, True, True, True], dtype=bool) -> False where there is -10000 ou NaN - - # Print area account of the pixel size 'info_spec.GetGeoTransform()' - print 'Area = ' + str(float((np.sum(mask_spec) * info_spec.GetGeoTransform()[1] * abs(info_spec.GetGeoTransform()[-1]) )/10000)) + 'ha' - - # Cloud mask - mask_cloud = np.in1d(data_cloud, 0) # This is the same opposite False where there is 0 - cloud = np.choose(mask_cloud, (False, mask_spec)) # If True in cloud mask, it take spectral image else False - dist = np.sum(cloud) # Sum of True. True is cloud - - # Computer cloud's percentage with dist (sum of cloud) by sum of the image's extent - try : - nb0 = float(dist)/(np.sum(mask_spec)) - print('For ' + os.path.split(str(img_spec))[1][:-4] + ', cloudy cover ' + str(100 - round(nb0*100, 2)) + "%") - except ZeroDivisionError: - nb0 = 0 - print("The raster isn\'t in the area !") - - return nb0 - - def calcul_ndvi(self, img_spec): - """ - Computer NDVI index for a Landsat image. - - NDVI = band4 - band3 / band4 + band3 with nb_captor = 0 - - or for Sentinel 2 image (2A) : NDVI = band3 - band2 / band3 + band2 with nb_captor = -1 - - :param img_spec: Spectral image path - :type img_spec: str - - """ - - # NDVI formula index for 2 captor (L8 or S2A Theia) - if self._class_archive._captor == 'SENTINEL2': - n_captor = -1 - else : - n_captor = 0 - - # Extract raster's information - data, in_ds = self.raster_data(img_spec) - - # Computer NDVI - mask = np.greater(data[0], -10000) - ndvi = np.choose(mask, (-10000, eval('(data[4+n_captor]-data[3+n_captor])') / eval('(data[4+n_captor]+data[3+n_captor])'))) # If True, -10000 (NaN) else compute mathematical operation - - # Outfile name - img_ndvi = img_spec[:-4] + '_ndvi.TIF' - self._one_date.append(img_ndvi) # Add ndvi image path - self._one_date.append(ndvi) # Add ndvi pixel value table - self.create_raster(img_ndvi, ndvi, in_ds) - - def create_raster(self, out_raster, data, in_ds): - """ - Create a raster empty with the input raster property - - :param out_raster: Output image path - :type out_raster: str - :param data: Pixel value matrix. Matrix size equal to that of a raster. - :type data: numpy.array - :param in_ds: Raster information - :type in_ds: gdal pointer - - :returns: gdal pointer -- variable **out_ds**, Raster out information. - - int -- variable **nbband**, Band number of the out layer. - - int -- variable **e**, Index to know if the raster exists. If it doesn't exists e = 0 else e = 1 (by default). - """ - -# if os.path.exists(str(out_raster)): -# os.remove(str(out_raster)) - e = 1 # Raster out exists by default - # Verify if the processing take input band or one spectral band - if data.ndim == 2 or self.choice_nb_b == 1: - nbband = 1 - else: - nbband = in_ds.RasterCount - - driver = gdal.GetDriverByName('GTiff') - if not os.path.exists(str(out_raster)): - e = 0 - # Create outfile - self.out_ds = driver.Create(str(out_raster), in_ds.RasterXSize, in_ds.RasterYSize, nbband, gdal.GDT_Float32) - if self.out_ds is None: - print 'Could not create ' + os.path.split(str(out_raster))[1] - sys.exit(1) - - # Get extent coordinates and raster resolution - transform = in_ds.GetGeoTransform() - # print transform - - minX = transform[0] - maxY = transform[3] - pixelWidth = transform[1] - pixelHeight = transform[5] - - geotransform = [minX, pixelWidth, 0, maxY, 0, pixelHeight] - - # Record projection - def_projection = in_ds.GetProjection() - - # Set the geo-traking and outfile projection - self.out_ds.SetGeoTransform(geotransform) - self.out_ds.SetProjection(def_projection) - - else: - - self.out_ds = gdal.Open(str(out_raster), gdal.GA_ReadOnly) - - return nbband, e - - def complete_raster(self, (nbband, e), data): - """ - This function complete the function above :func:`create_raster()`. It - fills the raster table and close the layer. - - :param out_ds: Raster out information - :type out_ds: gdal pointer - :param nbband: Band number of the out layer - :type nbband: int - :param e: Index to know if the raster existed. If it didn't exist e = 0. - :type e: int - :param data: Pixel value matrix. Matrix size equal to that of a raster. - :type data: numpy.array - """ - - # The e index to verify if the layer existed already because of the - # function :func:`create_raster()` - if e == 0 : - p = 0 # Increment for the number band - while p < nbband: - #Incrementation - p = p + 1 - - print "Copy on the band ", p - - # Loading spectral band of outfile - out_band = self.out_ds.GetRasterBand(p) - # write the data - if data.ndim == 2: - out_band.WriteArray(data, 0, 0) - else: - out_band.WriteArray(data[p-1], 0, 0) - - # Closing and statistics on output raster - out_band.FlushCache() - out_band.SetNoDataValue(-10000) - out_band.GetStatistics(-1, 1) - out_band = None - - # Close open data - self.out_ds = None - - \ No newline at end of file +class RasterSat_by_date(object): + """ + Satellite image processing's class. + This class include several processes to group images by date, mosaic images by date, + extract images information, compute ndvi, compute cloud pourcent and create new rasters. + + @param class_archive: Archive class name with every information on downloaded images + @type class_archive: class + + @param big_folder: Image processing folder + @type big_folder: str + + @param one_date: [year, month, day] ... + This variable is modified in the function :func:`mosaic_by_date()`. + To append mosaic image path, mosaic cloud image path, cloud pixel value table, + mosaic ndvi image path and ndvi pixel value table. + @type one_date: list of str + + @param choice_nb_b: A option to choice output image number of band : + func: `layer_rasterization` in Vector's class. + If this option is 0, it take input band. By default 0. + @type choice_nb_b: int + """ + def __init__(self, class_archive, big_folder): + """ + Create a new 'Landsat_by_date' instance + """ + + self.logger = Outils.Log("Log", "RasterSat_by_date") + + self._class_archive = class_archive + self._big_folder = big_folder + + self.out_ds = None + self.choice_nb_b = 0 + + def group_by_date(self, d_uni): + """ + Function to extract images on a single date + + @param d_uni: [year, month, day] + @type d_uni: list of str + + @returns: list of str -- variable **group** = [year, month, day, multispectral image path, cloud image path] + """ + + # Group of images with the same date + group = [] + + # Take images with the same date + + for d_dup in self._class_archive.list_img: + if d_dup[:3] == d_uni: + group.append(d_dup) + + return group + + def vrt_translate_gdal(self, vrt_translate, src_data, dst_data): + """ + Function to launch gdal tools in command line. With ``gdalbuildvrt`` and ``gdal_translate``. + This function is used :func:`mosaic_by_date` to mosaic image by date. + + @param vrt_translate: ``vrt`` or ``translate`` + @type vrt_translate: str + + @param src_data: Data source. Several data for vrt process and one data (vrt data) for gdal_translate + @type src_data: list (process ``vrt``) or str (process ``translate``) + + @param dst_data: Output path + @type dst_data: str + """ + + if os.path.exists(dst_data): + os.remove(dst_data) + + # Select process + if vrt_translate == 'vrt': + + # Verify input data + if type(src_data) is not np.ndarray and type(src_data) is not list: + self.logger.error('VRT file ! The data source should be composed of several data. A list minimal of 2 dimensions') + sys.exit(1) + + self.logger.info('Build VRT file') + if not os.path.exists(dst_data): + options = osgeo.gdal.BuildVRTOptions(srcNodata=-10000) + osgeo.gdal.BuildVRT(dst_data, src_data, options=options ) + + elif vrt_translate == 'translate': + # Verify input data + try : + src_data = str(src_data) + except: + self.logger.error('Geotiff file ! The data source should be composed of path file. A character string !') + sys.exit(1) + + self.logger.info('Build Geotiff file') + if not os.path.exists(dst_data): + options = osgeo.gdal.TranslateOptions(noData=-10000) + osgeo.gdal.Translate(dst_data, src_data, options=options) + + def mosaic_by_date(self, date): + """ + Function to merge images of the same date in a image group : func:`group_by_date`. + """ + + # Matrix multi images for a single date + group = self.group_by_date(date) # Every images [year, month, day, multispectral image, cloud image] + group_ = np.transpose(np.array(group)) # Transpose matrix to extract path of images + + # Create a folder with images year if it doesn't exist + mosaic_folder = "{0}/Mosaic".format(self._big_folder) + + if not os.path.exists(mosaic_folder): + os.mkdir(mosaic_folder) + + # Create a folder with images date if it doesn't exist + date_folder = "{0}/{1}".format(mosaic_folder, "".join(date)) + + if not os.path.exists(date_folder): + os.mkdir(date_folder) + + ############################# Build VRT file with data images required ############################# + + # Multispectral VRT outfile + vrt_out = "{0}/{1}{2}.VRT".format(date_folder,self._class_archive._captor,os.path.basename(date_folder)) + + if not os.path.exists(vrt_out): + self.vrt_translate_gdal('vrt', list(group_[3]), vrt_out) + + # Cloud VRT outfile + vrtcloud_out = "{0}/{1}{2}_NUA.VRT".format(date_folder,self._class_archive._captor,os.path.basename(date_folder)) + + if not os.path.exists(vrtcloud_out): + self.vrt_translate_gdal('vrt', list(group_[4]), vrtcloud_out) + + ########################### Build Geotiff file with data images required ########################### + + # Multispectral TIF outfile + gtif_out = "{0}.TIF".format(vrt_out[:-4]) + if not os.path.exists(gtif_out): + self.vrt_translate_gdal('translate', vrt_out, gtif_out) + + # Cloud TIF outfile + gtifcloud_out = "{0}.TIF".format(vrtcloud_out[:-4]) + if not os.path.exists(gtifcloud_out): + self.vrt_translate_gdal('translate', vrtcloud_out, gtifcloud_out) + + self.cloudiness_pourcentage = [gtif_out, gtifcloud_out] + + def raster_data(self, img): + """ + Function to extract raster information. + Return table of pixel values and raster information like + line number, pixel size, ... (gdal pointer) + + @param img : Raster path + @type img : str + + @returns : numpy.array -- variable **data**, Pixel value matrix of a raster. + + gdal pointer -- variable **_in_ds**, Raster information. + """ + + # Load Gdal's drivers + osgeo.gdal.AllRegister() + + self.logger.debug("Image : {0}".format(img)) + + # Loading input raster + self.logger.info('Loading input raster : {0}'.format(os.path.basename(img))) + in_ds = osgeo.gdal.Open(img, osgeo.gdal.GA_ReadOnly) + + # if it doesn't exist + if in_ds is None: + self.logger.error('Could not open ') + sys.exit(1) + + # Information on the input raster + if self.choice_nb_b == 0: + nbband = in_ds.RasterCount # Spectral band number + else: + nbband = self.choice_nb_b + + rows = in_ds.RasterYSize # Rows number + cols = in_ds.RasterXSize # Columns number + + # Table's declaration + data = [] + + for band in range(nbband): + + canal = in_ds.GetRasterBand(band + 1) # Select a band + + if nbband == 1: + # Assign pixel values at the data + data = canal.ReadAsArray(0, 0, cols, rows).astype(np.float16) + else: + data.append(canal.ReadAsArray(0, 0, cols, rows).astype(np.float16)) + + ################################### + + # Close input raster + _in_ds = in_ds + in_ds = None + + return data, _in_ds + + def pourc_cloud(self): + """ + Return clear pixel percentage on the image self.cloudiness_pourcentage[0] + because of a cloud image cloudiness_pourcentage[1]. + + :returns: float -- variable **nb0**, clear pixel percentage. + :Example: + + >>> import RasterSat_by_date + >>> Landsat_test = RasterSat_by_date(class_archive, big_folder, one_date) + >>> nb0_test = Landsat_test.pourc_cloud(Landsat_test._one_date[3], Landsat_test._one_date[4]) + >>> nb0_test + 98 + """ + + # Extract raster's information + data_spec, info_spec = self.raster_data(self.cloudiness_pourcentage[0]) + data_cloud, info_cloud = self.raster_data(self.cloudiness_pourcentage[1]) + + # Add cloud pixel value table + # self.cloudiness_pourcentage.append(data_cloud) + + # Extent of the images : + # ex : array([ True, True, True, True, False, True, True, True, True], dtype=bool) + # -> False where there is -10000 ou NaN + mask_spec = np.isin(data_spec[0], [-10000, math.isnan], invert=True) + + # Print area account of the pixel size 'info_spec.GetGeoTransform()' + area = float((np.sum(mask_spec) * info_spec.GetGeoTransform()[1] * abs(info_spec.GetGeoTransform()[-1]) )/10000) + self.logger.info("Area = {0} ha".format(area)) + + ############################## Cloud mask ############################## + + # This is the same opposite False where there is 0 + mask_cloud = np.isin(data_cloud, 0) + + # If True in cloud mask, it take spectral image else False + cloud = np.choose(mask_cloud, (False, mask_spec)) + + # Sum of True. True is cloud + dist = np.sum(cloud) + + # Computer cloud's percentage with dist (sum of cloud) by sum of the image's extent + nb0 = float(dist)/(np.sum(mask_spec)) if np.sum(mask_spec) != 0 else 0 + self.logger.info('For {0}, cloudy cover = {1}%'.format(os.path.basename(self.cloudiness_pourcentage[0]), 100 - round(nb0*100, 2))) + + return 1.0 - nb0 + + def calcul_ndvi(self): + """ + Function to compute NDVI index for a Landsat image with OTB BandMathX + - OTB help : + * il : Images list : data and cloud + * exp : Expression for ndvi : (PIR-R)/(PIR+R) + * out : Feature Output Image + """ + + canal_PIR = Satellites.SATELLITE[self._class_archive._captor]["PIR"] + canal_R = Satellites.SATELLITE[self._class_archive._captor]["R"] + + img_ndvi = "{0}_ndvi.TIF".format(self.cloudiness_pourcentage[0][:-4]) + + self.cloudiness_pourcentage.append(img_ndvi) # Add ndvi image path + + otb_MathBand = otb.Registry.CreateApplication("BandMathX") + otb_MathBand.SetParameterStringList("il", [self.cloudiness_pourcentage[0], self.cloudiness_pourcentage[1]]) + otb_MathBand.SetParameterString("exp",\ + "(im1b1 > -1 ? (im2b1 == 0 ? ndvi(im1b{1}, im1b{0}) : -1) : im1b1)"\ + .format(canal_PIR, canal_R)) + otb_MathBand.SetParameterString("out", img_ndvi) + + otb_MathBand.ExecuteAndWriteOutput() \ No newline at end of file diff --git a/Rpg.py b/Rpg.py index 580f1ec306249411b1f4e92ab1d3485111be6ffb..95b858ae280228656517cfba2a565be7bfb42b96 100644 --- a/Rpg.py +++ b/Rpg.py @@ -18,49 +18,64 @@ # along with PHYMOBAT 1.2. If not, see <http://www.gnu.org/licenses/>. import sys, os +import glob import numpy as np -from Vector import Vector +import Outils +import itertools + try : import ogr except : from osgeo import ogr + from collections import * +from Vector import Vector class Rpg(Vector): """ - Vector class inherits the super vector class properties. This class create a new RPG shapefile - with mono-crops. It needs a basic RPG shapefile and a basic RPG CSV file *(...-GROUPES-CULTURE...)* in :func:`mono_rpg`. - - :param vector_used: Input/Output shapefile to clip (path) - :type vector_used: str - :param vector_cut: Area shapefile (path) - :type vector_cut: str - :param rm_dupli: Rpg table with no duplicated crops group - :type rm_dupli: dict - :param head_in_read: List of rgp header - :type head_in_read: list of str - :param min_size: Minimum size to extract a rpg polygons - :type min_size: float + Vector class inherits the super vector class properties. + This class create a new RPG shapefile with mono-crops. + It needs a basic RPG shapefile and a basic RPG CSV file *(...-GROUPES-CULTURE...)* in :func:`mono_rpg`. + + @param vector_used: Input/Output shapefile to clip (path) + @type vector_used: str + + @param vector_cut: Area shapefile (path) + @type vector_cut: str + + @param rm_dupli: Rpg table with no duplicated crops group + @type rm_dupli: dict + + @param head_in_read: List of rgp header + @type head_in_read: list of str + + @param min_size: Minimum size to extract a rpg polygons + @type min_size: float """ def __init__(self, used, cut): - """Create a new 'Rpg' instance """ + Create a new 'Rpg' instance + """ + + self.logger = Outils.Log("Log", "Rpg") + Vector.__init__(self, used, cut) - + self.rm_dupli = defaultdict(list) self.head_in_read = [] self.min_size = 1 def create_new_rpg_files(self): """ - Function to create new rpg shapefile with **rm_dpli** variable. The output shapefile - will be create in the same folder than the input shapefile with prefix *MONO_*. - + Function to create new rpg shapefile with **rm_dpli** variable. The output shapefile + will be create in the same folder than the input shapefile with prefix *MONO_*. """ + ## The output shapefile if it exists - self.vector_used = os.path.split(self.vector_used)[0] + '/' + 'MONO_' + os.path.split(self.vector_used)[1].split('-')[2] + self.vector_used = "{0}/MONO_{1}".\ + format( os.path.dirname(self.vector_used), self.vector_name) if not os.path.exists(self.vector_used): @@ -69,41 +84,40 @@ class Rpg(Vector): # Projection # Import input shapefile projection srsObj = shp_ogr.GetSpatialRef() + # Conversion to syntax ESRI srsObj.MorphToESRI() # Create output file - out_ds = self.data_source.GetDriver().CreateDataSource(self.vector_used) - - if out_ds is None: - print('Could not create file') - sys.exit(1) + try: + out_ds = self.data_source.GetDriver().CreateDataSource(self.vector_used) + + # Specific output layer + out_layer = out_ds.CreateLayer(str(self.vector_used), srsObj, geom_type=ogr.wkbMultiPolygon) - # Specific output layer - out_layer = out_ds.CreateLayer(str(self.vector_used), srsObj, geom_type=ogr.wkbMultiPolygon) - - # Add existing fields - for i in range(0, len(self.head_in_read)): - fieldDefn = ogr.FieldDefn(self.head_in_read[i], ogr.OFTString) - out_layer.CreateField(fieldDefn) - - # Feature for the ouput shapefile - featureDefn = out_layer.GetLayerDefn() - - in_feature = shp_ogr.SetNextByIndex(0) # Polygons initialisation - in_feature = shp_ogr.GetNextFeature() - # Loop on input polygons to create a output polygons - while in_feature: + # Add existing fields + for i in range(0, len(self.head_in_read)): + fieldDefn = ogr.FieldDefn(self.head_in_read[i], ogr.OFTString) + out_layer.CreateField(fieldDefn) - id_rpg = str(in_feature.GetField(self.field_names[0])) - # Create a existing polygons in modified rpg list - # with minimum size greater than or equal to 1 ha - try: + # Feature for the ouput shapefile + featureDefn = out_layer.GetLayerDefn() + + in_feature = shp_ogr.SetNextByIndex(0) # Polygons initialisation + in_feature = shp_ogr.GetNextFeature() + + # Loop on input polygons to create a output polygons + while in_feature: + + id_rpg = str(in_feature.GetField(self.field_names[0])) + + # Create a existing polygons in modified rpg list + # with minimum size greater than or equal to 1 ha if self.rm_dupli[id_rpg] and float(self.rm_dupli[id_rpg][2].replace(',','.')) >= self.min_size: # Add .replace(',','.') if the input RPG contains comma instead of point - + geom = in_feature.GetGeometryRef() # Extract input geometry - + # Create a new polygon out_feature = ogr.Feature(featureDefn) @@ -118,31 +132,33 @@ class Rpg(Vector): # Destroy polygons out_feature.Destroy() in_feature.Destroy() - except: - pass + + # Next polygon + in_feature = shp_ogr.GetNextFeature() - # Next polygon - in_feature = shp_ogr.GetNextFeature() - - # Close data - out_ds.Destroy() - - def mono_rpg(self): - """ - Function to extract no duplicated crops. - + # Close data + out_ds.Destroy() + + except Exception as e: + self.logger.error('Error during creating file : {0}'.format(e)) + sys.exit(1) + + def mono_rpg(self, path_rpg): """ - + Function to extract no duplicated crops. + """ # Table from the RPG input shapefile name - file_tab = os.path.split(self.vector_used)[1].split('-')[len(os.path.split(self.vector_used)[1].split('-'))-1].split('_') - # Define the input csv file from RPG input shapefile - myfile = os.path.split(self.vector_used)[0] + '/' + file_tab[0] + '-' + file_tab[1] + '-GROUPES-CULTURE_' + file_tab[2] +\ - '_' + file_tab[3][:-3] + 'csv' - my_file = open(myfile, "r") + file_tab = os.path.split(path_rpg)[1].split('-')[len(os.path.split(path_rpg)[1].split('-'))-1].split('_') + # Define the input csv file from RPG input shapefile + myfile = "{0}/{1}-{2}-GROUPES-CULTURE_{3}_{4}.csv"\ + .format(os.path.dirname(path_rpg), file_tab[0], file_tab[1], file_tab[2], file_tab[3][:-4]) + in_read = [] - for l in my_file.readlines(): - in_read.append(l.split("\n")[0].split(";")) + + with open(myfile, 'r') as my_file : + for l in my_file.readlines(): + in_read.append(l.split("\n")[0].split(";")) # Fields name for y in in_read[0]: @@ -150,11 +166,8 @@ class Rpg(Vector): self.head_in_read.append(y) else: self.head_in_read.append(y[:10]) - body_in_read = map(list, zip(*in_read[1:])) # Transpose table [[e,e,e],[a,a,a]] -> [[e,a],[e,a],[e,a]] - -# self.rm_dupli = [[x, body_in_read[1][body_in_read[0].index(x)], body_in_read[2][body_in_read[0].index(x)]] \ -# for x in body_in_read[0] if body_in_read[0].count(x) == 1] + + body_in_read = list(map(list, zip(*in_read[1:]))) # Transpose table [[e,e,e],[a,a,a]] -> [[e,a],[e,a],[e,a]] for x in body_in_read[0]: if body_in_read[0].count(x) == 1: self.rm_dupli[x] = [x, body_in_read[1][body_in_read[0].index(x)], body_in_read[2][body_in_read[0].index(x)]] - \ No newline at end of file diff --git a/Sample.py b/Sample.py index 9b5409dad2722a4258e6d89ae4380c50de41a3c3..0c2ce2bf86c047eacc04540d0b664a8d2db85385 100644 --- a/Sample.py +++ b/Sample.py @@ -3,214 +3,246 @@ # # This file is part of PHYMOBAT 1.2. # Copyright 2016 Sylvio Laventure (IRSTEA - UMR TETIS) -# +# # PHYMOBAT 1.2 is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # PHYMOBAT 1.2 is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with PHYMOBAT 1.2. If not, see <http://www.gnu.org/licenses/>. import sys, os import random import numpy as np + from Vector import Vector +import Outils + try : - import ogr + import ogr except : - from osgeo import ogr + from osgeo import ogr class Sample(Vector): - - """ - Vector class inherits the super vector class properties. This class create training sample. - - :param vector_used: Input/Output shapefile to clip (path) - :type vector_used: str - :param vector_cut: Area shapefile (path) - :type vector_cut: str - :param nb_sample: Number of polygons for every sample - :type nb_sample: int - :param vector_val: Output shapefile to validate the futur classification - :type vector_val: str - - :opt: Refer to the Vector class - """ - - def __init__(self, used, cut, nb_sample, **opt): - """Create a new 'Sample' instance - - """ - Vector.__init__(self, used, cut, **opt) - - self._nb_sample = nb_sample - self.vector_val = '' - - def create_sample(self, **kwargs): - """ - Function to create a sample shapefile of a specific class - - :kwargs: **fieldname** (list of str) - Fieldname in the input shapefile (if the user want select polygons of the class names specific) - - **class** (list of str) - class names in the input shapefile (with fieldname index). - Can use one or several classes like this --> example : [classname1, classname2, ...] - """ - - kw_field = kwargs['fieldname'] if kwargs.get('fieldname') else '' - kw_classes = kwargs['class'] if kwargs.get('class') else '' - - # If the users want select polygons with a certain class name - if kw_field and kw_classes: - # The random sample with class name selected only - random_sample = np.array(random.sample(self.select_random_sample(kw_field, kw_classes), int(self._nb_sample))) - else: - # The random sample without class name selected - random_sample = np.array(random.sample(range(self.data_source.GetLayer().GetFeatureCount()), self._nb_sample)) - - # Output shapefile of the sample's polygons (path) - self.vector_used = self.vector_used[:-4] + '_' + kw_classes.replace(',','').replace(' ','') + 'rd.shp' - # Fill and create the sample shapefile - self.fill_sample(self.vector_used, random_sample[:len(random_sample)/2]) - # Output shapefile of the validate polygon (path) - self.vector_val = self.vector_used[:-6] + 'val.shp' - # Fill and create the validate polygons shapefile - self.fill_sample(self.vector_val, random_sample[len(random_sample)/2:]) - - def select_random_sample(self, kw_field, kw_classes): - """ - Function to select id with class name specific only. This function is used in :func:`create_sample` - - :param kw_field: Field name in the input shapefile - :type kw_field: str - :param kw_classes: Class names in the input shapefile like this --> 'classname1, classname2' - :type kw_classes: str - :returns: list -- variable **select_id**, List of id with a class name specific. - """ - - # Convert string in a list. For that, it remove - # space and clip this string with comma (Add everywhere if the script modified - # because the process work with a input string chain) - kw_classes = kw_classes.replace(' ','').split(',') - - # List of class name id - select_id = [] - - shp_ogr = self.data_source.GetLayer() - - # Loop on input polygons - in_feature = shp_ogr.SetNextByIndex(0) # Initialization - in_feature = shp_ogr.GetNextFeature() - while in_feature: - - # if polygon is a defined class name - ## .replace('0','') to remove '0' in front of for example '1' (RPG -> '01') - table_name_class = in_feature.GetField(self.field_names[self.field_names.index(kw_field)]) - # To avoid that the process crashed this part of the algorithm will be launch if the field is contains characters - if table_name_class != None : - if in_feature.GetField(self.field_names[self.field_names.index(kw_field)]).replace('0','') in kw_classes: - - # Add id in the extract list - select_id.append(in_feature.GetFID()) - - in_feature.Destroy() - - in_feature = shp_ogr.GetNextFeature() - return select_id - - def fill_sample(self, output_sample, polygon, **opt): - - """ - Function to fill and create the output sample shapefile. This function is used in :func:`create_sample` - to create samples polygons and validated polygons (to the take out the precision of the classification) - - :param output_sample: Path of the output shapefile - :type output_sample: str - :param polygon: Identity of the selected random polygons. If this variable = 0, the processing will take all polygons - :type polygon: list or int - - :opt: **add_fieldname** (int) - Variable to kown if add a field. By default non (0), if it have to add (1) - - **fieldname** (str) - Fieldname to add in the input shapefile - - **class** (int) - class names in integer to add in the input shapefile - """ - - # In option to add a integer field - add_field = opt['add_fieldname'] if opt.get('add_fieldname') else 0 - opt_field = opt['fieldname'] if opt.get('fieldname') else '' - opt_class = opt['class'] if opt.get('class') else 0 - - shp_ogr = self.data_source.GetLayer() - - # To take all polygon - if type(polygon) == int: - polygon = range(shp_ogr.GetFeatureCount()) - - # Projection - # Import input shapefile projection - srsObj = shp_ogr.GetSpatialRef() - # Conversion to syntax ESRI - srsObj.MorphToESRI() - - ## Remove the output shapefile if it exists - if os.path.exists(output_sample): - self.data_source.GetDriver().DeleteDataSource(output_sample) - out_ds = self.data_source.GetDriver().CreateDataSource(output_sample) - - if out_ds is None: - print('Could not create file') - sys.exit(1) - - # Specific output layer - out_layer = out_ds.CreateLayer(str(output_sample), srsObj, geom_type=ogr.wkbMultiPolygon) - - # Add existing fields - for i in range(0, len(self.field_names)): - # use the input FieldDefn to add a field to the output - fieldDefn = shp_ogr.GetFeature(0).GetFieldDefnRef(self.field_names[i]) - out_layer.CreateField(fieldDefn) - - # In Option : Add a integer field - if add_field == 1: - new_field = ogr.FieldDefn(opt_field, 0) - out_layer.CreateField(new_field) - - # Feature for the ouput shapefile - featureDefn = out_layer.GetLayerDefn() - - # Loop on the input elements - # Create a existing polygons in random list - for cnt in polygon: - - # Select input polygon by id - in_feature = shp_ogr.SetNextByIndex(cnt) - in_feature = shp_ogr.GetNextFeature() - - geom = in_feature.GetGeometryRef() # Extract input geometry - - # Create a new polygon - out_feature = ogr.Feature(featureDefn) - - # Set the polygon geometry and attribute - out_feature.SetGeometry(geom) - for i in range(0, len(self.field_names)): - out_feature.SetField(self.field_names[i], in_feature.GetField(self.field_names[i])) - # In Option : Add a integer field - if add_field == 1: - out_feature.SetField(opt_field, opt_class[0]) - - # Append polygon to the output shapefile - out_layer.CreateFeature(out_feature) - - # Destroy polygons - out_feature.Destroy() - in_feature.Destroy() - - # Close data - out_ds.Destroy() \ No newline at end of file + """ + Vector class inherits the super vector class properties. + This class create training sample. + + @param vector_used: Input/Output shapefile to clip (path) + @type vector_used: str + + @param vector_cut: Area shapefile (path) + @type vector_cut: str + + @param nb_sample: Number of polygons for every sample + @type nb_sample: int + + @param vector_val: Output shapefile to validate the futur classification + @type vector_val: str + + @opt: Refer to the Vector class + """ + + def __init__(self, used, cut, nb_sample, **opt): + """ + Create a new 'Sample' instance + """ + + self.logger = Outils.Log('Log', 'Sample') + + Vector.__init__(self, used, cut, **opt) + + self._nb_sample = nb_sample + self.vector_val = '' + + def create_sample(self, **kwargs): + """ + Function to create a sample shapefile of a specific class + + :kwargs: **fieldname** (list of str) - Fieldname in the input shapefile (if the user want select polygons of the class names specific) + + **class** (list of str) - class names in the input shapefile (with fieldname index). + Can use one or several classes like this --> example : [classname1, classname2, ...] + """ + + kw_field = kwargs['fieldname'] if kwargs.get('fieldname') else '' + kw_classes = kwargs['class'] if kwargs.get('class') else '' + + self.logger.debug("kw_field : {0}".format(kw_field)) + self.logger.debug("kw_classes : {0}".format(kw_classes)) + + self.output_folder = "{0}/{1}".format(self.output_folder, os.path.basename(os.path.dirname(self.vector_used))) + + if not os.path.exists(self.output_folder) : + os.mkdir(self.output_folder) + + # If the users want select polygons with a certain class name + if kw_field and kw_classes: + # The random sample with class name selected only + random_sample = np.array(random.sample(self.select_random_sample(kw_field, kw_classes), int(self._nb_sample))) + else: + # The random sample without class name selected + random_sample = np.array(random.sample(range(self.data_source.GetLayer().GetFeatureCount()), self._nb_sample)) + + self.logger.debug("random_sample : {0}".format(random_sample)) + + # Output shapefile of the sample's polygons (path) + # self.vector_used = "{0}_{1}_rd.shp".format(self.vector_used[:-4], kw_classes.replace(',','').replace(' ','')) + self.vector_used = "{0}/{1}_{2}_rd.shp".format(self.output_folder, os.path.basename(self.vector_used)[:-4],kw_classes.replace(',','').replace(' ','')) + + self.logger.debug("vector_used : {0}".format(self.vector_used)) + + self.logger.debug("Fill sample : {0} - {1}".format(self.vector_used, random_sample[:round(len(random_sample)/2)])) + + # Fill and create the sample shapefile + self.fill_sample(self.vector_used, random_sample[:round(len(random_sample)/2)]) + + # Output shapefile of the validate polygon (path) + self.vector_val = "{0}val.shp".format(self.vector_used[:-6]) + + # Fill and create the validate polygons shapefile + self.fill_sample(self.vector_val, random_sample[round(len(random_sample)/2):]) + + def select_random_sample(self, kw_field, kw_classes): + """ + Function to select id with class name specific only. + This function is used in :func:`create_sample` + + @param kw_field: Field name in the input shapefile + @type kw_field: str + + @param kw_classes: Class names in the input shapefile like this --> 'classname1, classname2' + @type kw_classes: str + + @returns: list -- variable **select_id**, List of id with a class name specific. + """ + + # Convert string in a list. For that, it remove + # space and clip this string with comma (Add everywhere if the script modified + # because the process work with a input string chain) + kw_classes = kw_classes.replace(' ','').split(',') + + # List of class name id + select_id = [] + + layer = self.data_source.GetLayer() + + assert layer.GetFeatureCount() != 0, "Le shapefile : {0} est vide.".format(self.data_source.GetLayer().GetName()) + + for i in range(layer.GetFeatureCount()) : + feature = layer.GetFeature(i) + + if feature.GetFieldIndex(self.field_names[self.field_names.index(kw_field)]) != -1 \ + and not feature.GetField(self.field_names[self.field_names.index(kw_field)]) is None : + if feature.GetField(self.field_names[self.field_names.index(kw_field)]).replace('0','') in kw_classes : + select_id.append(i) + + assert len(select_id) > 0, "Aucun polygone ne correspond." + + return select_id + + def fill_sample(self, output_sample, polygon, **opt): + """ + Function to fill and create the output sample shapefile. + This function is used in :func:`create_sample` to create samples polygons + and validated polygons (to the take out the precision of the classification). + + @param output_sample: Path of the output shapefile + @type output_sample: str + + @param polygon: Identity of the selected random polygons. + If this variable = 0, the processing will take all polygons + @type polygon: list or int + + @opt: **add_fieldname** (int) - Variable to kown if add a field. By default non (0), if it have to add (1) + + **fieldname** (str) - Fieldname to add in the input shapefile + + **class** (int) - class names in integer to add in the input shapefile + """ + + # In option to add a integer field + add_field = opt['add_fieldname'] if opt.get('add_fieldname') else 0 + opt_field = opt['fieldname'] if opt.get('fieldname') else '' + opt_class = opt['class'] if opt.get('class') else 0 + + shp_ogr = self.data_source.GetLayer() + + # To take all polygon + if type(polygon) == int: + polygon = range(shp_ogr.GetFeatureCount()) + + # Projection + # Import input shapefile projection + srsObj = shp_ogr.GetSpatialRef() + # Conversion to syntax ESRI + srsObj.MorphToESRI() + + ## Remove the output shapefile if it exists + if os.path.exists(output_sample): + self.data_source.GetDriver().DeleteDataSource(output_sample) + + out_ds = self.data_source.GetDriver().CreateDataSource(output_sample) + + if out_ds is None: + self.logger.error('Could not create file') + sys.exit(1) + + # Specific output layer + out_layer = out_ds.CreateLayer(output_sample, srsObj, geom_type=ogr.wkbMultiPolygon) + + # Add existing fields + for i in range(0, len(self.field_names)): + # use the input FieldDefn to add a field to the output + fieldDefn = shp_ogr.GetFeature(0).GetFieldDefnRef(self.field_names[i]) + out_layer.CreateField(fieldDefn) + + # In Option : Add a integer field + if add_field == 1: + new_field = ogr.FieldDefn(opt_field, 0) + out_layer.CreateField(new_field) + + # Feature for the ouput shapefile + featureDefn = out_layer.GetLayerDefn() + + # Loop on the input elements + # Create a existing polygons in random list + for cnt in polygon: + + # Select input polygon by id + in_feature = shp_ogr.SetNextByIndex(cnt) + in_feature = shp_ogr.GetNextFeature() + + # Extract input geometry + geom = in_feature.GetGeometryRef() + + # Create a new polygon + out_feature = ogr.Feature(featureDefn) + + # Set the polygon geometry and attribute + out_feature.SetGeometry(geom) + for i in range(0, len(self.field_names)): + out_feature.SetField(self.field_names[i],\ + float("%.5f" % in_feature.GetField(self.field_names[i])) \ + if type(in_feature.GetField(self.field_names[i])) is float \ + else in_feature.GetField(self.field_names[i])) + + # In Option : Add a integer field + if add_field == 1: + out_feature.SetField(opt_field, opt_class[0]) + + # Append polygon to the output shapefile + out_layer.CreateFeature(out_feature) + + # Destroy polygons + out_feature.Destroy() + in_feature.Destroy() + + # Close data + out_ds.Destroy() diff --git a/Satellites.py b/Satellites.py new file mode 100644 index 0000000000000000000000000000000000000000..ecb33f425b117f84c9a3ec0dc9107e9dce43ca22 --- /dev/null +++ b/Satellites.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import collections + +SATELLITE = collections.defaultdict(dict) + + # Info from Theia-land website or Olivier Hagolle blog + +########################## SENTINEL2 ############################### + +SATELLITE["SENTINEL2"]["server"] = "https://theia.cnes.fr/atdistrib" +SATELLITE["SENTINEL2"]["resto"] = "resto2" +SATELLITE["SENTINEL2"]["token_type"] = "text" +SATELLITE["SENTINEL2"]["R"] = 2 +SATELLITE["SENTINEL2"]["PIR"] = 3 + +########################## LANDSAT ################################# + +SATELLITE["Landsat"]["server"] = "https://theia-landsat.cnes.fr" +SATELLITE["Landsat"]["resto"] = "resto" +SATELLITE["Landsat"]["token_type"] = "json" +SATELLITE["Landsat"]["R"] = 3 +SATELLITE["Landsat"]["PIR"] = 4 + + + + diff --git a/Seath.py b/Seath.py index 9cbe0e1d33190912f259af9fa3a8fbaf16e9f05a..fccf80552b7811a0c1f15429ebc91f88acade9f7 100644 --- a/Seath.py +++ b/Seath.py @@ -18,6 +18,7 @@ # along with PHYMOBAT 2.0. If not, see <http://www.gnu.org/licenses/>. import numpy, math, sys +import Outils import numpy as np # sort, ... from collections import * # defaultdict @@ -57,6 +58,8 @@ class Seath(): self.value_1 = [] self.value_2 = [] + + self.logger = Outils.Log("Log", 'Seath') self.threshold = [] self.J = [] @@ -100,8 +103,8 @@ class Seath(): v[mark].append(np.var(C[mark])) p[mark].append(1 / float(len(C[mark]))) - print "m : ", m - print "v : ", v + self.logger.info("m : ", m) + self.logger.info("v : ", v) # Mean, standard deviation and likelihood initialisation phase for 2 classes m1 = m[0] @@ -126,12 +129,12 @@ class Seath(): # Optimal threshold # Logical condition depending on article figure 2 if ( seuil1[i] > m2[i] and seuil1[i] < m1[i] ) or ( seuil1[i] > m1[i] and seuil1[i] < m2[i] ) : - print "Valid threshold !" + self.logger.info("Valid threshold !") else: seuil1[i] = "" if ( seuil2[i] > m2[i] and seuil2[i] < m1[i] ) or ( seuil2[i] > m1[i] and seuil2[i] < m2[i] ) : - print "Valid threshold !" + self.logger.info("Valid threshold !") else: seuil2[i] = "" @@ -143,20 +146,19 @@ class Seath(): elif ( seuil1[i] == "" and seuil2[i] != "" ): seuil.append(seuil2[i]) - print("Bhattacharyya distance ", B) - print("J : ", self.J) - print("Threshold 1 : ", seuil1) - print("Threshold 2 : ", seuil2) - print("Optimal threshold :", seuil) + self.logger.info("Bhattacharyya distance ", B) + self.logger.info("J : ", self.J) + self.logger.info("Threshold 1 : ", seuil1) + self.logger.info("Threshold 2 : ", seuil2) + self.logger.info("Optimal threshold :", seuil) for i in range(len(seuil)): if seuil[i] != "" and m1[i] > m2[i]: - print('For ' + ind + ', the class 1 > ' + str(seuil[i])) + self.logger.info('For ' + ind + ', the class 1 > ' + str(seuil[i])) self.threshold.append('>' + str(seuil[i])) elif seuil[i] != "" and m1[i] < m2[i]: - print('For ' + ind + ', the class 1 < ' + str(seuil[i])) + self.logger.info('For ' + ind + ', the class 1 < ' + str(seuil[i])) self.threshold.append('<' + str(seuil[i])) else: - print('For ' + ind + ', not discrimination !') + self.logger.error('For ' + ind + ', not discrimination !') sys.exit(1) -# self.threshold.append('') \ No newline at end of file diff --git a/Segmentation.py b/Segmentation.py index 7e53b0768afaafcfaee54ecae1b6ceb836ceed10..40ea191dfdd1c565055eef5607e11f57b45defd1 100644 --- a/Segmentation.py +++ b/Segmentation.py @@ -1,337 +1,353 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # This file is part of PHYMOBAT 1.2. # Copyright 2016 Sylvio Laventure (IRSTEA - UMR TETIS) -# +# # PHYMOBAT 1.2 is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # PHYMOBAT 1.2 is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with PHYMOBAT 1.2. If not, see <http://www.gnu.org/licenses/>. import sys, os, math import numpy as np from Vector import Vector +import Outils + try : - import ogr, gdal + import ogr, gdal except : - from osgeo import ogr, gdal + from osgeo import ogr, gdal + from collections import * class Segmentation(Vector): - - """ - Vector class inherits the super vector class properties. This class create the final shapefile : Cartography - on a input segmentation by decision tree. - - The output classname are (**out_class_name** variable): - - Vegetation non naturelle - - Vegetation semi-naturelle - - Herbacees - - Ligneux - - Ligneux mixtes - - Ligneux denses - - Forte phytomasse - - Moyenne phytomasse - - Faible phytomasse - - :param vector_used: Input/Output shapefile to clip (path) - :type vector_used: str - :param vector_cut: Area shapefile (path) - :type vector_cut: str - :param output_file: Output shapefile cartography. This path is the same than the segmentation path. - :type output_file: str - :param out_class_name: List of output class name - :type out_class_name: list of str - :param out_threshold: List of output threshold - :type out_threshold: list of str - :param max_...: Biomass and density (IDM, SFS index) maximum - :type max_...: float - :param class_tab_final: Final decision tree table - :type class_tab_final: dict - :param stats_rpg_tif: Dictionnary with pxl percent in every polygon of class RPG. Mainly 'Maj_count' (Majority Value) and 'Maj_count_perc' (Majority Percent) - :type stats_rpg_tif: dict - """ - - def __init__(self, used, cut): - """Create a new 'Clustering' instance - - """ - Vector.__init__(self, used, cut) - - self.stats_rpg_tif = {} - self.output_file = 'Final_classification.shp' - - self.out_class_name = [] - self.out_threshold = [] - - self.class_tab_final = defaultdict(list) - - self.max_wood_idm = 0 - self.max_wood_sfs = 0 - self.max_bio = 0 - - def create_cartography(self, out_fieldnames, out_fieldtype): - """ - Function to create a output shapefile. In this output file, - there is the final cartography. With output defined field names - and field type in the main process. - - :param out_fieldnames: List of output field names - :type out_fieldnames: list of str - :param out_fieldtype: List of outpu field type - :type out_fieldtype: list of str - """ - - shp_ogr_ds = self.data_source - shp_ogr = self.data_source.GetLayer() - - # Projection - # Import input shapefile projection - srsObj = shp_ogr.GetSpatialRef() - # Conversion to syntax ESRI - srsObj.MorphToESRI() - - ## Remove the output final shapefile if it exists - self.vector_used = self.output_file - if os.path.exists(self.vector_used): - self.data_source.GetDriver().DeleteDataSource(self.vector_used) - out_ds = self.data_source.GetDriver().CreateDataSource(self.vector_used) - - if out_ds is None: - print('Could not create file') - sys.exit(1) - - # Specific output layer - out_layer = out_ds.CreateLayer(str(self.vector_used), srsObj, geom_type=ogr.wkbMultiPolygon) - - # Add new fields - # To add RPG_CODE field - out_fieldnames.insert(2,'RPG_CODE') - out_fieldtype.insert(2,ogr.OFTInteger) - # To add the others - for i in range(0, len(out_fieldnames)): - fieldDefn = ogr.FieldDefn(str(out_fieldnames[i]), out_fieldtype[i]) - out_layer.CreateField(fieldDefn) - # Add 2 fields to convert class string in code to confusion matrix - fieldDefn = ogr.FieldDefn('FBPHY_CODE', ogr.OFTInteger) - out_layer.CreateField(fieldDefn) - out_fieldnames.append('FBPHY_CODE') - fieldDefn = ogr.FieldDefn('FBPHY_SUB', ogr.OFTInteger) - out_layer.CreateField(fieldDefn) - out_fieldnames.append('FBPHY_SUB') - - # Feature for the ouput shapefile - featureDefn = out_layer.GetLayerDefn() - - in_feature = shp_ogr.SetNextByIndex(0) # Polygons initialisation - in_feature = shp_ogr.GetNextFeature() - - # Loop on input polygons - while in_feature: - - geom = in_feature.GetGeometryRef() # Extract input geometry - - # Create a new polygon - out_feature = ogr.Feature(featureDefn) - - # Set the polygon geometry and attribute - out_feature.SetGeometry(geom) - # Set the existing ID - out_feature.SetField(out_fieldnames[0], in_feature.GetField(self.field_names[2])) - # Set the area - out_feature.SetField(out_fieldnames[1], geom.GetArea()/10000) - - # Set the RPG column - recouv_crops_RPG = 0 - pourc_inter = self.stats_rpg_tif[in_feature.GetFID()]['Maj_count_perc'] - if pourc_inter >= 85: - recouv_crops_RPG = self.stats_rpg_tif[in_feature.GetFID()]['Maj_count'] - - out_feature.SetField('RPG_CODE', int(recouv_crops_RPG)) - - # Set the others polygons fields with the decision tree dictionnary - for i in range(3, len(out_fieldnames)): - # If list stopped it on the second level, complete by empty case - if len(self.class_tab_final[in_feature.GetFID()]) < len(out_fieldnames)-3 and \ - self.class_tab_final[in_feature.GetFID()] != []: - self.class_tab_final[in_feature.GetFID()].insert(len(self.class_tab_final[in_feature.GetFID()])-3,'') # To 3rd level - self.class_tab_final[in_feature.GetFID()].insert(len(self.class_tab_final[in_feature.GetFID()])-3,0) # To degree - - try: - # To the confusion matrix, replace level ++ by level -- - if i == len(out_fieldnames)-1: - if self.class_tab_final[in_feature.GetFID()][i-3] == 6: - # Crops to artificial vegetation - self.class_tab_final[in_feature.GetFID()][i-4] = 0 -# if self.class_tab_final[in_feature.GetFID()][i-3] == 2: -# # Grassland to natural vegetation -# self.class_tab_final[in_feature.GetFID()][i-3] = 1 - if self.class_tab_final[in_feature.GetFID()][i-3] > 7: - # Phytomass to natural vegetation - self.class_tab_final[in_feature.GetFID()][i-4] = 1 - - out_feature.SetField(str(out_fieldnames[i]), self.class_tab_final[in_feature.GetFID()][i-3]) - except: -# pass - for i in range(3, len(out_fieldnames)-3): - out_feature.SetField(str(out_fieldnames[i]), 'Undefined') - out_feature.SetField('FBPHY_CODE', 255) - out_feature.SetField('FBPHY_SUB', 255) -# sys.exit(1) - # Append polygon to the output shapefile - out_layer.CreateFeature(out_feature) - - # Destroy polygons - out_feature.Destroy() - in_feature.Destroy() - - # Next polygon - in_feature = shp_ogr.GetNextFeature() - - # Close data - out_ds.Destroy() - - def decision_tree(self, combin_tree): - """ - Function to build the decision tree. Taking account output threshold and input - class name. - - :param combin_tree: Decision tree combination - :type combin_tree: list of number class name - - """ - - # Combination tree on a sentence. Every sentence will be in a table. - cond_tab = [] - for ct in combin_tree: - cond_a = '' # Condition Term - c = 0 - while c < len(ct): - # Loop on tree combinaison - if self.out_threshold[ct[c]] =='': - # For interval condition - cond_a = cond_a + 'self.stats_dict[ind_stats][' + str(ct[c]/2) + ']' +\ - self.out_threshold[ct[c]-1].replace('>', '<=') + \ - ' and self.stats_dict[ind_stats][' + str(ct[c]/2) + ']' +\ - self.out_threshold[ct[c]+1].replace('<', '>=') + ' and ' - else: - cond_a = cond_a + 'self.stats_dict[ind_stats][' + str(ct[c]/2) + ']' +\ - self.out_threshold[ct[c]] + ' and ' - c = c + 1 - cond_tab.append(cond_a[:-5]) # Remove the last 'and' - - # Loop on every value - for ind_stats in range(len(self.stats_dict)): - # Loop on decision tree combination. - for cond in cond_tab: - # Add class name in the output table - try: - if eval(cond): - self.class_tab_final[ind_stats] = [self.out_class_name[s] \ - for s in combin_tree[cond_tab.index(cond)]] + \ - [combin_tree[cond_tab.index(cond)][len(combin_tree[cond_tab.index(cond)])-1]] + \ - [combin_tree[cond_tab.index(cond)][len(combin_tree[cond_tab.index(cond)])-1]] - except NameError: - # If there is 'nan' in the table statistics - if eval(cond.replace('nan','-10000')):# If there is 'nan' in the table statistics - self.class_tab_final[ind_stats] = [self.out_class_name[s] \ - for s in combin_tree[cond_tab.index(cond)]] + \ - [combin_tree[cond_tab.index(cond)][len(combin_tree[cond_tab.index(cond)])-1]] + \ - [combin_tree[cond_tab.index(cond)][len(combin_tree[cond_tab.index(cond)])-1]] - - def compute_biomass_density(self, method='SEATH'): - """ - Function to compute the biomass and density distribution. - It returns threshold of biomass level. - - :param method: Classification method used. It can set 'SEATH' (by default) or 'RF' - :type method: str - """ - - if method == 'SEATH': - distri = [v[1:] for k, v in self.stats_dict.items() if eval('v[0]' + self.out_threshold[1])] - - distri_bio = [] - distri_den = [] - for b in distri: - if eval('b[0]' + self.out_threshold[2]) and b[len(b)-1] != float('inf') and b[len(b)-1] != float('nan') and b[len(b)-1] < 1: - distri_bio.append(b) - else: - distri_den.append(b) - elif method == 'RF': - distri = [v[1:] for k, v in self.stats_dict.items() if not self.out_threshold[k] in [0,6,7]] - - distri_bio = [] - distri_den = [] - for b in distri: - if self.out_threshold[distri.index(b)] in [1,2,8,9,10] and b[len(b)-1] != -10000 and b[len(b)-1] < 1: - distri_bio.append(b) - else: - distri_den.append(b) - - # Set this variable used normally to define threshold of the classification with SEATH method - self.out_threshold = [] - # Transpose table - t_distri_bio = list(map(list, zip(*distri_bio))) - t_distri_den = list(map(list, zip(*distri_den))) - - # Biomass threshold - stdmore = (np.mean(t_distri_bio[2]) + np.std(t_distri_bio[2]))/np.max(t_distri_bio[2]) - stdless = (np.mean(t_distri_bio[2]) - np.std(t_distri_bio[2]))/np.max(t_distri_bio[2]) - self.out_threshold.append('>'+str(stdmore)) - self.out_threshold.append('') - self.out_threshold.append('<'+str(stdless)) - - # Compute density and biomass maximum - self.max_wood_idm = np.max(t_distri_den[1]) - self.max_wood_sfs = np.max(t_distri_den[0]) - self.max_bio = np.max(t_distri_bio[2]) - - def append_scale(self, select_class, form): - """ - Function to complete the 'class_tab_final' list with density and biomass information. This list will be used to build - the final shapefile. - - :param select_class: Class name to add degree - :type select_class: str - :param form: Formula to add degree - :type form: str - - """ - - for ind_stats in range(len(self.stats_dict)): - # Only valid on the second level - try: - if self.class_tab_final[ind_stats][1] == select_class: - self.class_tab_final[ind_stats].insert(len(self.class_tab_final[ind_stats])-2,eval(form)) - # To add phytomasse - try : - if self.class_tab_final[ind_stats][self.class_tab_final[ind_stats].index(eval(form))-1] == '' and \ - self.class_tab_final[ind_stats][self.class_tab_final[ind_stats].index(eval(form))-2] != '': - # dict[][A.index(real_pourcent)-1] == '' and dict[][A.index(real_pourcent)-2] != '' - # Print phytomasse class in the tab because of self.in_class_name in the Processing class - if not eval(form + self.out_threshold[0]) and not eval(form + self.out_threshold[2]): - self.class_tab_final[ind_stats][self.class_tab_final[ind_stats].index(eval(form))-1] = self.out_class_name[9] - self.class_tab_final[ind_stats][len(self.class_tab_final[ind_stats])-1] = 9 - elif eval(form + self.out_threshold[0]): - self.class_tab_final[ind_stats][self.class_tab_final[ind_stats].index(eval(form))-1] = self.out_class_name[8] - self.class_tab_final[ind_stats][len(self.class_tab_final[ind_stats])-1] = 8 - elif eval(form + self.out_threshold[2]): - self.class_tab_final[ind_stats][self.class_tab_final[ind_stats].index(eval(form))-1] = self.out_class_name[10] - self.class_tab_final[ind_stats][len(self.class_tab_final[ind_stats])-1] = 10 - except ValueError: - pass - - except IndexError: - pass - - \ No newline at end of file + """ + Vector class inherits the super vector class properties. This class create the final shapefile : Cartography + on a input segmentation by decision tree. + + The output classname are (**out_class_name** variable): + - Vegetation non naturelle + - Vegetation semi-naturelle + - Herbacees + - Ligneux + - Ligneux mixtes + - Ligneux denses + - Forte phytomasse + - Moyenne phytomasse + - Faible phytomasse + + @param vector_used: Input/Output shapefile to clip (path) + @type vector_used: str + + @param vector_cut: Area shapefile (path) + @type vector_cut: str + + @param output_file: Output shapefile cartography. This path is the same than the segmentation path. + @type output_file: str + + @param out_class_name: List of output class name + @type out_class_name: list of str + + @param out_threshold: List of output threshold + @type out_threshold: list of str + + @param max_...: Biomass and density (IDM, SFS index) maximum + @type max_...: float + + @param class_tab_final: Final decision tree table + @type class_tab_final: dict + + @param stats_rpg_tif: Dictionnary with pxl percent in every polygon of class RPG. + Mainly 'Maj_count' (Majority Value) and 'Maj_count_perc' (Majority Percent) + @type stats_rpg_tif: dict + """ + + def __init__(self, used, cut): + """ + Create a new 'Clustering' instance + """ + + self.logger = Outils.Log("Log", "Segmentation") + + Vector.__init__(self, used, cut) + + self.stats_rpg_tif = {} + self.output_file = 'Final_classification.shp' + + self.out_class_name = [] + self.out_threshold = dict() + + self.class_tab_final = defaultdict(list) + + self.max_wood_idm = 0 + self.max_wood_sfs = 0 + self.max_bio = 0 + + def create_cartography(self, out_fieldnames, out_fieldtype): + """ + Function to create a output shapefile. In this output file, + there is the final cartography. With output defined field names + and field type in the main process. + + :param out_fieldnames: List of output field names + :type out_fieldnames: list of str + :param out_fieldtype: List of outpu field type + :type out_fieldtype: list of str + """ + + self.logger.debug("Create output shapefile : {0}".format(self.output_file)) + shp_ogr_ds = self.data_source + shp_ogr = self.data_source.GetLayer() + + # Projection + # Import input shapefile projection + srsObj = shp_ogr.GetSpatialRef() + # Conversion to syntax ESRI + srsObj.MorphToESRI() + + ## Remove the output final shapefile if it exists + self.vector_used = self.output_file + if os.path.exists(self.vector_used): + self.data_source.GetDriver().DeleteDataSource(self.vector_used) + + out_ds = self.data_source.GetDriver().CreateDataSource(self.vector_used) + + if out_ds is None: + self.logger.error('Could not create file') + sys.exit(1) + + # Specific output layer + out_layer = out_ds.CreateLayer(self.vector_used, srsObj, geom_type=ogr.wkbMultiPolygon) + + # Add new fields + # To add RPG_CODE field + out_fieldnames.insert(2,'RPG_CODE') + out_fieldtype.insert(2,ogr.OFTInteger) + # To add the others + for i in range(0, len(out_fieldnames)): + fieldDefn = ogr.FieldDefn(str(out_fieldnames[i]), out_fieldtype[i]) + out_layer.CreateField(fieldDefn) + + # Add 2 fields to convert class string in code to confusion matrix + fieldDefn = ogr.FieldDefn('FBPHY_CODE', ogr.OFTInteger) + out_layer.CreateField(fieldDefn) + out_fieldnames.append('FBPHY_CODE') + fieldDefn = ogr.FieldDefn('FBPHY_SUB', ogr.OFTInteger) + out_layer.CreateField(fieldDefn) + out_fieldnames.append('FBPHY_SUB') + + # Feature for the ouput shapefile + featureDefn = out_layer.GetLayerDefn() + + # Loop on input polygons + for idx in range(shp_ogr.GetFeatureCount()) : + + in_feature = shp_ogr.GetFeature(idx) + geom = in_feature.GetGeometryRef() # Extract input geometry + + # Create a new polygon + out_feature = ogr.Feature(featureDefn) + + # Set the polygon geometry and attribute + out_feature.SetGeometry(geom) + # Set the existing ID + out_feature.SetField(out_fieldnames[0], in_feature.GetField(self.field_names[2])) + # Set the area + out_feature.SetField(out_fieldnames[1], geom.GetArea()/10000) + # Set the RPG column + recouv_crops_RPG = 0 + pourc_inter = self.stats_rpg_tif[in_feature.GetFID()]['Maj_count_perc'] + + if pourc_inter >= 85: + recouv_crops_RPG = self.stats_rpg_tif[in_feature.GetFID()]['Maj_count'] + + out_feature.SetField('RPG_CODE', int(recouv_crops_RPG)) + + # Set the others polygons fields with the decision tree dictionnary + for i in range(3, len(out_fieldnames)): + + # If list stopped it on the second level, complete by empty case + if len(self.class_tab_final[in_feature.GetFID()]) < len(out_fieldnames)-3 and \ + self.class_tab_final[in_feature.GetFID()] != []: + self.class_tab_final[in_feature.GetFID()].insert(len(self.class_tab_final[in_feature.GetFID()])-3,'') # To 3rd level + self.class_tab_final[in_feature.GetFID()].insert(len(self.class_tab_final[in_feature.GetFID()])-3,0) # To degree + + try: + # To the confusion matrix, replace level ++ by level -- + if i == len(out_fieldnames)-1: + if self.class_tab_final[in_feature.GetFID()][i-3] == 6: + # Crops to artificial vegetation + self.class_tab_final[in_feature.GetFID()][i-4] = 0 + # if self.class_tab_final[in_feature.GetFID()][i-3] == 2: + # Grassland to natural vegetation + # self.class_tab_final[in_feature.GetFID()][i-3] = 1 + + if self.class_tab_final[in_feature.GetFID()][i-3] > 7: + # Phytomass to natural vegetation + self.class_tab_final[in_feature.GetFID()][i-4] = 1 + + out_feature.SetField(str(out_fieldnames[i]), self.class_tab_final[in_feature.GetFID()][i-3]) + except: + for i in range(3, len(out_fieldnames)-3): + out_feature.SetField(str(out_fieldnames[i]), 'Undefined') + + out_feature.SetField('FBPHY_CODE', 255) + out_feature.SetField('FBPHY_SUB', 255) + + # Append polygon to the output shapefile + out_layer.CreateFeature(out_feature) + + # Destroy polygons + out_feature.Destroy() + + # Close data + out_ds.Destroy() + + def decision_tree(self, combin_tree): + """ + Function to build the decision tree. Taking account output threshold and input + class name. + + @param combin_tree: Decision tree combination + @type combin_tree: list of number class name + """ + + # Combination tree on a sentence. Every sentence will be in a table. + cond_tab = [] + for ct in combin_tree: + cond_a = '' # Condition Term + c = 0 + while c < len(ct): + # Loop on tree combinaison + if self.out_threshold[ct[c]] == '' : + # For interval condition + cond_a = cond_a + 'self.stats_dict[ind_stats][' + str(ct[c]/2) + ']' +\ + self.out_threshold[ct[c]-1].replace('>', '<=') + \ + ' and self.stats_dict[ind_stats][' + str(ct[c]/2) + ']' +\ + self.out_threshold[ct[c]+1].replace('<', '>=') + ' and ' + else: + cond_a = cond_a + 'self.stats_dict[ind_stats][' + str(ct[c]/2) + ']' +\ + self.out_threshold[ct[c]] + ' and ' + c = c + 1 + cond_tab.append(cond_a[:-5]) # Remove the last 'and' + + # Loop on every value + for ind_stats in range(len(self.stats_dict)): + # Loop on decision tree combination. + for cond in cond_tab: + # Add class name in the output table + try: + if eval(cond): + self.class_tab_final[ind_stats] = [self.out_class_name[s] \ + for s in combin_tree[cond_tab.index(cond)]] + \ + [combin_tree[cond_tab.index(cond)][len(combin_tree[cond_tab.index(cond)])-1]] + \ + [combin_tree[cond_tab.index(cond)][len(combin_tree[cond_tab.index(cond)])-1]] + except NameError: + # If there is 'nan' in the table statistics + if eval(cond.replace('nan','-10000')):# If there is 'nan' in the table statistics + self.class_tab_final[ind_stats] = [self.out_class_name[s] \ + for s in combin_tree[cond_tab.index(cond)]] + \ + [combin_tree[cond_tab.index(cond)][len(combin_tree[cond_tab.index(cond)])-1]] + \ + [combin_tree[cond_tab.index(cond)][len(combin_tree[cond_tab.index(cond)])-1]] + + def compute_biomass_density(self, method='SEATH'): + """ + Function to compute the biomass and density distribution. + It returns threshold of biomass level. + + @param method: Classification method used. It can set 'SEATH' (by default) or 'RF' + @type method: str + """ + + if method == 'SEATH': + distri = [v[1:] for k, v in self.stats_dict.items() if eval('v[0]' + self.out_threshold[1])] + + distri_bio = [] + distri_den = [] + for b in distri: + if eval('b[0]' + self.out_threshold[2]) and b[len(b)-1] != float('inf') and b[len(b)-1] != float('nan') and b[len(b)-1] < 1: + distri_bio.append(b) + else: + distri_den.append(b) + + elif method == 'RF': + + distri = [v[1:] for k, v in self.stats_dict.items() if not self.out_threshold["PREDICTION"][k] in [0,6,7]] + + distri_bio = [] + distri_den = [] + + # for b in distri: + for idx, b in enumerate(distri): + if self.out_threshold["PREDICTION"][idx] in [1,2,8,9,10]\ + and b[-1] is not None and b[-1] != -10000 and b[-1] < 1: + distri_bio.append(b) + else: + distri_den.append(b) + + # Transpose table + t_distri_bio = list(map(list, zip(*distri_bio))) + t_distri_den = list(map(list, zip(*distri_den))) + + # Biomass threshold + stdmore = (np.mean(t_distri_bio[2]) + np.std(t_distri_bio[2])) / np.max(t_distri_bio[2]) + stdless = (np.mean(t_distri_bio[2]) - np.std(t_distri_bio[2])) / np.max(t_distri_bio[2]) + + self.out_threshold["STDMORE"] = stdmore + self.out_threshold["STDLESS"] = stdless + + # Compute density and biomass maximum + wood_sfs = np.array(t_distri_den[0], dtype=np.float64) + wood_idm = np.array(t_distri_den[1], dtype=np.float64) + max_bio = np.array(t_distri_den[2], dtype=np.float64) + + self.max_wood_sfs = np.nanmax(wood_sfs) + self.max_wood_idm = np.nanmax(wood_idm) + self.max_bio = np.nanmax(max_bio) + + def append_scale(self, select_class, form): + """ + Function to complete the 'class_tab_final' list with density and biomass information. + This list will be used to build the final shapefile. + + @param select_class: Class name to add degree + @type select_class: str + + @param form: Formula to add degree + @type form: str + """ + + for ind_stats in range(len(self.stats_dict)): + # Only valid on the second level + try: + if self.class_tab_final[ind_stats][1] == select_class and self.stats_dict[ind_stats][3] is not None: + self.class_tab_final[ind_stats].insert(len(self.class_tab_final[ind_stats])-2,eval(form)) + # To add phytomasse + try : + if self.class_tab_final[ind_stats][self.class_tab_final[ind_stats].index(eval(form))-1] == '' and \ + self.class_tab_final[ind_stats][self.class_tab_final[ind_stats].index(eval(form))-2] != '': + # Print phytomasse class in the tab because of self.in_class_name + # in the Processing class + if not eval("{0}>{1}".format(form, self.out_threshold["STDMORE"])) and not \ + eval("{0}<{1}".format(form, self.out_threshold["STDLESS"])): + self.class_tab_final[ind_stats][self.class_tab_final[ind_stats].index(eval(form))-1] = self.out_class_name[9] + self.class_tab_final[ind_stats][len(self.class_tab_final[ind_stats])-1] = 9 + elif eval("{0}>{1}".format(form, self.out_threshold["STDMORE"])): + self.class_tab_final[ind_stats][self.class_tab_final[ind_stats].index(eval(form))-1] = self.out_class_name[8] + self.class_tab_final[ind_stats][len(self.class_tab_final[ind_stats])-1] = 8 + elif eval("{0}<{1}".format(form, self.out_threshold["STDLESS"])): + self.class_tab_final[ind_stats][self.class_tab_final[ind_stats].index(eval(form))-1] = self.out_class_name[10] + self.class_tab_final[ind_stats][len(self.class_tab_final[ind_stats])-1] = 10 + except ValueError: + pass + except IndexError: + pass diff --git a/Slope.py b/Slope.py index b96bf47150a8d6ff3fafc08c0dab0836da1d64c7..2325ce77c3bb7877569dcfe5675eca805da3a912 100644 --- a/Slope.py +++ b/Slope.py @@ -19,6 +19,7 @@ import os import subprocess +import Outils class Slope(): @@ -39,6 +40,7 @@ class Slope(): self.mnt = mnt self.out_mnt = '' + self.logger.info('Log', "Slope") def extract_slope(self): @@ -50,6 +52,6 @@ class Slope(): # Launch gdaldem command line to have slope in degrees process_tocall = ['gdaldem', 'slope', self.mnt, self.out_mnt] - print(process_tocall) + self.logger.info(process_tocall) subprocess.call(process_tocall) diff --git a/Toolbox.py b/Toolbox.py index 703722d852b3ff90a25703d208833e576e844584..864953374a10f2b319c05100c5423b242b91652f 100644 --- a/Toolbox.py +++ b/Toolbox.py @@ -17,134 +17,132 @@ # You should have received a copy of the GNU General Public License # along with PHYMOBAT 1.2. If not, see <http://www.gnu.org/licenses/>. +from datetime import date + +import otbApplication as otb + import os, sys, subprocess, glob import numpy as np -from datetime import date import json +import osgeo.gdal +import Constantes +import Outils + +class Toolbox(object): + """ + Class used to grouped small tools to cut raster or compute statistics on a raster. + + :param imag: Input image (path) + :type imag: str + + :param vect: Extent shapefile (path) + :type vect: str + """ + + def __init__(self): + """ + Create a new 'Toolbox' instance + """ + self.image = None + self.vect = None + self.output = None + self.logger = Outils.Log("Log", "Toolbox") + + def clip_raster(self, **kwargs): + """ + Function to clip a raster with a vector. + The raster created will be in the same folder than the input raster. + With a prefix 'Clip_'. + + :kwargs: **rm_rast** (int) - 0 (by default) or 1. Variable to remove the output raster. 0 to keep and 1 to remove. + + :returns: str -- variable **outclip**, output raster clip (path). + """ + + rm_rast = kwargs['rm_rast'] if kwargs.get('rm_rast') else 0 + + if self.output is None : + outclip = "{0}/Clip_{1}".format(os.path.dirname(self.image), os.path.basename(self.image)) + else : + if not os.path.exists(os.path.dirname(self.output)) : + os.mkdir(os.path.dirname(self.output)) + + outclip = self.output + + options = osgeo.gdal.WarpOptions(dstNodata=-10000, cropToCutline=True,\ + cutlineDSName=self.vect,outputType=osgeo.gdal.GDT_Int16 , format='GTiff') + + if not os.path.exists(outclip) or rm_rast == 1: + self.logger.info("Raster clip of {0}".format(os.path.basename(self.image))) + osgeo.gdal.Warp(outclip, self.image, options=options) + + return outclip + + + def calc_serie_stats(self, table, stats_name, output_folder): + """ + Function to compute stats on temporal cloud and ndvi spectral table + Ndvi stats : min max + + @param table: Spectral data, cloud raster and ndvi raster + @type table: numpy.ndarray + + @returns: list of numpy.ndarray -- variable **account_stats**, list of temporal NDVI stats. + + numpy.ndarray -- variable **account_cloud**, pixel number clear on the area. + """ + + ind = ['min({0})', 'max({0})'] + no_data_value = [99999, -10000] + + stack_ndvi = list(table[5]) + + image = "im{0}b1" + + otb_MathBand = otb.Registry.CreateApplication("BandMathX") + otb_MathBand.SetParameterStringList("il", stack_ndvi) + + path_stats = [] + + for idx, i in enumerate(ind): + + expression = "({0} != {1} ? {0} : im1b1)".format(\ + i.format(",".join("({0}>-1000 ? {0} : {1})".format(\ + image.format(j+1), no_data_value[idx]) for j in range(len(stack_ndvi)))), no_data_value[idx]) + + out_ndvistats_raster = "{0}/{1}.TIF".format(output_folder, stats_name[idx]) + + path_stats.append(out_ndvistats_raster) + + otb_MathBand.SetParameterString("exp",expression) + otb_MathBand.SetParameterString("out", out_ndvistats_raster) + + otb_MathBand.SetParameterOutputImagePixelType("out", otb.ImagePixelType_float) + + otb_MathBand.ExecuteAndWriteOutput() + + return path_stats + + + def check_proj(self): + """ + Function to check if raster's projection is RFG93. + For the moment, PHYMOBAT works with one projection only Lambert 93 EPSG:2154 + """ + + # Projection for PHYMOBAT + + proj_phymobat = 'AUTHORITY["EPSG","{0}"]'.format(Constantes.EPSG_PHYMOBAT) -class Toolbox(): - """ - Class used to grouped small tools to cut raster or compute statistics on a raster. - - :param imag: Input image (path) - :type imag: str - :param vect: Extent shapefile (path) - :type vect: str - """ - - def __init__(self): - """ - Create a new 'Toolbox' instance - """ - - self.imag = '' - self.vect = '' - - def clip_raster(self, **kwargs): - """ - Function to clip a raster with a vector. The raster created will be in the same folder than the input raster. - With a prefix *Clip_*. - - :kwargs: **rm_rast** (int) - 0 (by default) or 1. Variable to remove the output raster. 0 to keep and 1 to remove. - - :returns: str -- variable **outclip**, output raster clip (path). - """ - - rm_rast = kwargs['rm_rast'] if kwargs.get('rm_rast') else 0 - outclip = os.path.split(str(self.imag))[0] + '/Clip_' + os.path.split(str(self.imag))[1] - if not os.path.exists(outclip) or rm_rast == 1: - print 'Raster clip of ' + os.path.split(str(self.imag))[1] - # Command to clip a raster with a shapefile by Gdal - process_tocall_clip = ['gdalwarp', '-overwrite', '-dstnodata', '-10000', '-q', '-cutline', self.vect, '-crop_to_cutline', '-of', 'GTiff', self.imag, outclip] - # This is a trick to remove warning with the polygons that touch themselves - try: - r = subprocess.call(process_tocall_clip) - if r == 1: - sys.exit(1) - - except SystemExit: - print("Dissolve vector cut of the validation !!!") - vect_2 = self.vect[:-4] + '_v2.shp' - preprocess_tocall = 'ogr2ogr -overwrite ' + vect_2 + ' ' + self.vect + ' -dialect sqlite -sql "SELECT ST_Union(geometry), * FROM ' + \ - os.path.basename(self.vect)[:-4] +'"' - os.system(preprocess_tocall) - print 'Raster clip of ' + os.path.split(str(self.imag))[1] - process_tocall_clip = ['gdalwarp', '-overwrite', '-dstnodata', '-10000', '-q', '-cutline', vect_2, '-crop_to_cutline', '-of', 'GTiff', self.imag, outclip] - subprocess.call(process_tocall_clip) - for rem in glob.glob(vect_2[:-4] + '*'): - os.remove(rem) - - return outclip - - def calc_serie_stats(self, table): - """ - Function to compute stats on temporal cloud and ndvi spectral table - Ndvi stats : min max std max-min - - :param table: Spectral data, cloud raster and ndvi raster - :type table: numpy.ndarray - :returns: list of numpy.ndarray -- variable **account_stats**, list of temporal NDVI stats. - - numpy.ndarray -- variable **account_cloud**, pixel number clear on the area. - """ - - # Compute stats on these indexes - ind = ['np.min(tab_ndvi_masked, axis=2)', 'np.max(tab_ndvi_masked, axis=2)', 'np.std(tab_ndvi_masked, axis=2)', \ - 'np.max(tab_ndvi_masked, axis=2)-np.min(tab_ndvi_masked, axis=2)'] # [Min, Max, Std, Max-Min] - # For the cloud map - # In the input table the cloud floor is the 5th - tab_cloud = np.dstack(table[5]) # Stack cloud table (dimension : 12*X*Y to X*Y*12) - - cloud_true = (tab_cloud == 0) # if tab_cloud = 0 then True else False / Mask cloud - account_cloud = np.sum(cloud_true, axis=2) # Account to tab_cloud if != 0 => Sum of True. (Dimension X*Y) - - # For the ndvi stats - # In the input table the ndvi floor is the 7th - stack_ndvi = np.dstack(table[7]) # Like cloud table, stack ndvi table - # mask_ndvi = np.ma.masked_equal(stack_ndvi, -10000, copy=True) # Mask values -10000 - mask_cloud = np.ma.masked_where((stack_ndvi == -10000) | (tab_cloud != 0), tab_cloud) # Mask values -10000 and > 0(Not cloud) - # mask_cloud = (tab_cloud != 0) | (stack_ndvi == -10000) - tab_ndvi_masked = np.ma.array(stack_ndvi, mask=mask_cloud.mask) # mask_cloud.mask) # Ndvi table with clear values - - # Stats on the indexes defined above - account_stats = [] - for i in ind: - i_stats = eval(i) # Compute stats - i_stats.fill_value = -10000 # Substitute default fill value by -10000 - account_stats.append(i_stats.filled()) # Add stats table with true fill value - # To extract index of the minimum ndvi to find the date - if ind.index(i) == 0: - i_date = eval(i.replace('np.min','np.argmin')) - - # To create a matrix with the date of pxl with a ndvi min - tab_date = np.transpose(np.array(table[:3], dtype=object)) - # Loop on the temporal sequency - for d in range(len(tab_date)): - mask_data = np.ma.masked_values(i_date, d) - i_date = mask_data.filled(date(int(tab_date[d][0]), int(tab_date[d][1]), int(tab_date[d][2])).toordinal()) # Date = day for year =1 day = 1 and month = 1 - - account_stats.append(i_date) # Add the date table - - return account_stats, account_cloud - - def check_proj(self): - """ - Function to check if raster's projection is RFG93. - For the moment, PHYMOBAT works with one projection only Lambert 93 EPSG:2154 - """ - - # Projection for PHYMOBAT - epsg_phymobat = '2154' - proj_phymobat = 'AUTHORITY["EPSG","' + epsg_phymobat + '"]' - - info_gdal = 'gdalinfo -json ' + self.imag - info_json = json.loads(subprocess.check_output(info_gdal, shell=True)) - # Check if projection is in Lambert 93 - if not proj_phymobat in info_json['coordinateSystem']['wkt']: - output_proj = self.imag[:-4] + '_L93.tif' - reproj = 'gdalwarp -t_srs EPSG:' + epsg_phymobat + ' ' + self.imag + ' ' + output_proj - os.system(reproj) - # Remove old file and rename new file like the old file - os.remove(self.imag) - os.rename(output_proj, self.imag) - \ No newline at end of file + info_gdal = 'gdalinfo -json {0}'.format(self.image) + info_json = json.loads(subprocess.check_output(info_gdal, shell=True)) + + # Check if projection is in Lambert 93 + if not proj_phymobat in info_json['coordinateSystem']['wkt']: + output_proj = "{0}_L93.tif".format(self.image[:-4]) + reproj = "gdalwarp -t_srs EPSG: {0} {1} {2}".format(Constantes.EPSG_PHYMOBAT, self.image, output_proj) + os.system(reproj) + # Remove old file and rename new file like the old file + os.remove(self.image) + os.rename(output_proj, self.image) + \ No newline at end of file diff --git a/Vector.py b/Vector.py index 745e92c69d40c5afbc95e99ee5f634a2b074e4b6..2cca5347dbab932fd1609977ed323dae020e9e35 100644 --- a/Vector.py +++ b/Vector.py @@ -3,223 +3,220 @@ # # This file is part of PHYMOBAT 1.2. # Copyright 2016 Sylvio Laventure (IRSTEA - UMR TETIS) -# +# # PHYMOBAT 1.2 is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # PHYMOBAT 1.2 is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with PHYMOBAT 1.2. If not, see <http://www.gnu.org/licenses/>. import os, sys import subprocess import numpy as np -try : - import ogr, gdal -except : - from osgeo import ogr, gdal -from rasterstats import * +from osgeo import ogr +import otbApplication as otb from collections import * +import Outils from RasterSat_by_date import RasterSat_by_date class Vector(): - """ - Vector class to extract a area, vector data and zonal statistic (``rasterstats 0.3.2 package``) - - :param vector_used: Input/Output shapefile to clip (path) - :type vector_used: str - :param vector_cut: Area shapefile (path) - :type vector_cut: str - :param data_source: Input shapefile information - :type data_source: ogr pointer - :param stats_dict: ``Rasterstats`` results - :type stats_dict: dict - :param raster_ds: Raster information for a probably rasterization - :type raster_ds: gdal pointer - :param remove_shp: Remove shapefile or not. 0 : don't remove, 1 : remove - :type remove_shp: int - :opt: **Remove** (int) - For the remove_shp variable - - """ - - def __init__(self, used, cut, **opt): - """Create a new 'Vector' instance - - """ - self.vector_cut = cut - self.vector_used = used - self.remove_shp = opt['Remove'] if opt.get('Remove') else 0 - - self.clip_vector() - - self.data_source = '' - if self.data_source == '': - self.vector_data() - - # List of field name - self.field_names = [self.data_source.GetLayer().GetLayerDefn().GetFieldDefn(l).GetName() \ - for l in range(self.data_source.GetLayer().GetLayerDefn().GetFieldCount())] - - self.stats_dict = defaultdict(list) - self.raster_ds = None - - - - def clip_vector(self): - """ - Function to clip a vector with a vector - - """ - - outclip = os.path.split(self.vector_used)[0] + '/Clip_' + os.path.split(self.vector_used)[1] - if not os.path.exists(outclip) or self.remove_shp == 1: - print 'Clip of ' + os.path.split(self.vector_used)[1] - # Command to clip a vector with a shapefile by OGR - process_tocall_clip = ['ogr2ogr', '-overwrite', '-skipfailures', outclip, self.vector_used, '-clipsrc', self.vector_cut] - subprocess.call(process_tocall_clip) - - # Replace input filename by output filename - self.vector_used = outclip - - def vector_data(self): - """ - Function to extract vector layer information - - """ - - # import ogr variable - self.data_source = ogr.GetDriverByName('ESRI Shapefile').Open(self.vector_used, 0) - - if self.data_source is None: - print('Could not open file') - sys.exit(1) - - print('Shapefile opening : ' + self.data_source.GetLayer().GetName()) - - def close_data(self): - """ - Function to remove allocate memory - - """ - - # Close data sources - self.data_source.Destroy() - - print('Shapefile closing : ' + self.data_source.GetLayer().GetName()) - - def zonal_stats(self, (inraster, band), **kwargs): - """ - Function to compute the average in every polygons for a raster - because of package ``rasterstats`` in */usr/local/lib/python2.7/dist-packages/rasterstats-0.3.2-py2.7.egg/rasterstats/* - - :param (inraster,band): inraster -> Input image path, and band -> band number - :type (inraster,band): tuple - :kwargs: **rank** (int) - Zonal stats ranking launch - - **nb_img** (int) - Number images launched with zonal stats - """ - - ranking = kwargs['rank'] if kwargs.get('rank') else 0 - nb_img = kwargs['nb_img'] if kwargs.get('nb_img') else 1 - - print('Compute ' + os.path.split(str(self.vector_used))[1] + ' stats on ' + os.path.split(str(inraster))[1]) - stats = raster_stats(str(self.vector_used), str(inraster), stats =['mean'], band_num=band) - - for i in range(len(stats)): - temp = defaultdict(lambda : [0]*nb_img) - for j in range(nb_img): - try : - temp[0][j] = self.stats_dict[i][j] - except IndexError: - pass - temp[0][ranking] = stats[i].values()[1] - self.stats_dict[i] = temp[0] - - print('End of stats on ' + os.path.split(str(inraster))[1]) - - def zonal_stats_pp(self, inraster): - """ - A zonal statistics ++ to dertermine pxl percent in every polygon - - :param inraster: Input image path - :type inraster: str - :returns: dict -- **p_stats** : dictionnary with pxl percent in every polygon. Mainly 'Maj_count' (Majority Value) and 'Maj_count_perc' (Majority Percent) - - """ - - p_stats = raster_stats(str(self.vector_used), str(inraster), stats=['count'], copy_properties=True, categorical=True) - - for i in range(len(p_stats)): - percent = 0.0 - for p in p_stats[i].keys(): - if type(p) == np.float32 and p_stats[i][p]/float(p_stats[i]['count'])*100 > percent: - p_stats[i]['Maj_count'] = p - p_stats[i]['Maj_count_perc'] = p_stats[i][p]/float(p_stats[i]['count'])*100 - percent = p_stats[i]['Maj_count_perc'] - if not 'Maj_count' in p_stats[i].keys() or not 'Maj_count_perc' in p_stats[i].keys(): - p_stats[i]['Maj_count']=0 - p_stats[i]['Maj_count_perc']=0 - - return p_stats - - def layer_rasterization(self, raster_head, attribute_r, **kwargs): - """ - Function to rasterize a vector. Define resolution, projection of the output raster with a raster head. - And complete the gdal pointer empty properties with the layer's information of the vector and a defined field. - If a raster has several band, in option you can choice if you want one band or more. - - :param raster_head: Raster path that will look like the final raster of the rasterization - :type raster_head: str - :param attribute_r: Field name of the shapefile that contains class names - :type attribute_r: str - :kwargs: **choice_nb_b** (int) - Output image number of band. If you choice 1, take first band. If you choice 2, take two first band etc... - :returns: str -- **valid_raster** : output raster path from the rasterization - - """ - - # Export a example of a raster out information - # for the validation shapefile - example_raster = RasterSat_by_date('', '', [0]) # Call the raster class - example_raster.choice_nb_b = kwargs['choice_nb_b'] if kwargs.get('choice_nb_b') else 0 - raster_info = example_raster.raster_data(raster_head)# Extract data info - - # Define the validation's vector - valid_raster = self.vector_used[:-3]+'TIF' # Name of the output raster - if os.path.exists(str(valid_raster)): - os.remove(valid_raster) - - # Create the empty raster with the same properties - # Condition for the rasters with several bands - if raster_info[1].RasterCount > 1: - data_raster = raster_info[0][0] - else: - data_raster = raster_info[0] - info_out = example_raster.create_raster(valid_raster, data_raster, raster_info[1]) - self.raster_ds = example_raster.out_ds - - # Virtual rasterize the vector - pt_rast = gdal.RasterizeLayer(self.raster_ds, [1], self.data_source.GetLayer(), \ - options=["ATTRIBUTE=" + str(attribute_r)]) - - if pt_rast != 0: - raise Exception("error rasterizing layer: %s" % pt_rast) - - new_data = self.raster_ds.ReadAsArray() - - self.raster_ds = None - # Complete the raster creation - example_raster.complete_raster(info_out, new_data) - - return valid_raster - - - - + """ + Vector class to extract a area, vector data and zonal statistic + + @param vector_used: Input/Output shapefile to clip (path) + @type vector_used: str + + @param vector_cut: Area shapefile (path) + @type vector_cut: str + + @param vector_name: Name of the shapefile + @type vector_name: str + + @param vector_folder: Name of the folder containing the shapefile + @type vector_name: str + + @param data_source: Input shapefile information + @type data_source: ogr pointer + + @param stats_dict: Stats results + @type stats_dict: dict + + @param remove_shp: Remove shapefile or not. 0 : don't remove, 1 : remove + @type remove_shp: int + + @opt: **Remove** (int) - For the remove_shp variable + """ + + def __init__(self, used, cut, **opt): + """ + Create a new 'Vector' instance + """ + + if not hasattr(self, "logger") : + self.logger = Outils.Log("Log", 'vector') + + self.vector_name = os.path.basename(used) + self.vector_folder = os.path.dirname(used) + + self.vector_cut = cut + self.vector_used = used + self.remove_shp = opt['Remove'] if opt.get('Remove') else 0 + + self.stats_dict = defaultdict(list) + + def clip_vector(self, output_folder): + """ + Function to clip a vector with a vector + """ + + if not os.path.exists(output_folder) : + os.makedirs(output_folder) + + outclip = "{0}/Clip_{1}".format(output_folder, self.vector_name) + + if not os.path.exists(outclip) or self.remove_shp == 1: + self.logger.info('Clip of {0}'.format(self.vector_name)) + + # Command to clip a vector with a shapefile by OGR + process_tocall_clip =\ + ['ogr2ogr', '-overwrite',\ + '-skipfailures', outclip, self.vector_used, \ + '-clipsrc', self.vector_cut] + + subprocess.call(process_tocall_clip) + + # Replace input filename by output filename + self.vector_used = outclip + + def vector_data(self): + """ + Function to extract vector layer information + """ + + try: + self.data_source = ogr.Open(self.vector_used) + self.logger.info('Shapefile opening : {0}'.format(self.data_source.GetLayer().GetName())) + except : + self.logger.error('Could not open file') + sys.exit(1) + + # List of field name + self.field_names = [self.data_source.GetLayer().GetLayerDefn().GetFieldDefn(l).GetName() \ + for l in range(self.data_source.GetLayer().GetLayerDefn().GetFieldCount())] + + def close_data(self): + """ + Function to remove allocate memory + """ + + self.logger.info('Shapefile closing : {0}'.format(self.data_source.GetLayer().GetName())) + + # Close data sources + self.data_source.Destroy() + + def zonal_stats(self, liste_chemin): + """ + Function to compute the mean in every polygons on a list images with otb + + @param liste_chemin : List input image path + @type liste_chemin : list(string) + """ + + self.logger.info("Compute stats 'mean' on {0}".format(os.path.split(self.vector_used)[1])) + + zonal_stats = otb.Registry.CreateApplication("ZonalStatistics") + zonal_stats.SetParameterStringList("il", liste_chemin) + zonal_stats.SetParameterStringList("vec", [self.vector_used]) + zonal_stats.SetParameterStringList("stats", ["mean"]) + + zonal_stats.Execute() + + stats_otb = list(zonal_stats.GetParameterValue("out")) + + liste_valeur = [] + + for stats in stats_otb : + for s in stats.split(";"): + if s : + liste_valeur.append(np.array([float(x) for x in s.split()])) + + resultats = np.dstack(liste_valeur)[0] + + stats_dict = defaultdict(list) + + for idx, r in enumerate(resultats) : + self.stats_dict[idx] = r.tolist() + + self.logger.info("End of stats 'mean' on {0}".format(os.path.split(self.vector_used)[1])) + + def zonal_stats_pp(self, inraster): + """ + A zonal statistics ++ to dertermine pxl percent in every polygon + + :param inraster: Input image path + :type inraster: str + + :returns: dict -- **p_stats** : dictionnary with pxl percent in every polygon. Mainly 'Maj_count' (Majority Value) and 'Maj_count_perc' (Majority Percent) + """ + + zonal_stats = otb.Registry.CreateApplication("ZonalStatistics") + zonal_stats.SetParameterStringList("il", [inraster]) + zonal_stats.SetParameterStringList("vec", [self.vector_used]) + zonal_stats.SetParameterStringList("stats", ["count"]) + + zonal_stats.Execute() + + stats_otb = list(zonal_stats.GetParameterValue("out")) + + p_stats = [] + + for item in stats_otb: + liste_item = item.split() + dico = dict() + + dico['count'] = float(liste_item[0]) + dico['Maj_count'] = float(liste_item[1]) + dico['Maj_count_perc'] = float(liste_item[2]) + p_stats.append(dico) + + return p_stats + + def layer_rasterization(self, raster_head, attribute_r, **kwargs): + """ + Function to rasterize a vector using OTB. + + @param raster_head: Raster path that will look like the final raster of the rasterization + @type raster_head: str + + @param attribute_r: Field name of the shapefile that contains class names + @type attribute_r: str + + @kwargs: **choice_nb_b** (int) - Output image number of band. If you choice 1, take first band. If you choice 2, take two first band etc... + @returns: str -- **valid_raster** : output raster path from the rasterization + """ + + valid_raster = "{0}.TIF".format(self.vector_used[:-4])# Name of the output raster + + self.logger.debug("valid_raster : {0}".format(valid_raster)) + + if os.path.exists(valid_raster): + os.remove(valid_raster) + + layerRasterization = otb.Registry.CreateApplication("Rasterization") + layerRasterization.SetParameterString("in", self.vector_used) + layerRasterization.SetParameterString("out", valid_raster) + layerRasterization.SetParameterString("im", raster_head) + layerRasterization.SetParameterString("mode", "attribute") + layerRasterization.SetParameterString("mode.attribute.field", attribute_r) + + layerRasterization.ExecuteAndWriteOutput() + return valid_raster diff --git a/Vhrs.py b/Vhrs.py index 9266bbdfb04e86c2732162e9e7e400cb0b8fc7d2..c76252a9615d873384b50857c0846a8cc6692755 100644 --- a/Vhrs.py +++ b/Vhrs.py @@ -17,117 +17,128 @@ # You should have received a copy of the GNU General Public License # along with PHYMOBAT 1.2. If not, see <http://www.gnu.org/licenses/>. -import os -import subprocess +import os, sys +import glob +import Outils +import otbApplication as otb + from multiprocessing import Process class Vhrs(): - - """ - Class to compute Haralick and SFS textures because of OTB application in command line - - :param imag: The input image path to compute texture image - :type imag: str - :param out_sfs/out_haralick: Output path - :type out_sfs/out_haralick: str - :param mp: Boolean variable -> 0 or 1. - - - 0 means, not multi-processing - - 1 means, launch process with multi-processing - :type mp: int - """ - - def __init__(self, imag, mp): - """Create a new 'Texture' instance - - """ - - self._imag = imag - self.mp = mp - - print('SFS image') - self.out_sfs = self._imag[:-4] + '_sfs.TIF' - if not os.path.exists(self.out_sfs): - print('SFS image doesn\'t exist !') - p_sfs = Process(target=self.sfs_texture_extraction) - p_sfs.start() - if mp == 0: - p_sfs.join() -# self.sfs_texture_extraction() - - print('Haralick image') - self.out_haralick = self._imag[:-4] + '_haralick.TIF' - if not os.path.exists(self.out_haralick): - print('Haralick image doesn\'t exist !') - p_har = Process(target=self.haralick_texture_extraction, args=('simple', )) - p_har.start() - if mp == 0: - p_har.join() -# self.haralick_texture_extraction('simple') - - if mp == 1: - if not os.path.exists(self.out_sfs) and not os.path.exists(self.out_haralick): - p_sfs.join() - p_har.join() - - def sfs_texture_extraction(self): - - """ - Function to compute SFS texture image with OTB command line. - :Example: otbcli_SFSTextureExtraction -in qb_RoadExtract.tif -channel 1 -parameters.spethre 50.0 -parameters.spathre 100 -out SFSTextures.tif - - - OTB help : - * in : Input Image - * channel : Selected Channel - * parameters : Texture feature parameters. This group of parameters allows to define SFS texture parameters. The available texture features are SFS’Length, SFS’Width, SFS’PSI, SFS’W-Mean, SFS’Ratio and SFS’SD. They are provided in this exact order in the output image. - - parameters.spethre : Spectral Threshold - - parameters.spathre : Spatial Threshold - - parameters.nbdir : Number of Direction - - parameters.alpha : Alpha - - parameters.maxcons : Ratio Maximum Consideration Number - * out : Feature Output Image - - Source : http://otbcb.readthedocs.org/en/latest/Applications/app_SFSTextureExtraction.html - """ - - process_tocall = ['otbcli_SFSTextureExtraction', '-in', self._imag, '-channel', '2', '-parameters.spethre', '50.0', \ - '-parameters.spathre', '100', '-out', self.out_sfs] - - print(process_tocall) - subprocess.call(process_tocall) - - def haralick_texture_extraction(self, texture_choice): - - """ - Function to compute Haralick texture image with OTB command line. - :Example: otbcli_HaralickTextureExtraction -in qb_RoadExtract.tif -channel 2 -parameters.xrad 3 -parameters.yrad 3 -texture simple -out HaralickTextures.tif - - - OTB help : - * in : Input Image - * channel : Selected Channel - * Texture feature parameters : This group of parameters allows to define texture parameters. - - X Radius : X Radius - - Y Radius : Y Radius - - X Offset : X Offset - - Y Offset : Y Offset - * Image Minimum : Image Minimum - * Image Maximum : Image Maximum - * Histogram number of bin : Histogram number of bin - * Texture Set Selection Choice of The Texture Set Available choices are : - - Simple Haralick Texture Features: This group of parameters defines the 8 local Haralick texture feature output image. The image channels are: Energy, Entropy, Correlation, Inverse Difference Moment, Inertia, Cluster Shade, Cluster Prominence and Haralick Correlation - - Advanced Texture Features: This group of parameters defines the 9 advanced texture feature output image. The image channels are: Mean, Variance, Sum Average, Sum Variance, Sum Entropy, Difference of Entropies, Difference of Variances, IC1 and IC2 - - Higher Order Texture Features: This group of parameters defines the 11 higher order texture feature output image. The image channels are: Short Run Emphasis, Long Run Emphasis, Grey-Level Nonuniformity, Run Length Nonuniformity, Run Percentage, Low Grey-Level Run Emphasis, High Grey-Level Run Emphasis, Short Run Low Grey-Level Emphasis, Short Run High Grey-Level Emphasis, Long Run Low Grey-Level Emphasis and Long Run High Grey-Level Emphasis - * out : Feature Output Image - - Source : http://otbcb.readthedocs.org/en/latest/Applications/app_HaralickTextureExtraction.html - - :param texture_choice: Order texture choice -> Simple / Advanced / Higher - :type texture_choice: str - """ - - process_tocall = ['otbcli_HaralickTextureExtraction', '-in', self._imag, '-channel', '2', '-parameters.xrad', '3', \ - '-parameters.yrad', '3', '-texture', texture_choice, '-out', self.out_haralick] - - print(process_tocall) - subprocess.call(process_tocall) - \ No newline at end of file + """ + Class to compute Haralick and SFS textures with OTB + + @param imag: The input image path to compute texture image + @type imag: str + + @param out_sfs/out_haralick: Output path + @type out_sfs/out_haralick: str + + @param mp: Boolean variable -> 0 or 1. + - 0 means, not multi-processing + - 1 means, launch process with multi-processing + @type mp: int + """ + + def __init__(self, imag, mp): + """ + Create a new 'Texture' instance + """ + + self._image = imag + self.mp = mp + self.logger = Outils.Log('Log', "VHRS") + + self.out_sfs = "{0}_sfs.TIF".format(self._image[:-4]) + self.out_haralick = "{0}_haralick.TIF".format(self._image[:-4]) + + p_sfs = Process(target=self.sfs_texture_extraction) + p_sfs.start() + + if mp == 0: + p_sfs.join() + + p_har = Process(target=self.haralick_texture_extraction, args=('simple', )) + p_har.start() + + if mp == 0: + p_har.join() + + if mp == 1: + p_sfs.join() + p_har.join() + + def sfs_texture_extraction(self): + """ + Function to compute OTB SFS texture image + - OTB help : + * in : Input Image + * channel : Selected Channel + * parameters : Texture feature parameters. This group of parameters allows to define SFS texture parameters. The available texture features are SFS’Length, SFS’Width, SFS’PSI, SFS’W-Mean, SFS’Ratio and SFS’SD. They are provided in this exact order in the output image. + - parameters.spethre : Spectral Threshold + - parameters.spathre : Spatial Threshold + - parameters.nbdir : Number of Direction + - parameters.alpha : Alpha + - parameters.maxcons : Ratio Maximum Consideration Number + * out : Feature Output Image + """ + + self.logger.info('SFS image') + + if not os.path.exists(self.out_sfs): + + self.logger.info("SFS image doesn't exist !") + + otb_SFS = otb.Registry.CreateApplication("SFSTextureExtraction") + otb_SFS.SetParameterString("in", self._image) + otb_SFS.SetParameterInt("channel", 2) + otb_SFS.SetParameterInt("parameters.spethre", 50) + otb_SFS.SetParameterInt("parameters.spathre", 100) + otb_SFS.SetParameterString("out", self.out_sfs) + + otb_SFS.ExecuteAndWriteOutput() + + self.logger.info('SFS image created.') + + def haralick_texture_extraction(self, texture_choice): + """ + Function to compute OTB Haralick texture image + - OTB help : + * in : Input Image + * channel : Selected Channel + * Texture feature parameters : This group of parameters allows to define texture parameters. + - X Radius : X Radius + - Y Radius : Y Radius + - X Offset : X Offset + - Y Offset : Y Offset + * Image Minimum : Image Minimum + * Image Maximum : Image Maximum + * Histogram number of bin : Histogram number of bin + * Texture Set Selection Choice of The Texture Set Available choices are : + - Simple Haralick Texture Features: This group of parameters defines the 8 local Haralick texture feature output image. The image channels are: Energy, Entropy, Correlation, Inverse Difference Moment, Inertia, Cluster Shade, Cluster Prominence and Haralick Correlation + - Advanced Texture Features: This group of parameters defines the 9 advanced texture feature output image. The image channels are: Mean, Variance, Sum Average, Sum Variance, Sum Entropy, Difference of Entropies, Difference of Variances, IC1 and IC2 + - Higher Order Texture Features: This group of parameters defines the 11 higher order texture feature output image. The image channels are: Short Run Emphasis, Long Run Emphasis, Grey-Level Nonuniformity, Run Length Nonuniformity, Run Percentage, Low Grey-Level Run Emphasis, High Grey-Level Run Emphasis, Short Run Low Grey-Level Emphasis, Short Run High Grey-Level Emphasis, Long Run Low Grey-Level Emphasis and Long Run High Grey-Level Emphasis + * out : Feature Output Image + + Source : http://otbcb.readthedocs.org/en/latest/Applications/app_HaralickTextureExtraction.html + + @param texture_choice: Order texture choice -> Simple / Advanced / Higher + @type texture_choice: str + """ + self.logger.info('Haralick image') + + if not os.path.exists(self.out_haralick): + + self.logger.info("Haralick image doesn't exist !") + + otb_Haralick = otb.Registry.CreateApplication("HaralickTextureExtraction") + otb_Haralick.SetParameterString("in", self._image) + otb_Haralick.SetParameterInt("channel", 2) + otb_Haralick.SetParameterInt("parameters.xrad", 3) + otb_Haralick.SetParameterInt("parameters.yrad", 3) + otb_Haralick.SetParameterString("texture", texture_choice) + otb_Haralick.SetParameterString("out", self.out_haralick) + + otb_Haralick.ExecuteAndWriteOutput() + + self.logger.info('Haralick image created.') diff --git a/ui_A_propos_PHYMOBAT_window.py b/ui_A_propos_PHYMOBAT_window.py index 944ae335c0d033c3fc01be41cb2eef6cffb940cc..22c4d5d763ce0a990692dcf067e08e518b68dbed 100644 --- a/ui_A_propos_PHYMOBAT_window.py +++ b/ui_A_propos_PHYMOBAT_window.py @@ -23,21 +23,15 @@ # You should have received a copy of the GNU General Public License # along with PHYMOBAT 1.2. If not, see <http://www.gnu.org/licenses/>. -from PyQt4 import QtCore, QtGui +from PyQt5 import QtCore, QtGui, QtWidgets try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - def _fromUtf8(s): - return s - -try: - _encoding = QtGui.QApplication.UnicodeUTF8 + _encoding = QtWidgets.QApplication.UnicodeUTF8 def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig, _encoding) + return QtWidgets.QApplication.translate(context, text, disambig, _encoding) except AttributeError: def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig) + return QtWidgets.QApplication.translate(context, text, disambig) class Ui_About(object): """ @@ -46,19 +40,19 @@ class Ui_About(object): """ def setupUi(self, Form): - Form.setObjectName(_fromUtf8("A propos de PHYMOBAT")) + Form.setObjectName("A propos de PHYMOBAT") Form.resize(507, 578) - self.gridLayout = QtGui.QGridLayout(Form) - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.label = QtGui.QLabel(Form) - self.label.setObjectName(_fromUtf8("label")) + self.gridLayout = QtWidgets.QGridLayout(Form) + self.gridLayout.setObjectName("gridLayout") + self.label = QtWidgets.QLabel(Form) + self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 0, 0, 1, 3) - spacerItem = QtGui.QSpacerItem(193, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem = QtWidgets.QSpacerItem(193, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem, 1, 0, 1, 1) - self.close_newWindow = QtGui.QPushButton(Form) - self.close_newWindow.setObjectName(_fromUtf8("close_newWindow")) + self.close_newWindow = QtWidgets.QPushButton(Form) + self.close_newWindow.setObjectName("close_newWindow") self.gridLayout.addWidget(self.close_newWindow, 1, 1, 1, 1) - spacerItem1 = QtGui.QSpacerItem(193, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem1 = QtWidgets.QSpacerItem(193, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem1, 1, 2, 1, 1) self.retranslateUi(Form) diff --git a/ui_PHYMOBATe_tab.py b/ui_PHYMOBATe_tab.py index d85c1c515d5802b2ba9b3fac4dc27ee40b9cb9cb..e7bd23041f94ace972bd2f9785e5a8cf8372b600 100644 --- a/ui_PHYMOBATe_tab.py +++ b/ui_PHYMOBATe_tab.py @@ -7,21 +7,18 @@ # # WARNING! All changes made in this file will be lost! -from PyQt4 import QtCore, QtGui +from PyQt5 import QtCore, QtGui, QtWidgets -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - def _fromUtf8(s): - return s +def _fromUtf8(s): + return s try: - _encoding = QtGui.QApplication.UnicodeUTF8 + _encoding = QtWidgets.QApplication.UnicodeUTF8 def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig, _encoding) + return QtWidgets.QApplication.translate(context, text, disambig, _encoding) except AttributeError: def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig) + return QtWidgets.QApplication.translate(context, text, disambig) class Ui_PHYMOBAT(object): @@ -32,212 +29,212 @@ class Ui_PHYMOBAT(object): def setupUi(self, PHYMOBAT): PHYMOBAT.setObjectName(_fromUtf8("PHYMOBAT")) PHYMOBAT.resize(626, 658) - self.centralwidget = QtGui.QWidget(PHYMOBAT) + self.centralwidget = QtWidgets.QWidget(PHYMOBAT) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) - self.gridLayout = QtGui.QGridLayout(self.centralwidget) + self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.checkBox_multiprocess = QtGui.QCheckBox(self.centralwidget) + self.checkBox_multiprocess = QtWidgets.QCheckBox(self.centralwidget) self.checkBox_multiprocess.setCheckable(True) self.checkBox_multiprocess.setChecked(True) self.checkBox_multiprocess.setAutoRepeat(False) self.checkBox_multiprocess.setObjectName(_fromUtf8("checkBox_multiprocess")) self.gridLayout.addWidget(self.checkBox_multiprocess, 1, 0, 1, 1) - self.buttonBox = QtGui.QDialogButtonBox(self.centralwidget) + self.buttonBox = QtWidgets.QDialogButtonBox(self.centralwidget) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.Ok) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close|QtWidgets.QDialogButtonBox.Ok) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.gridLayout.addWidget(self.buttonBox, 1, 1, 1, 1) - self.tabWidget = QtGui.QTabWidget(self.centralwidget) + self.tabWidget = QtWidgets.QTabWidget(self.centralwidget) self.tabWidget.setObjectName(_fromUtf8("tabWidget")) - self.tab = QtGui.QWidget() + self.tab = QtWidgets.QWidget() self.tab.setObjectName(_fromUtf8("tab")) - self.gridLayout_3 = QtGui.QGridLayout(self.tab) + self.gridLayout_3 = QtWidgets.QGridLayout(self.tab) self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) - self.label_principal_folder = QtGui.QLabel(self.tab) + self.label_principal_folder = QtWidgets.QLabel(self.tab) self.label_principal_folder.setObjectName(_fromUtf8("label_principal_folder")) self.gridLayout_3.addWidget(self.label_principal_folder, 0, 0, 1, 2) - self.label_area_path = QtGui.QLabel(self.tab) + self.label_area_path = QtWidgets.QLabel(self.tab) self.label_area_path.setObjectName(_fromUtf8("label_area_path")) self.gridLayout_3.addWidget(self.label_area_path, 4, 0, 1, 2) - self.checkBox_download = QtGui.QCheckBox(self.tab) + self.checkBox_download = QtWidgets.QCheckBox(self.tab) self.checkBox_download.setObjectName(_fromUtf8("checkBox_download")) self.gridLayout_3.addWidget(self.checkBox_download, 7, 0, 1, 2) - self.label_id_theia = QtGui.QLabel(self.tab) + self.label_id_theia = QtWidgets.QLabel(self.tab) self.label_id_theia.setObjectName(_fromUtf8("label_id_theia")) self.gridLayout_3.addWidget(self.label_id_theia, 8, 0, 1, 2) - self.label_password = QtGui.QLabel(self.tab) + self.label_password = QtWidgets.QLabel(self.tab) self.label_password.setObjectName(_fromUtf8("label_password")) self.gridLayout_3.addWidget(self.label_password, 9, 3, 1, 1) - self.lineEdit_user = QtGui.QLineEdit(self.tab) + self.lineEdit_user = QtWidgets.QLineEdit(self.tab) self.lineEdit_user.setObjectName(_fromUtf8("lineEdit_user")) self.gridLayout_3.addWidget(self.lineEdit_user, 9, 1, 1, 1) - self.label_user = QtGui.QLabel(self.tab) + self.label_user = QtWidgets.QLabel(self.tab) self.label_user.setObjectName(_fromUtf8("label_user")) self.gridLayout_3.addWidget(self.label_user, 9, 0, 1, 1) - self.checkBox_VHRS = QtGui.QCheckBox(self.tab) + self.checkBox_VHRS = QtWidgets.QCheckBox(self.tab) self.checkBox_VHRS.setObjectName(_fromUtf8("checkBox_VHRS")) self.gridLayout_3.addWidget(self.checkBox_VHRS, 13, 0, 1, 2) - self.checkBox_listing = QtGui.QCheckBox(self.tab) + self.checkBox_listing = QtWidgets.QCheckBox(self.tab) self.checkBox_listing.setObjectName(_fromUtf8("checkBox_listing")) self.gridLayout_3.addWidget(self.checkBox_listing, 6, 0, 1, 2) - self.checkBox_MNT = QtGui.QCheckBox(self.tab) + self.checkBox_MNT = QtWidgets.QCheckBox(self.tab) self.checkBox_MNT.setObjectName(_fromUtf8("checkBox_MNT")) self.gridLayout_3.addWidget(self.checkBox_MNT, 11, 0, 1, 1) - self.label_listing = QtGui.QLabel(self.tab) + self.label_listing = QtWidgets.QLabel(self.tab) self.label_listing.setObjectName(_fromUtf8("label_listing")) self.gridLayout_3.addWidget(self.label_listing, 6, 3, 1, 1) - self.checkBox_processing = QtGui.QCheckBox(self.tab) + self.checkBox_processing = QtWidgets.QCheckBox(self.tab) self.checkBox_processing.setObjectName(_fromUtf8("checkBox_processing")) self.gridLayout_3.addWidget(self.checkBox_processing, 10, 0, 1, 4) - self.proxy = QtGui.QPushButton(self.tab) + self.proxy = QtWidgets.QPushButton(self.tab) self.proxy.setObjectName(_fromUtf8("proxy")) self.gridLayout_3.addWidget(self.proxy, 9, 6, 1, 1) - self.pushButton_browser_principal_folder = QtGui.QPushButton(self.tab) + self.pushButton_browser_principal_folder = QtWidgets.QPushButton(self.tab) self.pushButton_browser_principal_folder.setObjectName(_fromUtf8("pushButton_browser_principal_folder")) self.gridLayout_3.addWidget(self.pushButton_browser_principal_folder, 1, 6, 1, 1) - self.lineEdit_principal_folder = QtGui.QLineEdit(self.tab) + self.lineEdit_principal_folder = QtWidgets.QLineEdit(self.tab) self.lineEdit_principal_folder.setObjectName(_fromUtf8("lineEdit_principal_folder")) self.gridLayout_3.addWidget(self.lineEdit_principal_folder, 1, 0, 1, 6) - self.pushButton_browser_area_path = QtGui.QPushButton(self.tab) + self.pushButton_browser_area_path = QtWidgets.QPushButton(self.tab) self.pushButton_browser_area_path.setObjectName(_fromUtf8("pushButton_browser_area_path")) self.gridLayout_3.addWidget(self.pushButton_browser_area_path, 5, 6, 1, 1) - self.lineEdit_area_path = QtGui.QLineEdit(self.tab) + self.lineEdit_area_path = QtWidgets.QLineEdit(self.tab) self.lineEdit_area_path.setObjectName(_fromUtf8("lineEdit_area_path")) self.gridLayout_3.addWidget(self.lineEdit_area_path, 5, 0, 1, 6) - self.lineEdit_password = QtGui.QLineEdit(self.tab) - self.lineEdit_password.setEchoMode(QtGui.QLineEdit.Password) + self.lineEdit_password = QtWidgets.QLineEdit(self.tab) + self.lineEdit_password.setEchoMode(QtWidgets.QLineEdit.Password) self.lineEdit_password.setObjectName(_fromUtf8("lineEdit_password")) self.gridLayout_3.addWidget(self.lineEdit_password, 9, 5, 1, 1) - self.pushButton_browser_MNT = QtGui.QPushButton(self.tab) + self.pushButton_browser_MNT = QtWidgets.QPushButton(self.tab) self.pushButton_browser_MNT.setObjectName(_fromUtf8("pushButton_browser_MNT")) self.gridLayout_3.addWidget(self.pushButton_browser_MNT, 12, 6, 1, 1) - self.pushButton_browser_VHRS = QtGui.QPushButton(self.tab) + self.pushButton_browser_VHRS = QtWidgets.QPushButton(self.tab) self.pushButton_browser_VHRS.setObjectName(_fromUtf8("pushButton_browser_VHRS")) self.gridLayout_3.addWidget(self.pushButton_browser_VHRS, 14, 6, 1, 1) - self.lineEdit_MNT = QtGui.QLineEdit(self.tab) + self.lineEdit_MNT = QtWidgets.QLineEdit(self.tab) self.lineEdit_MNT.setObjectName(_fromUtf8("lineEdit_MNT")) self.gridLayout_3.addWidget(self.lineEdit_MNT, 12, 0, 1, 6) - self.lineEdit_VHRS = QtGui.QLineEdit(self.tab) + self.lineEdit_VHRS = QtWidgets.QLineEdit(self.tab) self.lineEdit_VHRS.setObjectName(_fromUtf8("lineEdit_VHRS")) self.gridLayout_3.addWidget(self.lineEdit_VHRS, 14, 0, 1, 6) - self.label_ex_period = QtGui.QLabel(self.tab) + self.label_ex_period = QtWidgets.QLabel(self.tab) font = QtGui.QFont() font.setPointSize(6) font.setItalic(True) self.label_ex_period.setFont(font) self.label_ex_period.setObjectName(_fromUtf8("label_ex_period")) self.gridLayout_3.addWidget(self.label_ex_period, 3, 2, 1, 2) - self.lineEdit_year_images = QtGui.QLineEdit(self.tab) + self.lineEdit_year_images = QtWidgets.QLineEdit(self.tab) self.lineEdit_year_images.setObjectName(_fromUtf8("lineEdit_year_images")) self.gridLayout_3.addWidget(self.lineEdit_year_images, 3, 5, 1, 2) - self.comboBox_captor = QtGui.QComboBox(self.tab) + self.comboBox_captor = QtWidgets.QComboBox(self.tab) self.comboBox_captor.setObjectName(_fromUtf8("comboBox_captor")) self.comboBox_captor.addItem(_fromUtf8("")) self.comboBox_captor.addItem(_fromUtf8("")) self.comboBox_captor.addItem(_fromUtf8("")) self.gridLayout_3.addWidget(self.comboBox_captor, 2, 5, 1, 2) - self.label_year_images = QtGui.QLabel(self.tab) + self.label_year_images = QtWidgets.QLabel(self.tab) self.label_year_images.setObjectName(_fromUtf8("label_year_images")) self.gridLayout_3.addWidget(self.label_year_images, 3, 0, 1, 2) - self.label_captor = QtGui.QLabel(self.tab) + self.label_captor = QtWidgets.QLabel(self.tab) self.label_captor.setObjectName(_fromUtf8("label_captor")) self.gridLayout_3.addWidget(self.label_captor, 2, 0, 1, 3) self.tabWidget.addTab(self.tab, _fromUtf8("")) - self.tab_2 = QtGui.QWidget() + self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName(_fromUtf8("tab_2")) - self.gridLayout_4 = QtGui.QGridLayout(self.tab_2) + self.gridLayout_4 = QtWidgets.QGridLayout(self.tab_2) self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) - self.pushButton_img_sample = QtGui.QPushButton(self.tab_2) + self.pushButton_img_sample = QtWidgets.QPushButton(self.tab_2) self.pushButton_img_sample.setObjectName(_fromUtf8("pushButton_img_sample")) self.gridLayout_4.addWidget(self.pushButton_img_sample, 8, 4, 1, 1) - self.checkBox_RPG = QtGui.QCheckBox(self.tab_2) + self.checkBox_RPG = QtWidgets.QCheckBox(self.tab_2) self.checkBox_RPG.setObjectName(_fromUtf8("checkBox_RPG")) self.gridLayout_4.addWidget(self.checkBox_RPG, 9, 0, 1, 1) - spacerItem = QtGui.QSpacerItem(49, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem = QtWidgets.QSpacerItem(49, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_4.addItem(spacerItem, 10, 1, 1, 1) - self.pushButton_clear_sample = QtGui.QPushButton(self.tab_2) + self.pushButton_clear_sample = QtWidgets.QPushButton(self.tab_2) self.pushButton_clear_sample.setObjectName(_fromUtf8("pushButton_clear_sample")) self.gridLayout_4.addWidget(self.pushButton_clear_sample, 10, 2, 1, 2) - self.checkBox_img_sample = QtGui.QCheckBox(self.tab_2) + self.checkBox_img_sample = QtWidgets.QCheckBox(self.tab_2) self.checkBox_img_sample.setObjectName(_fromUtf8("checkBox_img_sample")) self.gridLayout_4.addWidget(self.checkBox_img_sample, 7, 0, 1, 5) - self.lineEdit_select_sample_fieldname_1 = QtGui.QLineEdit(self.tab_2) + self.lineEdit_select_sample_fieldname_1 = QtWidgets.QLineEdit(self.tab_2) self.lineEdit_select_sample_fieldname_1.setObjectName(_fromUtf8("lineEdit_select_sample_fieldname_1")) self.gridLayout_4.addWidget(self.lineEdit_select_sample_fieldname_1, 4, 3, 1, 1) - self.lineEdit_select_sample_fieldname_2 = QtGui.QLineEdit(self.tab_2) + self.lineEdit_select_sample_fieldname_2 = QtWidgets.QLineEdit(self.tab_2) self.lineEdit_select_sample_fieldname_2.setObjectName(_fromUtf8("lineEdit_select_sample_fieldname_2")) self.gridLayout_4.addWidget(self.lineEdit_select_sample_fieldname_2, 4, 4, 1, 1) - self.lineEdit_img_sample = QtGui.QLineEdit(self.tab_2) + self.lineEdit_img_sample = QtWidgets.QLineEdit(self.tab_2) self.lineEdit_img_sample.setObjectName(_fromUtf8("lineEdit_img_sample")) self.gridLayout_4.addWidget(self.lineEdit_img_sample, 8, 0, 1, 4) - spacerItem1 = QtGui.QSpacerItem(49, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem1 = QtWidgets.QSpacerItem(49, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_4.addItem(spacerItem1, 5, 1, 1, 1) - self.lineEdit_select_sample_class_2 = QtGui.QLineEdit(self.tab_2) + self.lineEdit_select_sample_class_2 = QtWidgets.QLineEdit(self.tab_2) self.lineEdit_select_sample_class_2.setObjectName(_fromUtf8("lineEdit_select_sample_class_2")) self.gridLayout_4.addWidget(self.lineEdit_select_sample_class_2, 5, 4, 1, 1) - self.label_select_sample_fieldname = QtGui.QLabel(self.tab_2) + self.label_select_sample_fieldname = QtWidgets.QLabel(self.tab_2) self.label_select_sample_fieldname.setObjectName(_fromUtf8("label_select_sample_fieldname")) self.gridLayout_4.addWidget(self.label_select_sample_fieldname, 4, 0, 1, 1) - self.pushButton_add_sample = QtGui.QPushButton(self.tab_2) + self.pushButton_add_sample = QtWidgets.QPushButton(self.tab_2) self.pushButton_add_sample.setObjectName(_fromUtf8("pushButton_add_sample")) self.gridLayout_4.addWidget(self.pushButton_add_sample, 10, 4, 1, 1) - self.plainTextEdit_sample = QtGui.QPlainTextEdit(self.tab_2) + self.plainTextEdit_sample = QtWidgets.QPlainTextEdit(self.tab_2) self.plainTextEdit_sample.setObjectName(_fromUtf8("plainTextEdit_sample")) self.gridLayout_4.addWidget(self.plainTextEdit_sample, 11, 0, 1, 5) - self.lineEdit_select_sample_nb_poly = QtGui.QLineEdit(self.tab_2) + self.lineEdit_select_sample_nb_poly = QtWidgets.QLineEdit(self.tab_2) self.lineEdit_select_sample_nb_poly.setObjectName(_fromUtf8("lineEdit_select_sample_nb_poly")) self.gridLayout_4.addWidget(self.lineEdit_select_sample_nb_poly, 6, 4, 1, 1) - self.label_sample_path = QtGui.QLabel(self.tab_2) + self.label_sample_path = QtWidgets.QLabel(self.tab_2) self.label_sample_path.setObjectName(_fromUtf8("label_sample_path")) self.gridLayout_4.addWidget(self.label_sample_path, 0, 0, 1, 1) - self.label_select_sample_nb_poly = QtGui.QLabel(self.tab_2) + self.label_select_sample_nb_poly = QtWidgets.QLabel(self.tab_2) self.label_select_sample_nb_poly.setObjectName(_fromUtf8("label_select_sample_nb_poly")) self.gridLayout_4.addWidget(self.label_select_sample_nb_poly, 6, 0, 1, 1) - spacerItem2 = QtGui.QSpacerItem(49, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem2 = QtWidgets.QSpacerItem(49, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_4.addItem(spacerItem2, 4, 1, 1, 1) - self.pushButton_browser_sample_path = QtGui.QPushButton(self.tab_2) + self.pushButton_browser_sample_path = QtWidgets.QPushButton(self.tab_2) self.pushButton_browser_sample_path.setObjectName(_fromUtf8("pushButton_browser_sample_path")) self.gridLayout_4.addWidget(self.pushButton_browser_sample_path, 1, 4, 1, 1) - self.label_select_sample_class = QtGui.QLabel(self.tab_2) + self.label_select_sample_class = QtWidgets.QLabel(self.tab_2) self.label_select_sample_class.setObjectName(_fromUtf8("label_select_sample_class")) self.gridLayout_4.addWidget(self.label_select_sample_class, 5, 0, 1, 1) - spacerItem3 = QtGui.QSpacerItem(106, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem3 = QtWidgets.QSpacerItem(106, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_4.addItem(spacerItem3, 6, 2, 1, 2) - self.label_select_sample_class_1 = QtGui.QLabel(self.tab_2) + self.label_select_sample_class_1 = QtWidgets.QLabel(self.tab_2) self.label_select_sample_class_1.setObjectName(_fromUtf8("label_select_sample_class_1")) self.gridLayout_4.addWidget(self.label_select_sample_class_1, 2, 2, 1, 2) - self.lineEdit_sample_path = QtGui.QLineEdit(self.tab_2) + self.lineEdit_sample_path = QtWidgets.QLineEdit(self.tab_2) self.lineEdit_sample_path.setObjectName(_fromUtf8("lineEdit_sample_path")) self.gridLayout_4.addWidget(self.lineEdit_sample_path, 1, 0, 1, 4) - self.label_select_sample = QtGui.QLabel(self.tab_2) + self.label_select_sample = QtWidgets.QLabel(self.tab_2) self.label_select_sample.setObjectName(_fromUtf8("label_select_sample")) self.gridLayout_4.addWidget(self.label_select_sample, 2, 0, 1, 1) - spacerItem4 = QtGui.QSpacerItem(49, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem4 = QtWidgets.QSpacerItem(49, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_4.addItem(spacerItem4, 6, 1, 1, 1) - self.label_select_sample_class_2 = QtGui.QLabel(self.tab_2) + self.label_select_sample_class_2 = QtWidgets.QLabel(self.tab_2) self.label_select_sample_class_2.setObjectName(_fromUtf8("label_select_sample_class_2")) self.gridLayout_4.addWidget(self.label_select_sample_class_2, 2, 4, 1, 1) - self.checkBox_threshold = QtGui.QCheckBox(self.tab_2) + self.checkBox_threshold = QtWidgets.QCheckBox(self.tab_2) self.checkBox_threshold.setObjectName(_fromUtf8("checkBox_threshold")) self.gridLayout_4.addWidget(self.checkBox_threshold, 12, 0, 1, 3) - self.lineEdit_select_sample_class_1 = QtGui.QLineEdit(self.tab_2) + self.lineEdit_select_sample_class_1 = QtWidgets.QLineEdit(self.tab_2) self.lineEdit_select_sample_class_1.setObjectName(_fromUtf8("lineEdit_select_sample_class_1")) self.gridLayout_4.addWidget(self.lineEdit_select_sample_class_1, 5, 3, 1, 1) self.tabWidget.addTab(self.tab_2, _fromUtf8("")) - self.tab_3 = QtGui.QWidget() + self.tab_3 = QtWidgets.QWidget() self.tab_3.setObjectName(_fromUtf8("tab_3")) - self.gridLayout_2 = QtGui.QGridLayout(self.tab_3) + self.gridLayout_2 = QtWidgets.QGridLayout(self.tab_3) self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) - self.label_area_fieldtype = QtGui.QLabel(self.tab_3) + self.label_area_fieldtype = QtWidgets.QLabel(self.tab_3) self.label_area_fieldtype.setObjectName(_fromUtf8("label_area_fieldtype")) self.gridLayout_2.addWidget(self.label_area_fieldtype, 8, 3, 1, 1) - self.label_area_fieldname = QtGui.QLabel(self.tab_3) + self.label_area_fieldname = QtWidgets.QLabel(self.tab_3) self.label_area_fieldname.setObjectName(_fromUtf8("label_area_fieldname")) self.gridLayout_2.addWidget(self.label_area_fieldname, 7, 3, 1, 1) -# self.label_chps_type_2 = QtGui.QLabel(self.tab_3) +# self.label_chps_type_2 = QtWidgets.QLabel(self.tab_3) # self.label_chps_type_2.setObjectName(_fromUtf8("label_chps_type_2")) # self.gridLayout_2.addWidget(self.label_chps_type_2, 14, 2, 1, 1) - self.checkBox_classifier_2 = QtGui.QCheckBox(self.tab_3) + self.checkBox_classifier_2 = QtWidgets.QCheckBox(self.tab_3) self.checkBox_classifier_2.setObjectName(_fromUtf8("checkBox_classifier_2")) self.gridLayout_2.addWidget(self.checkBox_classifier_2, 12, 0, 1, 5) # self.label_chps_type_3 = QtGui.QLabel(self.tab_3) @@ -246,7 +243,7 @@ class Ui_PHYMOBAT(object): # self.lineEdit_fieldname_23 = QtGui.QLineEdit(self.tab_3) # self.lineEdit_fieldname_23.setObjectName(_fromUtf8("lineEdit_fieldname_23")) # self.gridLayout_2.addWidget(self.lineEdit_fieldname_23, 16, 4, 1, 1) - self.label_ouput = QtGui.QLabel(self.tab_3) + self.label_ouput = QtWidgets.QLabel(self.tab_3) self.label_ouput.setObjectName(_fromUtf8("label_ouput")) self.gridLayout_2.addWidget(self.label_ouput, 4, 0, 1, 3) # self.lineEdit_fieldname_13 = QtGui.QLineEdit(self.tab_3) @@ -255,25 +252,25 @@ class Ui_PHYMOBAT(object): # self.comboBox_fieldname_12 = QtGui.QComboBox(self.tab_3) # self.comboBox_fieldname_12.setObjectName(_fromUtf8("comboBox_fieldname_12")) # self.gridLayout_2.addWidget(self.comboBox_fieldname_12, 14, 3, 1, 1) - self.label_chps_name_0 = QtGui.QLabel(self.tab_3) + self.label_chps_name_0 = QtWidgets.QLabel(self.tab_3) self.label_chps_name_0.setObjectName(_fromUtf8("label_chps_name_0")) self.gridLayout_2.addWidget(self.label_chps_name_0, 7, 0, 1, 1) - self.label_segmentation = QtGui.QLabel(self.tab_3) + self.label_segmentation = QtWidgets.QLabel(self.tab_3) self.label_segmentation.setObjectName(_fromUtf8("label_segmentation")) self.gridLayout_2.addWidget(self.label_segmentation, 0, 0, 1, 2) # self.comboBox_fieldname_3 = QtGui.QComboBox(self.tab_3) # self.comboBox_fieldname_3.setObjectName(_fromUtf8("comboBox_fieldname_3")) # self.gridLayout_2.addWidget(self.comboBox_fieldname_3, 17, 5, 1, 1) - self.lineEdit_output = QtGui.QLineEdit(self.tab_3) + self.lineEdit_output = QtWidgets.QLineEdit(self.tab_3) self.lineEdit_output.setObjectName(_fromUtf8("lineEdit_output")) self.gridLayout_2.addWidget(self.lineEdit_output, 5, 0, 1, 6) # self.lineEdit_fieldname_3 = QtGui.QLineEdit(self.tab_3) # self.lineEdit_fieldname_3.setObjectName(_fromUtf8("lineEdit_fieldname_3")) # self.gridLayout_2.addWidget(self.lineEdit_fieldname_3, 16, 5, 1, 1) - self.label_id_fieldtype = QtGui.QLabel(self.tab_3) + self.label_id_fieldtype = QtWidgets.QLabel(self.tab_3) self.label_id_fieldtype.setObjectName(_fromUtf8("label_id_fieldtype")) self.gridLayout_2.addWidget(self.label_id_fieldtype, 8, 1, 1, 1) - self.checkBox_classifier_3 = QtGui.QCheckBox(self.tab_3) + self.checkBox_classifier_3 = QtWidgets.QCheckBox(self.tab_3) self.checkBox_classifier_3.setObjectName(_fromUtf8("checkBox_classifier_3")) self.gridLayout_2.addWidget(self.checkBox_classifier_3, 15, 0, 1, 5) # self.label_chps_name_2 = QtGui.QLabel(self.tab_3) @@ -285,22 +282,22 @@ class Ui_PHYMOBAT(object): # self.lineEdit_fieldname_12 = QtGui.QLineEdit(self.tab_3) # self.lineEdit_fieldname_12.setObjectName(_fromUtf8("lineEdit_fieldname_12")) # self.gridLayout_2.addWidget(self.lineEdit_fieldname_12, 13, 3, 1, 1) - self.radioButton_s = QtGui.QRadioButton(self.tab_3) + self.radioButton_s = QtWidgets.QRadioButton(self.tab_3) self.radioButton_s.setObjectName(_fromUtf8("radioButton_s")) self.gridLayout_2.addWidget(self.radioButton_s, 3, 3, 1, 3) - self.pushButton_browser_output = QtGui.QPushButton(self.tab_3) + self.pushButton_browser_output = QtWidgets.QPushButton(self.tab_3) self.pushButton_browser_output.setObjectName(_fromUtf8("pushButton_browser_output")) self.gridLayout_2.addWidget(self.pushButton_browser_output, 5, 6, 1, 1) - self.lineEdit_segmentation = QtGui.QLineEdit(self.tab_3) + self.lineEdit_segmentation = QtWidgets.QLineEdit(self.tab_3) self.lineEdit_segmentation.setObjectName(_fromUtf8("lineEdit_segmentation")) self.gridLayout_2.addWidget(self.lineEdit_segmentation, 1, 0, 1, 6) # self.label_chps_name_1 = QtGui.QLabel(self.tab_3) # self.label_chps_name_1.setObjectName(_fromUtf8("label_chps_name_1")) # self.gridLayout_2.addWidget(self.label_chps_name_1, 10, 2, 1, 1) - self.label_classification_method = QtGui.QLabel(self.tab_3) + self.label_classification_method = QtWidgets.QLabel(self.tab_3) self.label_classification_method.setObjectName(_fromUtf8("label_classification_method")) self.gridLayout_2.addWidget(self.label_classification_method, 2, 0, 1, 3) - self.radioButton_rf = QtGui.QRadioButton(self.tab_3) + self.radioButton_rf = QtWidgets.QRadioButton(self.tab_3) self.radioButton_rf.setEnabled(True) self.radioButton_rf.setMouseTracking(True) self.radioButton_rf.setChecked(True) @@ -312,10 +309,10 @@ class Ui_PHYMOBAT(object): # self.lineEdit_fieldname_1 = QtGui.QLineEdit(self.tab_3) # self.lineEdit_fieldname_1.setObjectName(_fromUtf8("lineEdit_fieldname_1")) # self.gridLayout_2.addWidget(self.lineEdit_fieldname_1, 10, 3, 1, 1) - self.pushButton_browser_segmentation = QtGui.QPushButton(self.tab_3) + self.pushButton_browser_segmentation = QtWidgets.QPushButton(self.tab_3) self.pushButton_browser_segmentation.setObjectName(_fromUtf8("pushButton_browser_segmentation")) self.gridLayout_2.addWidget(self.pushButton_browser_segmentation, 1, 6, 1, 1) - self.label_chps_type_0 = QtGui.QLabel(self.tab_3) + self.label_chps_type_0 = QtWidgets.QLabel(self.tab_3) self.label_chps_type_0.setObjectName(_fromUtf8("label_chps_type_0")) self.gridLayout_2.addWidget(self.label_chps_type_0, 8, 0, 1, 1) # self.label_chps_2 = QtGui.QLabel(self.tab_3) @@ -327,13 +324,13 @@ class Ui_PHYMOBAT(object): # self.comboBox_fieldname_13 = QtGui.QComboBox(self.tab_3) # self.comboBox_fieldname_13.setObjectName(_fromUtf8("comboBox_fieldname_13")) # self.gridLayout_2.addWidget(self.comboBox_fieldname_13, 17, 3, 1, 1) - self.label_ouput_fieldname = QtGui.QLabel(self.tab_3) + self.label_ouput_fieldname = QtWidgets.QLabel(self.tab_3) self.label_ouput_fieldname.setObjectName(_fromUtf8("label_ouput_fieldname")) self.gridLayout_2.addWidget(self.label_ouput_fieldname, 6, 0, 1, 4) # self.comboBox_fieldname_4 = QtGui.QComboBox(self.tab_3) # self.comboBox_fieldname_4.setObjectName(_fromUtf8("comboBox_fieldname_4")) # self.gridLayout_2.addWidget(self.comboBox_fieldname_4, 17, 6, 1, 1) - self.label_id_fieldname = QtGui.QLabel(self.tab_3) + self.label_id_fieldname = QtWidgets.QLabel(self.tab_3) self.label_id_fieldname.setObjectName(_fromUtf8("label_id_fieldname")) self.gridLayout_2.addWidget(self.label_id_fieldname, 7, 1, 1, 1) # self.lineEdit_fieldname_2 = QtGui.QLineEdit(self.tab_3) @@ -342,7 +339,7 @@ class Ui_PHYMOBAT(object): # self.comboBox_fieldname_2 = QtGui.QComboBox(self.tab_3) # self.comboBox_fieldname_2.setObjectName(_fromUtf8("comboBox_fieldname_2")) # self.gridLayout_2.addWidget(self.comboBox_fieldname_2, 14, 4, 1, 1) - self.checkBox_classifier_1 = QtGui.QCheckBox(self.tab_3) + self.checkBox_classifier_1 = QtWidgets.QCheckBox(self.tab_3) # self.checkBox_classifier_1.setEnabled(True) # self.checkBox_classifier_1.setCheckable(True) # self.checkBox_classifier_1.setChecked(False) @@ -363,35 +360,35 @@ class Ui_PHYMOBAT(object): self.tabWidget.addTab(self.tab_3, _fromUtf8("")) self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 2) PHYMOBAT.setCentralWidget(self.centralwidget) - self.menubar = QtGui.QMenuBar(PHYMOBAT) + self.menubar = QtWidgets.QMenuBar(PHYMOBAT) self.menubar.setEnabled(True) self.menubar.setGeometry(QtCore.QRect(0, 0, 626, 25)) self.menubar.setDefaultUp(True) self.menubar.setObjectName(_fromUtf8("menubar")) - self.menuMenu = QtGui.QMenu(self.menubar) + self.menuMenu = QtWidgets.QMenu(self.menubar) self.menuMenu.setTearOffEnabled(True) self.menuMenu.setObjectName(_fromUtf8("menuMenu")) - self.menuAide = QtGui.QMenu(self.menubar) + self.menuAide = QtWidgets.QMenu(self.menubar) self.menuAide.setObjectName(_fromUtf8("menuAide")) - self.menuMode = QtGui.QMenu(self.menubar) + self.menuMode = QtWidgets.QMenu(self.menubar) self.menuMode.setObjectName(_fromUtf8("menuMode")) PHYMOBAT.setMenuBar(self.menubar) - self.statusbar = QtGui.QStatusBar(PHYMOBAT) + self.statusbar = QtWidgets.QStatusBar(PHYMOBAT) self.statusbar.setObjectName(_fromUtf8("statusbar")) PHYMOBAT.setStatusBar(self.statusbar) - self.actionOuvrir = QtGui.QAction(PHYMOBAT) + self.actionOuvrir = QtWidgets.QAction(PHYMOBAT) self.actionOuvrir.setObjectName(_fromUtf8("actionOuvrir")) - self.actionSauver = QtGui.QAction(PHYMOBAT) + self.actionSauver = QtWidgets.QAction(PHYMOBAT) self.actionSauver.setObjectName(_fromUtf8("actionSauver")) - self.actionQuiter = QtGui.QAction(PHYMOBAT) + self.actionQuiter = QtWidgets.QAction(PHYMOBAT) self.actionQuiter.setObjectName(_fromUtf8("actionQuiter")) - self.actionAide_de_PHYMOBAT = QtGui.QAction(PHYMOBAT) + self.actionAide_de_PHYMOBAT = QtWidgets.QAction(PHYMOBAT) self.actionAide_de_PHYMOBAT.setObjectName(_fromUtf8("actionAide_de_PHYMOBAT")) - self.actionA_propos_de_PHYMOBAT = QtGui.QAction(PHYMOBAT) + self.actionA_propos_de_PHYMOBAT = QtWidgets.QAction(PHYMOBAT) self.actionA_propos_de_PHYMOBAT.setObjectName(_fromUtf8("actionA_propos_de_PHYMOBAT")) - self.actionMode_Simplifi = QtGui.QAction(PHYMOBAT) + self.actionMode_Simplifi = QtWidgets.QAction(PHYMOBAT) self.actionMode_Simplifi.setObjectName(_fromUtf8("actionMode_Simplifi")) - self.actionMode_expert = QtGui.QAction(PHYMOBAT) + self.actionMode_expert = QtWidgets.QAction(PHYMOBAT) self.actionMode_expert.setObjectName(_fromUtf8("actionMode_expert")) self.menuMenu.addAction(self.actionOuvrir) self.menuMenu.addAction(self.actionSauver) diff --git a/ui_PHYMOBATs_tab.py b/ui_PHYMOBATs_tab.py index 681f32afad5154480742330e4529e497bea23a1b..c5ae0b97dca3b026ed2614a1f787d3e842aa5843 100644 --- a/ui_PHYMOBATs_tab.py +++ b/ui_PHYMOBATs_tab.py @@ -7,335 +7,336 @@ # # WARNING! All changes made in this file will be lost! -from PyQt4 import QtCore, QtGui +from PyQt5 import QtCore, QtGui, QtWidgets try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - def _fromUtf8(s): - return s - -try: - _encoding = QtGui.QApplication.UnicodeUTF8 + _encoding = QtWidgets.QApplication.UnicodeUTF8 def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig, _encoding) + return QtWidgets.QApplication.translate(context, text, disambig, _encoding) except AttributeError: def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig) + return QtWidgets.QApplication.translate(context, text, disambig) class Ui_PHYMOBAT(object): - """ - Class to display “Simplify PHYMOBAT windowâ€. + Class to display “Simplify PHYMOBAT windowâ€. """ def setupUi(self, PHYMOBAT): - PHYMOBAT.setObjectName(_fromUtf8("PHYMOBAT")) + PHYMOBAT.setObjectName("PHYMOBAT") PHYMOBAT.resize(726, 1052) - self.centralwidget = QtGui.QWidget(PHYMOBAT) - self.centralwidget.setObjectName(_fromUtf8("centralwidget")) - self.gridLayout_4 = QtGui.QGridLayout(self.centralwidget) - self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) - self.buttonBox = QtGui.QDialogButtonBox(self.centralwidget) + self.centralwidget = QtWidgets.QWidget(PHYMOBAT) + self.centralwidget.setObjectName("centralwidget") + self.gridLayout_4 = QtWidgets.QGridLayout(self.centralwidget) + self.gridLayout_4.setObjectName("gridLayout_4") + self.buttonBox = QtWidgets.QDialogButtonBox(self.centralwidget) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.Ok) - self.buttonBox.setObjectName(_fromUtf8("buttonBox")) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close|QtWidgets.QDialogButtonBox.Ok) + self.buttonBox.setObjectName("buttonBox") self.gridLayout_4.addWidget(self.buttonBox, 5, 1, 1, 1) - self.checkBox_multiprocess = QtGui.QCheckBox(self.centralwidget) + self.checkBox_multiprocess = QtWidgets.QCheckBox(self.centralwidget) self.checkBox_multiprocess.setCheckable(True) - self.checkBox_multiprocess.setChecked(True) + self.checkBox_multiprocess.setChecked(False) self.checkBox_multiprocess.setAutoRepeat(False) - self.checkBox_multiprocess.setObjectName(_fromUtf8("checkBox_multiprocess")) + self.checkBox_multiprocess.setObjectName("checkBox_multiprocess") self.gridLayout_4.addWidget(self.checkBox_multiprocess, 5, 0, 1, 1) - self.frame_2 = QtGui.QFrame(self.centralwidget) - self.frame_2.setFrameShape(QtGui.QFrame.StyledPanel) - self.frame_2.setFrameShadow(QtGui.QFrame.Raised) - self.frame_2.setObjectName(_fromUtf8("frame_2")) - self.gridLayout_3 = QtGui.QGridLayout(self.frame_2) - self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) - self.label_select_sample_nb_poly_3 = QtGui.QLabel(self.frame_2) - self.label_select_sample_nb_poly_3.setObjectName(_fromUtf8("label_select_sample_nb_poly_3")) + self.frame_2 = QtWidgets.QFrame(self.centralwidget) + self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised) + self.frame_2.setObjectName("frame_2") + self.gridLayout_3 = QtWidgets.QGridLayout(self.frame_2) + self.gridLayout_3.setObjectName("gridLayout_3") + self.label_select_sample_nb_poly_3 = QtWidgets.QLabel(self.frame_2) + self.label_select_sample_nb_poly_3.setObjectName("label_select_sample_nb_poly_3") self.gridLayout_3.addWidget(self.label_select_sample_nb_poly_3, 5, 5, 1, 1) - self.label_select_sample_class_6 = QtGui.QLabel(self.frame_2) - self.label_select_sample_class_6.setObjectName(_fromUtf8("label_select_sample_class_6")) + self.label_select_sample_class_6 = QtWidgets.QLabel(self.frame_2) + self.label_select_sample_class_6.setObjectName("label_select_sample_class_6") self.gridLayout_3.addWidget(self.label_select_sample_class_6, 5, 0, 1, 1) - self.label_select_sample_class_7 = QtGui.QLabel(self.frame_2) - self.label_select_sample_class_7.setObjectName(_fromUtf8("label_select_sample_class_7")) + self.label_select_sample_class_7 = QtWidgets.QLabel(self.frame_2) + self.label_select_sample_class_7.setObjectName("label_select_sample_class_7") self.gridLayout_3.addWidget(self.label_select_sample_class_7, 3, 2, 1, 1) - self.lineEdit_select_sample_nb_poly_3 = QtGui.QLineEdit(self.frame_2) - self.lineEdit_select_sample_nb_poly_3.setObjectName(_fromUtf8("lineEdit_select_sample_nb_poly_3")) + self.lineEdit_select_sample_nb_poly_3 = QtWidgets.QLineEdit(self.frame_2) + self.lineEdit_select_sample_nb_poly_3.setObjectName("lineEdit_select_sample_nb_poly_3") self.gridLayout_3.addWidget(self.lineEdit_select_sample_nb_poly_3, 5, 6, 1, 1) - self.lineEdit_select_sample_fieldname_5 = QtGui.QLineEdit(self.frame_2) - self.lineEdit_select_sample_fieldname_5.setObjectName(_fromUtf8("lineEdit_select_sample_fieldname_5")) + self.lineEdit_select_sample_fieldname_5 = QtWidgets.QLineEdit(self.frame_2) + self.lineEdit_select_sample_fieldname_5.setObjectName("lineEdit_select_sample_fieldname_5") self.gridLayout_3.addWidget(self.lineEdit_select_sample_fieldname_5, 4, 2, 1, 2) - self.pushButton_browser_sample_path_3 = QtGui.QPushButton(self.frame_2) - self.pushButton_browser_sample_path_3.setObjectName(_fromUtf8("pushButton_browser_sample_path_3")) + self.pushButton_browser_sample_path_3 = QtWidgets.QPushButton(self.frame_2) + self.pushButton_browser_sample_path_3.setObjectName("pushButton_browser_sample_path_3") self.gridLayout_3.addWidget(self.pushButton_browser_sample_path_3, 1, 7, 2, 1) - spacerItem = QtGui.QSpacerItem(79, 24, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem = QtWidgets.QSpacerItem(79, 24, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_3.addItem(spacerItem, 4, 1, 1, 1) - self.lineEdit_select_sample_class_6 = QtGui.QLineEdit(self.frame_2) - self.lineEdit_select_sample_class_6.setObjectName(_fromUtf8("lineEdit_select_sample_class_6")) + self.lineEdit_select_sample_class_6 = QtWidgets.QLineEdit(self.frame_2) + self.lineEdit_select_sample_class_6.setObjectName("lineEdit_select_sample_class_6") self.gridLayout_3.addWidget(self.lineEdit_select_sample_class_6, 5, 4, 1, 1) - spacerItem1 = QtGui.QSpacerItem(79, 13, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem1 = QtWidgets.QSpacerItem(79, 13, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_3.addItem(spacerItem1, 5, 1, 1, 1) - self.label_select_sample_fieldname_3 = QtGui.QLabel(self.frame_2) - self.label_select_sample_fieldname_3.setObjectName(_fromUtf8("label_select_sample_fieldname_3")) + self.label_select_sample_fieldname_3 = QtWidgets.QLabel(self.frame_2) + self.label_select_sample_fieldname_3.setObjectName("label_select_sample_fieldname_3") self.gridLayout_3.addWidget(self.label_select_sample_fieldname_3, 4, 0, 1, 1) - self.label_sample_path_3 = QtGui.QLabel(self.frame_2) - self.label_sample_path_3.setObjectName(_fromUtf8("label_sample_path_3")) + self.label_sample_path_3 = QtWidgets.QLabel(self.frame_2) + self.label_sample_path_3.setObjectName("label_sample_path_3") self.gridLayout_3.addWidget(self.label_sample_path_3, 0, 0, 1, 4) - self.label_select_sample_class_8 = QtGui.QLabel(self.frame_2) - self.label_select_sample_class_8.setObjectName(_fromUtf8("label_select_sample_class_8")) + self.label_select_sample_class_8 = QtWidgets.QLabel(self.frame_2) + self.label_select_sample_class_8.setObjectName("label_select_sample_class_8") self.gridLayout_3.addWidget(self.label_select_sample_class_8, 3, 4, 1, 1) - self.lineEdit_sample_path_3 = QtGui.QLineEdit(self.frame_2) - self.lineEdit_sample_path_3.setObjectName(_fromUtf8("lineEdit_sample_path_3")) + self.lineEdit_sample_path_3 = QtWidgets.QLineEdit(self.frame_2) + self.lineEdit_sample_path_3.setObjectName("lineEdit_sample_path_3") self.gridLayout_3.addWidget(self.lineEdit_sample_path_3, 1, 0, 2, 7) - self.lineEdit_select_sample_fieldname_6 = QtGui.QLineEdit(self.frame_2) - self.lineEdit_select_sample_fieldname_6.setObjectName(_fromUtf8("lineEdit_select_sample_fieldname_6")) + self.lineEdit_select_sample_fieldname_6 = QtWidgets.QLineEdit(self.frame_2) + self.lineEdit_select_sample_fieldname_6.setObjectName("lineEdit_select_sample_fieldname_6") self.gridLayout_3.addWidget(self.lineEdit_select_sample_fieldname_6, 4, 4, 1, 1) - self.lineEdit_select_sample_class_5 = QtGui.QLineEdit(self.frame_2) - self.lineEdit_select_sample_class_5.setObjectName(_fromUtf8("lineEdit_select_sample_class_5")) + self.lineEdit_select_sample_class_5 = QtWidgets.QLineEdit(self.frame_2) + self.lineEdit_select_sample_class_5.setObjectName("lineEdit_select_sample_class_5") self.gridLayout_3.addWidget(self.lineEdit_select_sample_class_5, 5, 2, 1, 2) self.gridLayout_4.addWidget(self.frame_2, 3, 0, 1, 2) - self.frame_3 = QtGui.QFrame(self.centralwidget) - self.frame_3.setFrameShape(QtGui.QFrame.StyledPanel) - self.frame_3.setFrameShadow(QtGui.QFrame.Raised) - self.frame_3.setObjectName(_fromUtf8("frame_3")) - self.gridLayout_2 = QtGui.QGridLayout(self.frame_3) - self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) - self.label_ouput = QtGui.QLabel(self.frame_3) - self.label_ouput.setObjectName(_fromUtf8("label_ouput")) + self.frame_3 = QtWidgets.QFrame(self.centralwidget) + self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.frame_3.setFrameShadow(QtWidgets.QFrame.Raised) + self.frame_3.setObjectName("frame_3") + self.gridLayout_2 = QtWidgets.QGridLayout(self.frame_3) + self.gridLayout_2.setObjectName("gridLayout_2") + self.label_ouput = QtWidgets.QLabel(self.frame_3) + self.label_ouput.setObjectName("label_ouput") self.gridLayout_2.addWidget(self.label_ouput, 0, 0, 1, 1) - self.lineEdit_output = QtGui.QLineEdit(self.frame_3) - self.lineEdit_output.setObjectName(_fromUtf8("lineEdit_output")) + self.lineEdit_output = QtWidgets.QLineEdit(self.frame_3) + self.lineEdit_output.setObjectName("lineEdit_output") self.gridLayout_2.addWidget(self.lineEdit_output, 1, 0, 1, 1) - self.pushButton_browser_output = QtGui.QPushButton(self.frame_3) - self.pushButton_browser_output.setObjectName(_fromUtf8("pushButton_browser_output")) + self.pushButton_browser_output = QtWidgets.QPushButton(self.frame_3) + self.pushButton_browser_output.setObjectName("pushButton_browser_output") self.gridLayout_2.addWidget(self.pushButton_browser_output, 1, 1, 1, 1) self.gridLayout_4.addWidget(self.frame_3, 4, 0, 1, 2) - self.frame_4 = QtGui.QFrame(self.centralwidget) - self.frame_4.setFrameShape(QtGui.QFrame.StyledPanel) - self.frame_4.setFrameShadow(QtGui.QFrame.Raised) - self.frame_4.setObjectName(_fromUtf8("frame_4")) - self.gridLayout_5 = QtGui.QGridLayout(self.frame_4) - self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) - spacerItem2 = QtGui.QSpacerItem(90, 12, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.frame_4 = QtWidgets.QFrame(self.centralwidget) + self.frame_4.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.frame_4.setFrameShadow(QtWidgets.QFrame.Raised) + self.frame_4.setObjectName("frame_4") + self.gridLayout_5 = QtWidgets.QGridLayout(self.frame_4) + self.gridLayout_5.setObjectName("gridLayout_5") + spacerItem2 = QtWidgets.QSpacerItem(90, 12, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_5.addItem(spacerItem2, 4, 1, 1, 1) - self.pushButton_browser_sample_path = QtGui.QPushButton(self.frame_4) - self.pushButton_browser_sample_path.setObjectName(_fromUtf8("pushButton_browser_sample_path")) + self.pushButton_browser_sample_path = QtWidgets.QPushButton(self.frame_4) + self.pushButton_browser_sample_path.setObjectName("pushButton_browser_sample_path") self.gridLayout_5.addWidget(self.pushButton_browser_sample_path, 1, 6, 1, 1) - spacerItem3 = QtGui.QSpacerItem(82, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem3 = QtWidgets.QSpacerItem(82, 15, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_5.addItem(spacerItem3, 4, 6, 1, 1) - self.lineEdit_select_sample_nb_poly = QtGui.QLineEdit(self.frame_4) - self.lineEdit_select_sample_nb_poly.setObjectName(_fromUtf8("lineEdit_select_sample_nb_poly")) + self.lineEdit_select_sample_nb_poly = QtWidgets.QLineEdit(self.frame_4) + self.lineEdit_select_sample_nb_poly.setObjectName("lineEdit_select_sample_nb_poly") self.gridLayout_5.addWidget(self.lineEdit_select_sample_nb_poly, 4, 5, 1, 1) - self.label_select_sample_class_1 = QtGui.QLabel(self.frame_4) - self.label_select_sample_class_1.setObjectName(_fromUtf8("label_select_sample_class_1")) + self.label_select_sample_class_1 = QtWidgets.QLabel(self.frame_4) + self.label_select_sample_class_1.setObjectName("label_select_sample_class_1") self.gridLayout_5.addWidget(self.label_select_sample_class_1, 2, 2, 1, 1) - self.label_select_sample_class_2 = QtGui.QLabel(self.frame_4) - self.label_select_sample_class_2.setObjectName(_fromUtf8("label_select_sample_class_2")) + self.label_select_sample_class_2 = QtWidgets.QLabel(self.frame_4) + self.label_select_sample_class_2.setObjectName("label_select_sample_class_2") self.gridLayout_5.addWidget(self.label_select_sample_class_2, 2, 3, 1, 1) - self.label_select_sample_fieldname = QtGui.QLabel(self.frame_4) - self.label_select_sample_fieldname.setObjectName(_fromUtf8("label_select_sample_fieldname")) + self.label_select_sample_fieldname = QtWidgets.QLabel(self.frame_4) + self.label_select_sample_fieldname.setObjectName("label_select_sample_fieldname") self.gridLayout_5.addWidget(self.label_select_sample_fieldname, 3, 0, 1, 1) - spacerItem4 = QtGui.QSpacerItem(90, 12, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem4 = QtWidgets.QSpacerItem(90, 12, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_5.addItem(spacerItem4, 3, 1, 1, 1) - self.label_select_sample_nb_poly = QtGui.QLabel(self.frame_4) - self.label_select_sample_nb_poly.setObjectName(_fromUtf8("label_select_sample_nb_poly")) + self.label_select_sample_nb_poly = QtWidgets.QLabel(self.frame_4) + self.label_select_sample_nb_poly.setObjectName("label_select_sample_nb_poly") self.gridLayout_5.addWidget(self.label_select_sample_nb_poly, 4, 4, 1, 1) - self.lineEdit_select_sample_class_2 = QtGui.QLineEdit(self.frame_4) - self.lineEdit_select_sample_class_2.setObjectName(_fromUtf8("lineEdit_select_sample_class_2")) + self.lineEdit_select_sample_class_2 = QtWidgets.QLineEdit(self.frame_4) + self.lineEdit_select_sample_class_2.setObjectName("lineEdit_select_sample_class_2") self.gridLayout_5.addWidget(self.lineEdit_select_sample_class_2, 4, 3, 1, 1) - self.lineEdit_select_sample_fieldname_1 = QtGui.QLineEdit(self.frame_4) - self.lineEdit_select_sample_fieldname_1.setObjectName(_fromUtf8("lineEdit_select_sample_fieldname_1")) + self.lineEdit_select_sample_fieldname_1 = QtWidgets.QLineEdit(self.frame_4) + self.lineEdit_select_sample_fieldname_1.setObjectName("lineEdit_select_sample_fieldname_1") self.gridLayout_5.addWidget(self.lineEdit_select_sample_fieldname_1, 3, 2, 1, 1) - self.label_sample_path = QtGui.QLabel(self.frame_4) - self.label_sample_path.setObjectName(_fromUtf8("label_sample_path")) + self.label_sample_path = QtWidgets.QLabel(self.frame_4) + self.label_sample_path.setObjectName("label_sample_path") self.gridLayout_5.addWidget(self.label_sample_path, 0, 0, 1, 4) - self.lineEdit_select_sample_fieldname_2 = QtGui.QLineEdit(self.frame_4) - self.lineEdit_select_sample_fieldname_2.setObjectName(_fromUtf8("lineEdit_select_sample_fieldname_2")) + self.lineEdit_select_sample_fieldname_2 = QtWidgets.QLineEdit(self.frame_4) + self.lineEdit_select_sample_fieldname_2.setObjectName("lineEdit_select_sample_fieldname_2") self.gridLayout_5.addWidget(self.lineEdit_select_sample_fieldname_2, 3, 3, 1, 1) - self.lineEdit_sample_path = QtGui.QLineEdit(self.frame_4) - self.lineEdit_sample_path.setObjectName(_fromUtf8("lineEdit_sample_path")) + self.lineEdit_sample_path = QtWidgets.QLineEdit(self.frame_4) + self.lineEdit_sample_path.setObjectName("lineEdit_sample_path") self.gridLayout_5.addWidget(self.lineEdit_sample_path, 1, 0, 1, 6) - self.lineEdit_select_sample_class_1 = QtGui.QLineEdit(self.frame_4) - self.lineEdit_select_sample_class_1.setObjectName(_fromUtf8("lineEdit_select_sample_class_1")) + self.lineEdit_select_sample_class_1 = QtWidgets.QLineEdit(self.frame_4) + self.lineEdit_select_sample_class_1.setObjectName("lineEdit_select_sample_class_1") self.gridLayout_5.addWidget(self.lineEdit_select_sample_class_1, 4, 2, 1, 1) - self.label_select_sample_class = QtGui.QLabel(self.frame_4) - self.label_select_sample_class.setObjectName(_fromUtf8("label_select_sample_class")) + self.label_select_sample_class = QtWidgets.QLabel(self.frame_4) + self.label_select_sample_class.setObjectName("label_select_sample_class") self.gridLayout_5.addWidget(self.label_select_sample_class, 4, 0, 1, 1) self.gridLayout_4.addWidget(self.frame_4, 1, 0, 1, 2) - self.frame_5 = QtGui.QFrame(self.centralwidget) - self.frame_5.setFrameShape(QtGui.QFrame.StyledPanel) - self.frame_5.setFrameShadow(QtGui.QFrame.Raised) - self.frame_5.setObjectName(_fromUtf8("frame_5")) - self.gridLayout_6 = QtGui.QGridLayout(self.frame_5) - self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) - self.label_select_sample_class_4 = QtGui.QLabel(self.frame_5) - self.label_select_sample_class_4.setObjectName(_fromUtf8("label_select_sample_class_4")) + self.frame_5 = QtWidgets.QFrame(self.centralwidget) + self.frame_5.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.frame_5.setFrameShadow(QtWidgets.QFrame.Raised) + self.frame_5.setObjectName("frame_5") + self.gridLayout_6 = QtWidgets.QGridLayout(self.frame_5) + self.gridLayout_6.setObjectName("gridLayout_6") + self.label_select_sample_class_4 = QtWidgets.QLabel(self.frame_5) + self.label_select_sample_class_4.setObjectName("label_select_sample_class_4") self.gridLayout_6.addWidget(self.label_select_sample_class_4, 4, 0, 1, 1) - self.lineEdit_sample_path_2 = QtGui.QLineEdit(self.frame_5) - self.lineEdit_sample_path_2.setObjectName(_fromUtf8("lineEdit_sample_path_2")) + self.lineEdit_sample_path_2 = QtWidgets.QLineEdit(self.frame_5) + self.lineEdit_sample_path_2.setObjectName("lineEdit_sample_path_2") self.gridLayout_6.addWidget(self.lineEdit_sample_path_2, 1, 0, 1, 6) - self.label_select_sample_fieldname_2 = QtGui.QLabel(self.frame_5) - self.label_select_sample_fieldname_2.setObjectName(_fromUtf8("label_select_sample_fieldname_2")) + self.label_select_sample_fieldname_2 = QtWidgets.QLabel(self.frame_5) + self.label_select_sample_fieldname_2.setObjectName("label_select_sample_fieldname_2") self.gridLayout_6.addWidget(self.label_select_sample_fieldname_2, 3, 0, 1, 1) - self.lineEdit_select_sample_class_4 = QtGui.QLineEdit(self.frame_5) - self.lineEdit_select_sample_class_4.setObjectName(_fromUtf8("lineEdit_select_sample_class_4")) + self.lineEdit_select_sample_class_4 = QtWidgets.QLineEdit(self.frame_5) + self.lineEdit_select_sample_class_4.setObjectName("lineEdit_select_sample_class_4") self.gridLayout_6.addWidget(self.lineEdit_select_sample_class_4, 4, 3, 1, 1) - self.label_select_sample_nb_poly_2 = QtGui.QLabel(self.frame_5) - self.label_select_sample_nb_poly_2.setObjectName(_fromUtf8("label_select_sample_nb_poly_2")) + self.label_select_sample_nb_poly_2 = QtWidgets.QLabel(self.frame_5) + self.label_select_sample_nb_poly_2.setObjectName("label_select_sample_nb_poly_2") self.gridLayout_6.addWidget(self.label_select_sample_nb_poly_2, 4, 4, 1, 1) - self.label_select_sample_class_3 = QtGui.QLabel(self.frame_5) - self.label_select_sample_class_3.setObjectName(_fromUtf8("label_select_sample_class_3")) + self.label_select_sample_class_3 = QtWidgets.QLabel(self.frame_5) + self.label_select_sample_class_3.setObjectName("label_select_sample_class_3") self.gridLayout_6.addWidget(self.label_select_sample_class_3, 2, 2, 1, 1) - spacerItem5 = QtGui.QSpacerItem(76, 24, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem5 = QtWidgets.QSpacerItem(76, 24, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_6.addItem(spacerItem5, 4, 1, 1, 1) - self.lineEdit_select_sample_fieldname_3 = QtGui.QLineEdit(self.frame_5) - self.lineEdit_select_sample_fieldname_3.setObjectName(_fromUtf8("lineEdit_select_sample_fieldname_3")) + self.lineEdit_select_sample_fieldname_3 = QtWidgets.QLineEdit(self.frame_5) + self.lineEdit_select_sample_fieldname_3.setObjectName("lineEdit_select_sample_fieldname_3") self.gridLayout_6.addWidget(self.lineEdit_select_sample_fieldname_3, 3, 2, 1, 1) - self.pushButton_browser_sample_path_2 = QtGui.QPushButton(self.frame_5) - self.pushButton_browser_sample_path_2.setObjectName(_fromUtf8("pushButton_browser_sample_path_2")) + self.pushButton_browser_sample_path_2 = QtWidgets.QPushButton(self.frame_5) + self.pushButton_browser_sample_path_2.setObjectName("pushButton_browser_sample_path_2") self.gridLayout_6.addWidget(self.pushButton_browser_sample_path_2, 1, 6, 1, 1) - self.lineEdit_select_sample_fieldname_4 = QtGui.QLineEdit(self.frame_5) - self.lineEdit_select_sample_fieldname_4.setObjectName(_fromUtf8("lineEdit_select_sample_fieldname_4")) + self.lineEdit_select_sample_fieldname_4 = QtWidgets.QLineEdit(self.frame_5) + self.lineEdit_select_sample_fieldname_4.setObjectName("lineEdit_select_sample_fieldname_4") self.gridLayout_6.addWidget(self.lineEdit_select_sample_fieldname_4, 3, 3, 1, 1) - spacerItem6 = QtGui.QSpacerItem(76, 24, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem6 = QtWidgets.QSpacerItem(76, 24, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_6.addItem(spacerItem6, 3, 1, 1, 1) - self.label_sample_path_2 = QtGui.QLabel(self.frame_5) - self.label_sample_path_2.setObjectName(_fromUtf8("label_sample_path_2")) + self.label_sample_path_2 = QtWidgets.QLabel(self.frame_5) + self.label_sample_path_2.setObjectName("label_sample_path_2") self.gridLayout_6.addWidget(self.label_sample_path_2, 0, 0, 1, 3) - self.lineEdit_select_sample_nb_poly_2 = QtGui.QLineEdit(self.frame_5) - self.lineEdit_select_sample_nb_poly_2.setObjectName(_fromUtf8("lineEdit_select_sample_nb_poly_2")) + self.lineEdit_select_sample_nb_poly_2 = QtWidgets.QLineEdit(self.frame_5) + self.lineEdit_select_sample_nb_poly_2.setObjectName("lineEdit_select_sample_nb_poly_2") self.gridLayout_6.addWidget(self.lineEdit_select_sample_nb_poly_2, 4, 5, 1, 1) - self.lineEdit_select_sample_class_3 = QtGui.QLineEdit(self.frame_5) - self.lineEdit_select_sample_class_3.setObjectName(_fromUtf8("lineEdit_select_sample_class_3")) + self.lineEdit_select_sample_class_3 = QtWidgets.QLineEdit(self.frame_5) + self.lineEdit_select_sample_class_3.setObjectName("lineEdit_select_sample_class_3") self.gridLayout_6.addWidget(self.lineEdit_select_sample_class_3, 4, 2, 1, 1) - self.label_select_sample_class_5 = QtGui.QLabel(self.frame_5) - self.label_select_sample_class_5.setObjectName(_fromUtf8("label_select_sample_class_5")) + self.label_select_sample_class_5 = QtWidgets.QLabel(self.frame_5) + self.label_select_sample_class_5.setObjectName("label_select_sample_class_5") self.gridLayout_6.addWidget(self.label_select_sample_class_5, 2, 3, 1, 1) self.gridLayout_4.addWidget(self.frame_5, 2, 0, 1, 2) - self.frame = QtGui.QFrame(self.centralwidget) - self.frame.setFrameShape(QtGui.QFrame.StyledPanel) - self.frame.setFrameShadow(QtGui.QFrame.Raised) - self.frame.setObjectName(_fromUtf8("frame")) - self.gridLayout = QtGui.QGridLayout(self.frame) - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.label_principal_folder = QtGui.QLabel(self.frame) - self.label_principal_folder.setObjectName(_fromUtf8("label_principal_folder")) + self.frame = QtWidgets.QFrame(self.centralwidget) + self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.frame.setFrameShadow(QtWidgets.QFrame.Raised) + self.frame.setObjectName("frame") + self.gridLayout = QtWidgets.QGridLayout(self.frame) + self.gridLayout.setObjectName("gridLayout") + self.label_principal_folder = QtWidgets.QLabel(self.frame) + self.label_principal_folder.setObjectName("label_principal_folder") self.gridLayout.addWidget(self.label_principal_folder, 0, 0, 1, 2) - self.lineEdit_principal_folder = QtGui.QLineEdit(self.frame) - self.lineEdit_principal_folder.setObjectName(_fromUtf8("lineEdit_principal_folder")) + self.lineEdit_principal_folder = QtWidgets.QLineEdit(self.frame) + self.lineEdit_principal_folder.setObjectName("lineEdit_principal_folder") self.gridLayout.addWidget(self.lineEdit_principal_folder, 1, 0, 1, 5) - self.pushButton_browser_principal_folder = QtGui.QPushButton(self.frame) - self.pushButton_browser_principal_folder.setObjectName(_fromUtf8("pushButton_browser_principal_folder")) + self.pushButton_browser_principal_folder = QtWidgets.QPushButton(self.frame) + self.pushButton_browser_principal_folder.setObjectName("pushButton_browser_principal_folder") self.gridLayout.addWidget(self.pushButton_browser_principal_folder, 1, 5, 1, 1) - self.label_year_images = QtGui.QLabel(self.frame) - self.label_year_images.setObjectName(_fromUtf8("label_year_images")) + self.label_year_images = QtWidgets.QLabel(self.frame) + self.label_year_images.setObjectName("label_year_images") self.gridLayout.addWidget(self.label_year_images, 2, 0, 1, 1) - self.lineEdit_year_images = QtGui.QLineEdit(self.frame) - self.lineEdit_year_images.setObjectName(_fromUtf8("lineEdit_year_images")) + self.lineEdit_year_images = QtWidgets.QLineEdit(self.frame) + self.lineEdit_year_images.setObjectName("lineEdit_year_images") self.gridLayout.addWidget(self.lineEdit_year_images, 2, 1, 1, 2) - self.label_ex_period = QtGui.QLabel(self.frame) + self.label_ex_period = QtWidgets.QLabel(self.frame) font = QtGui.QFont() font.setPointSize(8) font.setItalic(True) self.label_ex_period.setFont(font) - self.label_ex_period.setObjectName(_fromUtf8("label_ex_period")) + self.label_ex_period.setObjectName("label_ex_period") self.gridLayout.addWidget(self.label_ex_period, 2, 3, 1, 3) - self.label_area_path = QtGui.QLabel(self.frame) - self.label_area_path.setObjectName(_fromUtf8("label_area_path")) + self.label_area_path = QtWidgets.QLabel(self.frame) + self.label_area_path.setObjectName("label_area_path") self.gridLayout.addWidget(self.label_area_path, 3, 0, 1, 2) - self.lineEdit_area_path = QtGui.QLineEdit(self.frame) - self.lineEdit_area_path.setObjectName(_fromUtf8("lineEdit_area_path")) + self.lineEdit_area_path = QtWidgets.QLineEdit(self.frame) + self.lineEdit_area_path.setObjectName("lineEdit_area_path") self.gridLayout.addWidget(self.lineEdit_area_path, 4, 0, 1, 5) - self.pushButton_browser_area_path = QtGui.QPushButton(self.frame) - self.pushButton_browser_area_path.setObjectName(_fromUtf8("pushButton_browser_area_path")) + self.pushButton_browser_area_path = QtWidgets.QPushButton(self.frame) + self.pushButton_browser_area_path.setObjectName("pushButton_browser_area_path") self.gridLayout.addWidget(self.pushButton_browser_area_path, 4, 5, 1, 1) - self.label_id_theia = QtGui.QLabel(self.frame) - self.label_id_theia.setObjectName(_fromUtf8("label_id_theia")) + self.label_id_theia = QtWidgets.QLabel(self.frame) + self.label_id_theia.setObjectName("label_id_theia") self.gridLayout.addWidget(self.label_id_theia, 5, 0, 1, 1) - self.label_user = QtGui.QLabel(self.frame) - self.label_user.setObjectName(_fromUtf8("label_user")) + self.label_user = QtWidgets.QLabel(self.frame) + self.label_user.setObjectName("label_user") self.gridLayout.addWidget(self.label_user, 6, 0, 1, 1) - self.lineEdit_user = QtGui.QLineEdit(self.frame) - self.lineEdit_user.setObjectName(_fromUtf8("lineEdit_user")) + + self.ignore_download = QtWidgets.QCheckBox(self.frame) + self.ignore_download.setCheckable(True) + self.ignore_download.setChecked(False) + self.ignore_download.setAutoRepeat(False) + self.ignore_download.setObjectName("ignore_download") + self.gridLayout.addWidget(self.ignore_download, 5, 1, 1, 1) + + self.lineEdit_user = QtWidgets.QLineEdit(self.frame) + self.lineEdit_user.setObjectName("lineEdit_user") self.gridLayout.addWidget(self.lineEdit_user, 6, 1, 1, 1) - spacerItem7 = QtGui.QSpacerItem(73, 13, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem7 = QtWidgets.QSpacerItem(73, 13, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem7, 6, 2, 1, 1) - self.label_password = QtGui.QLabel(self.frame) - self.label_password.setObjectName(_fromUtf8("label_password")) + self.label_password = QtWidgets.QLabel(self.frame) + self.label_password.setObjectName("label_password") self.gridLayout.addWidget(self.label_password, 6, 3, 1, 1) - self.lineEdit_password = QtGui.QLineEdit(self.frame) - self.lineEdit_password.setEchoMode(QtGui.QLineEdit.Password) - self.lineEdit_password.setObjectName(_fromUtf8("lineEdit_password")) + self.lineEdit_password = QtWidgets.QLineEdit(self.frame) + self.lineEdit_password.setEchoMode(QtWidgets.QLineEdit.Password) + self.lineEdit_password.setObjectName("lineEdit_password") self.gridLayout.addWidget(self.lineEdit_password, 6, 4, 1, 1) - spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem8 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem8, 6, 5, 1, 1) - self.checkBox_MNT = QtGui.QLabel(self.frame) - self.checkBox_MNT.setObjectName(_fromUtf8("checkBox_MNT")) + self.checkBox_MNT = QtWidgets.QLabel(self.frame) + self.checkBox_MNT.setObjectName("checkBox_MNT") self.gridLayout.addWidget(self.checkBox_MNT, 7, 0, 1, 1) - self.lineEdit_MNT = QtGui.QLineEdit(self.frame) - self.lineEdit_MNT.setObjectName(_fromUtf8("lineEdit_MNT")) + self.lineEdit_MNT = QtWidgets.QLineEdit(self.frame) + self.lineEdit_MNT.setObjectName("lineEdit_MNT") # self.lineEdit_MNT.setEnabled(False) self.gridLayout.addWidget(self.lineEdit_MNT, 8, 0, 1, 5) - self.pushButton_browser_MNT = QtGui.QPushButton(self.frame) - self.pushButton_browser_MNT.setObjectName(_fromUtf8("pushButton_browser_MNT")) + self.pushButton_browser_MNT = QtWidgets.QPushButton(self.frame) + self.pushButton_browser_MNT.setObjectName("pushButton_browser_MNT") # self.pushButton_browser_MNT.setEnabled(False) self.gridLayout.addWidget(self.pushButton_browser_MNT, 8, 5, 1, 1) - self.checkBox_VHRS = QtGui.QLabel(self.frame) - self.checkBox_VHRS.setObjectName(_fromUtf8("checkBox_VHRS")) + self.checkBox_VHRS = QtWidgets.QLabel(self.frame) + self.checkBox_VHRS.setObjectName("checkBox_VHRS") self.gridLayout.addWidget(self.checkBox_VHRS, 9, 0, 1, 1) - self.lineEdit_VHRS = QtGui.QLineEdit(self.frame) - self.lineEdit_VHRS.setObjectName(_fromUtf8("lineEdit_VHRS")) + self.lineEdit_VHRS = QtWidgets.QLineEdit(self.frame) + self.lineEdit_VHRS.setObjectName("lineEdit_VHRS") self.gridLayout.addWidget(self.lineEdit_VHRS, 10, 0, 1, 5) - self.pushButton_browser_VHRS = QtGui.QPushButton(self.frame) - self.pushButton_browser_VHRS.setObjectName(_fromUtf8("pushButton_browser_VHRS")) + self.pushButton_browser_VHRS = QtWidgets.QPushButton(self.frame) + self.pushButton_browser_VHRS.setObjectName("pushButton_browser_VHRS") self.gridLayout.addWidget(self.pushButton_browser_VHRS, 10, 5, 1, 1) - self.label_segmentation = QtGui.QLabel(self.frame) - self.label_segmentation.setObjectName(_fromUtf8("label_segmentation")) + self.label_segmentation = QtWidgets.QLabel(self.frame) + self.label_segmentation.setObjectName("label_segmentation") self.gridLayout.addWidget(self.label_segmentation, 11, 0, 1, 2) - self.lineEdit_segmentation = QtGui.QLineEdit(self.frame) - self.lineEdit_segmentation.setObjectName(_fromUtf8("lineEdit_segmentation")) + self.lineEdit_segmentation = QtWidgets.QLineEdit(self.frame) + self.lineEdit_segmentation.setObjectName("lineEdit_segmentation") self.gridLayout.addWidget(self.lineEdit_segmentation, 12, 0, 1, 5) - self.pushButton_browser_segmentation = QtGui.QPushButton(self.frame) - self.pushButton_browser_segmentation.setObjectName(_fromUtf8("pushButton_browser_segmentation")) + self.pushButton_browser_segmentation = QtWidgets.QPushButton(self.frame) + self.pushButton_browser_segmentation.setObjectName("pushButton_browser_segmentation") self.gridLayout.addWidget(self.pushButton_browser_segmentation, 12, 5, 1, 1) - self.proxy = QtGui.QPushButton(self.frame) - self.proxy.setObjectName(_fromUtf8("proxy")) + self.proxy = QtWidgets.QPushButton(self.frame) + self.proxy.setObjectName("proxy") self.gridLayout.addWidget(self.proxy, 6, 5, 1, 1) self.gridLayout_4.addWidget(self.frame, 0, 0, 1, 2) PHYMOBAT.setCentralWidget(self.centralwidget) - self.menubar = QtGui.QMenuBar(PHYMOBAT) + self.menubar = QtWidgets.QMenuBar(PHYMOBAT) self.menubar.setEnabled(True) self.menubar.setGeometry(QtCore.QRect(0, 0, 726, 25)) self.menubar.setDefaultUp(True) - self.menubar.setObjectName(_fromUtf8("menubar")) - self.menuMenu = QtGui.QMenu(self.menubar) + self.menubar.setObjectName("menubar") + self.menuMenu = QtWidgets.QMenu(self.menubar) self.menuMenu.setTearOffEnabled(True) - self.menuMenu.setObjectName(_fromUtf8("menuMenu")) - self.menuAide = QtGui.QMenu(self.menubar) - self.menuAide.setObjectName(_fromUtf8("menuAide")) - self.menuMode = QtGui.QMenu(self.menubar) - self.menuMode.setObjectName(_fromUtf8("menuMode")) + self.menuMenu.setObjectName("menuMenu") + self.menuAide = QtWidgets.QMenu(self.menubar) + self.menuAide.setObjectName("menuAide") + self.menuMode = QtWidgets.QMenu(self.menubar) + self.menuMode.setObjectName("menuMode") PHYMOBAT.setMenuBar(self.menubar) - self.statusbar = QtGui.QStatusBar(PHYMOBAT) - self.statusbar.setObjectName(_fromUtf8("statusbar")) + self.statusbar = QtWidgets.QStatusBar(PHYMOBAT) + self.statusbar.setObjectName("statusbar") PHYMOBAT.setStatusBar(self.statusbar) - self.actionOuvrir = QtGui.QAction(PHYMOBAT) - self.actionOuvrir.setObjectName(_fromUtf8("actionOuvrir")) - self.actionSauver = QtGui.QAction(PHYMOBAT) - self.actionSauver.setObjectName(_fromUtf8("actionSauver")) - self.actionQuiter = QtGui.QAction(PHYMOBAT) - self.actionQuiter.setObjectName(_fromUtf8("actionQuiter")) - self.actionAide_de_PHYMOBAT = QtGui.QAction(PHYMOBAT) - self.actionAide_de_PHYMOBAT.setObjectName(_fromUtf8("actionAide_de_PHYMOBAT")) - self.actionA_propos_de_PHYMOBAT = QtGui.QAction(PHYMOBAT) - self.actionA_propos_de_PHYMOBAT.setObjectName(_fromUtf8("actionA_propos_de_PHYMOBAT")) - self.actionMode_Simplifi = QtGui.QAction(PHYMOBAT) - self.actionMode_Simplifi.setObjectName(_fromUtf8("actionMode_Simplifi")) - self.actionMode_expert = QtGui.QAction(PHYMOBAT) - self.actionMode_expert.setObjectName(_fromUtf8("actionMode_expert")) + self.actionOuvrir = QtWidgets.QAction(PHYMOBAT) + self.actionOuvrir.setObjectName("actionOuvrir") + self.actionSauver = QtWidgets.QAction(PHYMOBAT) + self.actionSauver.setObjectName("actionSauver") + self.actionQuiter = QtWidgets.QAction(PHYMOBAT) + self.actionQuiter.setObjectName("actionQuiter") + self.actionAide_de_PHYMOBAT = QtWidgets.QAction(PHYMOBAT) + self.actionAide_de_PHYMOBAT.setObjectName("actionAide_de_PHYMOBAT") + self.actionA_propos_de_PHYMOBAT = QtWidgets.QAction(PHYMOBAT) + self.actionA_propos_de_PHYMOBAT.setObjectName("actionA_propos_de_PHYMOBAT") + self.actionMode_Simplifi = QtWidgets.QAction(PHYMOBAT) + self.actionMode_Simplifi.setObjectName("actionMode_Simplifi") + self.actionMode_expert = QtWidgets.QAction(PHYMOBAT) + self.actionMode_expert.setObjectName("actionMode_expert") self.menuMenu.addAction(self.actionOuvrir) self.menuMenu.addAction(self.actionSauver) self.menuMenu.addAction(self.actionQuiter) @@ -350,6 +351,7 @@ class Ui_PHYMOBAT(object): self.retranslateUi(PHYMOBAT) QtCore.QMetaObject.connectSlotsByName(PHYMOBAT) PHYMOBAT.setTabOrder(self.checkBox_multiprocess, self.buttonBox) + PHYMOBAT.setTabOrder(self.ignore_download, self.buttonBox) PHYMOBAT.setTabOrder(self.buttonBox, self.lineEdit_principal_folder) PHYMOBAT.setTabOrder(self.lineEdit_principal_folder, self.pushButton_browser_principal_folder) PHYMOBAT.setTabOrder(self.pushButton_browser_principal_folder, self.lineEdit_year_images) @@ -390,6 +392,7 @@ class Ui_PHYMOBAT(object): def retranslateUi(self, PHYMOBAT): PHYMOBAT.setWindowTitle(_translate("PHYMOBAT", "PHYMOBATs 3.0", None)) self.checkBox_multiprocess.setText(_translate("PHYMOBAT", "Multi-processing", None)) + self.ignore_download.setText(_translate("PHYMOBAT", "Ignore download", None)) self.label_select_sample_nb_poly_3.setText(_translate("PHYMOBAT", "<html><head/><body><p>Nbre de polygones</p></body></html>", None)) self.label_select_sample_class_6.setText(_translate("PHYMOBAT", "Classes", None)) self.label_select_sample_class_7.setText(_translate("PHYMOBAT", "<html><head/><body><p align=\"center\">Ligneux denses</p></body></html>", None)) diff --git a/ui_Proxy_window.py b/ui_Proxy_window.py index c0485df94bc34813db38e4c96e40720acef05e9a..8bf4749ac3760c98f915974019c8cb32544ffea1 100644 --- a/ui_Proxy_window.py +++ b/ui_Proxy_window.py @@ -7,21 +7,15 @@ # # WARNING! All changes made in this file will be lost! -from PyQt4 import QtCore, QtGui +from PyQt5 import QtCore, QtWidgets try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - def _fromUtf8(s): - return s - -try: - _encoding = QtGui.QApplication.UnicodeUTF8 + _encoding = QtWidgets.QApplication.UnicodeUTF8 def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig, _encoding) + return QtWidgets.QApplication.translate(context, text, disambig, _encoding) except AttributeError: def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig) + return QtWidgets.QApplication.translate(context, text, disambig) class Ui_Proxy_window(object): @@ -30,36 +24,36 @@ class Ui_Proxy_window(object): """ def setupUi(self, Proxy_window): - Proxy_window.setObjectName(_fromUtf8("Proxy_window")) + Proxy_window.setObjectName("Proxy_window") Proxy_window.resize(344, 144) Proxy_window.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu) - self.gridLayout = QtGui.QGridLayout(Proxy_window) - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.label_proxy = QtGui.QLabel(Proxy_window) - self.label_proxy.setObjectName(_fromUtf8("label_proxy")) + self.gridLayout = QtWidgets.QGridLayout(Proxy_window) + self.gridLayout.setObjectName("gridLayout") + self.label_proxy = QtWidgets.QLabel(Proxy_window) + self.label_proxy.setObjectName("label_proxy") self.gridLayout.addWidget(self.label_proxy, 0, 0, 1, 1) - self.lineEdit_proxy = QtGui.QLineEdit(Proxy_window) - self.lineEdit_proxy.setInputMask(_fromUtf8("")) - self.lineEdit_proxy.setText(_fromUtf8("")) + self.lineEdit_proxy = QtWidgets.QLineEdit(Proxy_window) + self.lineEdit_proxy.setInputMask("") + self.lineEdit_proxy.setText("") self.lineEdit_proxy.setFrame(True) - self.lineEdit_proxy.setObjectName(_fromUtf8("lineEdit_proxy")) + self.lineEdit_proxy.setObjectName("lineEdit_proxy") self.gridLayout.addWidget(self.lineEdit_proxy, 0, 2, 1, 1) - self.label_login_proxy = QtGui.QLabel(Proxy_window) - self.label_login_proxy.setObjectName(_fromUtf8("label_login_proxy")) + self.label_login_proxy = QtWidgets.QLabel(Proxy_window) + self.label_login_proxy.setObjectName("label_login_proxy") self.gridLayout.addWidget(self.label_login_proxy, 1, 0, 1, 2) - self.lineEdit_login_proxy = QtGui.QLineEdit(Proxy_window) - self.lineEdit_login_proxy.setObjectName(_fromUtf8("lineEdit_login_proxy")) + self.lineEdit_login_proxy = QtWidgets.QLineEdit(Proxy_window) + self.lineEdit_login_proxy.setObjectName("lineEdit_login_proxy") self.gridLayout.addWidget(self.lineEdit_login_proxy, 1, 2, 1, 1) - self.label_password_proxy = QtGui.QLabel(Proxy_window) - self.label_password_proxy.setObjectName(_fromUtf8("label_password_proxy")) + self.label_password_proxy = QtWidgets.QLabel(Proxy_window) + self.label_password_proxy.setObjectName("label_password_proxy") self.gridLayout.addWidget(self.label_password_proxy, 2, 0, 1, 2) - self.lineEdit_password_proxy = QtGui.QLineEdit(Proxy_window) - self.lineEdit_password_proxy.setObjectName(_fromUtf8("lineEdit_password_proxy")) + self.lineEdit_password_proxy = QtWidgets.QLineEdit(Proxy_window) + self.lineEdit_password_proxy.setObjectName("lineEdit_password_proxy") self.gridLayout.addWidget(self.lineEdit_password_proxy, 2, 2, 1, 1) - self.buttonBox_proxy = QtGui.QDialogButtonBox(Proxy_window) - self.buttonBox_proxy.setStandardButtons(QtGui.QDialogButtonBox.Apply|QtGui.QDialogButtonBox.Close) + self.buttonBox_proxy = QtWidgets.QDialogButtonBox(Proxy_window) + self.buttonBox_proxy.setStandardButtons(QtWidgets.QDialogButtonBox.Apply|QtWidgets.QDialogButtonBox.Close) self.buttonBox_proxy.setCenterButtons(False) - self.buttonBox_proxy.setObjectName(_fromUtf8("buttonBox_proxy")) + self.buttonBox_proxy.setObjectName("buttonBox_proxy") self.gridLayout.addWidget(self.buttonBox_proxy, 3, 1, 1, 2) self.retranslateUi(Proxy_window) diff --git a/ui_Warming_forgetting.py b/ui_Warming_forgetting.py index 87126e2358656b0bdb6ed3ffed6def4da03f18c9..87d3989d2e7446fd563540bcdf487fe3fba37667 100644 --- a/ui_Warming_forgetting.py +++ b/ui_Warming_forgetting.py @@ -23,21 +23,15 @@ # You should have received a copy of the GNU General Public License # along with PHYMOBAT 1.2. If not, see <http://www.gnu.org/licenses/>. -from PyQt4 import QtCore, QtGui +from PyQt5 import QtCore, QtWidgets try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - def _fromUtf8(s): - return s - -try: - _encoding = QtGui.QApplication.UnicodeUTF8 + _encoding = QtWidgets.QApplication.UnicodeUTF8 def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig, _encoding) + return QtWidgets.QApplication.translate(context, text, disambig, _encoding) except AttributeError: def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig) + return QtWidgets.QApplication.translate(context, text, disambig) class Ui_Warming_forgetting(object): """ @@ -45,19 +39,19 @@ class Ui_Warming_forgetting(object): """ def setupUi(self, Form): - Form.setObjectName(_fromUtf8("Form")) + Form.setObjectName("Form") Form.resize(332, 102) - self.gridLayout = QtGui.QGridLayout(Form) - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.label_forget = QtGui.QLabel(Form) - self.label_forget.setObjectName(_fromUtf8("label_forget")) + self.gridLayout = QtWidgets.QGridLayout(Form) + self.gridLayout.setObjectName("gridLayout") + self.label_forget = QtWidgets.QLabel(Form) + self.label_forget.setObjectName("label_forget") self.gridLayout.addWidget(self.label_forget, 0, 0, 1, 3) - spacerItem = QtGui.QSpacerItem(93, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem = QtWidgets.QSpacerItem(93, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem, 1, 0, 1, 1) - self.pushButton_ok_forget = QtGui.QPushButton(Form) - self.pushButton_ok_forget.setObjectName(_fromUtf8("pushButton_ok_forget")) + self.pushButton_ok_forget = QtWidgets.QPushButton(Form) + self.pushButton_ok_forget.setObjectName("pushButton_ok_forget") self.gridLayout.addWidget(self.pushButton_ok_forget, 1, 1, 1, 1) - spacerItem1 = QtGui.QSpacerItem(104, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem1 = QtWidgets.QSpacerItem(104, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem1, 1, 2, 1, 1) self.retranslateUi(Form) diff --git a/ui_Warming_study_area.py b/ui_Warming_study_area.py index e0113c2aa6878e0b741cf51cc4f6ffa7daabb18e..31da8eb4337edc0526d756e3700b89b78895f29e 100644 --- a/ui_Warming_study_area.py +++ b/ui_Warming_study_area.py @@ -23,21 +23,15 @@ # You should have received a copy of the GNU General Public License # along with PHYMOBAT 1.2. If not, see <http://www.gnu.org/licenses/>. -from PyQt4 import QtCore, QtGui +from PyQt5 import QtCore, QtWidgets try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - def _fromUtf8(s): - return s - -try: - _encoding = QtGui.QApplication.UnicodeUTF8 + _encoding = QtWidgets.QApplication.UnicodeUTF8 def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig, _encoding) + return QtWidgets.QApplication.translate(context, text, disambig, _encoding) except AttributeError: def _translate(context, text, disambig): - return QtGui.QApplication.translate(context, text, disambig) + return QtWidgets.QApplication.translate(context, text, disambig) class Ui_Warming_study_area(object): """ @@ -45,19 +39,19 @@ class Ui_Warming_study_area(object): """ def setupUi(self, Form): - Form.setObjectName(_fromUtf8("Form")) + Form.setObjectName("Form") Form.resize(318, 88) - self.gridLayout = QtGui.QGridLayout(Form) - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.label = QtGui.QLabel(Form) - self.label.setObjectName(_fromUtf8("label")) + self.gridLayout = QtWidgets.QGridLayout(Form) + self.gridLayout.setObjectName("gridLayout") + self.label = QtWidgets.QLabel(Form) + self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 0, 0, 1, 3) - spacerItem = QtGui.QSpacerItem(93, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem = QtWidgets.QSpacerItem(93, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem, 1, 0, 1, 1) - self.pushButton_ok_window_warning_study_area = QtGui.QPushButton(Form) - self.pushButton_ok_window_warning_study_area.setObjectName(_fromUtf8("pushButton_ok_window_warning_study_area")) + self.pushButton_ok_window_warning_study_area = QtWidgets.QPushButton(Form) + self.pushButton_ok_window_warning_study_area.setObjectName("pushButton_ok_window_warning_study_area") self.gridLayout.addWidget(self.pushButton_ok_window_warning_study_area, 1, 1, 1, 1) - spacerItem1 = QtGui.QSpacerItem(104, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + spacerItem1 = QtWidgets.QSpacerItem(104, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem1, 1, 2, 1, 1) self.retranslateUi(Form)