I am working on the referee report for Geraldo’s first paper. He/she asked about the effect of resolution, how changing the FWHM from 2.5 (miles models) to 3.1 (schiavon’s grid) would affect the result.
Geraldo prepared spectra from WAGGS and 2.5 and 3.1 of FWHM, which I am running in Starlight today 2020-08-29.
The run for 2.5 had kinematics FXK (fixed), but the run for 3.1 has the kinematics FIT.
require(reshape)
Loading required package: reshape
there is no package called ‘reshape’
Do the spectra look all right?
foo <- "norm_NGC6093_B7000_2015-04-14.txt"
spec25 <- read_table(paste0(wdir_data_25, foo), col_names = FALSE) %>%
mutate(fwhm = "2.5")
Parsed with column specification:
cols(
X1 = col_double(),
X2 = col_double(),
X3 = col_double()
)
spec31 <- read_table(paste0(wdir_data_31, foo), col_names = FALSE) %>%
mutate(fwhm = "3.1")
Parsed with column specification:
cols(
X1 = col_double(),
X2 = col_double(),
X3 = col_double()
)
specs <- bind_rows(spec25, spec31)
specs %>% filter(X1 >= 4850 & X1 <=5200) %>%
ggplot(aes(X1, X2, colour = fwhm)) +
geom_line()
Yes the spectra with different FWHM look all right.
Now let’s look at the results from the Starlight run.
read_parameters <- function(filename){
pars <- stcv05_read_output(filename, age_unit = 1.e9, z_mass = FALSE)$parameters %>% as_tibble()
return(pars)
}
#foo2 <- stcv05_read_output(paste0(wdir_output_25, foo, ".out"), age_unit = 1.e9, z_mass = FALSE)$parameters %>% as_tibble()
results_fwhm25 <- map_dfr( list.files(wdir_output_25, pattern = ".out$", full.names = TRUE), read_parameters)
DeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecated
results_fwhm31 <- map_dfr( list.files(wdir_output_31, pattern = ".out$", full.names = TRUE), read_parameters)
DeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecated
foo1 <- results_fwhm25 %>% select(filename, chi, adev, v0, vd, AV, mean_mass_age, mean_mass_logage, mean_mass_z, mean_mass_afe, bestssp) %>% mutate(fwhm = "2.5")
foo2 <- results_fwhm31 %>% select(filename, chi, adev, v0, vd, AV, mean_mass_age, mean_mass_logage, mean_mass_z, mean_mass_afe, bestssp) %>% mutate(fwhm = "3.1")
Plotting FWHM 2.5 against 3.1.
comparison_data <- bind_rows(foo1, foo2)
comparison_data %>% ggplot(aes(fill = fwhm, color = fwhm)) + geom_density(aes(chi), alpha = 0.5)
comparison_data %>% ggplot(aes(fill = fwhm, color = fwhm)) + geom_density(aes(adev), alpha = 0.5)
comparison_data %>% ggplot(aes(fill = fwhm, color = fwhm)) + geom_density(aes(AV), alpha = 0.5)
comparison_data %>% ggplot(aes(fill = fwhm, color = fwhm)) + geom_density(aes(mean_mass_age), alpha = 0.5)
comparison_data %>% ggplot(aes(fill = fwhm, color = fwhm)) + geom_density(aes(mean_mass_logage), alpha = 0.5)
comparison_data %>% ggplot(aes(fill = fwhm, color = fwhm)) + geom_density(aes(mean_mass_z), alpha = 0.5)
comparison_data %>% ggplot(aes(fill = fwhm, color = fwhm)) + geom_density(aes(mean_mass_afe), alpha = 0.5)
join_data <- inner_join(foo1, foo2, by = "filename", suffix = c(".fwhm25", ".fwhm31"))
join_data %>% ggplot() + geom_point(aes(chi.fwhm25, chi.fwhm31)) + geom_abline(slope = 1, intercept = 0, color = "gray")
join_data %>% ggplot() + geom_point(aes(adev.fwhm25, adev.fwhm31)) + geom_abline(slope = 1, intercept = 0, color = "gray")
join_data %>% ggplot() + geom_point(aes(AV.fwhm25, AV.fwhm31)) + geom_abline(slope = 1, intercept = 0, color = "gray")
join_data %>% ggplot() + geom_point(aes(mean_mass_age.fwhm25, mean_mass_age.fwhm31)) + geom_abline(slope = 1, intercept = 0, color = "gray")
join_data %>% ggplot() + geom_point(aes(mean_mass_logage.fwhm25, mean_mass_logage.fwhm31)) + geom_abline(slope = 1, intercept = 0, color = "gray")
join_data %>% ggplot() + geom_point(aes(mean_mass_z.fwhm25, mean_mass_z.fwhm31)) + geom_abline(slope = 1, intercept = 0, color = "gray")
join_data %>% ggplot() + geom_point(aes(mean_mass_afe.fwhm25, mean_mass_afe.fwhm31)) + geom_abline(slope = 1, intercept = 0, color = "gray")
NA
NA
Let’s compute some numbers.
join_data <- join_data %>% mutate(delta_logage = mean_mass_logage.fwhm25 - mean_mass_logage.fwhm31,
delta_z = mean_mass_z.fwhm25 - mean_mass_z.fwhm31,
delta_afe = mean_mass_afe.fwhm25 - mean_mass_afe.fwhm31)
print("age:")
[1] "age:"
quantile(join_data$delta_logage, probs = c(0.25, 0.5,0.75))
25% 50% 75%
-0.019940970 -0.003682166 0.004959504
print("z:")
[1] "z:"
quantile(join_data$delta_z, probs = c(0.25, 0.5,0.75))
25% 50% 75%
-0.026277816 -0.006634396 0.010151374
print("afe:")
[1] "afe:"
quantile(join_data$delta_afe, probs = c(0.25, 0.5,0.75))
25% 50% 75%
-0.002721510 0.000758952 0.013705903
ggplot(join_data, aes(delta_logage)) + geom_density()
ggplot(join_data, aes(delta_z)) + geom_density()
ggplot(join_data, aes(delta_afe)) + geom_density()