-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_data_generator.py
33 lines (25 loc) · 1009 Bytes
/
fake_data_generator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
###################################################
# Fake Cosmological Data Generator #
# Matheus J. Castro #
# Version 1.3 #
# Last Modification: 06/11/2021 (month/day/year) #
###################################################
import numpy as np
from time import gmtime, strftime
import snia
zs = np.loadtxt("SN_2021.cat", skiprows=1).T[0]
errors = np.loadtxt("SN_2021.cat", skiprows=1).T[2]
# Parâmetros dos Dados Falsos
h0 = 70
omega_m = 0.3
omega_ee = 0.7
w = -1
#############################
data = []
for i in zs:
data.append(snia.lumin_dist_mod_func(h0, i, omega_m, omega_ee, w, show=False, precision=1E-10)[1])
# np.random.seed(int(strftime("%m%d%H%M%S", gmtime())))
# errors = np.abs(np.random.normal(data, np.std(errors), len(errors)))
data_to_save = np.array([zs, data, errors]).T
head = "redshift modulo_de_distancia erro_do_mod_dist"
np.savetxt("fake_data.cat", data_to_save, header=head, fmt="%f")