pvlib-python: Inconsistent default settings for _prep_inputs_solar_pos in prepare_inputs and prepare_inputs_from_poa

Hi there,

I find that _prep_inputs_solar_pos method has been both called in prepare_inputs and prepare_inputs_from_poa. However, the former takes an additional argument, press_temp that contains temperature pulled from the weather data provided outside. For the default nrel_numpy algorithm, I further checked its input requirement is avg. yearly air temperature in degrees C rather than the instantaneous temperature provided in weather. Hence I would like to ask if the following codes in prepare_inputs are redundant at least for the default ‘nrel_numpy’ algorithm?

        # build kwargs for solar position calculation
        try:
            press_temp = _build_kwargs(['pressure', 'temp_air'], weather)
            press_temp['temperature'] = press_temp.pop('temp_air')
        except KeyError:
            pass

And thereby we change self._prep_inputs_solar_pos(press_temp) to self._prep_inputs_solar_pos() in prepare_inputs?

Meanwhile, does the temperature really matter? How much uncertainty will it cause in the calculation of the sun’s position? Should we provide avg. local temperature data if for a global modelling purpose?

Any help would be appreciated!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (16 by maintainers)

Most upvoted comments

Looks to me like Michalsky 1988 is the one to cite.

It looks like SAM uses that solpos C function. For the refraction calculation (which appears to be different than in SPA) pressure and temperature can be time-dependent, or fixed at defaults (1013mb and 15C, the docstring says 10C but that looks to be a typo).

I don’t have a preference for any of the solar position algorithms. A drawback of SOLPOS is that it does not appear to be published other than as code.