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

A potential bug in the NOAA/emulated CO2 metric #110

Open
minxu74 opened this issue Dec 9, 2024 · 0 comments
Open

A potential bug in the NOAA/emulated CO2 metric #110

minxu74 opened this issue Dec 9, 2024 · 0 comments

Comments

@minxu74
Copy link
Contributor

minxu74 commented Dec 9, 2024

In the ConfCO2.py, line 212-224:

        # Get the model result
        mod = m.extractTimeSeries(
            emulated_flux,
            initial_time=obs.time_bnds[0, 0] - float(Ninf) / 12 * 365 + 29.0,
            final_time=obs.time_bnds[-1, 1],
        )
        # What if I don't have Ninf leadtime?
        tf = min(obs.time_bnds[-1, 1], mod.time_bnds[-1, 1])
        if tf % 365 > 2:
            tf -= tf % 365  # needs to end in integer years
        obs.trim(t=[-1e20, tf])
        mod.trim(t=[-1e20, tf])

It is used to conform the end of years of model results and observations. But the above codes assumed that the start year of model results (initial_time) are float(Ninf) / 12 * 365 + 29.0 earlier than that of observations. It is not true for some use cases. It will cause the "inconsistent shape error" in the line eflux = np.ma.masked_array(eflux, mask=obs.data.mask)

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