Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import ResStock weather files #156

Open
mnblonsky opened this issue Nov 26, 2024 · 0 comments
Open

Import ResStock weather files #156

mnblonsky opened this issue Nov 26, 2024 · 0 comments

Comments

@mnblonsky
Copy link
Collaborator

It would be nice to be able to parse and use weather files from ResStock. They use a different format than NSRDB or EPW files. Probably not a major priority, though it is a lot easier to download these files from OEDI than from other sources, especially if you're already downloading other files from ResStock.

I haven't looked at the data in the files, but I assume they have all the data that OCHRE needs. If so, it shouldn't be too hard to implement.

I also wrote some code to download ResStock weather files, but I'd rather not add this in (in Analysis.py) until we can actually use them. For now, I'll just leave the code here.

def download_resstock_weather(
    weather_station=None,
    state=None,
    hpxml_file=None,
    local_folder=None,
    year="2024",
    release="resstock_tmy3_release_2",
):
    # downloads a weather file from ResStock
    # see https://resstock.nrel.gov/datasets
    # works for ResStock 2024.2 releases
    # Note: renames weather file to <weather_station>.epw
    weather_year = "2018" if "amy2018" in release.lower() else "TMY3"
    if weather_station is None or state is None:
        # get weather_id from HPXML file
        if hpxml_file is None:
            raise Exception("Must specify weather ID or provide an HPXML file.")
        raise NotImplementedError()
        
    # determine path and file name
    oedi_path = "/".join(
        [
            "nrel-pds-building-stock",
            "end-use-load-profiles-for-us-building-stock",
            year,
            release,
            "weather",
            f"state={state}",
            f"{weather_station}_{weather_year}.csv",
        ]
    )
    local_path = os.path.join(local_folder, f"{weather_station}.epw")

    # download weather file
    s3_client = boto3.client("s3", config=Config(signature_version=UNSIGNED))
    s3_client.download_file("oedi-data-lake", oedi_path, local_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant