question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent default settings for _prep_inputs_solar_pos in prepare_inputs and prepare_inputs_from_poa

See original GitHub issue

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!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
adriessecommented, Sep 28, 2020

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

1reaction
cwhansecommented, Sep 27, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found