Esempio n. 1
0
import sys
sys.path.append('..')
from run_fakes import fake_loop
from photometry import mag2flux

import numpy as np
x = 5 + np.random.rand(200) * 10
y = x - 1 + 2 * np.random.rand(200)
y[100:] = 120 - y[100:]


fake_loop(x, y,
          (mag2flux(15.11, 'F621M'), mag2flux(14.7, 'F845M')),
          200, 'BG-CRU', i_inserted=9)
Esempio n. 2
0
import sys
sys.path.append('..')
from run_fakes import fake_loop

#fake_loop(10, 30, (1e5, 1e5), 100, 'outside_0')
#fake_loop(10, 30, (1e4, 1e4), 100, 'outside_1')
#fake_loop(10, 30, (1e3, 1e3), 100, 'outside_2')
#fake_loop(10, 30, (2e2, 2e2), 100, 'outside_3')

import numpy as np
x = np.random.rand(100) * 10 + 10
y = np.random.rand(100) * 80 + 20
fake_loop(x, y, (2e4, 2e4), 100, 'outside_i7_0', i_inserted=7)
Esempio n. 3
0
import sys
sys.path.append('..')
from run_fakes import fake_loop
from photometry import mag2flux

import numpy as np
x = np.ones(200)
y = np.ones(200)
x[:100] = 56 - np.random.rand(100) * 5
x[100:] = 64 + np.random.rand(100) * 5
y = 100 - 3 + np.random.rand(200) * 6


fake_loop(x, y,
          (mag2flux(11.91, 'F621M'), mag2flux(11.04, 'F845M')),
          200, 'U-AQL', i_inserted=42)
Esempio n. 4
0
import sys
sys.path.append('..')
from run_fakes import fake_loop
from photometry import mag2flux

import numpy as np
x = np.ones(200)
y = np.ones(200)
x[:100] = 56 - np.random.rand(100) * 5
x[100:] = 64 + np.random.rand(100) * 5
y = 13 - 3 + np.random.rand(200) * 6

fake_loop(x,
          y, (mag2flux(15.36, 'F621M'), mag2flux(14.33, 'F845M')),
          200,
          'R-CRU',
          i_inserted=21)
Esempio n. 5
0
sys.path.append('..')
from run_fakes import fake_loop
from photometry import mag2flux

import numpy as np

phi = 2 * np.pi * np.random.rand(200)


def index(phi):
    '''Close to diffraction spike or bleed column?'''
    return ((np.mod(phi, np.pi) < 0.2) | (np.mod(phi, np.pi) > 2.9) |
            (np.abs(np.mod(phi, np.pi / 2) - np.pi / 4) < 0.1) |
            # close to source
            (np.abs(phi - np.deg2rad(320.)) < 0.3))


ind = index(phi)
while ind.sum() > 0:
    phi[ind] = 2 * np.pi * np.random.rand(ind.sum())
    ind = index(phi)

x = 60 + 40 * np.sin(phi)
y = 60 + 40 * np.cos(phi)

fake_loop(x,
          y, (mag2flux(16.18, 'F621M'), mag2flux(14.85, 'F845M')),
          200,
          'U-VUL',
          i_inserted=45)
Esempio n. 6
0
import sys
import numpy as np

sys.path.append('..')
from run_fakes import fake_loop, default_mags

ang = 2 * np.pi * np.random.uniform(size=500)
d = float(sys.argv[1])
print(d)
x = d * np.sin(ang) + 61
y = d * np.cos(ang) + 61

for i, mags in enumerate(default_mags):
    fake_loop(x, y, mags, 500, 'r{}_{}'.format(d, i))
Esempio n. 7
0
import sys
sys.path.append('..')
from run_fakes import fake_loop
from photometry import mag2flux

import numpy as np

phi = 2 * np.pi * np.random.rand(200)


def index(phi):
    '''Close to diffraction spike or bleed column?'''
    return ((np.mod(phi, np.pi) < 0.2) | (np.mod(phi, np.pi) > 2.9) |
            (np.abs(phi - np.pi * 3 / 2) < 0.2) |
            (np.abs(np.mod(phi, np.pi / 2) - np.pi / 4) < 0.25))


ind = index(phi)
while ind.sum() > 0:
    phi[ind] = 2 * np.pi * np.random.rand(ind.sum())
    ind = index(phi)

x = 60 + 23 * np.sin(phi)
y = 60 + 23 * np.cos(phi)

fake_loop(x,
          y, (mag2flux(11.4, 'F621M'), mag2flux(11.2, 'F845M')),
          200,
          'S-NOR',
          i_inserted=30)
Esempio n. 8
0
import sys
sys.path.append('..')
from run_fakes import fake_loop

fake_loop(30, 30, (3e4, 3e4), 100, 'diag_1')
fake_loop(30, 30, (1e4, 1e4), 100, 'diag_2')
fake_loop(30, 30, (3e3, 3e3), 100, 'diag_3')