Skip to content

Ring

Ring

Ring of the planet

Parameters:

Name Type Description Default
fi float

Ring inner radius (must be >= 1)

required
fe float

Ring outer radius (must be >= 1 and >= fi)

required
ir float

Projected inclination of ring wrt to the skyplane [degrees]. 90 for an edge-on ring, 0 for face on

required
theta float

Projected ring tilt [degrees]. 90 means that the image of the ring in perpendicular to the orbit in the plane of the sky.

required
Source code in SOAP/classes.py
class Ring:
    """Ring of the planet

    Args:
        fi (float):
            Ring inner radius (must be >= 1)
        fe (float):
            Ring outer radius (must be >= 1 and >= fi)
        ir (float):
            Projected inclination of ring wrt to the skyplane [degrees].
            90 for an edge-on ring, 0 for face on
        theta (float):
            Projected ring tilt [degrees]. 90 means that the image of the ring in
            perpendicular to the orbit in the plane of the sky.
    """

    @maybe_quantity_input(ir=U.deg, theta=U.deg)
    def __init__(self, fi, fe, ir, theta):
        if fe < fi:
            raise ValueError("Outer radius must be larger than inner radius")

        self.fi = fi
        self.fe = fe
        self.ir = ir
        self.theta = theta

    def __repr__(self):
        if self.fi == self.fe or (self.fe <= 1.0 and self.fi <= 1.0):
            return "no ring"

        pars = f"fi={self.fi}; fe={self.fe}; ir={self.ir}; theta={self.theta}"
        return f"SOAP.Ring({pars})"

    def set(self, **kwargs):
        for k, v in kwargs.items():
            try:
                getattr(self, k)
                setattr(self, k, v)
            except AttributeError:
                print(f'attribute "{k}" does not exist')