From 28492f880d87cacb32ca1a2a709dd8192406e40f Mon Sep 17 00:00:00 2001 From: "John (EBo) David" Date: Fri, 11 May 2018 15:36:56 -0400 Subject: [PATCH 1/2] added notebook to generate a clean training dataset for two images which cover the Walker Lake example provided the results of the training dataset run, and removed previous versions of the training data. --- examples/gen_landsat_training_set.ipynb | 462 ++++++++++++++++++++++++ examples/landsat5_training.csv | 23 -- examples/landsat8_training.csv | 29 -- examples/landsat_training.csv | 113 ++++++ 4 files changed, 575 insertions(+), 52 deletions(-) create mode 100644 examples/gen_landsat_training_set.ipynb delete mode 100644 examples/landsat5_training.csv delete mode 100644 examples/landsat8_training.csv create mode 100644 examples/landsat_training.csv diff --git a/examples/gen_landsat_training_set.ipynb b/examples/gen_landsat_training_set.ipynb new file mode 100644 index 0000000..c719263 --- /dev/null +++ b/examples/gen_landsat_training_set.ipynb @@ -0,0 +1,462 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "rasterio: 0.36.0\n" + ] + } + ], + "source": [ + "import rasterio\n", + "import numpy as np\n", + "import pandas as pd\n", + "\n", + "print(\"rasterio: %s\"%rasterio.__version__)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "# Define the Landsat bands so that we can use a high level \n", + "# description to interface.\n", + "band_def5 = {'blue':1,'green':2,'red':3,'nir':4,'swir1':5,'thermal':6,'swir2':7}\n", + "band_def8 = {'ultra_blue':1,'blue':2,'green':3,'red':4,'nir':5,'swir1':6,'swir2':7,\n", + " 'pan':8,'cirus':9,'thermal1':10,'thermal2':11}\n", + "# generate the names of all images by \n", + "images5 = [\"LT05_L1TP_042033_19881022_20161001_01_T1_sr_band%d.tif\"%b for b in band_def5.values()]\n", + "images8 = [\"LC08_L1TP_042033_20171022_20171107_01_T1_sr_band%d.tif\"%b for b in band_def8.values()]\n", + "\n", + "# what bands do we care about?\n", + "bands = [\"red\",\"green\",\"blue\",\"nir\"]\n", + "\n", + "# What bands are we going t ogenerate\n", + "calculated = ['ndvi','bn','bnn']\n", + "\n", + "# how shal we subsample the ordered computed data?\n", + "num_pts = 20\n", + "step = 5\n", + "_end = num_pts * step" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "# find some of the brightest NDVI and BN locations. \n", + "# This is rather arbitrary but provides some useful data.\n", + "with rasterio.open(images5[band_def5[\"red\"]-1]) as red_img:\n", + " red = red_img.read()\n", + "with rasterio.open(images5[band_def5[\"nir\"]-1]) as nir_img:\n", + " nir = nir_img.read()\n", + " affine = nir_img.affine\n", + "\n", + "blue_img = rasterio.open(images5[band_def5[\"blue\"]-1])\n", + "blue = blue_img.read()\n", + "\n", + "# because we are using Landsat reflectance images, the pixel vause are not\n", + "# the raw sensor info, and the numbers can be out of the theretical range,\n", + "# so mask out the nonsensical values that might cause problems.\n", + "bnmask = (nir>0) & (red>0) & (blue>0) & (nir<10000) & (red<10000) & (blue<10000)\n", + "\n", + "ndvi = (nir-red)/(nir+red)\n", + "sndvi = sorted(ndvi.flatten()[bnmask.flatten()],reverse=True)[0:_end:step]\n", + "bn = blue/nir\n", + "bnn = (nir-blue)/(nir+blue)\n", + "sbn = sorted(bn.flatten()[bnmask.flatten()],reverse=True)[0:_end:step]\n", + "sbnn = sorted(bnn.flatten()[bnmask.flatten()],reverse=True)[0:_end:step]\n", + " \n", + "def find_loc(band,values,img):\n", + " import numpy as np\n", + "\n", + " npts = []\n", + " for v in values:\n", + " x,y = [a[0] for a in np.where(band==v)[1:]]\n", + " #print(pos)\n", + " npts.append(affine*[y+0.25,x+0.25])\n", + " \n", + " return list(set(npts))\n", + "\n", + "ndvi_pts = find_loc(ndvi,sndvi,nir_img)\n", + "bn_pts = find_loc(bn,sbn,nir_img)\n", + "bnn_pts = find_loc(bnn,sbnn,nir_img)\n", + "\n", + "# hand coded water\n", + "water_pts=[(348586,4286269),(338690,4323890)]\n", + "\n", + "del red, nir, blue, ndvi\n", + "del bnn, bn, blue_img" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "num NDVI points = 20\n", + "num BN points = 16\n", + "num BNN points = 20\n", + "num Water points = 2\n" + ] + } + ], + "source": [ + "print(\"num NDVI points =\",len(ndvi_pts))\n", + "print(\"num BN points =\",len(bn_pts))\n", + "print(\"num BNN points =\",len(bnn_pts))\n", + "print(\"num Water points =\",len(water_pts))" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "# extract the basic band info, as well as \n", + "def fill_pt(images,band_def,bands,name,\n", + " north=None,east=None,row=None,col=None,\n", + " ptype=None):\n", + " ndf = pd.DataFrame(data=[name],columns=[\"image\"])" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "# extract the basic band info, as well as \n", + "def fill_pt(images,band_def,bands,name,\n", + " north=None,east=None,row=None,col=None,\n", + " ptype=None):\n", + " ndf = pd.DataFrame(data=[name],columns=[\"image\"])\n", + " ndf['type'] = ptype\n", + " \n", + " for band in bands:\n", + " image = images[band_def[band]-1]\n", + " \n", + " img = rasterio.open(image)\n", + " affine = img.affine\n", + " \n", + " if (north==None or east==None) and (row==None or col==None):\n", + " print(\"Error: need either north+east or row+col\")\n", + " return {}\n", + " if (north!=None and east!=None):\n", + " row,col = img.index(y=north,x=east)\n", + " elif (row!=None and col!=None):\n", + " east,north = affine * (col,row)\n", + " else:\n", + " print(\"Error: north+east / row+col pairs not found\")\n", + " return {}\n", + " \n", + " ndf['east'],ndf['north'] = east,north\n", + " ndf['row'],ndf['col'] = row,col\n", + "\n", + " val = img.read(window=((row,row+1),(col,col+1)))[0][0][0]\n", + " ndf[band] = val\n", + " if (val<0) or (val>=10000):\n", + " ndf['row'],ndf['col'] = np.nan,np.nan\n", + " for band in bands:\n", + " ndf[band] = np.nan\n", + " return ndf\n", + " \n", + " del img\n", + " return ndf\n", + "\n", + "# extract the basic band info, as well as \n", + "def fill_computed(df,**kwargs):\n", + " for key in kwargs:\n", + " kwargs[key](df)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "# process the Landsat-5 images\n", + "df = pd.DataFrame()\n", + "for east,north in water_pts:\n", + " df = df.append(fill_pt(images5,band_def5,bands,\n", + " images5[0].split(\"_sr_band\")[0],\n", + " north=north,east=east,ptype='water'), ignore_index=True)\n", + "for east,north in ndvi_pts:\n", + " df = df.append(fill_pt(images5,band_def5,bands,\n", + " images5[0].split(\"_sr_band\")[0],\n", + " north=north,east=east,ptype='veg'), ignore_index=True)\n", + "for east,north in bn_pts:\n", + " df = df.append(fill_pt(images5,band_def5,bands,\n", + " images5[0].split(\"_sr_band\")[0],\n", + " north=north,east=east,ptype='back'), ignore_index=True)\n", + "for east,north in bnn_pts:\n", + " df = df.append(fill_pt(images5,band_def5,bands,\n", + " images5[0].split(\"_sr_band\")[0],\n", + " north=north,east=east,ptype='norm_back'), ignore_index=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "# process the Landsat-8 images\n", + "for east,north in water_pts:\n", + " df = df.append(fill_pt(images8,band_def8,bands,\n", + " images8[0].split(\"_sr_band\")[0],\n", + " north=north,east=east,ptype='water'), ignore_index=True)\n", + "for east,north in ndvi_pts:\n", + " df = df.append(fill_pt(images8,band_def8,bands,\n", + " images8[0].split(\"_sr_band\")[0],\n", + " north=north,east=east,ptype='veg'), ignore_index=True)\n", + "for east,north in bn_pts:\n", + " df = df.append(fill_pt(images8,band_def8,bands,\n", + " images8[0].split(\"_sr_band\")[0],\n", + " north=north,east=east,ptype='back'), ignore_index=True)\n", + "for east,north in bnn_pts:\n", + " df = df.append(fill_pt(images8,band_def8,bands,\n", + " images8[0].split(\"_sr_band\")[0],\n", + " north=north,east=east,ptype='norm_back'), ignore_index=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "# define the user defined caculations.\n", + "def ndvi(df):\n", + " df['ndvi'] = (df['nir']-df['red'])/(df['nir']+df['red'])\n", + "def bn(df):\n", + " df['bn'] = df['blue']/df['nir']\n", + "def bnn(df):\n", + " df['bnn'] = (df['nir']-df['blue'])/(df['nir']+df['blue'])\n", + "\n", + "fill_computed(df,ndvi=ndvi,bn=bn,bnn=bnn)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "# find the locations with NaN's. We scrubbed the row/col variables above\n", + "# to make this easy.\n", + "rf = df[df['row'].isna()]\n", + "\n", + "# drop both the locations with NaN's and its pairs in other images as well\n", + "#df = df.dropna(axis=0, how='all')\n", + "df = df[~(df['east'].isin(rf['east'].values) & df['north'].isin(rf['north'].values))]" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
imagetypeeastnorthrowcolredgreenbluenirndvibnbnn
0LT05_L1TP_042033_19881022_20161001_01_T1water348586.04286269.04264.03540.0182.0351.0319.0130.0-0.1666672.453846-0.420935
1LT05_L1TP_042033_19881022_20161001_01_T1water338690.04323890.03010.03210.0620.0656.0527.0433.0-0.1775881.217090-0.097917
2LT05_L1TP_042033_19881022_20161001_01_T1veg353692.54379167.51168.03710.0366.0661.0459.05673.00.8787880.0809100.850294
3LT05_L1TP_042033_19881022_20161001_01_T1veg346402.54360627.51786.03467.0360.0611.0325.05405.00.8751080.0601300.886562
4LT05_L1TP_042033_19881022_20161001_01_T1veg314692.54315987.53274.02410.0365.0562.0417.05380.00.8729330.0775090.856132
\n", + "
" + ], + "text/plain": [ + " image type east north \\\n", + "0 LT05_L1TP_042033_19881022_20161001_01_T1 water 348586.0 4286269.0 \n", + "1 LT05_L1TP_042033_19881022_20161001_01_T1 water 338690.0 4323890.0 \n", + "2 LT05_L1TP_042033_19881022_20161001_01_T1 veg 353692.5 4379167.5 \n", + "3 LT05_L1TP_042033_19881022_20161001_01_T1 veg 346402.5 4360627.5 \n", + "4 LT05_L1TP_042033_19881022_20161001_01_T1 veg 314692.5 4315987.5 \n", + "\n", + " row col red green blue nir ndvi bn bnn \n", + "0 4264.0 3540.0 182.0 351.0 319.0 130.0 -0.166667 2.453846 -0.420935 \n", + "1 3010.0 3210.0 620.0 656.0 527.0 433.0 -0.177588 1.217090 -0.097917 \n", + "2 1168.0 3710.0 366.0 661.0 459.0 5673.0 0.878788 0.080910 0.850294 \n", + "3 1786.0 3467.0 360.0 611.0 325.0 5405.0 0.875108 0.060130 0.886562 \n", + "4 3274.0 2410.0 365.0 562.0 417.0 5380.0 0.872933 0.077509 0.856132 " + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# show a few for inspection\n", + "df.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "# write it out some place\n", + "df.to_csv(\"landsat_training.csv\",index=False)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.5" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/examples/landsat5_training.csv b/examples/landsat5_training.csv deleted file mode 100644 index c0a4b82..0000000 --- a/examples/landsat5_training.csv +++ /dev/null @@ -1,23 +0,0 @@ -image,type,easting,northing,red,green,blue,nir,ndvi,bn,bnn -LT05_L1TP_042033_19881022_20161001_01_T1,water,348586,4286269,182,351,319,130,-0.1666666716337204,2.4538462162017822,-0.42093542218208313 -LT05_L1TP_042033_19881022_20161001_01_T1,water,338690,4323890,620,656,527,433,-0.1775878369808197,1.2170900106430054,-0.09791667014360428 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,345930.0,4360830.0,358,506,272,5411,0.8758883476257324,0.05026797205209732,0.9042758941650391 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,344490.0,4363590.0,343,639,374,5826,0.8887988328933716,0.06419498473405838,0.8793548345565796 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,346410.0,4360620.0,360,611,325,5405,0.8751084208488464,0.06012950837612152,0.886561930179596 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,292590.0,4304550.0,67,419,172,4602,0.9713000655174255,0.03737505525350571,0.9279430508613586 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,346290.0,4360200.0,370,570,367,5676,0.8776050209999084,0.06465820968151093,0.8785371780395508 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,346290.0,4360230.0,369,569,390,5629,0.876958966255188,0.06928406655788422,0.8704103827476501 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,345900.0,4360830.0,359,507,349,5407,0.8754769563674927,0.06454595923423767,0.8787352442741394 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,353700.0,4379160.0,366,661,459,5673,0.8787878751754761,0.08090957254171371,0.8502935171127319 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,346440.0,4360230.0,326,571,345,5623,0.8904017210006714,0.06135514751076698,0.8843833804130554 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,313800.0,4317510.0,323,610,394,5188,0.8827798962593079,0.07594449073076248,0.8588319420814514 -LT05_L1TP_042033_19881022_20161001_01_T1,back,447090.0,4268640.0,1272,1113,20000,1628,0.12275861948728561,12.285012245178223,-0.849454402923584 -LT05_L1TP_042033_19881022_20161001_01_T1,back,310170.0,4317240.0,195,562,599,88,-0.37809187173843384,6.806818008422852,-0.743813693523407 -LT05_L1TP_042033_19881022_20161001_01_T1,back,471420.0,4362540.0,1970,1613,20000,2436,0.10576486587524414,8.210180282592773,-0.7828490138053894 -LT05_L1TP_042033_19881022_20161001_01_T1,back,270750.0,4239390.0,128,264,279,45,-0.4797687828540802,6.199999809265137,-0.7222222089767456 -LT05_L1TP_042033_19881022_20161001_01_T1,back,346710.0,4288530.0,272,355,280,36,-0.7662337422370911,7.777777671813965,-0.7721518874168396 -LT05_L1TP_042033_19881022_20161001_01_T1,back,458880.0,4314180.0,1417,1187,20000,1740,0.10231231898069382,11.494253158569336,-0.8399264216423035 -LT05_L1TP_042033_19881022_20161001_01_T1,back,346770.0,4286280.0,97,350,341,31,-0.515625,11.0,-0.8333333134651184 -LT05_L1TP_042033_19881022_20161001_01_T1,back,347910.0,4286010.0,181,252,271,31,-0.7075471878051758,8.741935729980469,-0.7947019934654236 -LT05_L1TP_042033_19881022_20161001_01_T1,back,439470.0,4239240.0,1927,1573,20000,2244,0.07600095868110657,8.9126558303833,-0.7982377409934998 -LT05_L1TP_042033_19881022_20161001_01_T1,back,451440.0,4285740.0,665,624,20000,1058,0.2280905395746231,18.90359115600586,-0.8995156288146973 diff --git a/examples/landsat8_training.csv b/examples/landsat8_training.csv deleted file mode 100644 index 0c0d221..0000000 --- a/examples/landsat8_training.csv +++ /dev/null @@ -1,29 +0,0 @@ -image,type,easting,northing,red,green,blue,nir,ndvi,bn,bnn -LT05_L1TP_042033_19881022_20161001_01_T1,water,338690,4323890,433,620,656,93,-0.6463878154754639,7.053763389587402,-0.7516688704490662 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,403860.0,4212150.0,1234,931,773,3844,0.5139818787574768,0.20109261572360992,0.66515052318573 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,403740.0,4212120.0,659,559,446,2231,0.5439446568489075,0.19991035759449005,0.6667912006378174 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,366450.0,4292970.0,870,2133,1701,2785,0.5239397883415222,0.6107720136642456,0.24164065718650818 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,368670.0,4292220.0,2486,2221,1893,8272,0.5378323197364807,0.2288442999124527,0.6275454759597778 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,277680.0,4241760.0,44,126,210,159,0.5665024518966675,1.3207547664642334,-0.13821138441562653 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,366420.0,4292910.0,477,2008,1560,2717,0.7013149857521057,0.5741626620292664,0.2705167233943939 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,346710.0,4289340.0,36,230,452,127,0.558282196521759,3.5590550899505615,-0.5613126158714294 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,366450.0,4292820.0,575,1672,1466,2246,0.5923431515693665,0.6527159214019775,0.21012930572032928 -LT05_L1TP_042033_19881022_20161001_01_T1,veg,338250.0,4377090.0,27,137,206,126,0.6470588445663452,1.634920597076416,-0.2409638613462448 -LT05_L1TP_042033_19881022_20161001_01_T1,back,334290.0,4366080.0,1033,2041,2063,25,-0.9527410268783569,82.5199966430664,-0.9760536551475525 -LT05_L1TP_042033_19881022_20161001_01_T1,back,343320.0,4381950.0,1636,2175,1923,25,-0.9698976278305054,76.91999816894531,-0.9743326306343079 -LT05_L1TP_042033_19881022_20161001_01_T1,back,334410.0,4366110.0,984,2042,2111,24,-0.9523809552192688,87.95833587646484,-0.9775175452232361 -LT05_L1TP_042033_19881022_20161001_01_T1,back,337080.0,4367250.0,783,1615,1728,23,-0.9429280161857605,75.13043212890625,-0.9737293124198914 -LT05_L1TP_042033_19881022_20161001_01_T1,back,372150.0,4376310.0,1428,1694,1960,26,-0.9642366170883179,75.38461303710938,-0.9738166928291321 -LT05_L1TP_042033_19881022_20161001_01_T1,back,372180.0,4376400.0,1428,1651,1959,26,-0.9642366170883179,75.34615325927734,-0.9738035202026367 -LT05_L1TP_042033_19881022_20161001_01_T1,back,334170.0,4366440.0,834,1956,2062,25,-0.9417927861213684,82.4800033569336,-0.9760421514511108 -LT05_L1TP_042033_19881022_20161001_01_T1,back,334350.0,4365480.0,884,1914,2015,25,-0.9449945092201233,80.5999984741211,-0.9754902124404907 -LT05_L1TP_042033_19881022_20161001_01_T1,back,334290.0,4365930.0,984,2041,2110,25,-0.9504460096359253,84.4000015258789,-0.976580798625946 -LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,300900.0,4300920.0,2252,1089,708,3717,0.2454347461462021,0.190476194024086,0.6800000071525574 -LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,342840.0,4369170.0,2283,1009,700,4554,0.3321632146835327,0.15371102094650269,0.7335363626480103 -LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,310620.0,4331070.0,2313,1137,757,3873,0.25218233466148376,0.19545571506023407,0.6730021834373474 -LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,301050.0,4300890.0,2105,962,659,3412,0.236904114484787,0.1931418478488922,0.6762466430664062 -LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,403770.0,4212000.0,1281,971,726,3942,0.5094773173332214,0.18417046964168549,0.688946008682251 -LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,403860.0,4212030.0,1281,930,726,3744,0.49014925956726074,0.19391025602817535,0.6751677989959717 -LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,365250.0,4293270.0,2625,2256,373,2950,0.05829596519470215,0.12644067406654358,0.7755040526390076 -LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,365310.0,4293360.0,2624,2297,563,2983,0.06402710825204849,0.1887361705303192,0.6824591159820557 -LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,403950.0,4212150.0,1615,1177,773,4369,0.46022728085517883,0.1769283562898636,0.6993387937545776 diff --git a/examples/landsat_training.csv b/examples/landsat_training.csv new file mode 100644 index 0000000..02ff024 --- /dev/null +++ b/examples/landsat_training.csv @@ -0,0 +1,113 @@ +image,type,east,north,row,col,red,green,blue,nir,ndvi,bn,bnn +LT05_L1TP_042033_19881022_20161001_01_T1,water,348586.0,4286269.0,4264.0,3540.0,182.0,351.0,319.0,130.0,-0.16666666666666666,2.453846153846154,-0.4209354120267261 +LT05_L1TP_042033_19881022_20161001_01_T1,water,338690.0,4323890.0,3010.0,3210.0,620.0,656.0,527.0,433.0,-0.17758784425451093,1.2170900692840647,-0.09791666666666667 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,353692.5,4379167.5,1168.0,3710.0,366.0,661.0,459.0,5673.0,0.8787878787878788,0.08090957165520889,0.850293542074364 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,346402.5,4360627.5,1786.0,3467.0,360.0,611.0,325.0,5405.0,0.8751084128360798,0.060129509713228495,0.8865619546247818 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,314692.5,4315987.5,3274.0,2410.0,365.0,562.0,417.0,5380.0,0.8729329852045257,0.0775092936802974,0.8561324823184405 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,345892.5,4360837.5,1779.0,3450.0,359.0,507.0,349.0,5407.0,0.8754769337495665,0.06454595894211208,0.878735232800556 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,346282.5,4360807.5,1780.0,3463.0,349.0,548.0,307.0,5182.0,0.8738022057494124,0.059243535314550365,0.8881399161960284 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,346282.5,4360237.5,1799.0,3463.0,369.0,569.0,390.0,5629.0,0.8769589863287762,0.06928406466512702,0.8704103671706264 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,314482.5,4315717.5,3283.0,2403.0,365.0,610.0,394.0,5428.0,0.8739858449853272,0.07258658806190126,0.8646513225695637 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,313792.5,4317517.5,3223.0,2380.0,323.0,610.0,394.0,5188.0,0.8827798947559427,0.07594448727833462,0.858831959871014 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,346432.5,4360237.5,1799.0,3468.0,326.0,571.0,345.0,5623.0,0.8904017481929736,0.06135514849724347,0.8843833780160858 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,313222.5,4324597.5,2987.0,2361.0,366.0,611.0,438.0,5389.0,0.8728062554300609,0.08127667470773799,0.8496653509524627 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,346282.5,4360207.5,1800.0,3463.0,370.0,570.0,367.0,5676.0,0.8776050281177639,0.06465821000704722,0.8785371504219759 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,344482.5,4363597.5,1687.0,3403.0,343.0,639.0,374.0,5826.0,0.8887988328740477,0.0641949879848953,0.8793548387096775 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,346792.5,4358557.5,1855.0,3480.0,354.0,597.0,413.0,5296.0,0.8746902654867257,0.0779833836858006,0.8553161674548958 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,347122.5,4358707.5,1850.0,3491.0,349.0,593.0,383.0,5159.0,0.8732752360203341,0.07423919364217872,0.8617827499097799 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,292582.5,4304557.5,3655.0,1673.0,67.0,419.0,172.0,4602.0,0.9713000642535875,0.03737505432420687,0.9279430247172182 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,346882.5,4358617.5,1853.0,3483.0,352.0,646.0,411.0,5250.0,0.8743305962156372,0.07828571428571429,0.8547959724430313 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,347092.5,4358707.5,1850.0,3490.0,350.0,593.0,407.0,5209.0,0.8740780715956107,0.07813399884814744,0.85505698005698 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,347152.5,4358767.5,1848.0,3492.0,348.0,591.0,404.0,5064.0,0.8713968957871396,0.07977883096366509,0.8522311631309437 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,345922.5,4360837.5,1779.0,3451.0,358.0,506.0,272.0,5411.0,0.8758883688680881,0.050267972648309,0.904275910610593 +LT05_L1TP_042033_19881022_20161001_01_T1,veg,346372.5,4360417.5,1793.0,3466.0,365.0,513.0,310.0,5340.0,0.8720420683610868,0.05805243445692884,0.8902654867256637 +LT05_L1TP_042033_19881022_20161001_01_T1,back,355132.5,4284037.5,4339.0,3758.0,349.0,493.0,481.0,26.0,-0.8613333333333333,18.5,-0.8974358974358975 +LT05_L1TP_042033_19881022_20161001_01_T1,back,280462.5,4233067.5,6038.0,1269.0,84.0,168.0,326.0,42.0,-0.3333333333333333,7.761904761904762,-0.7717391304347826 +LT05_L1TP_042033_19881022_20161001_01_T1,back,347902.5,4286017.5,4273.0,3517.0,181.0,252.0,271.0,31.0,-0.7075471698113207,8.741935483870968,-0.7947019867549668 +LT05_L1TP_042033_19881022_20161001_01_T1,back,309472.5,4317307.5,3230.0,2236.0,280.0,514.0,689.0,137.0,-0.34292565947242204,5.029197080291971,-0.6682808716707022 +LT05_L1TP_042033_19881022_20161001_01_T1,back,348832.5,4293877.5,4011.0,3548.0,358.0,740.0,532.0,86.0,-0.6126126126126126,6.186046511627907,-0.7216828478964401 +LT05_L1TP_042033_19881022_20161001_01_T1,back,350212.5,4295017.5,3973.0,3594.0,274.0,454.0,420.0,86.0,-0.5222222222222223,4.883720930232558,-0.6600790513833992 +LT05_L1TP_042033_19881022_20161001_01_T1,back,309592.5,4317577.5,3221.0,2240.0,280.0,514.0,666.0,137.0,-0.34292565947242204,4.861313868613139,-0.6587795765877957 +LT05_L1TP_042033_19881022_20161001_01_T1,back,346822.5,4286407.5,4260.0,3481.0,268.0,398.0,387.0,81.0,-0.5358166189111748,4.777777777777778,-0.6538461538461539 +LT05_L1TP_042033_19881022_20161001_01_T1,back,349192.5,4295137.5,3969.0,3560.0,570.0,837.0,576.0,86.0,-0.7378048780487805,6.6976744186046515,-0.7401812688821753 +LT05_L1TP_042033_19881022_20161001_01_T1,back,349672.5,4295137.5,3969.0,3576.0,231.0,453.0,419.0,86.0,-0.45741324921135645,4.872093023255814,-0.6594059405940594 +LT05_L1TP_042033_19881022_20161001_01_T1,back,309352.5,4317667.5,3218.0,2232.0,280.0,562.0,643.0,137.0,-0.34292565947242204,4.693430656934306,-0.6487179487179487 +LT05_L1TP_042033_19881022_20161001_01_T1,back,346762.5,4286287.5,4264.0,3479.0,97.0,350.0,341.0,31.0,-0.515625,11.0,-0.8333333333333334 +LT05_L1TP_042033_19881022_20161001_01_T1,back,355102.5,4286347.5,4262.0,3757.0,351.0,544.0,417.0,78.0,-0.6363636363636364,5.346153846153846,-0.6848484848484848 +LT05_L1TP_042033_19881022_20161001_01_T1,back,352582.5,4291927.5,4076.0,3673.0,400.0,548.0,486.0,86.0,-0.6460905349794238,5.651162790697675,-0.6993006993006993 +LT05_L1TP_042033_19881022_20161001_01_T1,back,352942.5,4290967.5,4108.0,3685.0,273.0,405.0,418.0,85.0,-0.5251396648044693,4.91764705882353,-0.6620278330019881 +LT05_L1TP_042033_19881022_20161001_01_T1,back,349432.5,4294687.5,3984.0,3568.0,274.0,501.0,442.0,86.0,-0.5222222222222223,5.1395348837209305,-0.6742424242424242 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,346342.5,4360777.5,1781.0,3465.0,399.0,500.0,314.0,4920.0,0.8499717992103779,0.06382113821138212,0.8800152846771112 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,346342.5,4360477.5,1791.0,3465.0,408.0,562.0,280.0,5798.0,0.868514340960361,0.048292514660227666,0.907864429088516 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,346282.5,4360177.5,1801.0,3463.0,416.0,571.0,344.0,5574.0,0.86110183639399,0.0617151058485827,0.8837445082798243 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,346312.5,4360417.5,1793.0,3464.0,454.0,563.0,332.0,5445.0,0.8460756060349212,0.06097337006427916,0.8850614505798857 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,344512.5,4363417.5,1693.0,3404.0,475.0,587.0,373.0,5877.0,0.85044080604534,0.06346775565764846,0.88064 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,346222.5,4360537.5,1789.0,3461.0,448.0,556.0,345.0,5313.0,0.8444714459295262,0.06493506493506493,0.8780487804878049 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,346282.5,4360627.5,1786.0,3463.0,402.0,555.0,318.0,5317.0,0.8594159818150027,0.05980816249764905,0.8871339840283939 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,347332.5,4358797.5,1847.0,3498.0,390.0,589.0,330.0,5069.0,0.8571166880381023,0.06510159794831327,0.8777551398407113 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,346222.5,4360237.5,1799.0,3461.0,368.0,517.0,315.0,5332.0,0.8708771929824561,0.05907726931732933,0.8884363378785196 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,345982.5,4360747.5,1782.0,3453.0,356.0,556.0,294.0,5113.0,0.8698116657524227,0.057500488949735966,0.8912520806362123 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,346282.5,4360687.5,1784.0,3463.0,353.0,553.0,339.0,5372.0,0.8766812227074235,0.06310498883097543,0.8812817369987743 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,346252.5,4360477.5,1791.0,3462.0,542.0,611.0,350.0,5606.0,0.8236824983734548,0.0624331073849447,0.8824714573539288 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,346252.5,4360657.5,1785.0,3462.0,400.0,553.0,289.0,5172.0,0.8564249820531228,0.05587780355761794,0.8941585790148324 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,346222.5,4360207.5,1800.0,3461.0,369.0,518.0,292.0,5529.0,0.8748728382502543,0.052812443479833604,0.8996735956021302 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,345982.5,4360837.5,1779.0,3453.0,355.0,503.0,318.0,5468.0,0.8780697235102181,0.05815654718361375,0.8900795022468027 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,344482.5,4363597.5,1687.0,3403.0,343.0,639.0,374.0,5826.0,0.8887988328740477,0.0641949879848953,0.8793548387096775 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,346102.5,4360747.5,1782.0,3457.0,306.0,550.0,336.0,5580.0,0.8960244648318043,0.060215053763440864,0.8864097363083164 +LT05_L1TP_042033_19881022_20161001_01_T1,norm_back,346282.5,4360207.5,1800.0,3463.0,370.0,570.0,367.0,5676.0,0.8776050281177639,0.06465821000704722,0.8785371504219759 +LC08_L1TP_042033_20171022_20171107_01_T1,water,348586.0,4286269.0,4654.0,3510.0,100.0,230.0,222.0,24.0,-0.6129032258064516,9.25,-0.8048780487804879 +LC08_L1TP_042033_20171022_20171107_01_T1,water,338690.0,4323890.0,3400.0,3180.0,406.0,633.0,419.0,74.0,-0.6916666666666667,5.662162162162162,-0.6997971602434077 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,353692.5,4379167.5,1558.0,3680.0,386.0,637.0,352.0,4437.0,0.839933651254406,0.07933288257831868,0.8529964501983712 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,346402.5,4360627.5,2176.0,3437.0,1337.0,1092.0,812.0,2832.0,0.35859918445670425,0.2867231638418079,0.5543358946212953 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,314692.5,4315987.5,3664.0,2380.0,1826.0,1482.0,1123.0,2327.0,0.120635685046954,0.48259561667382894,0.34898550724637684 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,345892.5,4360837.5,2169.0,3420.0,1197.0,1049.0,766.0,3035.0,0.43431001890359167,0.25238879736408565,0.5969481715338069 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,346282.5,4360807.5,2170.0,3433.0,1277.0,1068.0,787.0,2916.0,0.39088957786787504,0.26989026063100136,0.5749392384553065 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,346282.5,4360237.5,2189.0,3433.0,1255.0,1035.0,759.0,3378.0,0.4582344053529031,0.2246891651865009,0.6330674401740392 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,314482.5,4315717.5,3673.0,2373.0,2004.0,1629.0,1224.0,2518.0,0.11366651923927466,0.48610007942811756,0.3458043826830572 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,313792.5,4317517.5,3613.0,2350.0,446.0,645.0,395.0,4169.0,0.8067172264355363,0.09474694171264092,0.8269062226117441 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,346432.5,4360237.5,2189.0,3438.0,1396.0,1129.0,835.0,3087.0,0.37720276600490743,0.27048914804016844,0.5741968383477818 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,313222.5,4324597.5,3377.0,2331.0,460.0,698.0,366.0,4559.0,0.8166965530982268,0.08028076332529063,0.8513705583756345 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,346282.5,4360207.5,2190.0,3433.0,1236.0,1032.0,766.0,3316.0,0.45694200351493847,0.2310012062726176,0.6246937775600196 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,344482.5,4363597.5,2077.0,3373.0,1184.0,1049.0,721.0,3173.0,0.4565067707137939,0.22722975102426726,0.6296866974833076 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,346792.5,4358557.5,2245.0,3450.0,1491.0,1213.0,924.0,2002.0,0.1462925851703407,0.46153846153846156,0.3684210526315789 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,347122.5,4358707.5,2240.0,3461.0,1143.0,930.0,763.0,1567.0,0.15645756457564575,0.48691767708998085,0.34506437768240344 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,292582.5,4304557.5,4045.0,1643.0,1116.0,936.0,621.0,3223.0,0.48559575939156485,0.1926776295376978,0.6768990634755463 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,346882.5,4358617.5,2243.0,3453.0,1553.0,1263.0,939.0,2092.0,0.14787379972565157,0.4488527724665392,0.3804025074232926 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,347092.5,4358707.5,2240.0,3460.0,1163.0,958.0,762.0,1578.0,0.15140459686245897,0.4828897338403042,0.3487179487179487 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,347152.5,4358767.5,2238.0,3462.0,1215.0,984.0,789.0,1663.0,0.1556636553161918,0.4744437763078773,0.3564437194127243 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,345922.5,4360837.5,2169.0,3421.0,1194.0,1059.0,772.0,3084.0,0.4417952314165498,0.2503242542153048,0.5995850622406639 +LC08_L1TP_042033_20171022_20171107_01_T1,veg,346372.5,4360417.5,2183.0,3436.0,1367.0,1125.0,825.0,3088.0,0.38630751964085297,0.26716321243523317,0.57832864809609 +LC08_L1TP_042033_20171022_20171107_01_T1,back,355132.5,4284037.5,4729.0,3728.0,2188.0,1923.0,1473.0,2505.0,0.06754741103771575,0.5880239520958084,0.2594268476621418 +LC08_L1TP_042033_20171022_20171107_01_T1,back,280462.5,4233067.5,6428.0,1239.0,42.0,109.0,93.0,50.0,0.08695652173913043,1.86,-0.3006993006993007 +LC08_L1TP_042033_20171022_20171107_01_T1,back,347902.5,4286017.5,4663.0,3487.0,101.0,230.0,221.0,25.0,-0.6031746031746031,8.84,-0.7967479674796748 +LC08_L1TP_042033_20171022_20171107_01_T1,back,309472.5,4317307.5,3620.0,2206.0,81.0,161.0,239.0,45.0,-0.2857142857142857,5.311111111111111,-0.6830985915492958 +LC08_L1TP_042033_20171022_20171107_01_T1,back,348832.5,4293877.5,4401.0,3518.0,2207.0,1877.0,1341.0,2672.0,0.09530641524902644,0.5018712574850299,0.33167206578619485 +LC08_L1TP_042033_20171022_20171107_01_T1,back,350212.5,4295017.5,4363.0,3564.0,2070.0,1710.0,1305.0,2972.0,0.17889726299087663,0.43909825033647376,0.38975917699321955 +LC08_L1TP_042033_20171022_20171107_01_T1,back,309592.5,4317577.5,3611.0,2210.0,89.0,159.0,245.0,52.0,-0.2624113475177305,4.711538461538462,-0.6498316498316499 +LC08_L1TP_042033_20171022_20171107_01_T1,back,346822.5,4286407.5,4650.0,3451.0,1120.0,1066.0,861.0,1292.0,0.07131011608623548,0.6664086687306502,0.20018578727357175 +LC08_L1TP_042033_20171022_20171107_01_T1,back,349192.5,4295137.5,4359.0,3530.0,2664.0,2418.0,1790.0,2992.0,0.05799151343705799,0.5982620320855615,0.25135926390631536 +LC08_L1TP_042033_20171022_20171107_01_T1,back,349672.5,4295137.5,4359.0,3546.0,1867.0,1472.0,1043.0,2936.0,0.2225692275661045,0.35524523160762944,0.4757476752953003 +LC08_L1TP_042033_20171022_20171107_01_T1,back,309352.5,4317667.5,3608.0,2202.0,96.0,169.0,244.0,60.0,-0.23076923076923078,4.066666666666666,-0.6052631578947368 +LC08_L1TP_042033_20171022_20171107_01_T1,back,346762.5,4286287.5,4654.0,3449.0,1676.0,1500.0,1160.0,2064.0,0.10374331550802139,0.562015503875969,0.2803970223325062 +LC08_L1TP_042033_20171022_20171107_01_T1,back,355102.5,4286347.5,4652.0,3727.0,1927.0,1657.0,1330.0,2346.0,0.09805757079335362,0.56692242114237,0.2763873775843308 +LC08_L1TP_042033_20171022_20171107_01_T1,back,352582.5,4291927.5,4466.0,3643.0,2209.0,1879.0,1471.0,2502.0,0.06219486308639355,0.5879296562749801,0.25950163604329224 +LC08_L1TP_042033_20171022_20171107_01_T1,back,352942.5,4290967.5,4498.0,3655.0,2881.0,2367.0,1823.0,3404.0,0.0832140015910899,0.5355464159811986,0.30246795484981825 +LC08_L1TP_042033_20171022_20171107_01_T1,back,349432.5,4294687.5,4374.0,3538.0,2243.0,2003.0,1555.0,2535.0,0.06111343658434491,0.6134122287968442,0.2396088019559902 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,346342.5,4360777.5,2171.0,3435.0,1305.0,1084.0,814.0,2847.0,0.3713872832369942,0.2859149982437654,0.5553127560775745 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,346342.5,4360477.5,2181.0,3435.0,1503.0,1224.0,893.0,3156.0,0.3547971667739858,0.2829531051964512,0.5589034329464065 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,346282.5,4360177.5,2191.0,3433.0,1329.0,1107.0,818.0,3131.0,0.4040358744394619,0.2612583839029064,0.5857179032666497 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,346312.5,4360417.5,2183.0,3434.0,1306.0,1077.0,789.0,3055.0,0.4010548039440495,0.25826513911620297,0.5894901144640999 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,344512.5,4363417.5,2083.0,3374.0,1412.0,1172.0,858.0,3180.0,0.38501742160278746,0.269811320754717,0.575037147102526 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,346222.5,4360537.5,2179.0,3431.0,1317.0,1085.0,800.0,2854.0,0.36849676336609927,0.2803083391730904,0.5621237000547346 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,346282.5,4360627.5,2176.0,3433.0,1251.0,1020.0,771.0,2657.0,0.35977482088024565,0.29017689123071133,0.5501750291715286 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,347332.5,4358797.5,2237.0,3468.0,1279.0,1036.0,814.0,1749.0,0.15521796565389695,0.46540880503144655,0.3648068669527897 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,346222.5,4360237.5,2189.0,3431.0,1229.0,1033.0,768.0,3154.0,0.43919689710244125,0.2435003170577045,0.6083630800611932 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,345982.5,4360747.5,2172.0,3423.0,1142.0,1012.0,727.0,3059.0,0.45631992382766007,0.2376593658058189,0.6159535129424194 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,346282.5,4360687.5,2174.0,3433.0,1258.0,1036.0,773.0,2634.0,0.35354573484069884,0.29347000759301445,0.5462283533900792 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,346252.5,4360477.5,2181.0,3432.0,1417.0,1153.0,849.0,3085.0,0.370501999111506,0.2752025931928687,0.5683782409761058 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,346252.5,4360657.5,2175.0,3432.0,1222.0,995.0,740.0,2656.0,0.369778236204229,0.2786144578313253,0.5641931684334511 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,346222.5,4360207.5,2190.0,3431.0,1308.0,1093.0,812.0,3022.0,0.3958429561200924,0.2686962276637988,0.5764214919144497 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,345982.5,4360837.5,2169.0,3423.0,1134.0,998.0,736.0,2990.0,0.45004849660523766,0.24615384615384617,0.6049382716049383 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,344482.5,4363597.5,2077.0,3373.0,1184.0,1049.0,721.0,3173.0,0.4565067707137939,0.22722975102426726,0.6296866974833076 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,346102.5,4360747.5,2172.0,3427.0,1105.0,993.0,722.0,2985.0,0.45965770171149145,0.24187604690117254,0.6104666846506609 +LC08_L1TP_042033_20171022_20171107_01_T1,norm_back,346282.5,4360207.5,2190.0,3433.0,1236.0,1032.0,766.0,3316.0,0.45694200351493847,0.2310012062726176,0.6246937775600196 From 0b6b51319aa326c0ff8b18f6feb6aa779f284d39 Mon Sep 17 00:00:00 2001 From: "John (EBo) David" Date: Fri, 11 May 2018 15:40:48 -0400 Subject: [PATCH 2/2] cleared the training set generator --- examples/gen_landsat_training_set.ipynb | 191 ++---------------------- 1 file changed, 15 insertions(+), 176 deletions(-) diff --git a/examples/gen_landsat_training_set.ipynb b/examples/gen_landsat_training_set.ipynb index c719263..184859f 100644 --- a/examples/gen_landsat_training_set.ipynb +++ b/examples/gen_landsat_training_set.ipynb @@ -2,17 +2,9 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "rasterio: 0.36.0\n" - ] - } - ], + "outputs": [], "source": [ "import rasterio\n", "import numpy as np\n", @@ -23,7 +15,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -50,7 +42,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -101,20 +93,9 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "num NDVI points = 20\n", - "num BN points = 16\n", - "num BNN points = 20\n", - "num Water points = 2\n" - ] - } - ], + "outputs": [], "source": [ "print(\"num NDVI points =\",len(ndvi_pts))\n", "print(\"num BN points =\",len(bn_pts))\n", @@ -124,7 +105,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -137,7 +118,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -187,7 +168,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -213,7 +194,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -238,7 +219,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -255,7 +236,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -270,151 +251,9 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
imagetypeeastnorthrowcolredgreenbluenirndvibnbnn
0LT05_L1TP_042033_19881022_20161001_01_T1water348586.04286269.04264.03540.0182.0351.0319.0130.0-0.1666672.453846-0.420935
1LT05_L1TP_042033_19881022_20161001_01_T1water338690.04323890.03010.03210.0620.0656.0527.0433.0-0.1775881.217090-0.097917
2LT05_L1TP_042033_19881022_20161001_01_T1veg353692.54379167.51168.03710.0366.0661.0459.05673.00.8787880.0809100.850294
3LT05_L1TP_042033_19881022_20161001_01_T1veg346402.54360627.51786.03467.0360.0611.0325.05405.00.8751080.0601300.886562
4LT05_L1TP_042033_19881022_20161001_01_T1veg314692.54315987.53274.02410.0365.0562.0417.05380.00.8729330.0775090.856132
\n", - "
" - ], - "text/plain": [ - " image type east north \\\n", - "0 LT05_L1TP_042033_19881022_20161001_01_T1 water 348586.0 4286269.0 \n", - "1 LT05_L1TP_042033_19881022_20161001_01_T1 water 338690.0 4323890.0 \n", - "2 LT05_L1TP_042033_19881022_20161001_01_T1 veg 353692.5 4379167.5 \n", - "3 LT05_L1TP_042033_19881022_20161001_01_T1 veg 346402.5 4360627.5 \n", - "4 LT05_L1TP_042033_19881022_20161001_01_T1 veg 314692.5 4315987.5 \n", - "\n", - " row col red green blue nir ndvi bn bnn \n", - "0 4264.0 3540.0 182.0 351.0 319.0 130.0 -0.166667 2.453846 -0.420935 \n", - "1 3010.0 3210.0 620.0 656.0 527.0 433.0 -0.177588 1.217090 -0.097917 \n", - "2 1168.0 3710.0 366.0 661.0 459.0 5673.0 0.878788 0.080910 0.850294 \n", - "3 1786.0 3467.0 360.0 611.0 325.0 5405.0 0.875108 0.060130 0.886562 \n", - "4 3274.0 2410.0 365.0 562.0 417.0 5380.0 0.872933 0.077509 0.856132 " - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# show a few for inspection\n", "df.head()" @@ -422,7 +261,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, "outputs": [], "source": [