Skip to content

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

@minxu74

Description

@minxu74

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions