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
#include <list> | |
#include <string> | |
#include <math.h> | |
#include "Epetra_ConfigDefs.h" | |
#ifdef HAVE_MPI | |
#include "mpi.h" | |
#include "Epetra_MpiComm.h" | |
#else | |
#include "Epetra_SerialComm.h" |
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
#include <list> | |
#include <string> | |
#include <math.h> | |
#include "Epetra_ConfigDefs.h" | |
#ifdef HAVE_MPI | |
#include "mpi.h" | |
#include "Epetra_MpiComm.h" | |
#else | |
#include "Epetra_SerialComm.h" |
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
g++ -O2 testVBR.cpp -ltrilinos_epetra -I/usr/include/trilinos/ -I/usr/include/openmpi -o testVBR && mpirun -n 2 ./testVBR |
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
cmake_minimum_required (VERSION 2.6) | |
project(testTP) | |
include_directories("/usr/include/trilinos/", "/usr/include/openmpi") | |
add_executable(testTP testTP.cpp) | |
target_link_libraries(testTP trilinos_epetra) |
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 objgraph | |
import pyfits | |
import gc | |
import numpy as np | |
print("Create table") | |
#a=pyfits.Column(name='',format='K',array=[1,2,3]) # Column instead correctly frees up memory | |
a=pyfits.new_table([pyfits.Column(name='',format='K',array=[1,2,3])]) | |
print("Delete table") |
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 numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib import mlab | |
def one_over_f(f, knee, alpha): | |
desc = np.ones_like(f) | |
desc[f<KNEE] = np.abs((f[f<KNEE]/KNEE)**(-alpha)) | |
desc[0] = 1 | |
return desc |
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 healpy | |
vec=np.array([[0, 0, 1], [1, 0, 0]]) | |
theta, phi = healpy.vec2ang(vec) | |
#theta = array([ 0. , 1.57079633]) | |
#phi = array([ 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
m = np.ones(healpy.nside2npix(64)) | |
cl = healpy.anafast(m) # array([ 12.56637061, 0. ,0. .... all zeros | |
m[100:200]=healpy.UNSEEN | |
clunseen = healpy.anafast(m) # array([ 1.39439151e+56, 1.37741024e+56, | |
m[100:200]=0 | |
clzero = healpy.anafast(m) # array([ 1.25152959e+01, 5.13689503e-05, 5.01205239e-05, |
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
NSIDE=8 | |
vec = [ 0.17101007, 0.03015369, 0.98480775] | |
qd=healpy.query_disc(NSIDE, vec, 6, deg=True, nest=False) | |
m = np.zeros(healpy.nside2npix(NSIDE)) | |
m[qd]=1 | |
healpy.mollview(m) | |
print(qd) | |
#array([ 3, 0, 11, 4]) | |
#IDL |
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 numpy as np | |
from planck import LFI | |
import matplotlib.pyplot as plt | |
lfi = LFI.LFI() | |
def horn2freq(horn): | |
if horn <= 23: | |
return 70 | |
elif horn <= 26: |
OlderNewer