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
// now refactored as jquery plugin | |
(function($) { | |
$.fn.extend({ | |
packedMultiImage: function(width, height) { | |
return this.each(function() { | |
var k = 4; // FIXME hardcoded | |
var $this = $(this); | |
// set up the rectangle packer | |
var rootNode = new Node(); | |
rootNode.rect = new Rect(0, 0, width, height); |
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
<resolvers> | |
<resolver name="pid"> | |
<var name="root">/mnt/svalbard/dives</var> | |
<match var="pid" pattern="((([A-Z]+)\.)?((\d{6})\d\d)\.(\d+)\.(\d+))(\.(\w+))?" | |
groups="lid _ pfx ymd ym ts1 ts2 _ ext"> | |
<!-- high-priority cruises --> | |
<match var="ym" value="200303"> | |
<path var="dir" match="${root}/200303_OC387/processed/color_corrected/*"> | |
<path match="${dir}/${lid}.jpeg"/> | |
</path> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
DIGITS='0123456789ABCDEF' | |
k=34587 | |
n=16 | |
result = '' | |
while k > 0: | |
digit = k % n | |
result = DIGITS[digit] + result | |
k = (k-digit) / n |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 StringIO import StringIO | |
import xml.etree.ElementTree as ET | |
mvco_ns = 'http://ifcb-data.whoi.edu/mvco/' | |
lid = 'IFCB5_2011_033_041857' | |
nsmap = {'mvco': mvco_ns} | |
def parse_id(pfx_id, nsmap={}): | |
ns_statements = ' '.join(['xmlns:%s="%s"' % (k,v) for k,v in nsmap.items()]) | |
xml = '<%s %s/>' % (pfx_id, ns_statements) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<namespace name="ifcb.utils"> | |
<rule name="reorg_products" include="src dest"> | |
<invoke rule="ifcb.files.find_data_dirs"/> | |
<!-- directory=product root dir, product=product type --> | |
<any> | |
<test var="product" eq="blobs"> | |
<path var="src" match="${directory}/[0-9]*/[0-9]*/*_blobs_v2.zip"/> | |
<match var="src" pattern=".*/((.*_blobs).*)" groups="product_filename pid"/> | |
<invoke rule="ifcb.pid"/> | |
</test> |
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 re | |
import time | |
from urllib2 import urlopen | |
import json | |
FEED_URL='http://ifcb-data.whoi.edu/mvco/feed.json' | |
DATA_DIR='/data' | |
FORMATS=('hdr','adc','roi') |
OlderNewer