Skip to content

make planck_taper t1 and t2 args floats #14

@Cyberface

Description

@Cyberface

Make sure to enforce that t1 and t2 are floats other wise you get inaccurate results

def planck_taper(tlist, t1, t2):
    """tlist: array of times
    t1. for t<=t1 then return 0
    t2. for t>=t2 then return 1
    else return 1./(np.exp((t2-t1)/(t-t1)+(t2-t1)/(t-t2))+1)"""
    tout = []
    for t in tlist:
        if t<=t1:
            tout.append(0.)
        elif t>=t2:
            tout.append(1.)
        else:
            tout.append(1./(exp((t2-t1)/(t-t1)+(t2-t1)/(t-t2))+1))
    return asarray(tout)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions