Output 4

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

PEU(327)-Spring 2023

Observational Astrophysics Laboratory (OAL)

Lab 9

Supervised by
Professor Hisham Anwer

May 2023
Lab 9 • May 2023

Contents
1 Experiment XVIII 2
1.1 PreLab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 CDM PLot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Code Explanation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 MS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 RGB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.6 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1
Lab 9 • May 2023

1 Experiment XVIII
1.1 PreLab
If we take the logarithm of both sides of this equation, we get:
log10 e
log10 ρ = −z
hz
This equation is in the form of a straight line with a slope of − 0.4343
hz .

1.2 CDM PLot

Figure 1: The red clump has an absolute magnitude ≈ 0

1.3 Code Explanation


N,edges=np.histogram(distance,bins=100,range=[0,4000])

1. This line computes a histogram of the data in the distance array, with 100 bins in the range [0,4000],
and returns two values: N, which is an array of bin counts, and edges, which is an array of bin edges.
These values are assigned to the variables N and edges, respectively.

vol=(4.*np.pi/3)*edges**3

2. This line computes the volume of each bin in the histogram by raising the edges of each bin to the
power of 3, multiplying by a constant factor 4*pi/3, and assigning the resulting values to the variable
vol.

dvol=np.diff(vol)

2
Lab 9 • May 2023

3. This line computes the difference between adjacent elements of the vol array and assigns the resulting
values to the variable dvol. This represents the differential volume of each bin.

logdens=np.log10(N/dvol)

4. This line computes the logarithm (base 10) of the ratio of the bin counts N to the differential volumes
dvol, and assigns the resulting values to the variable logdens. This represents the logarithmic density
of each bin.

bincent=0.5*(edges[1:]+edges[:-1])

5. This line computes the center of each bin by taking the average of the upper and lower edges of the
bin, and assigns the resulting values to the variable bincent.

plt.scatter(bincent,logdens)

6. This line creates a scatter plot of the bincent values on the x-axis and the logdens values on the y-axis
using the scatter function from the matplotlib.pyplot library. The resulting plot is displayed on the
screen.

1.4 MS

Figure 2: Main Sequence fitted Plot

Given The slope m = −0.001830025566025466


1
m=−
Hz
1
Hz = −
m
Substituting the value of m, we get:
1
Hz = − ≈ 545.958 Hz
−0.001830025566025466
Therefore, Hz is approximately 545.958 Hz.

3
Lab 9 • May 2023

Figure 3: The red clump stars fitted Plot

1.5 RGB
Given The slope m = −0.00100732867526532633
1
m=−
Hz
1
Hz = −
m
Substituting the value of m, we get:
−1
Hz = ≈ 993.723 Hz
−0.0010073286752653263
Therefore, Hz is approximately 993.723 Hz.

1.6 Comments
Comparing these two values, we can see that the scale height for the red giant stars is higher than that for
the main sequence stars. This makes sense, as red giant stars are more massive and have larger radii than
main sequence stars, and thus have a larger spatial distribution.
The red clump stars should give a better estimate for the scale height than the all main sequence stars
sample because the red clump stars have a narrower range of luminosity and are more tightly clustered in the
HR diagram. This means they are more uniform in their properties, making it easier to accurately determine
their distance and scale height.

You might also like