Skip to content

Instantly share code, notes, and snippets.

View prl900's full-sized avatar

Pablo Rozas Larraondo prl900

View GitHub Profile
from keras.models import load_model, Sequential
from keras import layers
from keras.layers import Layer
from keras import models
import numpy as np
import matplotlib.pyplot as plt
import sys
x = np.load("/datasets/10zlevels.npy")
y = 1000*np.expand_dims(np.load("/datasets/1980-2016/full_tp_1980_2016.npy"), axis=3)
import pickle
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
#hist = pickle.load(open("trainHistoryDict_0-5-7", 'rb'))
hist = pickle.load(open("trainHistoryDict_9", 'rb'))
print hist.keys()
plt.plot(hist['loss'])
plt.plot(hist['val_loss'])
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import datacube as dc
import ctypes
from contextlib import closing
import numpy as np
from datacube.helpers import ga_pq_fuser
from datacube.storage import masking
import xarray as xr
import multiprocessing as mp
#N = 1001*1001
import datacube as dc
class BurnCube(dc.Datacube):
def __init__(self):
super(BurnCube, self).__init__(app='TreeMapping.getLandsatStack')
self.measurements = ['red','green','blue','nir','swir1','swir2']
self.res = (-100,100)
def load_cube(self, lon, lat, period):
query = {
package main
import (
"fmt"
"image"
"image/color"
"image/png"
"os"
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import gdal
from osgeo import osr
import numpy as np
ras = np.load("/Users/pablo/Downloads/test.npy")
drv = gdal.GetDriverByName("GTiff")
ds = drv.Create("/Users/pablo/Downloads/gbdx.tif", 8765, 10000, 1, gdal.GDT_Float32)
proj = osr.SpatialReference()
proj.ImportFromEPSG(4326)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.