source('recalc_px_putirka.r');
sensors.t.opx_cpx_brey_kohler <- function(Opx, Cpx, P=10, usePFU = FALSE, ...){
row_names = paste0(Opx$Name,'-',Cpx$Name);
if (!usePFU) {
Opx <- recalc.px_putirka(Opx);
Cpx <- recalc.px_putirka(Cpx);
}
Tcalc <- -273.15 + ((23664 +
( 24.9+126.3*Cpx$Fe_pfu/(Cpx$Fe_pfu+Cpx$Mg_pfu))*P ) /
( 13.38 + ( log((1-Cpx$Ca_pfu/(1-Cpx$Na_pfu))/(1-Opx$Ca_pfu/(1-Opx$Na_pfu))) )^2 +
11.59*Opx$Fe_pfu/(Opx$Fe_pfu+Opx$Mg_pfu) ));
Eq_check <- (Cpx$Fe_pfu/Cpx$Mg_pfu)/(Opx$Fe_pfu/Opx$Mg_pfu);
Eq_check <- Eq_check > 0.95 && Eq_check < 1.23;
return (data.frame(Name=row_names,P_seq=P,T_calc=Tcalc,Eq_check=Eq_check));
}
sensors.t.opx_cpx_brey_kohler.args <- function() {
ars <- list();
ars$minerals = c('Opx','Cpx');
ars$ranges = c('P');
return(ars);
}