Skip to content

Instantly share code, notes, and snippets.

View KMarkert's full-sized avatar
👨‍💻

Kel Markert KMarkert

👨‍💻
View GitHub Profile
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]...);
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
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
@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.
@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.
"""
<!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>
import os
import fire
import numpy as np
from osgeo import gdal
from scipy import ndimage
import dask.array as da
import tensorflow as tf
from tensorflow.python import keras
from tensorflow.python.keras import layers
@KMarkert
KMarkert / stac_search_example.ipynb
Last active March 4, 2020 09:17
stac_search_example.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@KMarkert
KMarkert / gedi_to_vector.py
Last active October 7, 2023 06:53
Python script to take GEDI level 2 data and convert variables to a geospatial vector format. Usage `python gedi_to_vector.py <path> --variables [<var1>,<var2>,...,<varN>] --outFormat <extension> --filterBounds [<W>,<S>,<E>,<N>] --verbose`
import os
import fire
import h5py
import glob
import tqdm
import numpy as np
import pandas as pd
import geopandas as gpd
# requires fire, h5py, tqdm, numpy, pandas, and geopandas
@KMarkert
KMarkert / gedi_to_csv.py
Created February 12, 2020 22:37
Python script to take GEDI level 2 data and convert variables to a CSV file. Usage `python gedi_to_csv.py <path> --variables [<var1>,<var2>,<var3>] --verbose`
import os
import fire
import h5py
import glob
import tqdm
import numpy as np
import pandas as pd
# requires h5py, tqdm, fire, numpy, and pandas to run