Skip to content

ModelChain.prepare_inputs fails to pass solar_position and airmass to Location.get_clearsky #481

Closed
@wholmgren

Description

@wholmgren

ModelChain.prepare_inputs calculates results for clear sky condition if no irradiance data is provided. The ModelChain is supposed to pass solar position and airmass data to Location.get_clearsky to speed up calculations and keep them consistent. #199 changed the ineichen API and this ModelChain code was not updated to reflect the new arguments.

These lines:

        if not any([x in ['ghi', 'dni', 'dhi'] for x in self.weather.columns]):
            self.weather[['ghi', 'dni', 'dhi']] = self.location.get_clearsky(
                self.solar_position.index, self.clearsky_model,
                zenith_data=self.solar_position['apparent_zenith'],
                airmass_data=self.airmass['airmass_absolute'])

should read

        if not any([x in ['ghi', 'dni', 'dhi'] for x in self.weather.columns]):
            self.weather[['ghi', 'dni', 'dhi']] = self.location.get_clearsky(
                self.solar_position.index, self.clearsky_model,
                solar_position=self.solar_position,  # fixed here and below
                airmass_absolute=self.airmass['airmass_absolute'])

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions