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

era5POS preprocessor #48

Open
tommylees112 opened this issue Jun 27, 2019 · 3 comments
Open

era5POS preprocessor #48

tommylees112 opened this issue Jun 27, 2019 · 3 comments

Comments

@tommylees112
Copy link
Contributor

the era5POS data when converted to monthly doesn't necessarily make sense to just upsample from hourly to monthly

    @staticmethod
    def resample_time(ds: xr.Dataset,
                      resample_length: str = 'M',
                      upsampling: bool = False) -> xr.Dataset:

        # TODO: would be nice to programmatically get upsampling / not
        ds = ds.sortby('time')

        resampler = ds.resample(time=resample_length)

        if not upsampling:
            return resampler.mean()
        else:
            return resampler.nearest()

Because it's then Mean HOURLY precipitation over a month - when really we should be summing over the month.

...
        if not upsampling:
            return resampler.mean()
        elif data == 'era5POS':
             return resampler.sum()
        else:
            return resampler.nearest()

Otherwise we get extremely different spatial patterns:

CHIRPS (mm/month)

Screenshot 2019-06-27 at 12 16 37

ERA5POS (mm/hour mean for each month)

Screenshot 2019-06-27 at 12 16 42

@gabrieltseng
Copy link
Contributor

gabrieltseng commented Jun 28, 2019

Isn't this okay if we normalize (which we do)?

@tommylees112
Copy link
Contributor Author

hmmm yeah you would think so actually. but the spatial patterns would remain the same and they're so vastly different i'm just a little concerned that we haven't done the preprocessing correctly!

@gabrieltseng
Copy link
Contributor

Are they so different? They have extremely different resolutions (this is only resolved at the engineering step), but the peaks in precipitation look like they are in roughly the same spot, as well as the troughs.

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

2 participants