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

Unrealistic clearsky ratio scenes at night #229

Open
grantbuster opened this issue Aug 5, 2024 · 0 comments
Open

Unrealistic clearsky ratio scenes at night #229

grantbuster opened this issue Aug 5, 2024 · 0 comments
Labels

Comments

@grantbuster
Copy link
Member

Seeing weird clearsky ratio scenes at night in timesteps 12-14 where left is clearsky ratio, right is ghi. Timesteps with all(ghi < 10) are being caught at dawn/dusk and making really weird clearsky ratio scenes at night. Would be a good experiment to set timesteps where all(cs_ghi < 10) = np.nan to try and get rid of these weird cs ratio scenes.

image

Code to reproduce based on tests/batch_handlers/test_bh_h5_cc.py

"""pytests for H5 climate change data batch handlers"""

import os
import matplotlib.pyplot as plt
import numpy as np
import pytest

from sup3r.preprocessing import (
    BatchHandlerCC,
    DataHandlerH5SolarCC,
    DataHandlerH5WindCC,
)
from sup3r.preprocessing.utilities import numpy_if_tensor
from sup3r.utilities.pytest.helpers import BatchHandlerTesterCC

SHAPE = (20, 20)
FEATURES_S = ['clearsky_ratio', 'ghi', 'clearsky_ghi']
TARGET_S = (39.01, -105.13)
FEATURES_W = ['u_100m', 'v_100m', 'temperature_100m']
TARGET_W = (39.01, -105.15)
TARGET_SURF = (39.1, -105.4)

dh_kwargs = {
    'target': TARGET_S,
    'shape': SHAPE,
    'time_slice': slice(None, None, 2),
    # 'time_roll': -7,
}
from sup3r import CONFIG_DIR, TEST_DATA_DIR
FP_NSRDB = os.path.join(TEST_DATA_DIR, 'test_nsrdb_co_2018.h5')

test = np.asarray(handler.data.hourly[:, :, 816:888])

for idt in range(36):
    fig, ax = plt.subplots(1, 2, figsize=(15, 5))
    for idf in range(test.shape[-1]):
        a = ax[idf].imshow(test[:, :, idt, idf])
        plt.colorbar(a, ax=ax[idf])
    plt.title(idt)
    plt.show()
    plt.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant