-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit test and change on daily global insolation on inclined surface.
- Loading branch information
1 parent
3457396
commit 00549ea
Showing
19 changed files
with
465 additions
and
372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
library(here) | ||
|
||
Ib_beta_eq = dget(here("functions", "I_b_beta.R")) | ||
Ibi_eq = dget(here("functions", "I_bi.R")) | ||
|
||
function(Ls, phi, tau, al=0.1, beta, gamma_c, nfft){ | ||
function(Ls, phi, tau, beta, gamma_c, nfft){ | ||
if(gamma_c > 180 || gamma_c < -180){ | ||
stop("Surface azimuth angle gamma_c must between -180 and 180 degress with zero south, east negative, and west positive.") | ||
} | ||
|
||
# H_b_beta is obtained by integrating I_b_beta over the period from sunrise to sunset. | ||
H_b_beta = Ib_beta_eq(Ls=Ls, phi=phi, tau=tau, T_start=0, T_end=24, al=al, beta=beta, gamma_c=gamma_c, nfft=nfft) | ||
# H_bi is obtained by integrating I_bi over the period from sunrise to sunset. | ||
H_bi = Ibi_eq(Ls=Ls, phi=phi, tau=tau, T_start=0, T_end=24, beta=beta, gamma_c=gamma_c, nfft=nfft) | ||
|
||
# Return result. | ||
return(H_b_beta) | ||
return(H_bi) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
library(here) | ||
Hbi_eq = dget(here("functions", "H_bi.R")) | ||
|
||
test_data_dir = "test/data/" | ||
|
||
spacecrafts = list( | ||
"VL1" = list( | ||
"latitude" = 22.3, | ||
"longitude" = -49.97, | ||
"beta_optimal" = 6.5 | ||
), | ||
"VL2" = list( | ||
"latitude" = 47.7, | ||
"longitude" = 134.29, | ||
"beta_optimal" = 22 | ||
) | ||
) | ||
|
||
# Expected data | ||
expected_data = list( | ||
"VL1" = list( | ||
"tau" = read.csv(here(test_data_dir, "discretized_tau_at_vl1_fig_3_1991_update.csv")), | ||
"insolation" = | ||
list( | ||
"beta_equals_phi" = read.csv(here(test_data_dir, "daily_insolation_on_an_inclined_surface_for_beta_equals_phi_at_vl1_table_ii_1993.csv")), | ||
"beta_optimal" = read.csv(here(test_data_dir, "daily_insolation_on_optimal_inclined_angle_beta_at_vl1_table_iii_1993.csv")) | ||
) | ||
), | ||
"VL2" = list( | ||
"tau" = read.csv(here(test_data_dir, "discretized_tau_at_vl2_fig_3_1991_update.csv")), | ||
"insolation" = | ||
list( | ||
"beta_equals_phi" = read.csv(here(test_data_dir, "daily_insolation_on_an_inclined_surface_for_beta_equals_phi_at_vl2_table_ii_1993.csv")), | ||
"beta_optimal" = read.csv(here(test_data_dir, "daily_insolation_on_optimal_inclined_angle_beta_at_vl2_table_iii_1993.csv")) | ||
) | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.