ashiklom / rrtm

Other
7 stars 3 forks source link

Parameter order in PROSPECT #6

Closed serbinsh closed 2 years ago

serbinsh commented 2 years ago

While trying to develop inversion scripts that compar 5b and D, I noticed a mismatch in the way the parameters are listed in the manual and in the function. This is important as it matters how the parameter priors are defined and added to inversion and what the user expects based on what they think they are inputting

IN the manual

prospect4(N, Cab, Cw, Cm, ...)

prospect5(N, Cab, Car, Cbrown, Cw, Cm, ...)

prospectd(N, Cab, Car, Cbrown, Canth, Cw, Cm, ...)

but in the functions

prospect4 <- function(N, Cab, Cw, Cm, ...) {
  cc <- rbind(Cab, Cw, Cm) / N
  k <-  dataspec_p4 %*% cc
  gpm(k, N, p45_talf, p45_t12, p45_t21, ...)
}

#' @rdname prospect
#' @export
prospect5 <- function(N, Cab, Car, Cbrown, Cw, Cm, ...) {
  cc <- rbind(Cab, Car, Cbrown, Cw, Cm) / N
  k <-  dataspec_p5 %*% cc
  gpm(k, N, p45_talf, p45_t12, p45_t21, ...)
}

#' @rdname prospect
#' @export
prospectd <- function(N, Cab, Car, Cbrown, Canth, Cw, Cm, ...) {
  cc <- rbind(Cab, Car, Canth, Cbrown, Cw, Cm) / N
  k <-  dataspec_pd %*% cc
  gpm(k, N, pd_talf, pd_t12, pd_t21, ...)
}

isnt exactly consistent

e.g.

function(N, Cab, Car, Cbrown, Canth, Cw, Cm, ...)

but cc <- rbind(Cab, Car, Canth, Cbrown, Cw, Cm) / N

@ashiklom i am going to assume this is important unless there is some agnostic thing going on in the background?

serbinsh commented 2 years ago

Actually, I think I am wrong here and instead I have just mis-understood the order in my scripts. probably just need to modify the order based on the function args

serbinsh commented 2 years ago

Yup - user error, not realizing the order for PROSPECT-D. Closing