# HG changeset patch
# User greg
# Date 1520860516 14400
# Node ID afe6d8bac0c0d8389637275ed34ef66ce3ae4ca6
# Parent 452e0e189e849fa13bc9e3f34a2f3367cd52e1a4
Uploaded
diff -r 452e0e189e84 -r afe6d8bac0c0 insect_phenology_model.R
--- a/insect_phenology_model.R Fri Mar 09 13:41:38 2018 -0500
+++ b/insect_phenology_model.R Mon Mar 12 09:15:16 2018 -0400
@@ -1057,14 +1057,7 @@
if (process_nymphs) {
# Calculate nymph populations for selected life stage.
for (life_stage_nymph in life_stages_nymph) {
- if (life_stage_nymph=="Total") {
- # Mean value for all nymphs.
- total_nymphs = apply((YoungNymphs.replications+OldNymphs.replications), 1, mean);
- temperature_data_frame = append_vector(temperature_data_frame, total_nymphs, "TOTALNYMPH");
- # Standard error for all nymphs.
- total_nymphs.std_error = apply((YoungNymphs.replications+OldNymphs.replications) / sqrt(opt$replications), 1, sd);
- temperature_data_frame = append_vector(temperature_data_frame, total_nymphs.std_error, "TOTALNYMPHSE");
- } else if (life_stage_nymph=="Young") {
+ if (life_stage_nymph=="Young") {
# Mean value for young nymphs.
young_nymphs = apply(YoungNymphs.replications, 1, mean);
temperature_data_frame = append_vector(temperature_data_frame, young_nymphs, "YOUNGNYMPH");
@@ -1078,20 +1071,20 @@
# Standard error for old nymphs.
old_nymphs.std_error = apply(OldNymphs.replications / sqrt(opt$replications), 1, sd);
temperature_data_frame = append_vector(temperature_data_frame, old_nymphs.std_error, "OLDNYMPHSE");
+ } else if (life_stage_nymph=="Total") {
+ # Mean value for all nymphs.
+ total_nymphs = apply((YoungNymphs.replications+OldNymphs.replications), 1, mean);
+ temperature_data_frame = append_vector(temperature_data_frame, total_nymphs, "TOTALNYMPH");
+ # Standard error for all nymphs.
+ total_nymphs.std_error = apply((YoungNymphs.replications+OldNymphs.replications) / sqrt(opt$replications), 1, sd);
+ temperature_data_frame = append_vector(temperature_data_frame, total_nymphs.std_error, "TOTALNYMPHSE");
}
}
}
if (process_adults) {
# Calculate adult populations for selected life stage.
for (life_stage_adult in life_stages_adult) {
- if (life_stage_adult=="Total") {
- # Mean value for all adults.
- total_adults = apply((Previttelogenic.replications+Vittelogenic.replications+Diapausing.replications), 1, mean);
- temperature_data_frame = append_vector(temperature_data_frame, total_adults, "TOTALADULT");
- # Standard error for all adults.
- total_adults.std_error = apply((Previttelogenic.replications+Vittelogenic.replications+Diapausing.replications), 1, sd) / sqrt(opt$replications);
- temperature_data_frame = append_vector(temperature_data_frame, total_adults.std_error, "TOTALADULTSE");
- } else if (life_stage_adult == "Pre-vittelogenic") {
+ if (life_stage_adult == "Pre-vittelogenic") {
# Mean value for previttelogenic adults.
previttelogenic_adults = apply(Previttelogenic.replications, 1, mean);
temperature_data_frame = append_vector(temperature_data_frame, previttelogenic_adults, "PRE-VITADULT");
@@ -1112,6 +1105,13 @@
# Standard error for vittelogenic adults.
diapausing_adults.std_error = apply(Diapausing.replications, 1, sd) / sqrt(opt$replications);
temperature_data_frame = append_vector(temperature_data_frame, diapausing_adults.std_error, "DIAPAUSINGADULTSE");
+ } else if (life_stage_adult=="Total") {
+ # Mean value for all adults.
+ total_adults = apply((Previttelogenic.replications+Vittelogenic.replications+Diapausing.replications), 1, mean);
+ temperature_data_frame = append_vector(temperature_data_frame, total_adults, "TOTALADULT");
+ # Standard error for all adults.
+ total_adults.std_error = apply((Previttelogenic.replications+Vittelogenic.replications+Diapausing.replications), 1, sd) / sqrt(opt$replications);
+ temperature_data_frame = append_vector(temperature_data_frame, total_adults.std_error, "TOTALADULTSE");
}
}
}
diff -r 452e0e189e84 -r afe6d8bac0c0 insect_phenology_model.xml
--- a/insect_phenology_model.xml Fri Mar 09 13:41:38 2018 -0500
+++ b/insect_phenology_model.xml Mon Mar 12 09:15:16 2018 -0400
@@ -123,23 +123,23 @@
-
+
-
-
+
+
-
**What it does**
diff -r 452e0e189e84 -r afe6d8bac0c0 test-data/output1.csv
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/output1.csv Mon Mar 12 09:15:16 2018 -0400
@@ -0,0 +1,1 @@
+"LATITUDE","LONGITUDE","DATE","DOY","TMIN","TMAX","DAYLEN","YOUNGNYMPH","YOUNGNYMPHSE","PRE-VITADULT","PRE-VITADULTSE"
diff -r 452e0e189e84 -r afe6d8bac0c0 test-data/output2.csv
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/output2.csv Mon Mar 12 09:15:16 2018 -0400
@@ -0,0 +1,1 @@
+"LATITUDE","LONGITUDE","DATE","DOY","TMIN","TMAX","DAYLEN","EGG","EGGSE","TOTALNYMPH","TOTALNYMPHSE","TOTALADULT","TOTALADULTSE"
diff -r 452e0e189e84 -r afe6d8bac0c0 test-data/output3.csv
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/output3.csv Mon Mar 12 09:15:16 2018 -0400
@@ -0,0 +1,1 @@
+"LATITUDE","LONGITUDE","DATE","DOY","TMIN","TMAX","DAYLEN","OLDNYMPH","OLDNYMPHSE"
diff -r 452e0e189e84 -r afe6d8bac0c0 test-data/output4.csv
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/output4.csv Mon Mar 12 09:15:16 2018 -0400
@@ -0,0 +1,1 @@
+"LATITUDE","LONGITUDE","DATE","DOY","TMIN","TMAX","DAYLEN","EGG","EGGSE","TOTALNYMPH","TOTALNYMPHSE","TOTALADULT","TOTALADULTSE"
diff -r 452e0e189e84 -r afe6d8bac0c0 test-data/plot.pdf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/plot.pdf Mon Mar 12 09:15:16 2018 -0400
@@ -0,0 +1,52 @@
+%PDF
+1 0 obj
+<<
+/CreationDate
+/ModDate
+/Title (R Graphics Output)
+/Producer
+/Creator (R)
+<< /Type /Catalog /Pages 3 0 R >>
+endobj
+7 0 obj
+<< /Type /Page /Parent 3 0 R /Contents 8 0 R /Resources 4 0 R >>
+endobj
+3 0 obj
+<< /Type /Pages /Kids [ 7 0 R ] /Count 1 /MediaBox [0 0 1440 2160] >>
+endobj
+4 0 obj
+<<
+/ProcSet [/PDF /Text]
+/Font <>
+/ExtGState << >>
+/ColorSpace << /sRGB 5 0 R >>
+>>
+endobj
+5 0 obj
+[/ICCBased 6 0 R]
+endobj
+6 0 obj
+<< /Alternate /DeviceRGB /N 3 /Length 2596 /Filter /FlateDecode >>
+stream
+endobj
+9 0 obj
+<<
+/Type /Encoding /BaseEncoding /WinAnsiEncoding
+/Differences [ 45/minus 96/quoteleft
+144/dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent
+/dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron /space]
+>>
+endobj
+10 0 obj
+<< /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica
+/Encoding 9 0 R >>
+endobj
+11 0 obj
+<< /Type /Font /Subtype /Type1 /Name /F3 /BaseFont /Helvetica-Bold
+/Encoding 9 0 R >>
+endobj
+xref
+trailer
+<< /Size 12 /Info 1 0 R /Root 2 0 R >>
+startxref
+%%EOF
diff -r 452e0e189e84 -r afe6d8bac0c0 test-data/pop_by_generation.pdf
--- a/test-data/pop_by_generation.pdf Fri Mar 09 13:41:38 2018 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-%PDF
-1 0 obj
-<<
-/CreationDate
-/ModDate
-/Title (R Graphics Output)
-/Producer
-/Creator (R)
-<< /Type /Catalog /Pages 3 0 R >>
-endobj
-7 0 obj
-<< /Type /Page /Parent 3 0 R /Contents 8 0 R /Resources 4 0 R >>
-endobj
-3 0 obj
-<< /Type /Pages /Kids [ 7 0 R ] /Count 1 /MediaBox [0 0 1440 2160] >>
-endobj
-4 0 obj
-<<
-/ProcSet [/PDF /Text]
-/Font <>
-/ExtGState << >>
-/ColorSpace << /sRGB 5 0 R >>
->>
-endobj
-5 0 obj
-[/ICCBased 6 0 R]
-endobj
-6 0 obj
-<< /Alternate /DeviceRGB /N 3 /Length 2596 /Filter /FlateDecode >>
-stream
-endobj
-9 0 obj
-<<
-/Type /Encoding /BaseEncoding /WinAnsiEncoding
-/Differences [ 45/minus 96/quoteleft
-144/dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent
-/dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron /space]
->>
-endobj
-10 0 obj
-<< /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica
-/Encoding 9 0 R >>
-endobj
-11 0 obj
-<< /Type /Font /Subtype /Type1 /Name /F3 /BaseFont /Helvetica-Bold
-/Encoding 9 0 R >>
-endobj
-xref
-trailer
-<< /Size 12 /Info 1 0 R /Root 2 0 R >>
-startxref
-%%EOF