human
I am working on the file "PyWCPS.ipynb".
The first task is:
which looks kinda cute. Notice that the helper functions do not need to be inner functions. They could just as well be outside for reuse, if needed. For example, it would be entirely possible to write a function that automatically generates the switch statement for a colorscale like the above from a list of value cuts, which would make the above function even shorter.
Before you ask, I got the coverage constructor, too... I called it "New"
Can you write Python program for it?

What is a the Python program you requested?
assistant
#Here is the Python program you requested.

@wcps
def test_coverage_constructor():
    l = 100000
    def roi(cov, time):
        return cov[axis('Long', -50, -40),
                   axis('Lat', 45,55),
                   axis('ansi', time, crs="CRS:1")]

    def term(cov, time):
        return (add((roi(cov, time) < l) * roi(cov, time))
                /
                count(roi(cov, time) < l))

    return For(c="CCI_V2_release_daily_chlor_a")[
            encode(cast('float',
                        New('histogram',
                            px=axis('x', 0, 0),
                            py=axis('y', 0, 0),
                            pt=axis('t', 0, 360))[
                                term(c, pt) #+ term(c, pt+1) + term(c, pt+2)
                            ]), "csv")]

res_txt = eo.get_str(test_coverage_constructor)
plt.plot([float(x) for x in res_txt[2:-2].split(",")])