<jupyter_start><jupyter_text>Object 1: <NAME>, Alex, Mark<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import astropy.coordinates as coord
import astropy.units as u
import astropy.constants as const
%matplotlib inline
data = np.genfromtxt('obj1.data', dtype=None, names=True)
ID = data['ID']
RA = data['RAJ2000']
DEC = data['DECJ2000']
Z = data['Z']
E_Z = data['E_Z']
V = Z*(const.c.to('km/s'))
z_hist, bins = np.histogram(Z, bins=np.linspace(0,1,50))
plt.plot((bins[1:]+bins[:-1])/2., z_hist, c = 'r')
plt.xlabel("Redshift")
plt.ylabel("Frequency")
plt.title("Redshift")
plt.xlim(0.0, 0.8)
z_mode = bins[np.argmax(vel_hist)]
vel_hist, bins = np.histogram(V, bins=np.linspace(0,2.5e5,50))
plt.plot((bins[1:]+bins[:-1])/2., vel_hist)
plt.xlabel("Velocity [km/s]")
plt.ylabel("Frequency")
plt.title("Velocities")
plt.xlim(5e4, 15e4)
plt.axvline(1e5 + 2e4, c= 'r', label = 'Upper Bound')
plt.axvline(1e5 - 2e4, c = 'b', label = 'Lower Bound')
plt.legend()
velocity_disp = np.std(V[np.abs(V.value-1e5)<2e4])
print('Velocity Dispersion = {}'.format(velocity_disp))
RA_range = (max(RA)-min(RA)) * u.degree
DEC_range = (max(DEC)-min(DEC)) * u.degree
RA_real = RA_range.to(u.rad)
DEC_real = DEC_range.to(u.rad)

theta = np.sqrt(RA_real**2 + DEC_real**2)

print('Angular Size = {}'.format(theta))
H_naught = 70 * u.km / u.s / u.Mpc
v_mode = z_mode * (const.c.to('km/s'))

dist = v_mode / H_naught
a = (1+z_mode)**2*theta*(dist) /u.rad

print('Distance = {}'.format(dist))
print('Actual Size = {}'.format(a))
mass = 930 * (velocity_disp/(u.km)*(u.s))**2 * (a.to(u.pc)/u.pc) *u.M_sun
print('Mass = {}'.format(mass))<jupyter_output>Mass = 1.018809151900692e+18 solMass
{'fraction_non_alphanumeric': 0.21352941176470588, 'fraction_numerical': 0.04411764705882353, 'mean_word_length': 5.542307692307692, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '213679', 'license': 'MIT', 'n_tokens_mistral': 810, 'n_tokens_neox': 747, 'n_words': 137, 'path': 'day4/redshift/data/Object1DataAnalysis.ipynb', 'repo_name': 'savannahpobre/usrp-sciprog', 'size': '1704'}