This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'Taylor' | |
''' | |
Makes a request to our terrain generation server and then outputs a .bin in web-friendly format. | |
Uses a version of convert_envi.py | |
''' | |
import os, struct, sys, math, requests | |
server = 'http://<terrain_server>/<terrain_script>.ashx?' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
date_tag = 'SDR' | |
def main(): | |
if len(sys.argv) < 2: | |
print('Usage: sdr_file_test.py sodar/path/dir/') | |
sys.exit(-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'Taylor' | |
''' | |
Convert binary format to ArcAscii Format - adapted from https://gist.github.com/nikmolnar/284b5541bfc54946a24b | |
''' | |
import os, struct, sys, math, requests | |
server = 'your/terrain/server/here' # Ask for the URL if you want to try it out. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function computeHeights(hmTexture: THREE.Texture, stats: any) { | |
const image = hmTexture.image | |
let w = image.naturalWidth | |
let h = image.naturalHeight | |
let canvas = document.createElement('canvas') | |
canvas.width = w | |
canvas.height = h | |
let ctx = canvas.getContext('2d') | |
ctx.drawImage(image, 0, 0, w, h) | |
let data = ctx.getImageData(0, 0, w, h).data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Converts a 2D shapefile to a 3D shapefile """ | |
import sys | |
import os | |
import struct | |
import numpy as np | |
import fiona | |
from fiona.transform import transform_geom, transform | |
from fiona.crs import from_epsg | |
from PIL import Image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Converts a 2D shapefile to a 3D shapefile """ | |
import sys | |
import os | |
import struct | |
import numpy as np | |
import fiona | |
from fiona.transform import transform_geom, transform | |
from fiona.crs import from_epsg | |
from PIL import Image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
WorkCrew - a WebWorker work queue library | |
Usage: | |
// Create an 8 worker pool using worker.js. | |
var crew = new WorkCrew('worker.js', 8); | |
// Do something whenever a job is completed. | |
// The result object structure is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sodar_utils import SodarCollection | |
import matplotlib.pyplot as plt | |
import numpy as np | |
sodars = SodarCollection('sodar_data/Primet') | |
data = sodars.night_array('speed') | |
# Find the index of the specific night we're interested in | |
index = [i for i, j in enumerate(data[1]) if j['name']=='0518'][0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Taylor Mutch, | |
Revision date - 11/22/2016 | |
Utilities for working with the VALCEX data. | |
timestamp in this context will refer to either a Sodar timestamp (e.x. 120314124500), | |
or a datetime.datetime object (e.x. datetime(2012, 3, 14, 12, 45)) | |
""" | |
import os | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sodar_utils import SodarCollection | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import matplotlib.colors as col | |
sodars = SodarCollection('sodar_data/Primet') | |
data = sodars.night_array('direction') | |
def cyclic_colormap(): |
OlderNewer