<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//TaxonX//DTD Taxonomic Treatment Publishing DTD v0 20100105//EN" "https://aem.pensoft.net/nlm/tax-treatment-NS0.dtd">
<article xmlns:tp="http://www.plazi.org/taxpub" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" article-type="research-article" xml:lang="en">
  <front>
    <journal-meta>
      <journal-id journal-id-type="publisher-id">78</journal-id>
      <journal-id journal-id-type="index">urn:lsid:arphahub.com:pub:3845C6FC-D117-5A0E-B63F-122CB98024F9</journal-id>
      <journal-title-group>
        <journal-title xml:lang="en">Agricultural and Environmental Modelling</journal-title>
        <abbrev-journal-title xml:lang="en">AEM</abbrev-journal-title>
      </journal-title-group>
      <issn pub-type="epub">3134-1810</issn>
      <publisher>
        <publisher-name>Pensoft Publishers</publisher-name>
      </publisher>
    </journal-meta>
    <article-meta>
      <article-id pub-id-type="doi">10.3897/aem.8.208963</article-id>
      <article-id pub-id-type="publisher-id">208963</article-id>
      <article-categories>
        <subj-group subj-group-type="heading">
          <subject>Software Description</subject>
        </subj-group>
        <subj-group subj-group-type="scientific_subject">
          <subject>Computer &amp; Information sciences</subject>
          <subject>Diseases &amp; Pests</subject>
        </subj-group>
      </article-categories>
      <title-group>
        <article-title>TrackTrap: An R-based computational tool for modeling pest phenology with automated weather integration</article-title>
      </title-group>
      <contrib-group content-type="authors">
        <contrib contrib-type="author" corresp="yes">
          <name name-style="western">
            <surname>Bhandari</surname>
            <given-names>Santosh</given-names>
          </name>
          <email xlink:type="simple">santoshbhandari4556@gmail.com</email>
          <uri content-type="orcid">https://orcid.org/0000-0001-9991-474X</uri>
          <xref ref-type="aff" rid="A1">1</xref>
          <role content-type="http://credit.niso.org/contributor-roles/conceptualization/">Conceptualization</role>
          <role content-type="http://credit.niso.org/contributor-roles/writing-original-draft/">Writing - original draft</role>
          <role content-type="http://credit.niso.org/contributor-roles/data-curation/">Data curation</role>
          <role content-type="http://credit.niso.org/contributor-roles/formal-analysis/">Formal analysis</role>
          <role content-type="http://credit.niso.org/contributor-roles/investigation/">Investigation</role>
          <role content-type="http://credit.niso.org/contributor-roles/methodology/">Methodology</role>
          <role content-type="http://credit.niso.org/contributor-roles/resources/">Resources</role>
          <role content-type="http://credit.niso.org/contributor-roles/software/">Software</role>
        </contrib>
        <contrib contrib-type="author" corresp="no">
          <name name-style="western">
            <surname>Ghimire</surname>
            <given-names>Mahesh</given-names>
          </name>
          <uri content-type="orcid">https://orcid.org/0009-0005-6295-0954</uri>
          <xref ref-type="aff" rid="A1">1</xref>
          <role content-type="http://credit.niso.org/contributor-roles/writing-review-editing/">Writing - review and editing</role>
          <role content-type="http://credit.niso.org/contributor-roles/formal-analysis/">Formal analysis</role>
          <role content-type="http://credit.niso.org/contributor-roles/methodology/">Methodology</role>
          <role content-type="http://credit.niso.org/contributor-roles/validation/">Validation</role>
        </contrib>
        <contrib contrib-type="author" corresp="no">
          <name name-style="western">
            <surname>Kharel</surname>
            <given-names>Lalit</given-names>
          </name>
          <uri content-type="orcid">https://orcid.org/0009-0002-0699-546X</uri>
          <xref ref-type="aff" rid="A2">2</xref>
          <role content-type="http://credit.niso.org/contributor-roles/writing-review-editing/">Writing - review and editing</role>
          <role content-type="http://credit.niso.org/contributor-roles/data-curation/">Data curation</role>
          <role content-type="http://credit.niso.org/contributor-roles/formal-analysis/">Formal analysis</role>
          <role content-type="http://credit.niso.org/contributor-roles/methodology/">Methodology</role>
          <role content-type="http://credit.niso.org/contributor-roles/software/">Software</role>
          <role content-type="http://credit.niso.org/contributor-roles/validation/">Validation</role>
          <role content-type="http://credit.niso.org/contributor-roles/visualization/">Visualization</role>
        </contrib>
      </contrib-group>
      <aff id="A1">
        <label>1</label>
        <addr-line content-type="verbatim">University of California Agriculture and Natural Resources, Davis, CA, USA</addr-line>
        <institution>University of California Agriculture and Natural Resources</institution>
        <addr-line content-type="city">Davis</addr-line>
        <country>United States of America</country>
      </aff>
      <aff id="A2">
        <label>2</label>
        <addr-line content-type="verbatim">School of Computing, University of Nebraska, Lincoln, NE, USA</addr-line>
        <institution>School of Computing, University of Nebraska</institution>
        <addr-line content-type="city">Lincoln</addr-line>
        <country>United States of America</country>
        <uri content-type="ror">https://ror.org/0238rvs44</uri>
      </aff>
      <author-notes>
        <fn fn-type="corresp">
          <p>Corresponding author: Santosh Bhandari (<email xlink:type="simple">santoshbhandari4556@gmail.com)</email></p>
        </fn>
        <fn fn-type="edited-by">
          <p>Academic editor: Christopher John Topping</p>
        </fn>
      </author-notes>
      <pub-date pub-type="collection">
        <year>2026</year>
      </pub-date>
      <pub-date pub-type="epub">
        <day>03</day>
        <month>11</month>
        <year>2026</year>
      </pub-date>
      <volume>8</volume>
      <elocation-id>e208963</elocation-id>
      <uri content-type="arpha" xlink:href="http://openbiodiv.net/A6E4D157-E8D8-5105-9E86-3E3974B4F7F4">A6E4D157-E8D8-5105-9E86-3E3974B4F7F4</uri>
      <history>
        <date date-type="received">
          <day>25</day>
          <month>07</month>
          <year>2026</year>
        </date>
        <date date-type="accepted">
          <day>27</day>
          <month>10</month>
          <year>2026</year>
        </date>
      </history>
      <permissions>
        <copyright-statement>Santosh Bhandari, Mahesh Ghimire, Lalit Kharel</copyright-statement>
        <license license-type="creative-commons-attribution" xlink:href="http://creativecommons.org/licenses/by/4.0/" xlink:type="simple">
          <license-p>This is an open access article distributed under the terms of the Creative Commons Attribution License (CC BY 4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.</license-p>
        </license>
      </permissions>
      <abstract>
        <label>Abstract</label>
        <p>Understanding pest phenology is fundamental to integrated pest management (<abbrev xlink:title="integrated pest management">IPM</abbrev>), as constant pest monitoring provides timely information needed for informed management decisions throughout the growing season. Conventional tools and techniques for pest phenology modeling rely on routine trap monitoring to identify the reference event (biofix) and on growing degree days (<abbrev xlink:title="growing degree days">GDD</abbrev>) to track subsequent developmental progress since the biofix. Manual compilation, cleaning, and processing of weather data from multiple sources can be time-consuming, error-prone tasks that can further delay the development and application of phenology models. Several resources on <abbrev xlink:title="Comprehensive R Archive Network">CRAN</abbrev> (Comprehensive R Archive Network) provide only partial support for pest monitoring workflows, with limited integration of raw trap data processing, automated weather retrieval, <abbrev xlink:title="growing degree days">GDD</abbrev> calculation, and pest phenology visualization within a single package. In this paper, we present TrackTrap, an open-source R package that automates this workflow by using two meteorological Application Programming Interfaces (<abbrev xlink:title="Application Programming Interfaces">APIs</abbrev>), namely Daymet and Open-Meteo, to retrieve location-specific weather information for a user-specified date. As an alternative, users may instead provide weather data manually as a CSV file downloaded from the California Irrigation Management Information System (<abbrev xlink:title="California Irrigation Management Information System">CIMIS</abbrev>). Following the user’s inputs, TrackTrap then processes JSON responses from Open-Meteo, weather data retrieved via the daymetr package for Daymet, or CSV data manually downloaded from the <abbrev xlink:title="California Irrigation Management Information System">CIMIS</abbrev> website. Using pest-specific developmental thresholds stored in the package’s built-in database or user-supplied values, TrackTrap computes cumulative <abbrev xlink:title="growing degree days">GDD</abbrev> using the simple-average method with a horizontal upper-temperature cutoff when specified or without an upper cutoff when explicitly selected. TrackTrap provides researchers and pest control advisors (<abbrev xlink:title="pest control advisors">PCAs</abbrev>) with an automated, reproducible script to compute degree-days beginning the day after biofix and visualize trap catches against accumulated degree days. The software and resources for accessing TrackTrap are freely available in the Zenodo and GitHub repositories.</p>
      </abstract>
      <kwd-group>
        <label>Key words:</label>
        <kwd>GDD</kwd>
        <kwd>IPM</kwd>
        <kwd>pest modelling</kwd>
        <kwd>R package</kwd>
        <kwd>TrackTrap</kwd>
        <kwd>weather API</kwd>
      </kwd-group>
    </article-meta>
    <notes>
      <sec sec-type="Citation" id="sec1">
        <title>Citation</title>
        <p>Bhandari S, Ghimire M, Kharel L (2026) TrackTrap: An R-based computational tool for modeling pest phenology with automated weather integration. Agricultural and Environmental Modelling 8: е208963. <ext-link xlink:href="10.3897/aem.8.208963" ext-link-type="doi">https://doi.org/10.3897/aem.8.208963</ext-link></p>
      </sec>
    </notes>
  </front>
  <body>
    <sec sec-type="Introduction" id="sec2">
      <title>Introduction</title>
      <p>Growing degree day (<abbrev xlink:title="growing degree days">GDD</abbrev>) models are crucial for integrated pest management (<abbrev xlink:title="integrated pest management">IPM</abbrev>) programs to translate temperature accumulation into standard estimates of insect development, generation intervals, and appropriate treatment timings. Despite being an important matter in applied entomology, the practical workflow for implementing <abbrev xlink:title="growing degree days">GDD</abbrev> models is inconsistent. Acquiring up-to-date and historical weather parameters has recently become a major computational limitation for agricultural researchers and professionals who are constantly seeking to obtain data for calculating <abbrev xlink:title="growing degree days">GDD</abbrev>. Manual weather data extraction involves accessing web-based meteorological databases, downloading the appropriate datasets in available formats, filtering out missing or incorrect sensor values, and performing threshold-specific mathematical calculations in spreadsheets. This manual data-processing pipeline is laborious, prone to human error, performs poorly in multi-year or multi-location studies, and lacks the programmatic reproducibility necessary for modern data-driven agriculture (<xref ref-type="bibr" rid="B12">Wolfert et al. 2017</xref>). TrackTrap solves this issue by integrating weather retrieval, <abbrev xlink:title="growing degree days">GDD</abbrev> calculation, and phenology visualization into a single R package.</p>
      <p>The economic benefits of precise pest phenology modeling are substantial. For instance, in California alone, the specialty crop industry generates approximately $50 billion in annual economic value and accounts for a significant share of the state’s agricultural output. Growers of high-value crops such as citrus, grapes, nuts, and vegetables face recurring pest management challenges, with expenditures for monitoring, biological control, and pesticide applications often representing 5–15% of annual production costs, depending on crop and pest pressure. Because pest populations are strongly influenced by temperature, precipitation, and other environmental factors, <abbrev xlink:title="integrated pest management">IPM</abbrev> programs must continually evolve by incorporating improved monitoring tools, phenology models, and sustainable management strategies to maintain effective and economically viable pest suppression.</p>
      <p>A successful <abbrev xlink:title="integrated pest management">IPM</abbrev> strategy relies heavily on pest- and crop-informed decisions to optimize monitoring efforts, biocontrol release, and pesticide application timing. Insects are poikilothermic ectotherms, meaning their body temperature varies with environmental conditions and is largely determined by external heat sources (<xref ref-type="bibr" rid="B4">Herms 2004</xref>; <xref ref-type="bibr" rid="B7">Scribner et al. 2025</xref>). Accurate <abbrev xlink:title="growing degree days">GDD</abbrev> modeling helps researchers track critical life stages of economic pests by calculating the accumulation of thermal heat units above a pest-specific developmental threshold, thereby enabling timely monitoring and targeted management intervention, thus reducing unnecessary pesticide applications while improving pest control efficiency and crop productivity (<xref ref-type="bibr" rid="B2">Briere et al. 1999</xref>).</p>
      <p>Although <abbrev xlink:title="growing degree days">GDD</abbrev> is simple to calculate, daily monitoring can be a tedious task (<xref ref-type="bibr" rid="B4">Herms 2004</xref>). The accuracy and usability of a <abbrev xlink:title="growing degree days">GDD</abbrev> model, while important, are intrinsically linked to the spatial and temporal resolution of the underlying weather data (<xref ref-type="bibr" rid="B8">Sridhar and Reddy 2013</xref>). To address weather data acquisition issues, several meteorological stations, such as Daymet, Open-Meteo, and the California Irrigation Management Information System (<abbrev xlink:title="California Irrigation Management Information System">CIMIS</abbrev>), have made their databases openly available through Application Programming Interfaces (<abbrev xlink:title="Application Programming Interfaces">APIs</abbrev>), each with different spatial and temporal resolutions. These <abbrev xlink:title="Application Programming Interfaces">APIs</abbrev> provide routine access to high-resolution weather data but are limited in usability. Furthermore, data availability varies across platforms, which challenges long-term phenological studies. For instance, Daymet offers very accurate historical baseline data at 1-km resolution, but its datasets are usually available with a 1-year latency, meaning they do not provide the real-time, current-year observations needed for active in-season decision-making. This variation in availability highlights the need for a workflow that allows users to switch between weather sources as required.</p>
      <p>To bridge this gap and enable effective decision-making in agriculture, this research proposes TrackTrap, a new open-source R package (<xref ref-type="bibr" rid="B6">R Core Team 2026</xref>) that integrates both weather data acquisition and pest phenology visualization. TrackTrap serves as a computational engine that enables researchers to retrieve weather data and compute <abbrev xlink:title="growing degree days">GDD</abbrev> without prior software development experience. Users can select a weather source, with Open-Meteo being used by default. Daymet and the historical archive at Open-Meteo provide temperatures for each day, subject to the availability of data from these sources. In case of failure to retrieve data or if the provided series do not contain the user-intended date for the monitoring period, calculation is aborted with an error.</p>
      <p>With user-configurable source selection and automated <abbrev xlink:title="growing degree days">GDD</abbrev> calculations, TrackTrap makes an otherwise time-consuming, multi-step process efficient and repeatable. This document provides insight into the TrackTrap architecture, how data flows through it, and how it supports informed pest management.</p>
    </sec>
    <sec sec-type="Project description" id="sec3">
      <title>Project description</title>
      <sec sec-type="Software architecture and data flow" id="sec4">
        <title>Software architecture and data flow</title>
        <p>TrackTrap uses the tidyverse-style package ‘dplyr’ to optimize data processing through efficient data manipulation techniques. In this architecture, complete data pipelines are handled from data ingestion to final visualization.</p>
      </sec>
      <sec sec-type="Data ingestion" id="sec5">
        <title>Data ingestion</title>
        <p>TrackTrap relies on the httr package in R to interact directly with the Open-Meteo API, handle secure communication via programmatic Hypertext Transfer Protocol Secure (<abbrev xlink:title="Hypertext Transfer Protocol Secure">HTTPS</abbrev>) requests, and convert the returned JSON into R data structures. In contrast, the daymetr package utilizes its own web resources to retrieve Daymet data secured via <abbrev xlink:title="Hypertext Transfer Protocol Secure">HTTPS</abbrev> communication. <abbrev xlink:title="California Irrigation Management Information System">CIMIS</abbrev> data is imported manually via CSV import, not a programmatic API call. Users may also provide daily weather data directly. Together, these three pathways provide TrackTrap with high-resolution weather data from localized station records to broader grid-based or global geographic coverage.</p>
        <p><bold><abbrev xlink:title="California Irrigation Management Information System">CIMIS</abbrev></bold>: <abbrev xlink:title="California Irrigation Management Information System">CIMIS</abbrev> provides agricultural information by accessing weather station data from an extensive network managed by the California Department of Water Resources (<xref ref-type="bibr" rid="B3">CDWR 2026</xref>). Due to repeated connection errors during development, <abbrev xlink:title="California Irrigation Management Information System">CIMIS</abbrev> was not integrated via its automated web API; instead, a manual CSV import option was utilized as an alternative for users.</p>
        <p><bold>Daymet</bold>: The Daymet database is an open-source dataset of daily weather data developed by Oak Ridge National Laboratory, with 1 km resolution across North America and extensive historical records dating back to 1980 (<xref ref-type="bibr" rid="B9">Thornton et al. 2014</xref>).</p>
        <p><bold>Open-Meteo</bold>: Open-Meteo helps maintain TrackTrap’s usability for global agricultural users by using open-source global weather <abbrev xlink:title="Application Programming Interfaces">APIs</abbrev> in real-time. It provides high-resolution models at 1–2 km resolution for Central Europe, France, Switzerland, the UK, and North America, while providing 9–11 km resolution for other global models (<xref ref-type="bibr" rid="B14">Zippenfenig 2023</xref>).</p>
        <p>Users are required to provide pest code and trap observation data containing date and trap_counts columns, with one observation per monitoring date. For a custom analysis, users assign pest = NULL and provide a lower temperature threshold. Latitude and longitude are also needed if weather is retrieved using Open-Meteo or Daymet but are not needed for <abbrev xlink:title="California Irrigation Management Information System">CIMIS</abbrev> CSV input since the file provides temperature data directly, and location coordinates are not extracted from it. Coordinates provided by the user are retained as metadata for plot labelling.</p>
        <p>TrackTrap defines biofix as the date of the first positive trap count in the provided monitoring series. This convention is applied consistently across all the listed pests; however, it does not imply that the first capture represents the starting point of every published developmental model. Since there may be instances earlier in the season when very few pests are detected in the trap followed by a sustained period of no pest detection, users are suggested to manually remove such instances and only consider the monitoring period shortly before or starting from the first sustained catch as the biofix. Based on user inputs, TrackTrap then generates an API query string and converts the API response into a standard data frame. Missing daily observations, invalid temperatures, and minimum temperatures exceeding maxima abort the calculation with an error.</p>
      </sec>
      <sec sec-type="The computational engine" id="sec6">
        <title>The computational engine</title>
        <p>Once the temperature data is compiled, TrackTrap calculates <abbrev xlink:title="growing degree days">GDD</abbrev> using the standard simple average method with a horizontal upper-threshold cutoff (<xref ref-type="bibr" rid="B1">Arnold 1960</xref>; <xref ref-type="bibr" rid="B5">Mcmaster and Wilhelm 1997</xref>) when prompted by the user and is implemented directly using base-R operations. However, users have the option to omit an upper-threshold cutoff for <abbrev xlink:title="growing degree days">GDD</abbrev> calculation. The horizontal cutoff method caps the average temperature at the upper threshold before subtracting the lower threshold temperature, since it assumes that the development continues at a constant rate at temperatures higher than the upper threshold (<italic>T<sub>upper</sub></italic>) (<xref ref-type="bibr" rid="B10">UC IPM 2016</xref>). To enable rapid processing of multi-decade temporal arrays, these models use base R vectorized operations, avoiding row-wise iteration.</p>
        <p>Mathematically, daily <italic><abbrev xlink:title="growing degree days">GDD</abbrev><sub>i</sub></italic> are calculated using the horizontal cutoff (single-average) method as follows. Before calculation, the daily mean of minimum (<italic>T<sub>min,i</sub></italic> and maximum (<italic>T<sub>max,i</sub></italic>) temperatures are calculated, and then the horizontal cutoff is applied to the average.</p>
        <p>
          <mml:math id="M1" display="block">
            <mml:msub>
              <mml:mi>T</mml:mi>
              <mml:mi>i</mml:mi>
            </mml:msub>
            <mml:mo>=</mml:mo>
            <mml:mfrac>
              <mml:mrow>
                <mml:msub>
                  <mml:mi>T</mml:mi>
                  <mml:mrow>
                    <mml:mo movablelimits="true">max</mml:mo>
                    <mml:mo>,</mml:mo>
                    <mml:mi>i</mml:mi>
                  </mml:mrow>
                </mml:msub>
                <mml:mo>+</mml:mo>
                <mml:msub>
                  <mml:mi>T</mml:mi>
                  <mml:mrow>
                    <mml:mo movablelimits="true">min</mml:mo>
                    <mml:mo>,</mml:mo>
                    <mml:mi>i</mml:mi>
                  </mml:mrow>
                </mml:msub>
              </mml:mrow>
              <mml:mn>2</mml:mn>
            </mml:mfrac>
          </mml:math>
        </p>
        <p>
          <mml:math id="M2" display="block">
            <mml:msubsup>
              <mml:mi>T</mml:mi>
              <mml:mi>i</mml:mi>
              <mml:mrow>
                <mml:mi>′</mml:mi>
              </mml:mrow>
            </mml:msubsup>
            <mml:mo>=</mml:mo>
            <mml:mo movablelimits="true">min</mml:mo>
            <mml:mrow>
              <mml:mo>(</mml:mo>
              <mml:msub>
                <mml:mi>T</mml:mi>
                <mml:mi>i</mml:mi>
              </mml:msub>
              <mml:mo>,</mml:mo>
              <mml:msub>
                <mml:mi>T</mml:mi>
                <mml:mrow>
                  <mml:mtext>upper </mml:mtext>
                </mml:mrow>
              </mml:msub>
              <mml:mo>)</mml:mo>
            </mml:mrow>
          </mml:math>
        </p>
        <p>where <italic>T<sub>i</sub></italic> and <italic>T'<sub>i</sub></italic> are the daily average on day i and cutoff-adjusted daily mean temperature on day i, respectively. The lower threshold (<italic>T<sub>lower</sub></italic>) is then subtracted from the cutoff-adjusted mean temperature to yield the daily degree-day accumulation:</p>
        <p>
          <mml:math id="M3" display="block">
            <mml:mi>G</mml:mi>
            <mml:mi>D</mml:mi>
            <mml:msub>
              <mml:mi>D</mml:mi>
              <mml:mi>i</mml:mi>
            </mml:msub>
            <mml:mo>=</mml:mo>
            <mml:mo movablelimits="true">max</mml:mo>
            <mml:mrow>
              <mml:mo>(</mml:mo>
              <mml:msubsup>
                <mml:mi>T</mml:mi>
                <mml:mi>i</mml:mi>
                <mml:mrow>
                  <mml:mi>′</mml:mi>
                </mml:mrow>
              </mml:msubsup>
              <mml:mo>–</mml:mo>
              <mml:msub>
                <mml:mi>T</mml:mi>
                <mml:mrow>
                  <mml:mtext>lower </mml:mtext>
                </mml:mrow>
              </mml:msub>
              <mml:mo>,</mml:mo>
              <mml:mn>0</mml:mn>
              <mml:mo>)</mml:mo>
            </mml:mrow>
          </mml:math>
        </p>
        <p>This implementation is limited by the daily mean temperature before the lower threshold is subtracted. Hence, the calculated daily thermal increment does not increase once the mean temperature exceeds the upper threshold. <italic><abbrev xlink:title="growing degree days">GDD</abbrev><sub>i</sub></italic> is set to zero whenever the result is negative. Cumulative growing degree-days (<italic>CDD<sub>n</sub></italic>) from a biofix date (t0) through day n &gt; t0 are then obtained by summation:</p>
        <p>
          <mml:math id="M4" display="block">
            <mml:mi>C</mml:mi>
            <mml:mi>D</mml:mi>
            <mml:msub>
              <mml:mi>D</mml:mi>
              <mml:mi>n</mml:mi>
            </mml:msub>
            <mml:mo>=</mml:mo>
            <mml:munderover>
              <mml:mo>∑</mml:mo>
              <mml:mrow>
                <mml:mi>i</mml:mi>
                <mml:mo>=</mml:mo>
                <mml:mi>t</mml:mi>
                <mml:mn>0</mml:mn>
                <mml:mo>+</mml:mo>
                <mml:mn>1</mml:mn>
              </mml:mrow>
              <mml:mi>n</mml:mi>
            </mml:munderover>
            <mml:mi>G</mml:mi>
            <mml:mi>D</mml:mi>
            <mml:msub>
              <mml:mi>D</mml:mi>
              <mml:mi>i</mml:mi>
            </mml:msub>
            <mml:mo>,</mml:mo>
            <mml:mstyle scriptlevel="0">
              <mml:mspace width="1em"/>
            </mml:mstyle>
            <mml:mi>C</mml:mi>
            <mml:mi>D</mml:mi>
            <mml:msub>
              <mml:mi>D</mml:mi>
              <mml:mrow>
                <mml:mi>t</mml:mi>
                <mml:mn>0</mml:mn>
              </mml:mrow>
            </mml:msub>
            <mml:mo>=</mml:mo>
            <mml:mn>0</mml:mn>
          </mml:math>
        </p>
        <p>Temperatures are expressed in degrees Fahrenheit, and thermal heat accumulation is expressed in Fahrenheit degree-days.</p>
        <p>Furthermore, a lazy-loaded reference database (pest_thresholds.rda) exists in the package that contains 90 pest records, including pest names, scientific names, available temperature thresholds, thermal reference values, and parameter sources. These values were compiled from online sources, including published literature and established degree-day resources from different U.S. universities such as UC <abbrev xlink:title="integrated pest management">IPM</abbrev>. Missing parameters for each variable are stored as ‘NA’. However, inclusion of a pest record does not indicate that a complete or validated phenology model is available for that pest. Users may provide custom values that are supported by documented sources and that are relevant to the developmental endpoint and computation methodology specified.</p>
        <p>The thermal reference values correspond to different endpoints such as egg hatch, immature development, adult emergence, and intervals between successive flights or generations. Degree day calculation requires at least a finite value of the lower development threshold for calculation. If no upper threshold is available, the user must either provide custom values or configure upper_cutoff= “none”.</p>
        <p>Custom thresholds can be used to override available database values for listed pests. If the pest is custom or not listed in the database, users are required to set pest as ‘NULL’, provide custom_lower and indicate the upper-cutoff selection. These threshold values are dynamically combined with the temperature data retrieved from the selected weather source (Daymet, Open-Meteo, or a manually supplied <abbrev xlink:title="California Irrigation Management Information System">CIMIS</abbrev> CSV file) to compute the cumulative heat units accumulated by the target pest. An optional display label and custom_thermal_requirement may also be provided. Repeat markers need to be set to TRUE for repetition and are not generated automatically from the database.</p>
        <p>
          <bold>Description of the three functions executed by TrackTrap (Table <xref ref-type="table" rid="T1">1</xref>)</bold>
        </p>
        <table-wrap id="T1" position="float" orientation="portrait">
          <label>Table 1.</label>
          <caption>
            <p>Description of the three functions executed by TrackTrap.</p>
          </caption>
          <table>
            <tbody>
              <tr>
                <th rowspan="1" colspan="1">
                  <bold>Function</bold>
                </th>
                <th rowspan="1" colspan="1">
                  <bold>Input</bold>
                </th>
                <th rowspan="1" colspan="1">
                  <bold>Output</bold>
                </th>
                <th rowspan="1" colspan="1">
                  <bold>Role</bold>
                </th>
              </tr>
              <tr>
                <td rowspan="3" colspan="1">Weather Retrieval</td>
                <td rowspan="1" colspan="1">Open-Meteo: lat, lon, start_date, end_date, timezone, and model</td>
                <td rowspan="3" colspan="1">Data frame: date, tmin (°F), tmax (°F)</td>
                <td rowspan="3" colspan="1">Access a daily min/max temperature from Open-Meteo (default; historical + live data), Daymet (gridded data, capped at most recent calendar year, conversion of °C→°F), or a user-provided <abbrev xlink:title="California Irrigation Management Information System">CIMIS</abbrev> CSV</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">Daymet: lat, lon (year range derived from trap data; current year unsupported).</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1"><abbrev xlink:title="California Irrigation Management Information System">CIMIS</abbrev> CSV: cimis_csv_path (lat/lon not used for retrieval, but stored as attributes for plotting)</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">calc_pest_phenology()</td>
                <td rowspan="1" colspan="1">trap_data containing date and trap_counts; optional pest; weather_source inputs; custom_lower, custom_upper, upper_cutoff, custom_thermal_requirement, and custom_pest_label. Optional database provides reference data.</td>
                <td rowspan="1" colspan="1">Data frame: trap_data merged with tmax, tmin, avg_temp, daily DD, cumulative_dd, and cumulative_dd_from_biofix. Complete daily calculations and metadata are retained as attributes.</td>
                <td rowspan="1" colspan="1">Calculates degree-days using the simple-average method, with an optional cap on the daily mean and a zero floor. A missing upper threshold requires a user-specified value or explicit upper_cutoff =”none”. Biofix is the first positive trap count; thermal accumulation begins the following day.</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">plot_trap_phenology()</td>
                <td rowspan="1" colspan="1">pheno_data; optional pest, year, lat/lon, custom_thermal_requirement, repeat_markers, and custom_pest_label</td>
                <td rowspan="1" colspan="1">ggplot object</td>
                <td rowspan="1" colspan="1">Visualizes trap catch against accumulated degree-days since biofix. The plot includes a biofix line, and optionally (if a thermal reference value was provided or retained in calculation metadata) a thermal requirement marker. Multiple thermal requirement markers are drawn with repeat_markers = TRUE.</td>
              </tr>
            </tbody>
          </table>
        </table-wrap>
        <p>
          <bold>TrackTrap architecture (Fig. <xref ref-type="fig" rid="F1">1</xref>)</bold>
        </p>
        <fig id="F1">
          <object-id content-type="doi">10.3897/aem.8.208963.figure1</object-id>
          <object-id content-type="arpha">73955BF6-E587-57ED-AC7C-E14BFAF2B5C5</object-id>
          <label>Figure 1.</label>
          <caption>
            <p>Thematic workflow of the TrackTrap package in R.</p>
          </caption>
          <graphic xlink:href="aem-08-e208963-g001.jpg" id="oo_1827158.jpg">
            <uri content-type="original_file">https://binary.pensoft.net/fig/1827158</uri>
          </graphic>
        </fig>
      </sec>
      <sec sec-type="Use case for application: Pest phenology visualization for Fall Armyworm (FAW)" id="sec7">
        <title>Use case for application: Pest phenology visualization for Fall Armyworm (FAW)</title>
        <p>TrackTrap was employed to develop an example of phenology visualization for Fall Armyworm (<italic><tp:taxon-name><tp:taxon-name-part taxon-name-part-type="genus" reg="Spodoptera">Spodoptera</tp:taxon-name-part> <tp:taxon-name-part taxon-name-part-type="species" reg="frugiperda">frugiperda</tp:taxon-name-part></tp:taxon-name></italic>, FAW), a polyphagous pest affecting more than 80 crops worldwide. Data on FAW were retrieved from a publicly available insect monitoring repository from the Department of Entomology, University of Kentucky (UK, <ext-link xlink:href="https://ipm.mgcafe.uky.edu/faw" ext-link-type="uri">https://ipm.mgcafe.uky.edu/faw</ext-link>) and used as an example case study to illustrate visualization and analysis workflows implemented in the TrackTrap package (Table <xref ref-type="table" rid="T2">2</xref>).</p>
        <table-wrap id="T2" position="float" orientation="portrait">
          <label>Table 2.</label>
          <caption>
            <p>Insect count data on FAW were randomly selected for the years 2017, 2019, 2020, and 2024 in the monitoring period (April-September) from the University of Kentucky Research Center, Princeton, KY (<xref ref-type="bibr" rid="B11">University of Kentucky Integrated Pest Management Program 2026</xref>).</p>
          </caption>
          <table>
            <tbody>
              <tr>
                <th rowspan="1" colspan="1">
                  <bold>Year</bold>
                </th>
                <th rowspan="1" colspan="1">
                  <bold>Station</bold>
                </th>
                <th rowspan="1" colspan="1">
                  <bold>Coordinates</bold>
                </th>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">2017</td>
                <td rowspan="1" colspan="1">Princeton, KY</td>
                <td rowspan="1" colspan="1">37.1009, -87.853</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">2019</td>
                <td rowspan="1" colspan="1">Princeton, KY</td>
                <td rowspan="1" colspan="1">37.1009, -87.853</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">2020</td>
                <td rowspan="1" colspan="1">Princeton, KY</td>
                <td rowspan="1" colspan="1">37.1009, -87.853</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">2024</td>
                <td rowspan="1" colspan="1">Princeton, KY</td>
                <td rowspan="1" colspan="1">37.1009, -87.853</td>
              </tr>
            </tbody>
          </table>
        </table-wrap>
        <p>The TrackTrap package was loaded in the R environment using library (TrackTrap), and trap observations were imported from CSV files. “Daymet” was specified as the weather source for <abbrev xlink:title="growing degree days">GDD</abbrev> calculation because it provides higher-resolution, precise weather coverage for the user-specified latitude and longitude when real-time information is not available. On the backend, the calc_pest_phenology function (from the package) queries weather data from the initial date of monitoring for each year available in the dataset. For fall armyworm, the lower developmental threshold was set to 54.6 °F (12.57 °C). Because the selected parameter set did not provide a verified compatible upper threshold, calculations used upper_cutoff = “none”. The plot_trap_phenology function then visualized trap catches against cumulative degree-days since biofix. A thermal reference value of 704.8 °F DD was supplied through custom_thermal_requirement that represented the mean egg-to_adult requirement. Multiple lines were displayed using repeat_markers = TRUE.</p>
        <p>
          <bold>Code script (Fig. <xref ref-type="fig" rid="F2">2</xref>)</bold>
        </p>
        <fig id="F2">
          <object-id content-type="doi">10.3897/aem.8.208963.figure2</object-id>
          <object-id content-type="arpha">29DD17F8-E931-57E9-8733-D66755E9FD8E</object-id>
          <label>Figure 2.</label>
          <caption>
            <p>Code script.</p>
          </caption>
          <graphic xlink:href="aem-08-e208963-g002.jpg" id="oo_1827159.jpg">
            <uri content-type="original_file">https://binary.pensoft.net/fig/1827159</uri>
          </graphic>
        </fig>
        <p>
          <bold>FAW Phenology Visualization (Fig. <xref ref-type="fig" rid="F3">3</xref>)</bold>
        </p>
        <fig id="F3">
          <object-id content-type="doi">10.3897/aem.8.208963.figure3</object-id>
          <object-id content-type="arpha">FBB0144A-AB0E-505B-AEF9-B2245DA8EE04</object-id>
          <label>Figure 3.</label>
          <caption>
            <p>Pest phenology visualization of the fall armyworm (FAW) in different years of pest monitoring (top-left — 2017, top-right — 2019, bottom-left — 2020, and bottom-right — 2024) at the University of Kentucky Research Center, Princeton, KY, USA.</p>
          </caption>
          <graphic xlink:href="aem-08-e208963-g003.jpg" id="oo_1827160.jpg">
            <uri content-type="original_file">https://binary.pensoft.net/fig/1827160</uri>
          </graphic>
        </fig>
      </sec>
      <sec sec-type="Interpretation of FAW phenology visualization" id="sec8">
        <title>Interpretation of FAW phenology visualization</title>
        <p>FAW trap-catch patterns varied across monitoring years 2017, 2019, 2020, and 2024 (Fig. <xref ref-type="fig" rid="F3">3</xref>). In 2017, catches remained low throughout the monitoring period, with no signs of a significant late-season increase. This pattern is consistent with two shared hypotheses: (1) below-average summer heat accumulation might have slowed degree-day progression relative to other years, and (2) the low peak trap catch early in the season suggests a low initial captured population that, together with reduced heat accumulation, could have limited subsequent population buildup across developmental stages.</p>
        <p>In 2020, the largest reported trap-catch peak was above 400 individuals at approximately 1700 °F-days from first capture. Based on the thermal reference of 704.898 °F-days, the peak was between the second and third multiples of the reference value, about 1409.8 and 2114.7 °F-days, respectively. The thermal reference is the egg-to-adult development. In this case, the accumulation source is the first adult capture. Its repeated multiples thus provide reference positions along the thermal-time axis rather than independently determined generation limits. It shows the importance of continuous monitoring even after initial low catches; however, trap counts alone do not indicate crop infestation or damage.</p>
        <p>To make a valid comparison among different weather sources, the calculation parameters must be consistent because differences in developmental thresholds, accumulation dates, and degree-day methods can be misinterpreted as differences in the weather inputs. For the revised comparison, the daily minimum and maximum temperatures from the University of Kentucky station, Open-Meteo, and Daymet should be computed using the identical simple-average calculation (Fig. <xref ref-type="fig" rid="F4">4</xref>):</p>
        <p>
          <mml:math id="M5" display="block">
            <mml:mi>D</mml:mi>
            <mml:msub>
              <mml:mi>D</mml:mi>
              <mml:mi>i</mml:mi>
            </mml:msub>
            <mml:mo>=</mml:mo>
            <mml:mo movablelimits="true">max</mml:mo>
            <mml:mrow>
              <mml:mo>[</mml:mo>
              <mml:mn>0</mml:mn>
              <mml:mo>,</mml:mo>
              <mml:mfrac>
                <mml:mrow>
                  <mml:msub>
                    <mml:mi>T</mml:mi>
                    <mml:mrow>
                      <mml:mo movablelimits="true">max</mml:mo>
                      <mml:mo>,</mml:mo>
                      <mml:mi>i</mml:mi>
                    </mml:mrow>
                  </mml:msub>
                  <mml:mo>+</mml:mo>
                  <mml:msub>
                    <mml:mi>T</mml:mi>
                    <mml:mrow>
                      <mml:mo movablelimits="true">min</mml:mo>
                      <mml:mo>,</mml:mo>
                      <mml:mi>i</mml:mi>
                    </mml:mrow>
                  </mml:msub>
                </mml:mrow>
                <mml:mn>2</mml:mn>
              </mml:mfrac>
              <mml:mo>–</mml:mo>
              <mml:mn>54.6</mml:mn>
              <mml:mo>]</mml:mo>
            </mml:mrow>
          </mml:math>
        </p>
        <p>The upper temperature cutoff is not used in this configuration. Biofix is defined as first capture on 26 April 2024, at which point cumulative degree-days are set to zero, and accumulation begins on 27 April. Station-specific accumulated values should be calculated from daily station temperatures, not adjusted from an existing cumulative degree-day interval. Cumulative accumulation from the station on 27 September 2024 was 2995.6 °F-days. Open-Meteo and Daymet exceeded this amount, with 228.1 °F-days (7.61%) and 213.9 °F-days (7.14%), respectively (Table <xref ref-type="table" rid="T3">3</xref>). Percentage differences were calculated as 100 (DD gridded – DD station)/DD station. If the station accumulation was zero, percentage differences were undefined. These results illustrate agreement under the selected calculation settings at one location for a single monitoring season.</p>
        <fig id="F4">
          <object-id content-type="doi">10.3897/aem.8.208963.figure4</object-id>
          <object-id content-type="arpha">37EF0571-8D91-54F3-B271-D54A67673146</object-id>
          <label>Figure 4.</label>
          <caption>
            <p>Pest phenology visualization of the fall armyworm (FAW) in 2024 (Left) Daymet (Middle) Open-meteo, and (Right) University of Kentucky Princeton (adjusted as per TrackTrap computation).</p>
          </caption>
          <graphic xlink:href="aem-08-e208963-g004.jpg" id="oo_1827161.jpg">
            <uri content-type="original_file">https://binary.pensoft.net/fig/1827161</uri>
          </graphic>
        </fig>
        <table-wrap id="T3" position="float" orientation="portrait">
          <label>Table 3.</label>
          <caption>
            <p>Comparison of Fall Armyworm (<tp:taxon-name><tp:taxon-name-part taxon-name-part-type="genus" reg="Spodoptera">Spodoptera</tp:taxon-name-part> <tp:taxon-name-part taxon-name-part-type="species" reg="frugiperda">frugiperda</tp:taxon-name-part></tp:taxon-name>) degree-day accumulation across on-site station observations (University of Kentucky) and gridded meteorological sources (Open-Meteo and Daymet) at Princeton, KY (2024).</p>
          </caption>
          <table>
            <tbody>
              <tr>
                <th rowspan="1" colspan="1">
                  <bold>Date</bold>
                </th>
                <th rowspan="1" colspan="1">
                  <bold>Trap Catch</bold>
                </th>
                <th rowspan="1" colspan="1">
                  <bold>Kentucky Station Min/Max (°F)</bold>
                </th>
                <th rowspan="1" colspan="1">
                  <bold>Kentucky Station SUMDD</bold>
                </th>
                <th rowspan="1" colspan="1">
                  <bold>Open-Meteo DD</bold>
                </th>
                <th rowspan="1" colspan="1">
                  <bold>Daymet DD</bold>
                </th>
                <th rowspan="1" colspan="1">
                  <bold>Δ (Open-Meteo – Kentucky)</bold>
                </th>
                <th rowspan="1" colspan="1">
                  <bold>Δ (Daymet – Kentucky)</bold>
                </th>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-04-05</bold>
                </td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">30.0 / 49.0</td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">–</td>
                <td rowspan="1" colspan="1">–</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-04-12</bold>
                </td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">43.0 / 66.0</td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">–</td>
                <td rowspan="1" colspan="1">–</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-04-19</bold>
                </td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">52.0 / 69.0</td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">–</td>
                <td rowspan="1" colspan="1">–</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-04-26 (Biofix)</bold>
                </td>
                <td rowspan="1" colspan="1">3</td>
                <td rowspan="1" colspan="1">52.0 / 81.0</td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">–</td>
                <td rowspan="1" colspan="1">–</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-05-03</bold>
                </td>
                <td rowspan="1" colspan="1">9</td>
                <td rowspan="1" colspan="1">64.0 / 75.0</td>
                <td rowspan="1" colspan="1">111.8</td>
                <td rowspan="1" colspan="1">117.8</td>
                <td rowspan="1" colspan="1">119.2</td>
                <td rowspan="1" colspan="1">6.0</td>
                <td rowspan="1" colspan="1">7.4</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-05-10</bold>
                </td>
                <td rowspan="1" colspan="1">4</td>
                <td rowspan="1" colspan="1">53.0 / 68.0</td>
                <td rowspan="1" colspan="1">218.6</td>
                <td rowspan="1" colspan="1">229.0</td>
                <td rowspan="1" colspan="1">235.0</td>
                <td rowspan="1" colspan="1">10.4</td>
                <td rowspan="1" colspan="1">16.4</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-05-17</bold>
                </td>
                <td rowspan="1" colspan="1">1</td>
                <td rowspan="1" colspan="1">63.0 / 75.0</td>
                <td rowspan="1" colspan="1">292.4</td>
                <td rowspan="1" colspan="1">314.3</td>
                <td rowspan="1" colspan="1">321.1</td>
                <td rowspan="1" colspan="1">21.9</td>
                <td rowspan="1" colspan="1">28.7</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-05-24</bold>
                </td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">66.0 / 76.0</td>
                <td rowspan="1" colspan="1">420.2</td>
                <td rowspan="1" colspan="1">445.5</td>
                <td rowspan="1" colspan="1">456.1</td>
                <td rowspan="1" colspan="1">25.3</td>
                <td rowspan="1" colspan="1">35.9</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-05-31</bold>
                </td>
                <td rowspan="1" colspan="1">22</td>
                <td rowspan="1" colspan="1">61.0 / 81.0</td>
                <td rowspan="1" colspan="1">528.0</td>
                <td rowspan="1" colspan="1">556.8</td>
                <td rowspan="1" colspan="1">567.3</td>
                <td rowspan="1" colspan="1">28.8</td>
                <td rowspan="1" colspan="1">39.3</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-06-07</bold>
                </td>
                <td rowspan="1" colspan="1">6</td>
                <td rowspan="1" colspan="1">56.0 / 85.0</td>
                <td rowspan="1" colspan="1">655.8</td>
                <td rowspan="1" colspan="1">688.4</td>
                <td rowspan="1" colspan="1">703.5</td>
                <td rowspan="1" colspan="1">32.6</td>
                <td rowspan="1" colspan="1">47.7</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-06-14</bold>
                </td>
                <td rowspan="1" colspan="1">23</td>
                <td rowspan="1" colspan="1">62.0 / 90.0</td>
                <td rowspan="1" colspan="1">752.6</td>
                <td rowspan="1" colspan="1">795.3</td>
                <td rowspan="1" colspan="1">815.5</td>
                <td rowspan="1" colspan="1">42.7</td>
                <td rowspan="1" colspan="1">62.9</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-06-21</bold>
                </td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">68.0 / 91.0</td>
                <td rowspan="1" colspan="1">921.4</td>
                <td rowspan="1" colspan="1">978.7</td>
                <td rowspan="1" colspan="1">994.9</td>
                <td rowspan="1" colspan="1">57.3</td>
                <td rowspan="1" colspan="1">73.5</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-06-28</bold>
                </td>
                <td rowspan="1" colspan="1">9</td>
                <td rowspan="1" colspan="1">68.0 / 90.0</td>
                <td rowspan="1" colspan="1">1088.2</td>
                <td rowspan="1" colspan="1">1160.4</td>
                <td rowspan="1" colspan="1">1172.9</td>
                <td rowspan="1" colspan="1">72.2</td>
                <td rowspan="1" colspan="1">84.7</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-07-05</bold>
                </td>
                <td rowspan="1" colspan="1">2</td>
                <td rowspan="1" colspan="1">69.0 / 86.0</td>
                <td rowspan="1" colspan="1">1253.0</td>
                <td rowspan="1" colspan="1">1335.9</td>
                <td rowspan="1" colspan="1">1347.5</td>
                <td rowspan="1" colspan="1">82.9</td>
                <td rowspan="1" colspan="1">94.5</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-07-12</bold>
                </td>
                <td rowspan="1" colspan="1">18</td>
                <td rowspan="1" colspan="1">68.0 / 88.0</td>
                <td rowspan="1" colspan="1">1407.8</td>
                <td rowspan="1" colspan="1">1500.9</td>
                <td rowspan="1" colspan="1">1513.3</td>
                <td rowspan="1" colspan="1">93.1</td>
                <td rowspan="1" colspan="1">105.5</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-07-19</bold>
                </td>
                <td rowspan="1" colspan="1">8</td>
                <td rowspan="1" colspan="1">60.0 / 81.3</td>
                <td rowspan="1" colspan="1">1564.2</td>
                <td rowspan="1" colspan="1">1671.5</td>
                <td rowspan="1" colspan="1">1680.7</td>
                <td rowspan="1" colspan="1">107.3</td>
                <td rowspan="1" colspan="1">116.5</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-07-26</bold>
                </td>
                <td rowspan="1" colspan="1">27</td>
                <td rowspan="1" colspan="1">69.6 / 84.3</td>
                <td rowspan="1" colspan="1">1716.4</td>
                <td rowspan="1" colspan="1">1831.6</td>
                <td rowspan="1" colspan="1">1840.8</td>
                <td rowspan="1" colspan="1">115.2</td>
                <td rowspan="1" colspan="1">124.4</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-08-02</bold>
                </td>
                <td rowspan="1" colspan="1">2</td>
                <td rowspan="1" colspan="1">70.0 / 87.0</td>
                <td rowspan="1" colspan="1">1890.2</td>
                <td rowspan="1" colspan="1">2018.7</td>
                <td rowspan="1" colspan="1">2028.9</td>
                <td rowspan="1" colspan="1">128.5</td>
                <td rowspan="1" colspan="1">138.7</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-08-09</bold>
                </td>
                <td rowspan="1" colspan="1">14</td>
                <td rowspan="1" colspan="1">63.0 / 83.0</td>
                <td rowspan="1" colspan="1">2045.0</td>
                <td rowspan="1" colspan="1">2190.6</td>
                <td rowspan="1" colspan="1">2197.4</td>
                <td rowspan="1" colspan="1">145.6</td>
                <td rowspan="1" colspan="1">152.4</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-08-16</bold>
                </td>
                <td rowspan="1" colspan="1">17</td>
                <td rowspan="1" colspan="1">70.0 / 90.0</td>
                <td rowspan="1" colspan="1">2179.8</td>
                <td rowspan="1" colspan="1">2342.6</td>
                <td rowspan="1" colspan="1">2341.6</td>
                <td rowspan="1" colspan="1">162.8</td>
                <td rowspan="1" colspan="1">161.8</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-08-23</bold>
                </td>
                <td rowspan="1" colspan="1">4</td>
                <td rowspan="1" colspan="1">62.0 / 89.0</td>
                <td rowspan="1" colspan="1">2307.6</td>
                <td rowspan="1" colspan="1">2480.8</td>
                <td rowspan="1" colspan="1">2477.0</td>
                <td rowspan="1" colspan="1">173.2</td>
                <td rowspan="1" colspan="1">169.4</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-08-30</bold>
                </td>
                <td rowspan="1" colspan="1">0</td>
                <td rowspan="1" colspan="1">70.0 / 94.0</td>
                <td rowspan="1" colspan="1">2483.4</td>
                <td rowspan="1" colspan="1">2678.9</td>
                <td rowspan="1" colspan="1">2673.3</td>
                <td rowspan="1" colspan="1">195.5</td>
                <td rowspan="1" colspan="1">189.9</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-09-06</bold>
                </td>
                <td rowspan="1" colspan="1">2</td>
                <td rowspan="1" colspan="1">60.0 / 93.0</td>
                <td rowspan="1" colspan="1">2630.2</td>
                <td rowspan="1" colspan="1">2841.7</td>
                <td rowspan="1" colspan="1">2829.8</td>
                <td rowspan="1" colspan="1">211.5</td>
                <td rowspan="1" colspan="1">199.6</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-09-13</bold>
                </td>
                <td rowspan="1" colspan="1">62</td>
                <td rowspan="1" colspan="1">65.0 / 84.0</td>
                <td rowspan="1" colspan="1">2720.0</td>
                <td rowspan="1" colspan="1">2947.8</td>
                <td rowspan="1" colspan="1">2927.3</td>
                <td rowspan="1" colspan="1">227.8</td>
                <td rowspan="1" colspan="1">207.3</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-09-20</bold>
                </td>
                <td rowspan="1" colspan="1">28</td>
                <td rowspan="1" colspan="1">62.0 / 91.0</td>
                <td rowspan="1" colspan="1">2862.8</td>
                <td rowspan="1" colspan="1">3093.6</td>
                <td rowspan="1" colspan="1">3078.7</td>
                <td rowspan="1" colspan="1">230.8</td>
                <td rowspan="1" colspan="1">215.9</td>
              </tr>
              <tr>
                <td rowspan="1" colspan="1">
                  <bold>2024-09-27</bold>
                </td>
                <td rowspan="1" colspan="1">22</td>
                <td rowspan="1" colspan="1">62.0 / 70.0</td>
                <td rowspan="1" colspan="1">2995.6</td>
                <td rowspan="1" colspan="1">3223.7</td>
                <td rowspan="1" colspan="1">3209.5</td>
                <td rowspan="1" colspan="1">228.1</td>
                <td rowspan="1" colspan="1">213.9</td>
              </tr>
            </tbody>
          </table>
        </table-wrap>
      </sec>
      <sec sec-type="Statement of novelty" id="sec9">
        <title>Statement of novelty</title>
        <p>Existing degree-day tools fall broadly into two categories: (1) integrated web platforms that provide pre-built species models (e.g., USPEST.org, which hosts over 130 phenology models) and regional extension tools (e.g., WSU and UC <abbrev xlink:title="integrated pest management">IPM</abbrev> degree-day calculators), and (2) R libraries that compute degree-days from user-provided temperature and threshold inputs without broader pipeline integration (e.g., the R package degday, which implements the simple average, triangle and sine methods (<xref ref-type="bibr" rid="B1">Arnold 1960</xref>; <xref ref-type="bibr" rid="B13">Zalom et al. 1983</xref>). TrackTrap differs from the first category by providing a reproducible and scriptable R interface rather than a web platform, and from the second by integrating automated multi-source weather retrieval, a reference database containing 90 pest entries, user-extensible custom thresholds, and phenology visualization into a single reproducible pipeline, rather than requiring users to assemble these steps themselves from scratch. This end-to-end workflow from data ingestion to final phenology visualization removes the manual data-wrangling process that has limited reproducibility in applied pest monitoring. Additionally, its open-source nature and <abbrev xlink:title="Comprehensive R Archive Network">CRAN</abbrev>-based design provide easy access for extension researchers and <abbrev xlink:title="integrated pest management">IPM</abbrev> professionals lacking dedicated data science support.</p>
      </sec>
      <sec sec-type="Availability and Installation of the package" id="sec10">
        <title>Availability and Installation of the package</title>
        <p>TrackTrap (version 1.1.0) is distributed under the MIT + file license and is openly available on GitHub, with a permanent, citable archive on Zenodo. The package will also be installable directly via install.packages (“TrackTrap”) in R. Researchers are encouraged to submit issues or feature requests in the repository’s issue tracker.</p>
        <p>GitHub: <ext-link xlink:href="https://github.com/Santosh4355/TrackTrap" ext-link-type="uri">https://github.com/Santosh4355/TrackTrap</ext-link></p>
        <p>Zenodo URL: <ext-link xlink:href="10.5281/zenodo.23446360" ext-link-type="doi">https://doi.org/10.5281/zenodo.23446360</ext-link></p>
      </sec>
      <sec sec-type="Technical specifications" id="sec11">
        <title>Technical specifications</title>
        <p>
          <bold>Dependencies</bold>
        </p>
        <p><bold>Name</bold>: TrackTrap</p>
        <p><bold>Version</bold>: 1.1.0</p>
        <p><bold>Repository</bold>: Archived via Zenodo (doi: [<ext-link xlink:href="10.5281/zenodo.23446360" ext-link-type="doi">https://doi.org/10.5281/zenodo.23446360</ext-link>]); development version on GitHub ([<ext-link xlink:href="https://github.com/Santosh4355/TrackTrap" ext-link-type="uri">https://github.com/Santosh4355/TrackTrap</ext-link>]);</p>
        <p><bold>License</bold>: MIT + file License (open source)</p>
        <p><bold>Encoding</bold>: UTF-8</p>
        <p><bold>Programming Language</bold>: R (&gt;=3.5.0)</p>
        <p><bold>Key dependencies</bold>: daymetr, ggplot2, httr, utils</p>
      </sec>
    </sec>
    <sec sec-type="Conclusion" id="sec12">
      <title>Conclusion</title>
      <p>As agricultural datasets increase in size and complexity, entomologists require optimized computational tools to assist in pest monitoring. TrackTrap addresses the challenge of manual weather data collection and degree-day calculation by integrating API data querying and <abbrev xlink:title="growing degree days">GDD</abbrev> modeling directly into the R environment. It enables researchers to perform rapid, reproducible phenological modeling to support modern <abbrev xlink:title="integrated pest management">IPM</abbrev> strategies.</p>
    </sec>
    <sec sec-type="Limitation" id="sec13">
      <title>Limitation</title>
      <p>Biofix is the date when there is the first sustained occurrence of a pest earlier in the season. Often, the biofix determination is left to growers. There are instances when there is initial detection of a pest followed by a prolonged period of no pest detection. More recently, researchers have proposed using the first sustained catch as the biofix rather than relying on the first single positive catch. This package expects users to determine the first sustained catches of the targeted pest and format the dataset accordingly before feeding it for analysis. In the use case example, no trimming was done to adjust for zero counts of FAW from the University of Kentucky dataset across the monitoring dates preceding the biofix.</p>
    </sec>
  </body>
  <back>
    <ack>
      <title>Acknowledgements</title>
      <p>TrackTrap was built independently by the authors and did not rely on institutional funds or time. We thank the California Irrigation Management Information System (<abbrev xlink:title="California Irrigation Management Information System">CIMIS</abbrev>), Open-Meteo, and NASA Daymet for the free access to weather data used for growing degree day calculations and pest phenology modeling in TrackTrap. We are deeply grateful to the developers and maintainers of the R packages that this work depends on, such as dplyr, ggplot2, and httr, which enabled us to process data, integrate API, and visualize information.</p>
      <p>A premium subscription to Grammarly was used to improve the standard of writing intended for academic journals.</p>
    </ack>
    <ref-list>
      <title>References</title>
      <ref id="B1">
        <mixed-citation>Arnold CY (1960) Maximum-minimum temperatures as a basis for computing heat units. <ext-link xlink:href="https://www.semanticscholar.org/paper/Maximum-minimum-temperatures-as-a-basis-for-heat-Arnold/93e8b88fc27e6903a873a537cc069d6f84e04a44" ext-link-type="uri">https://www.semanticscholar.org/paper/Maximum-minimum-temperatures-as-a-basis-for-heat-Arnold/93e8b88fc27e6903a873a537cc069d6f84e04a44</ext-link> [October 28, 2026]</mixed-citation>
      </ref>
      <ref id="B2">
        <mixed-citation>Briere JF, Pracros P, Le Roux AY, Pierre JS (1999) A novel rate model of temperature-dependent development for arthropods. Environmental Entomology 28: 22–29. <ext-link xlink:href="10.1093/ee/28.1.22" ext-link-type="doi">https://doi.org/10.1093/ee/28.1.22</ext-link></mixed-citation>
      </ref>
      <ref id="B3">
        <mixed-citation>California Department of Water Resources [CDWR] (2026) CIMIS - California Irrigation Management Information System. <ext-link xlink:href="https://www.cimis.water.ca.gov/" ext-link-type="uri">https://www.cimis.water.ca.gov/</ext-link> [October 28, 2026]</mixed-citation>
      </ref>
      <ref id="B4">
        <mixed-citation>Herms D (2004) Using degree-days and plant phenology to predict pest activity. In: IPM (Integrated Pest Management) of Midwest Landscapes, 49–59.</mixed-citation>
      </ref>
      <ref id="B5">
        <mixed-citation>Mcmaster G, Wilhelm WW (1997) Growing degree-days: one equation, two interpretations. Agricultural and Forest Meteorology 87: 291–300. <ext-link xlink:href="10.1016/S0168-1923(97)00027-0" ext-link-type="doi">https://doi.org/10.1016/S0168-1923(97)00027-0</ext-link></mixed-citation>
      </ref>
      <ref id="B6">
        <mixed-citation>R Core Team (2026) A Language and Environment for Statistical Computing, R Foundation for Statistical Computing, Vienna, Austria. <ext-link xlink:href="http://www.R-project.org" ext-link-type="uri">http://www.R-project.org</ext-link></mixed-citation>
      </ref>
      <ref id="B7">
        <mixed-citation>Scribner HF, Murrell EG, Chérémond NE, Abshire J, Castaldi J, Zhu KY, Morrison III WR (2025) Developing a growing degree day model to guide integrated pest management of <italic><tp:taxon-name><tp:taxon-name-part taxon-name-part-type="genus">Eucosma</tp:taxon-name-part> <tp:taxon-name-part taxon-name-part-type="species">giganteana</tp:taxon-name-part></tp:taxon-name></italic>, a pest of a novel perennial oilseed crop. Journal of Economic Entomology 118: 1711–1720. <ext-link xlink:href="10.1093/jee/toaf107" ext-link-type="doi">https://doi.org/10.1093/jee/toaf107</ext-link> [October 28, 2026]</mixed-citation>
      </ref>
      <ref id="B8">
        <mixed-citation>Sridhar V, Reddy PVR (2013) Use of Degree Days and Plant Phenology: A Reliable Tool for Predicting Insect Pest Activity Under Climate Change Conditions. In: Singh HCP, Rao NKS, Shivashankar KS (Eds), Climate-Resilient Horticulture: Adaptation and Mitigation Strategies. Springer India, India, 287–294. <ext-link xlink:href="10.1007/978-81-322-0974-4_25" ext-link-type="doi">https://doi.org/10.1007/978-81-322-0974-4_25</ext-link></mixed-citation>
      </ref>
      <ref id="B9">
        <mixed-citation>Thornton PE, Thornton MM, Mayer BW, Wilhelmi N, Wei Y, Devarakonda R, Cook RB (2014) Daymet: Daily Surface Weather Data on a 1-km Grid for North America, Version 2. Oak Ridge National Laboratory (ORNL). <ext-link xlink:href="https://www.osti.gov/biblio/1148868" ext-link-type="uri">https://www.osti.gov/biblio/1148868</ext-link> [October 28, 2026]</mixed-citation>
      </ref>
      <ref id="B10">
        <mixed-citation>UC IPM [UC Statewide Integrated Pest Management Program] (2016) Degree-Days: About Degree-Days--UC IPM. <ext-link xlink:href="https://ipm.ucanr.edu/Weather/ddconcepts.html" ext-link-type="uri">https://ipm.ucanr.edu/Weather/ddconcepts.html</ext-link> [October 28, 2026]</mixed-citation>
      </ref>
      <ref id="B11">
        <mixed-citation>University of Kentucky Integrated Pest Management Program (2026) Weekly Insect Counts | Integrated Pest Management Program. <ext-link xlink:href="https://ipm.mgcafe.uky.edu/insectcounts" ext-link-type="uri">https://ipm.mgcafe.uky.edu/insectcounts</ext-link> [October 28, 2026]</mixed-citation>
      </ref>
      <ref id="B12">
        <mixed-citation>Wolfert S, Ge L, Verdouw C, Bogaardt M-J (2017) Big data in smart farming–a review. Agricultural systems 153: 69–80. <ext-link xlink:href="10.1016/j.agsy.2017.01.023" ext-link-type="doi">https://doi.org/10.1016/j.agsy.2017.01.023</ext-link> [October 28, 2026]</mixed-citation>
      </ref>
      <ref id="B13">
        <mixed-citation>Zalom FG, Goodell PB, Wilson LT, Barnett WW, Bentley WJ (1983) 21373 Degree days: the calculation and use of heat units in pest management. University of California, Division of Agriculture and Natural Resources.</mixed-citation>
      </ref>
      <ref id="B14">
        <mixed-citation>Zippenfenig P (2023) Open-meteo. com weather api. Zenodo. <ext-link xlink:href="https://ui.adsabs.harvard.edu/abs/2024zndo...7973572Z/abstract" ext-link-type="uri">https://ui.adsabs.harvard.edu/abs/2024zndo...7973572Z/abstract</ext-link> [October 28, 2026]</mixed-citation>
      </ref>
    </ref-list>
    <sec sec-type="Additional information" id="sec14">
      <title>Additional information</title>
      <sec sec-type="Conflict of interest" id="sec15">
        <title>Conflict of interest</title>
        <p>The authors have declared that no competing interests exist.</p>
      </sec>
      <sec sec-type="Ethical statement" id="sec16">
        <title>Ethical statement</title>
        <p>No ethical statement was reported.</p>
      </sec>
      <sec sec-type="Artificial Intelligence (AI) use" id="sec17">
        <title>Artificial Intelligence (AI) use</title>
        <p>The authors accept full responsibility for the content of the manuscript, including the disclosure of any use of AI.</p>
        <p>No AI tools were used in the preparation of this manuscript.</p>
      </sec>
      <sec sec-type="Funding" id="sec18">
        <title>Funding</title>
        <p>No funding was reported.</p>
      </sec>
      <sec sec-type="Author contributions" id="sec19">
        <title>Author contributions</title>
        <p>SB: Conceptualization, Methodology, Software, Formal analysis, Investigation, Resources, Data Curation, Writing – Original draft. MG: Methodology, Validation, Formal analysis, Writing – Review and Editing. LK: Methodology, Software, Validation, Formal analysis, Data Curation, Writing – Review and Editing, Visualization</p>
      </sec>
      <sec sec-type="Author ORCIDs" id="sec20">
        <title>Author ORCIDs</title>
        <p>S. Bhandari <ext-link xlink:href="https://orcid.org/0000-0001-9991-474X" ext-link-type="uri">https://orcid.org/0000-0001-9991-474X</ext-link></p>
        <p>M. Ghimire <ext-link xlink:href="https://orcid.org/0009-0005-6295-0954" ext-link-type="uri">https://orcid.org/0009-0005-6295-0954</ext-link></p>
        <p>L. Kharel <ext-link xlink:href="https://orcid.org/0009-0002-0699-546X" ext-link-type="uri">https://orcid.org/0009-0002-0699-546X</ext-link></p>
      </sec>
      <sec sec-type="Data availability" id="sec21">
        <title>Data availability</title>
        <p>All of the data that support the findings of this study are available in the main text or Supplementary Information.</p>
      </sec>
    </sec>
    <sec sec-type="supplementary-material">
      <title>Supplementary materials</title>
      <supplementary-material id="S1" position="float" orientation="portrait" xlink:type="simple">
        <object-id content-type="doi">10.3897/aem.8.208963.suppl1</object-id>
        <object-id content-type="arpha">0D008805-49B4-50AA-9B22-0FF8CFA03628</object-id>
        <label>Supplementary material 1</label>
        <caption>
          <p>Input data format</p>
        </caption>
        <statement content-type="dataType">
          <label>Data type</label>
          <p>pdf</p>
        </statement>
        <media xlink:href="aem-08-e208963-s001.pdf" mimetype="application" mime-subtype="pdf" position="float" orientation="portrait" id="oo_1827162.pdf">
          <uri content-type="original_file">https://binary.pensoft.net/file/1827162</uri>
        </media>
        <permissions>
          <license>
            <license-p>This dataset is made available under the Open Database License (<ext-link ext-link-type="uri" xlink:href="http://opendatacommons.org/licenses/odbl/1.0/">http://opendatacommons.org/licenses/odbl/1.0/</ext-link>). The Open Database License (ODbL) is a license agreement intended to allow users to freely share, modify, and use this Dataset while maintaining this same freedom for others, provided that the original source and author(s) are credited.</license-p>
          </license>
        </permissions>
        <attrib specific-use="authors"> Santosh Bhandari, Mahesh Ghimire, Lalit Kharel</attrib>
      </supplementary-material>
    </sec>
  </back>
</article>
