Package pycosmicstar :: Module observationalCSFR
[hide private]
[frames] | no frames]

Source Code for Module pycosmicstar.observationalCSFR

 1  # -*- coding: utf-8 -*- 
 2  #!/usr/bin/env python3 
 3  # *-* Coding: UTF-8 *-* 
 4   
 5  from __future__ import division, absolute_import 
 6   
 7  __author__ = "Eduardo dos Santos Pereira" 
 8  __email__ = "pereira.somoza@gmail.com" 
 9  __credits__ = ["Eduardo dos Santos Pereira"] 
10  __license__ = "GPLV3" 
11  __version__ = "1.0.1" 
12  __maintainer__ = "Eduardo dos Santos Pereira" 
13  __status__ = "Stable" 
14   
15   
16  """Observational Cosmic Star Formation Rate 
17   
18  This file is part of pystar. 
19  copyright : Eduardo dos Santos Pereira 
20   
21  pystar is free software: you can redistribute it and/or modify 
22  it under the terms of the GNU General Public License as published by 
23  the Free Software Foundation, either version 3 of the License. 
24  pystar is distributed in the hope that it will be useful, 
25  but WITHOUT ANY WARRANTY; without even the implied warranty of 
26  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
27  GNU General Public License for more details. 
28   
29  You should have received a copy of the GNU General Public License 
30  along with Foobar.  If not, see <http://www.gnu.org/licenses/>. 
31   
32  """ 
33   
34  from numpy import array, loadtxt 
35   
36   
37 -class ObservationalCSFR:
38
39 - def __init__(self):
40 arq = open("./data/hopkins_2004.dat", 'r') 41 self.data = loadtxt(arq, delimiter=",")
42
43 - def csfredshift(self):
44 """Return the redshift and the CSFR from 45 observational data 46 """ 47 return self.data[:, 0], self.data[:, 1]
48
49 - def errorData(self):
50 """Return the asymetric errors in the redshif and CSFR 51 respectively 52 """ 53 xerr = array([self.data[:, 0] - self.data[:, 2], 54 self.data[:, 3] - self.data[:, 0]]) 55 yerr = array([self.data[:, 1] - self.data[:, 4], 56 self.data[:, 5] - self.data[:, 1]]) 57 return xerr, yerr
58