Skip to content

Instantly share code, notes, and snippets.

View KMarkert's full-sized avatar
👨‍💻

Kel Markert KMarkert

👨‍💻
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>AQ-ML Data Extractor</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v1.6.0/mapbox-gl.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v1.6.0/mapbox-gl.css" rel="stylesheet" />
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-draw/v1.0.9/mapbox-gl-draw.js'></script>
@KMarkert
KMarkert / cors_server.py
Created March 10, 2020 17:43
simple cors_server for accessing files while developing on web app
import SimpleHTTPServer
class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def send_head(self):
"""Common code for GET and HEAD commands.
This sends the response code and MIME headers.
Return value is either a file object (which has to be copied
to the outputfile by the caller unless the command was HEAD,
and must be closed by the caller under all circumstances), or
None, in which case the caller has nothing further to do.
"""
@KMarkert
KMarkert / smap_l2_9km_gridding.ipynb
Last active June 22, 2020 18:45
smap_l2_9km_gridding.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
import pandas as pd
def sklearn_tree_to_ee_string(estimator, feature_names):
# extract out the information need to build the tree string
n_nodes = estimator.tree_.node_count
children_left = estimator.tree_.children_left
children_right = estimator.tree_.children_right
feature_idx = estimator.tree_.feature
import ee
import math
import numpy as np
import datetime
import pandas as pd
#from atmospheric import Atmospheric
ee.Initialize()
# global variables using in functions
using PyCall;
# import the ee Python module into Julia
# and initialize the EE API
ee = pyimport("ee");
ee.Initialize();
# load in ee.Image and sample a point
dem = ee.Image("USGS/SRTMGL1_003");
xy = ee.Geometry.Point([86.9250, 27.9881]...);
using PyCall;
# import the ee Python module into Julia
# and initialize the EE API
ee = pyimport("ee");
ee.Initialize();
# load in ee.Image and sample a point
dem = ee.Image("USGS/SRTMGL1_003");
xy = ee.Geometry.Point([86.9250, 27.9881]...);
using PyCall, Plots;
theme(:bright);
# import the ee Python module into Julia
# and initialize the EE API
ee = pyimport("ee");
ee.Initialize();
# produce tabular data that can be plotted by data visualization in Julia
# Fetch a Landsat image.
using PyCall, Plots, Colors, FileIO;
# import the ee Python module into Julia
# and initialize the EE API
ee = pyimport("ee");
ee.Initialize();
# produce tabular data that can be plotted by data visualization in Julia
# Fetch a Landsat image.
img = ee.Image("LANDSAT/LT05/C01/T1_SR/LT05_034033_20000913");
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.