I'm looking to estimate the temperature at the end of a river reach of a few miles in length based on known (measured) temperature at the start of the reach plus weather information: historical data for model fitting and forecast data for forecasting. I'd like this on a sub-day temporal timescale--let's say hourly.

From what I read, I presume that solar radiation is a key factor in determining the change in temperature from the start to the end of the reach, so I'm looking for ways to estimate the hourly solar radiation. Then I can try a regression model of end-of-reach temperature vs. start-of-reach temperature and solar radiation.

I tend to work in R, so solutions that come as part of an R package would be nice, solutions easy to implement in R would probably be okay. The R packages solaR and insol seem like potential candidates, but neither strike me as obvious choices yet.

I also found the 2005 "Estimating hourly incoming solar radiation from limited meteorological data" by spokas et al. (https://naldc.nal.usda.gov/download/1910/PDF) and a USDA implementation in Java of the algorithm in SolarCalc (https://www.ars.usda.gov/research/software/download/?softwareid=62). Its data requirements--max and min daily air temperatures and rainfall--seem minimal.

I've looked at CRAN and GitHub, but the best thing I've found is the python pysolarcalc (https://github.com/borevitzlab/pysolarcalc/tree/master/docs/src). I've skimmed the titles and summaries of many of the 160 questions here on solar radiation, too, but I haven't seen an answer.

Does anyone know of an implemntation of this algorithm in R?

Does anyone have a better solution to suggest?


  • $\begingroup$ If you are ok with matlab/GNU-Octave I think this script could help you: mathworks.com/matlabcentral/fileexchange/19791-solar-radiation $\endgroup$
    – user12525
    Aug 15 '18 at 16:21
  • $\begingroup$ @Universal_learner: Thanks. I didn't know about that. In theory, I should be okay with Octave. I tend to work in org-mode with org-babel, so different languages can work. I have two concerns: my relative lack of familiarity with Octave and the difficulty I think I've read about in getting Octave running on Windows (the target system). $\endgroup$
    – Bill
    Aug 15 '18 at 22:12
  • $\begingroup$ I don't know if there are troubles on windows. exe files are at their site. The interface is quite similar to R if I remember well, but you migth lose a bit of time understanding syntaxis $\endgroup$
    – user12525
    Aug 16 '18 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.