This is not from a "graded assignment" I have trimmed the mean data and finally I need to calcuate and plot the residuals. So the trimmed mean (minus) the flux data. The final plot should look "dumbell" in shape (see attached plot). This is the code so far. mean_ccf = np.mean(fluxs, axis=0) # New figure for the mean plot fig_mean, ax_mean = plt.subplots(figsize=(7, 7)) # Mean data plot ax_mean.plot(lams[0], mean_ccf, linewidth=1) ax_mean.set_xlim(15,35) # Set labels and title for the mean plot ax_mean.set_xlabel('RV [km/s]') ax_mean.set_ylabel('') ax_mean.set_title('Mean CCF') plt.show() # Calculate residuals #fluxs = np.array(fluxs) check whether I need this line (maybe not) residuals = fluxs - mean_ccf # I have replaced "fluxs" with "mask" - i get an empty plot?" # Residuals data plot fig_res, ax_res=plt.subplots(figsize=(7, 7)) for i in range(len(lams)): ax_res.plot(lams[i], residuals[i], linewidth=1) # Set labels and title for the residuals plot ax_res.set_xlabel('RV [km/s]') ax_res.set_ylabel('') ax_res.set_title('CCF Residuals') plt.show()
This is not from a "graded assignment"
I have trimmed the mean data and finally I need to calcuate and plot the residuals. So the trimmed mean (minus) the flux data.
The final plot should look "dumbell" in shape (see attached plot).
This is the code so far.
mean_ccf = np.mean(fluxs, axis=0)
# New figure for the mean plot
fig_mean, ax_mean = plt.subplots(figsize=(7, 7))
# Mean data plot
ax_mean.plot(lams[0], mean_ccf, linewidth=1)
ax_mean.set_xlim(15,35)
# Set labels and title for the mean plot
ax_mean.set_xlabel('RV [km/s]')
ax_mean.set_ylabel('')
ax_mean.set_title('Mean CCF')
plt.show()
# Calculate residuals
#fluxs = np.array(fluxs) check whether I need this line (maybe not)
residuals = fluxs - mean_ccf # I have replaced "fluxs" with "mask" - i get an empty plot?"
# Residuals data plot
fig_res, ax_res=plt.subplots(figsize=(7, 7))
for i in range(len(lams)):
ax_res.plot(lams[i], residuals[i], linewidth=1)
# Set labels and title for the residuals plot
ax_res.set_xlabel('RV [km/s]')
ax_res.set_ylabel('')
ax_res.set_title('CCF Residuals')
plt.show()
Step by step
Solved in 3 steps