HenryDane / climlab

Python package for process-oriented climate modeling
MIT License
1 stars 0 forks source link

Make DailyInsolation use hour angle when lon is present #2

Closed HenryDane closed 10 months ago

HenryDane commented 1 year ago

This needs to be fixed:

insolation.py L557:

        if 'lon' in dom.axes:
            # insolation is latitude-only, need to broadcast across longitude
            #  assumption is axes are ordered (lat, lon, depth)
            #  NOTE this is a clunky hack and all this will go away
            #  when we use xarray structures for these internals
            insolation = np.tile(insolation[...,np.newaxis], dom.axes['lon'].num_points)
HenryDane commented 1 year ago

Fixed with branch commit 4f76f5bcaa6cd7cf96e187f9b6574cb9f8767755 on the insolation branch.

HenryDane commented 1 year ago

Needs verification/proof using math.

HenryDane commented 1 year ago

Use:

    # ...

    day = 1.0

    LST = np.fmod((np.fmod(day, 1.0) + (lon / 360)), 1.0)
    # hour angle in rad
    h = (LST - 0.5) * 2 * np.pi

and add test for temporal average over a day and updated documentation. Check with Prof Feldl before pull request.

HenryDane commented 10 months ago

Considering this closed now that InstantInsolation is on main branch.