Skip to content

Instantly share code, notes, and snippets.

View mainvoid007's full-sized avatar

Olaf Maywald mainvoid007

  • codingschule
  • Hamburg
View GitHub Profile
@mainvoid007
mainvoid007 / installcdo.sh
Last active November 4, 2021 15:37
install cdo with grib2, hdf5, netcdf4
#!/bin/bash
# Institut für Wetter- und Klimakommunikation GmbH / Qmet
# O. Maywald <maywald@klimagipfel.de>
# This should install CDO with grib2, netcdf and HDF5 support. Note that the binaries are in /opt/cdo-install/bin.
# For further information look:
# http://www.studytrails.com/blog/install-climate-data-operator-cdo-with-netcdf-grib2-and-hdf5-support/
# docker-command
def pol2latlon(x,y):
R = 6370.04
lam0 = math.radians(10);
phi0 = math.radians(60);
lam = np.arctan(x*-1 / y) + lam0
z = math.pow(R,2) * math.pow(1+np.sin(phi0),2) - (math.pow(x,2) + math.pow(y,2))
n = math.pow(R,2) * math.pow(1+np.sin(phi0),2) + (math.pow(x,2) + math.pow(y,2))
phi = np.arcsin(z/n)
return (math.degrees(lam), math.degrees(phi))
@mainvoid007
mainvoid007 / t2mReWrite.js
Last active November 15, 2017 07:21
Temperaturen auslesen und in einem anderen Text austauschen
//http://jsfiddle.net/mainvoid/qq7zcufg/
$('#btn').click(function () {
replaceT2m(
getT2mMinMaxFromText($('#data').html()),
getT2mFromText($('#text').text()))
});
function replaceT2m(resultArrayData, resultArrayText) {
var myTextArray = $('#text').text().split('In der Nacht');