Skip to content

Clarify the timestamp/index conventions for iotools get functions #2963

Backlog

Description

@williamhobbs

Is your feature request related to a problem? Please describe.
Many iotools.get_... functions clarify the output index/timestamp convention in the docstring, but several do not:

  • get_nsrdb_psm4_...
  • get_pvgis_...
  • get_cams (table in notes says "Beginning/end of time period" while input param label can be 'left' or 'right', maybe this could be made consistent and it would be nice to clarify in the "Returns" part of the docstring)
  • get_solargis (timestamp_type is an input parameter, but it would be nice to clarify this in the "Returns" part of the docstring)
  • get_bsrn
  • get_surfrad
  • get_solrad
  • get_midc

Describe the solution you'd like
Clarify that NSRDB data are returned with a center of interval index/timestamp, and whatever is correct for the other datasets.

Similarly, some descriptions are inconsistent. Some say "interval" and some say "period", and "middle" vs "midpoint" vs "center"

Additional context
Examples:

get_solaranywhere:

Returns
-------
data: pandas.DataFrame
Timeseries data from SolarAnywhere. The index is the observation time
(middle of period).

get_nasa_power:

Returns
-------
data : pd.DataFrame
Time series data. The index corresponds to the start (left) of the
interval.

get_solcat_historic:

Returns
-------
data : pandas.DataFrame
containing the values for the parameters requested. The times
in the DataFrame index indicate the midpoint of each interval.

Also note descriptions in the following, which say "center" and "center-labeled":

Activity

  1. added this to the v0.16.2 milestone on Nov 25, 2026
  2. RDaxini commented on Nov 25, 2026

    @RDaxini
    Member

    Good observation @williamhobbs. If you want to open a PR for this, I'll review it at the start of next week. I can also open one if not, unless if someone wants to handle this sooner. I won't have my laptop over the next few days.

    Making this statement of work assignment now in the hope we can resolve this without the need for involving or attracting the attention of six million bots:)

  3. kandersolar commented on Nov 25, 2026

    @kandersolar
    Member

    I believe @AdamRJensen has mentioned previously going one step further: adding a parameter to all functions (like map_variables) to control the labeling convention.

  4. williamhobbs commented on Nov 25, 2026

    @williamhobbs
    ContributorAuthor

    If you want to open a PR for this

    I won't get to it this week. Probably not next week, either.

    adding a parameter to all functions (like map_variables) to control the labeling convention.

    I like this. My opinion is that the default for iotools.get functions should be to return center of interval timestamps, because that's what is needed for solar position calculations. Maybe the new parameter could be something like use_native_timestamp with a default of False. Not sure how that would work with solargis and cams, which already have parameters that partially control timestamps.

    Either way, documenting the "native" convention would be useful. Our documentation on ERA5 timestamps seems to be one of the few places on the internet that clearly documents it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions