Skip to content

Instantly share code, notes, and snippets.

View Spaxe's full-sized avatar
🏹

Xavier Ho Spaxe

🏹
View GitHub Profile
> /usr/local/lib/python2.7/site-packages/datacube-1.0.1+20.g0cfa148.dirty-py2.7.egg/datacube/storage/storage.py(340)open()
339 _LOG.debug("openening %s, band %s", filename, bandnumber)
--> 340 with rasterio.open(filename) as src:
341 self.transform = src.affine
ipdb>
2016-03-30 10:09:55,373 DEBUG Got coordinate system
2016-03-30 10:09:55,373 INFO Failed to auto identify EPSG: 7
2016-03-30 10:09:55,376 DEBUG Got coordinate system
2016-03-30 10:09:55,376 INFO Failed to auto identify EPSG: 7
$ datacube-ingest -vvv ingest LS8_OLI_TIRS_NBAR_P54_GANBAR01-032_090_083_20160222
2016-03-29 16:16:45,683 INFO Matched collection u'eo' (1)
2016-03-29 16:16:45,683 INFO Indexing 3e034b98-64d9-451b-9697-2603e0b24ff2
2016-03-29 16:16:45,684 DEBUG Using provided collection 1
2016-03-29 16:16:45,695 INFO Indexed datasets LS8_OLI_TIRS_NBAR_P54_GANBAR01-032_090_083_20160222
2016-03-29 16:16:45,700 INFO Storing 1 dataset(s) using StorageType(name=u'ls8_nbar_albers', id_=5)
2016-03-29 16:16:45,738 DEBUG openening /Users/ho03b/landsat/nci/LS8_OLI_TIRS_NBAR_P54_GANBAR01-032_090_083_20160222/scene01/LS8_OLI_TIRS_NBAR_P54_GANBAR01-032_090_083_20160222_B6.tif, band 1
2016-03-29 16:16:45,765 DEBUG Got coordinate system
2016-03-29 16:16:45,765 INFO Failed to auto identify EPSG: 7
2016-03-29 16:16:45,765 DEBUG Got coordinate system
$ gdalinfo LS8_OLI_TIRS_NBAR_P54_GANBAR01-032_090_083_20160222/scene01/LS8_OLI_TIRS_NBAR_P54_GANBAR01-032_090_083_20160222_B6.tif
Driver: GTiff/GeoTIFF
Files: LS8_OLI_TIRS_NBAR_P54_GANBAR01-032_090_083_20160222/scene01/LS8_OLI_TIRS_NBAR_P54_GANBAR01-032_090_083_20160222_B6.tif
Size is 9081, 8761
Coordinate System is:
PROJCS["GDA94 / MGA zone 56",
GEOGCS["GDA94",
DATUM["Geocentric_Datum_of_Australia_1994",
SPHEROID["GRS 1980",6378137,298.2572221010002,
AUTHORITY["EPSG","7019"]],
acquisition:
groundstation: {aos: '2016-02-22 00:00:00', los: '2016-02-22 00:00:00', name: LGN}
creation_dt: '2016-02-22 00:00:00'
extent:
center_dt: '2016-02-22 23:49:48'
coord:
ll: {lat: -34.13197564959201, lon: 148.99925096327698}
lr: {lat: -34.18755686123215, lon: 151.4592804114545}
ul: {lat: -32.161057012323695, lon: 149.08786274420427}
ur: {lat: -32.21263337678139, lon: 151.49349704177084}
@Spaxe
Spaxe / gist:aba0f07b522e4f6a76b5
Created March 29, 2016 04:55
ingestion error
$ datacube-ingest -v ingest LS8_OLI_TIRS_NBAR_P54_GANBAR01-032_090_083_20160222/
2016-03-29 15:54:03,252 INFO Matched collection u'eo' (1)
2016-03-29 15:54:03,252 INFO Indexing cff1bd88-89bd-4516-9d27-a11e040942ce
2016-03-29 15:54:03,260 INFO Indexed datasets LS8_OLI_TIRS_NBAR_P54_GANBAR01-032_090_083_20160222
2016-03-29 15:54:03,264 INFO Storing 1 dataset(s) using StorageType(name=u'ls8_nbar', id_=8)
2016-03-29 15:54:03,275 INFO Failed to auto identify EPSG: 7
2016-03-29 15:54:03,276 INFO Failed to auto identify EPSG: 7
2016-03-29 15:54:03,276 ERROR CPLE_AppDefined in No PROJ.4 translation for source SRS, coordinate
transformation initialization has failed.
2016-03-29 15:54:03,276 ERROR Error opening source dataset: /Users/ho03b/landsat/nci/LS8_OLI_TIRS_NBAR_P54_GANBAR01-032_090_083_20160222/scene01/LS8_OLI_TIRS_NBAR_P54_GANBAR01-032_090_083_20160222_B6.tif
@Spaxe
Spaxe / colour_sort.py
Created March 24, 2016 00:53
Sorting image colours by RGB in descending order
# Processing 3.0.1 Python mode
# Original artist: https://medium.com/@GroundTruth/in-living-color-antarctica-s-vibrant-wildlife-under-the-sea-54ee6f09d662#.maye8r6ws
'''Sorts an image by rgb colour and draws them in gradient'''
bar_width = 50
w = 1980
h = 1366
def setup():
size(1980, 1366)
@Spaxe
Spaxe / csv-converter.js
Created March 21, 2016 11:34
Simple NodeJS commandline script to convert JSON to CSV
// Usage:
// node csv-converter.js input_path.json > output_path.csv
//
// Dependency: json-2-csv
if (process.argv.length < 3) process.exit(1);
var fs = require('fs');
var json_2_csv = require('json-2-csv');
@Spaxe
Spaxe / oceanic-next.css
Last active February 16, 2016 10:27
Oceanic Next RainbowJS Theme
/**
* Oceanic Next Theme for RainbowJS (https://github.com/ccampbell/rainbow)
*
* Adaptation of Oceanic Next from
* https://github.com/voronianski/oceanic-next-color-scheme
*
* Usage: include this file in your HTML like this:
* <link rel="stylesheet" type="text/css" href="css/oceanic-next.css">
*
* Anything transformed by RainbowJS will be automatically applied.
@Spaxe
Spaxe / search-wikipedia.js
Created January 9, 2016 11:46
Search on wikipedia
const wikipedia = require("node-wikipedia");
const searchWiki = (term) => {
return new Promise( (resolve, reject) => {
wikipedia.page.data(term, { content: true }, (response) => {
if (!response) reject(null);
resolve(response);
});
});
};
@Spaxe
Spaxe / callback-promise.js
Created December 16, 2015 22:21
Promise wrapper - turns any async function with callback into a ES6 Promise
let promise = ( func, ...args ) => {
return new Promise( ( resolve, reject ) => {
let callback = ( error, data ) => {
if (error) reject(error);
else resolve(data);
};
args.push(callback);
func.apply(func, args);
});