Commit 952d500b authored by Martin Reinecke's avatar Martin Reinecke
Browse files

remove obsolete files

parent 81910c01
Pipeline #11569 canceled with stage
in 7 minutes and 14 seconds
#!/usr/bin/env python
import itertools
import numpy as np
import libsharp_wrapper_gl as gl
# deterministic
np.random.seed(42)
def distance_array(nlat, nlon, latitude, longitude):
lat = latitude * (np.pi / (nlat - 1))
lon = longitude * (2 * np.pi / (nlon - 1))
# Vincenty formula: https://en.wikipedia.org/wiki/Great-circle_distance
# phi_1, lambda_1 = lat, lon
# phi_2, lambda_2 = 0
numerator = np.sqrt((np.cos(0) * np.sin(lon - 0))**2 +
((np.cos(lat) * np.sin(0)) -
(np.sin(lat) * np.cos(0) * np.cos(lon - 0)))**2)
denominator = (
np.sin(lat) * np.sin(0)) + (np.cos(lat) * np.cos(0) * np.cos(lon - 0))
return np.arctan(numerator/denominator)
# for GLSpace(nlat=2, nlon=3)
da_0 = np.array(
[distance_array(2, 3, *divmod(idx, 3)) for idx in np.arange(6)])
# for GLSpace(nlat=2, nlon=3)
weight_0 = np.array(list(itertools.chain.from_iterable(
itertools.repeat(x, 3) for x in gl.vol(2))))
w_0_x = np.random.rand(6)
w_0_res = w_0_x * weight_0
weight_1 = np.array(list(itertools.chain.from_iterable(
itertools.repeat(x, 3) for x in gl.vol(2))))
weight_1 = weight_1.reshape([1, 1, 6])
w_1_x = np.random.rand(32, 16, 6)
w_1_res = w_1_x * weight_1
# write everything to disk
np.savez(
'gl_space', da_0=da_0, w_0_x=w_0_x, w_0_res=w_0_res, w_1_x=w_1_x,
w_1_res=w_1_res)
#!/usr/bin/env python
import numpy as np
import healpy as hp
# deterministic
np.random.seed(42)
# for HPSpace(nside=2)
da_0 = np.array([np.arccos(hp.pix2vec(2, idx)[0]) for idx in np.arange(48)])
# for HPSpace(nside=2)
w_0_x = np.random.rand(48)
w_0_res = w_0_x * ((4 * np.pi) / 48)
w_1_res = w_0_x * (((4 * np.pi) / 48)**2)
# write everything to disk
np.savez('hp_space', da_0=da_0, w_0_x=w_0_x, w_0_res=w_0_res, w_1_x=w_0_x,
w_1_res=w_1_res)
#!/usr/bin/env python
from __future__ import division
import numpy as np
# deterministic
np.random.seed(42)
def distance_array_helper(index_arr, lmax):
if index_arr <= lmax:
index_half = index_arr
else:
if (index_arr - lmax) % 2 == 0:
index_half = (index_arr + lmax) / 2
else:
index_half = (index_arr + lmax + 1) / 2
m = (
np.ceil(((2 * lmax + 1) - np.sqrt((2 * lmax + 1)**2 -
8 * (index_half - lmax))) / 2)
).astype(int)
return index_half - m * (2 * lmax + 1 - m) // 2
# for LMSpace(5)
da_0 = [distance_array_helper(idx, 5) for idx in np.arange(36)]
# random input for weight
w_0_x = np.random.rand(32, 16, 6)
# random input for hermitian
h_0_res_real = np.random.rand(32, 16, 6).astype(np.complex128)
h_0_res_imag = np.random.rand(32, 16, 6).astype(np.complex128)
h_0_x = h_0_res_real + h_0_res_imag * 1j
# write everything to disk
np.savez('lm_space', da_0=da_0, w_0_x=w_0_x, w_0_res=w_0_x, h_0_x=h_0_x,
h_0_res_real=h_0_res_real, h_0_res_imag=h_0_res_imag)
#!/usr/bin/env python
from __future__ import division
import numpy as np
# deterministic
np.random.seed(42)
# for now directly the kindex
# RGSpace((4, 4), harmonic=True)
da_0 = np.array([0, 1.0, 1.41421356, 2., 2.23606798, 2.82842712])
# power 1
w_0_x = np.random.rand(32, 16, 6)
# RGSpace((4, 4), harmonic=True)
# using rho directly
weight_0 = np.array([1, 4, 4, 2, 4, 1])
weight_0 = weight_0.reshape([1, 1, 6])
w_0_res = w_0_x * weight_0
# write everything to disk
np.savez('power_space',
da_0=da_0,
w_0_x=w_0_x,
w_0_res=w_0_res)
#!/usr/bin/env python
from __future__ import division
import numpy as np
# deterministic
np.random.seed(42)
# for RGSpace(shape=(4, 4), distances=None, zerocenter=[False, False])
cords_0 = np.ogrid[0:4, 0:4]
da_0 = ((cords_0[0] - 4 // 2) * 0.25)**2
da_0 = np.fft.fftshift(da_0)
temp = ((cords_0[1] - 4 // 2) * 0.25)**2
temp = np.fft.fftshift(temp)
da_0 = da_0 + temp
da_0 = np.sqrt(da_0)
# for RGSpace(shape=(4, 4), distances=None, zerocenter=[True, True])
da_1 = ((cords_0[0] - 4 // 2) * 0.25)**2
temp = ((cords_0[1] - 4 // 2) * 0.25)**2
da_1 = da_1 + temp
da_1 = np.sqrt(da_1)
# for RGSpace(shape=(4, 4), distances=(12, 12), zerocenter=[True, True])
da_2 = ((cords_0[0] - 4 // 2) * 12)**2
temp = ((cords_0[1] - 4 // 2) * 12)**2
da_2 = da_2 + temp
da_2 = np.sqrt(da_2)
# power 1
w_0_x = np.random.rand(32, 12, 6)
# for RGSpace(shape=(11,11), distances=None, harmonic=False)
w_0_res = w_0_x * (1/11 * 1/11)
# for RGSpace(shape=(11, 11), distances=(1.3,1.3), harmonic=False)
w_1_res = w_0_x * (1.3 * 1.3)
# for RGSpace(shape=(11,11), distances=None, harmonic=True)
w_2_res = w_0_x * (1.0 * 1.0)
# for RGSpace(shape=(11,11), distances=(1.3, 1,3), harmonic=True)
w_3_res = w_0_x * (1.3 * 1.3)
# hermitianization
h_0_x = np.array([
[0.88250339+0.12102381j, 0.54293435+0.7345584j, 0.87057998+0.20515315j,
0.16602950+0.09396132j],
[0.83853902+0.17974696j, 0.79735933+0.37104425j, 0.22057732+0.9498977j,
0.14329183+0.47899678j],
[0.96934284+0.3792878j, 0.13118669+0.45643055j, 0.16372149+0.48235714j,
0.66141537+0.20383357j],
[0.49168197+0.77572178j, 0.09570420+0.14219071j, 0.69735595+0.33017333j,
0.83692452+0.18544449j]])
h_0_res_real = np.array([
[0.88250339+0.j, 0.35448193+0.32029854j, 0.87057998+0.j,
0.35448193-0.32029854j],
[0.66511049-0.29798741j, 0.81714193+0.09279988j, 0.45896664+0.30986218j,
0.11949801+0.16840303j],
[0.96934284+0.j, 0.39630103+0.12629849j, 0.16372149+0.j,
0.39630103-0.12629849j],
[0.66511049+0.29798741j, 0.11949801-0.16840303j, 0.45896664-0.30986218j,
0.81714193-0.09279988j]])
h_0_res_imag = np.array([
[0.12102381+0.j, 0.41425986-0.18845242j, 0.20515315+0.j,
0.41425986+0.18845242j],
[0.47773437-0.17342852j, 0.27824437+0.0197826j, 0.64003551+0.23838932j,
0.31059374-0.02379381j],
[0.37928780+0.j, 0.33013206+0.26511434j, 0.48235714+0.j,
0.33013206-0.26511434j],
[0.47773437+0.17342852j, 0.31059374+0.02379381j, 0.64003551-0.23838932j,
0.27824437-0.0197826j]])
h_1_x = np.array([
[[0.23987021+0.41617749j, 0.34605012+0.55462234j, 0.07947035+0.73360723j,
0.22853748+0.39275304j],
[0.90254910+0.02107809j, 0.28195470+0.56031588j, 0.23004043+0.33873536j,
0.56398377+0.68913034j],
[0.81897406+0.2050369j, 0.88724852+0.8137488j, 0.84645004+0.0059284j,
0.14950377+0.50013099j]],
[[0.93491597+0.73251066j, 0.74764790+0.11539037j, 0.48090736+0.04352568j,
0.49363732+0.97233093j],
[0.72761881+0.74636216j, 0.46390134+0.4343401j, 0.88436859+0.79415269j,
0.67027606+0.85498234j],
[0.86318727+0.19076379j, 0.36859448+0.89842333j, 0.73407193+0.85091112j,
0.44187657+0.08936409j]]
])
h_1_res_real = np.array([
[[0.23987021+0.j, 0.28729380+0.08093465j, 0.07947035+0.j,
0.28729380-0.08093465j],
[0.90254910+0.j, 0.42296924-0.06440723j, 0.23004043+0.j,
0.42296924+0.06440723j],
[0.81897406+0.j, 0.51837614+0.1568089j, 0.84645004+0.j,
0.51837614-0.1568089j]],
[[0.93491597+0.j, 0.62064261-0.42847028j, 0.48090736+0.j,
0.62064261+0.42847028j],
[0.72761881+0.j, 0.56708870-0.21032112j, 0.88436859+0.j,
0.56708870+0.21032112j],
[0.86318727+0.j, 0.40523552+0.40452962j, 0.73407193+0.j,
0.40523552-0.40452962j]]
])
h_1_res_imag = np.array([
[[0.41617749+0.j, 0.47368769-0.05875632j, 0.73360723+0.j,
0.47368769+0.05875632j],
[0.02107809+0.j, 0.62472311+0.14101454j, 0.33873536+0.j,
0.62472311-0.14101454j],
[0.20503690+0.j, 0.65693990-0.36887238j, 0.00592840+0.j,
0.65693990+0.36887238j]],
[[0.73251066+0.j, 0.54386065-0.12700529j, 0.04352568+0.j,
0.54386065+0.12700529j],
[0.74636216+0.j, 0.64466122+0.10318736j, 0.79415269+0.j,
0.64466122-0.10318736j],
[0.19076379+0.j, 0.49389371+0.03664104j, 0.85091112+0.j,
0.49389371-0.03664104j]]
])
# write everything to disk
np.savez('rg_space',
da_0=da_0,
da_1=da_1,
da_2=da_2,
w_0_x=w_0_x,
w_0_res=w_0_res,
w_1_res=w_1_res,
w_2_res=w_2_res,
w_3_res=w_3_res,
h_0_x=h_0_x,
h_0_res_real=h_0_res_real,
h_0_res_imag=h_0_res_imag,
h_1_x=h_1_x,
h_1_res_real=h_1_res_real,
h_1_res_imag=h_1_res_imag)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment