Skip to content

Instantly share code, notes, and snippets.

View prl900's full-sized avatar

Pablo Rozas Larraondo prl900

View GitHub Profile
package main
import (
"fmt"
"image"
"image/color"
"image/png"
"os"
)
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 = {
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
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 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'])
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)
@prl900
prl900 / awdc.py
Last active October 23, 2018 03:14
#!/g/data/v10/public/modules/agdc-py3-env/20171214/envs/agdc/bin/python
import pyproj
import argparse
import glob
import os
import sys
import shutil
import uuid
import subprocess
@prl900
prl900 / agdc_extractor.py
Created October 29, 2018 02:01
This script allows extracting Landsat data from the AGDC for a selected location
#!/g/data/v10/public/modules/dea-env/20181015/bin/python
import datacube as dc
from datacube.helpers import ga_pq_fuser
from datacube.storage import masking
import pyproj
import numpy as np
import xarray as xr
import datetime
import warnings
#!/g/data/v10/public/modules/dea-env/20181015/bin/python
import datacube as dc
from datacube.helpers import ga_pq_fuser
from datacube.storage import masking
import pyproj
import numpy as np
import xarray as xr
import datetime
import warnings