Creating Classifier

This commit is contained in:
Daniel Saavedra
2020-11-18 03:05:29 -03:00
parent 54d46d71e3
commit 9d80f542a6
11 changed files with 7667 additions and 5581 deletions

View File

@@ -2,18 +2,9 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/dlsaavedra/anaconda3/envs/new/lib/python3.7/site-packages/pysal/__init__.py:65: VisibleDeprecationWarning: PySAL's API will be changed on 2018-12-31. The last release made with this API is version 1.14.4. A preview of the next API version is provided in the `pysal` 2.0 prelease candidate. The API changes and a guide on how to change imports is provided at https://migrating.pysal.org\n",
" ), VisibleDeprecationWarning)\n"
]
}
],
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
@@ -70,11 +61,13 @@
{
"cell_type": "markdown",
"metadata": {},
"source": []
"source": [
"# Parameters"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
@@ -86,6 +79,7 @@
"ZonaPV = 'BP-B-5'\n",
"path_kml_panel = 'Pampa/KML/Paneles_' + ZonaPV +'.kml'\n",
"path_kml_mesa ='Pampa/KML/Mesa_' + ZonaPV +'.kml'\n",
"path_dict = 'Pampa/KML/Mesa_' + ZonaPV + '.pickle'\n",
"\n",
"panel_size = (29 , 50)\n",
"#panel_size = (37 , 17) #weight, height size#\n",
@@ -95,8 +89,22 @@
"\n",
"\n",
"GR_String = gr.from_file(path_String)\n",
"GR_T = gr.from_file(path_T)\n",
"\n",
"GR_T = gr.from_file(path_T)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Enumerate Tables and Panels"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"\n",
"label_im, nb_labels = ndimage.label(GR_String.raster.data > 0)#, structure= np.ones((2,2))) ## Label each connect region\n",
"\n",
@@ -154,11 +162,13 @@
{
"cell_type": "markdown",
"metadata": {},
"source": []
"source": [
"# Save dictionary with gps data"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
@@ -190,7 +200,10 @@
" string_coord['panels'][panel_key] = panel_coord\n",
" \n",
" L_strings_coord[string_key] = string_coord\n",
"\n"
"\n",
"## Save List in coordinate latitud and longitude ###\n",
"with open(path_dict, 'wb') as handle:\n",
" pickle.dump(L_strings_coord, handle, protocol=pickle.HIGHEST_PROTOCOL)"
]
},
{
@@ -202,7 +215,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 10,
"metadata": {},
"outputs": [
{
@@ -308,7 +321,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 11,
"metadata": {},
"outputs": [
{
@@ -320,6 +333,10 @@
}
],
"source": [
"\n",
"## Load List in coordinate latitud and longitude ###\n",
"with open(path_dict, \"rb\") as fp:\n",
" L_strings_coord = pickle.load(fp)\n",
"\n",
"kml=simplekml.Kml()\n",
"\n",