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 databasin.client import Client | |
c = Client() | |
c.login('user', 'pass') | |
# Package must have complete metadata and style necessary for one-step import | |
dataset = c.import_netcdf_dataset('/path/to/netcdf_with_metadata_and_style.zip') | |
# One-step imports are private by default | |
dataset.make_public() |
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
#!C:\Users\nik\Documents\environments\databasin_web\Scripts\python2.7.exe | |
# EASY-INSTALL-ENTRY-SCRIPT: 'celery==3.1.17','console_scripts','celery' | |
__requires__ = 'celery==3.1.19' | |
import sys | |
from pkg_resources import load_entry_point | |
if __name__ == '__main__': | |
sys.exit( | |
load_entry_point('celery==3.1.19', 'console_scripts', 'celery')() | |
) |
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
""" | |
This script takes a directory of NetCDF datasets and a single JSON style file and creates one ZIP archive | |
per dataset, ready to upload to Data Basin. | |
""" | |
import json | |
import os | |
import sys | |
from zipfile import ZipFile, ZIP_DEFLATED |
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
<?php | |
$SECRET_KEY = "<secret key here>"; | |
function base64url_encode($data) { | |
return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); | |
} | |
function is_valid($secret, $value, $salt, $signature) { | |
$verify = base64url_encode(hash_hmac("sha1", $value, sha1($salt . $secret, true), true)); | |
return $signature === $verify; |
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 mapnik | |
m = mapnik.Map(600, 600) | |
m.srs = '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' | |
rs = mapnik.RasterSymbolizer() | |
# COLORIZER_DISCRETE is a binned/classified rendere. Other options are COLORIZER_LINEAR (stretched) and | |
# COLORIZER_EXACT (unique) | |
rs.colorizer = mapnik.RasterColorizer(mapnik.COLORIZER_DISCRETE, mapnik.Color(0, 0, 0, 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
""" | |
This script converts from a simple binary elevation format to ArcASCII. The format of the binary file is: | |
Offset Type Description | |
----------------------------- | |
0 uint Grid width | |
4 uint Grid height | |
8 float* Elevation values as floats in row-major order from lower-left to upper-right. | |
""" |
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 openpyxl import Workbook | |
import os | |
COLUMNS = [ | |
'Name', 'Data Lead', 'Description', 'Date Obtained', 'Time Period of Content Date', 'Publication Date', | |
'URL', 'Contact', 'Processing Notes', 'Keywords', 'Relative Path', 'Absolute Path' | |
] | |
def parse_readme(f): |
NewerOlder