This file contains hidden or 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
#!/bin/bash | |
#PBS -A ###-###-## | |
#PBS -l walltime=00:05:00 | |
#PBS -l nodes=1:ppn=8 | |
#PBS -t [1-10]%10 | |
# More information about the identification section available at: | |
# https://wiki.calculquebec.ca/w/Moab/en | |
# PBRT generic submission script |
This file contains hidden or 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
#!/usr/bin/env python | |
""" | |
Data from: http://www.siata.gov.co/newpage/index.php | |
Archives: http://www.siata.gov.co/kml/00_Radar/Ultimo_Barrido/ | |
Exemple d'utilisation: | |
$ python convert_radar_to_numeric.py 201606031736.png AreaMetropolitanaRadar_05_240_DBZH.png 0 80 output.npz | |
$ python | |
>>> import numpy as np | |
>>> f = np.load(open('output.npz', 'rb')) | |
>>> from matplotlib import pyplot as plt |
This file contains hidden or 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 [map] = reference_normal_map(imsize) | |
% Script that builds the normal map of a sphere for reference | |
if (nargin < 1), imsize = 201; end; | |
range = linspace(-1, 1, imsize); | |
X = repmat(range, [size(range, 2), 1]); | |
Y = flipud(repmat(range', [1, size(range, 2)])); | |
Z = (1 - (X.^2 + Y.^2)).^0.5; | |
% Change the range for display from 0..1 instead of -1..1 |
This file contains hidden or 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 sys | |
import os | |
import shutil | |
import pickle | |
from glob import glob | |
import numpy as np | |
from scipy.misc import imread | |
from scipy.ndimage.filters import gaussian_laplace | |
from scipy.signal import find_peaks_cwt |
This file contains hidden or 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 numpy as np | |
from mpl_toolkits.mplot3d import Axes3D | |
import matplotlib.pyplot as plt | |
from scipy import interpolate | |
from plyfile import PlyData, PlyElement | |
def plotPointCloud(pc, color='b', marker='o', fig_ax=None, blocking=False): | |
if not fig_ax: | |
fig = plt.figure() |
This file contains hidden or 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 concurrent.futures | |
from random import choice, randint | |
from collections import Iterable | |
from operator import add, mul, sub, neg, abs | |
MIN_VAL, MAX_VAL = -20, 20 | |
def pdiv(left, right): | |
"""Division protected against divisions by zero.""" |
This file contains hidden or 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 concurrent.futures | |
from operator import add, mul, sub | |
def pdiv(left, right): | |
try: | |
return left / right | |
except ZeroDivisionError: | |
return 1 |
This file contains hidden or 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 operator import add, mul, sub | |
def pdiv(left, right): | |
try: | |
return left / right | |
except ZeroDivisionError: | |
return 1 | |
This file contains hidden or 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
%% 1. Load the LuxRender | |
luxrend = load('ico_lux.mat'); | |
mask = luxrend.mask; mask = imerode( mask, strel('disk', 2) ); mask(end,:) = false; | |
% Convert to intensity | |
%intensity_luxrender = zeros(size(luxrend.I, 1)/3, size(luxrend.I, 2)); | |
intensity_luxrender = zeros(sum(luxrend.mask(:)), size(luxrend.I, 2)); | |
for i = 1:size(luxrend.I, 2) | |
%im = hdr_rgb2gray(reshape(l.I(:,i), [], 3)); | |
im = hdr_rgb2gray(reshape(l.I(:,i), [size(l.mask, 1), size(l.mask, 2), 3])); |
This file contains hidden or 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
k = 3; % Number of columns to take | |
%L = normc([1, 0, 0; 0, 1, 0; rand(3, 10)']'); | |
%L = normc([1, 0, 0; 1, 0, 1; 1, 1, 0; 0, 1, 1; 0, 0, 1]'); | |
%L = normc([1, 0, 0; 0, 1, 0; 0.1, 0.9, 0; -0.1, 0.9, 0; 0.1, 0.1, 0.1]'); | |
L = normc([0.2, 0, 0.1; -0.1, 0.9, 0; 0.1, 0.1, 0.2; 0, 1, 0; 0.1, 0.9, 0]'); | |
% Golub's algorithm | |
[~,~,V] = svd(L); | |
[~,~,E] = qr(V(:,1:k)',0); | |
E = E(1:k); |