Returns a join producing only elements not in the secondary collection.

    Returns a join that produces the elements of the primary collection that
    match no elements of the secondary collection. No properties are added to
    the results.


Returns a join that returns all pairs of elements.

    Returns a join that pairs each element from the first collection with a
    group of matching elements from the second collection.

    The list of matches is added to each result as an additional property. If
    measureKey is specified, each match has the value of its join measure
    attached. Join measures are produced when withinDistance or maxDifference
    filters are used as the join condition.

    Args:
      matchesKey: The property name used to save the matches list.
      ordering: The property on which to sort the matches list.
      ascending: Whether the ordering is ascending.
      measureKey: An optional property name used to save the measure of the join
        condition on each match.
      outer: If true, primary rows without matches will be included in the
        result.


Returns a join that returns the best match pairs.

    Returns a join that pairs each element from the first collection with a
    matching element from the second collection. The match with the best join
    measure is added to each result as an additional property. Join measures are
    produced when withinDistance or maxDifference filters are used as the join
    condition.

    Args:
      matchKey: The key used to save the match.
      measureKey: The key used to save the measure of the join condition on the
        match.
      outer: If true, primary rows without matches will be included in the
        result.


Returns a join that returns the first match pairs.

    Returns a join that pairs each element from the first collection with a
    matching element from the second collection. The first match is added to the
    result as an additional property.

    Args:
      matchKey: The property name used to save the match.
      ordering: The property on which to sort the matches before selecting the
        first.
      ascending: Whether the ordering is ascending.
      measureKey: An optional property name used to save the measure of the join
        condition on the match.
      outer: If true, primary rows without matches will be included in the
        result.


Returns a join that returns match pairs.

    Returns a join that produces the elements of the primary collection that
    match any element of the secondary collection. No properties are added to
    the results.


Registers a function used to type-coerce arguments and return values.

    Args:
      promoter: A function used to type-coerce arguments and return values.
          Passed a value as the first parameter and a type name as the second.
          Can be used, for example, promote numbers or strings to Images.
          Should return the input promoted if the type is recognized,
          otherwise the original input.


Calls the function with the given positional and keyword arguments.

    Args:
      *args: The positional arguments to pass to the function.
      **kwargs: The named arguments to pass to the function.

    Returns:
      A ComputedObject representing the called function. If the signature
      specifies a recognized return type, the returned value will be cast
      to that type.


Calls the function with a dictionary of named arguments.

    Args:
      named_args: A dictionary of named arguments to pass to the function.

    Returns:
      A ComputedObject representing the called function. If the signature
      specifies a recognized return type, the returned value will be cast
      to that type.


Promotes arguments to their types based on the function's signature.

    Verifies that all required arguments are provided and no unknown arguments
    are present.

    Args:
      args: A dictionary of keyword arguments to the function.

    Returns:
      A dictionary of promoted arguments.

    Raises:
      EEException: If unrecognized arguments are passed or required ones are
          missing.


Converts a list of positional arguments to a map of keyword arguments.

    Uses the function's signature for argument names. Note that this does not
    check whether the array contains enough arguments to satisfy the call.

    Args:
      args: Positional arguments to the function.
      extra_keyword_args: Optional named arguments to add.

    Returns:
      Keyword arguments to the function.

    Raises:
      EEException: If conflicting arguments or too many of them are supplied.


Create a new Date by adding the specified units to the given Date.

    Args:
      delta: The amount to move in the unit. Negative values go back in time.
      unit: One of 'year', 'month', 'week', 'day', 'hour', 'minute', or
        'second'.
      timeZone: The time zone (e.g., 'America/Los_Angeles'); defaults to UTC.

    Returns:
      An ee.Date.


Returns the difference between two Dates in the specified units.

    Args:
      start: The date to compare to.
      unit: One of 'year', 'month', 'week', 'day', 'hour', 'minute', or
        'second'.

    Returns:
      Returns an ee.Number based on the average length of the unit.


Convert a date to string.

    The format string is described here:

    http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html

    Args:
      format: A Joda Time pattern. If omitted, it uses the ISO default date.
      timeZone: The time zone (e.g., 'America/Los_Angeles'); defaults to UTC.

    Returns:
      An ee.String.


Returns a Date given year, month, day.

    Args:
      year: The year, 2013, for example.
      month: The month, 3, for example.
      day: The day, 15, for example.
      timeZone: The time zone (e.g., 'America/Los_Angeles'); defaults to UTC.


Parse a date string, given a string describing its format.

    Args:
      format: A pattern, as described at
        https://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html.
      date: A string matching the given pattern.
      timeZone: The time zone (e.g., 'America/Los_Angeles'); defaults to UTC.

    Returns:
      An ee.Date.


Returns the ratio of the length of one unit to the length of another.

    For example, unitRatio('day', 'minute') returns 1440.

    Valid units are 'year', 'month', 'week', 'day', 'hour', 'minute', and
    'second'.

    Args:
      numerator: Unit to be divided by the denominator.
      denominator: Unit to divide into the numerator.

    Returns:
      An ee.Number.


Create a new Date by setting one or more of the units of the given Date.

    If a timeZone is given the new value(s) is interpreted in that zone. Skip or
    set to None any argument to keep the same as the input Date.

    Args:
      year: Set the year.
      month: Set the month.
      day: Set the day.
      hour: Set the hour.
      minute: Set the minute.
      second: Set the second.
      timeZone: The time zone (e.g., 'America/Los_Angeles'); defaults to UTC.

    Returns:
      An ee.Date.


Deserialize an object from a JSON string appropriate for API calls.

  Args:
    json_obj: The JSON representation of the input.

  Returns:
    The deserialized object.


Decodes an object previously encoded using the EE API v2 (DAG) format.

  Args:
    json_obj: The serialied object to decode.

  Returns:
    The decoded object.


Decodes an object previously encoded using the EE API v2 (DAG) format.

  This uses a provided scope for ValueRef lookup and does not allow the
  input to be a CompoundValue.

  Args:
    json_obj: The serialied object to decode.
    named_values: The objects that can be referenced by ValueRefs.

  Returns:
    The decoded object.


Creates an EE object representing the application of `func` to `args`.


Deserializes an object from the JSON string used in Cloud API calls.

  Args:
    json_obj: The JSON representation of the input.

  Returns:
    The deserialized object.


Decodes an object previously encoded using the EE Cloud API format.

  Args:
    json_obj: The serialized object to decode.

  Returns:
    The decoded object.


Registers the known classes.

  Args:
    classes: A dictionary of the classes available in the ee module.


Converts a class to the API-friendly type name.

  Args:
    a_class: The class.

  Returns:
    The name of the class, or "Object" if not recognized.


Converts a class name to a class.  Returns None if not an ee class.

  Args:
    name: The class name.

  Returns:
    The named class.


Checks whether a type is a subtype of another.

  Args:
    firstType: The first type name.
    secondType: The second type name.

  Returns:
    Whether secondType is a subtype of firstType.


Returns true if this object is a number or number variable.

  Args:
    obj: The object to check.

  Returns:
    Whether the object is a number or number variable.


Returns true if this object is a string or string variable.

  Args:
    obj: The object to check.

  Returns:
    Whether the object is a string or string variable.


Returns true if this object is an array or array variable.

  Args:
    obj: The object to check.

  Returns:
    Whether the object is an array or array variable.


Returns an ee.Projection scaled to the given scale in linear meters.

    Returns the projection scaled such that its units have the given scale in
    linear meters, as measured at the point of true scale.

    Args:
      meters: The scale in linear meters.


Returns the coordinate reference system (crs) of this projection.

    Returns the authority code (e.g., 'EPSG:4326') for the base coordinate
    system of this projection, or null if the base coordinate system is not
    found in any available database.


Returns the linear scale in meters of the units of this projection.

    Done as measured at the point of true scale.


Returns an ee.Projection scaled by the given amount in each axis.

    Args:
      x: The amount to scale by in the x axis.
      y: The amount to scale by in the y axis.


Returns a WKT representation of the transform of this Projection.

    This is the transform that converts from projected coordinates to the base
    coordinate system.


Returns an ee.Projection translated by the given amount in each axis.

    Args:
      x: The amount to translate by in the x axis.
      y: The amount to translate by in the y axis.


Configure OAuth2 credentials for a Google Service Account.

  Args:
    email: The email address of the account for which to configure credentials.
        Ignored if key_file or key_data represents a JSON service account key.
    key_file: The path to a file containing the private key associated with
        the service account. Both JSON and PEM files are supported.
    key_data: Raw key data to use, if key_file is not specified.

  Returns:
    An OAuth2 credentials object.


Invoke the given algorithm with the specified args.

  Args:
    func: The function to call. Either an ee.Function object or the name of
        an API function.
    *args: The positional arguments to pass to the function.
    **kwargs: The named arguments to pass to the function.

  Returns:
    A ComputedObject representing the called function. If the signature
    specifies a recognized return type, the returned value will be cast
    to that type.


Call a function with a dictionary of named arguments.

  Args:
    func: The function to call. Either an ee.Function object or the name of
        an API function.
    named_args: A dictionary of arguments to the function.

  Returns:
    A ComputedObject representing the called function. If the signature
    specifies a recognized return type, the returned value will be cast
    to that type.


Returns a context manager that prints a profile of enclosed API calls.

  The profile will be printed when the context ends, whether or not any error
  occurred within the context.

  # Simple example:
  with ee.profilePrinting():
     print ee.Number(1).add(1).getInfo()

  Args:
    destination: A file-like object to which the profile text is written.
        Defaults to sys.stderr.


Returns properties from a feature as a dictionary.

    Args:
      properties: The list of properties to extract.  Defaults to all non-system
        properties


Returns projection name from a CRS.


Constructs an ee.Geometry describing a point.

    Args:
      coords: A list of two [x,y] coordinates in the given projection.
      proj: The projection of this geometry, or EPSG:4326 if unspecified.
      *args: For convenience, varargs may be used when all arguments are
        numbers. This allows creating EPSG:4326 points, e.g.,
        ee.Geometry.Point(lng, lat).
      **kwargs: Keyword args that accept "lon" and "lat" for backward-
        compatibility.

    Returns:
      An ee.Geometry describing a point.


Constructs an ee.Geometry describing a MultiPoint.

    Args:
      coords: A list of points, each in the GeoJSON 'coordinates' format of a
          Point, or a list of the x,y coordinates in the given projection, or
          an ee.Geometry describing a point.
      proj: The projection of this geometry. If unspecified, the default is
          the projection of the input ee.Geometry, or EPSG:4326 if there are
          no ee.Geometry inputs.
      *args: For convenience, varargs may be used when all arguments are
          numbers. This allows creating EPSG:4326 MultiPoints given an even
          number of arguments, e.g.,
          ee.Geometry.MultiPoint(aLng, aLat, bLng, bLat, ...).

    Returns:
      An ee.Geometry describing a MultiPoint.


Constructs an ee.Geometry describing a rectangular polygon.

    Args:
      coords: The minimum and maximum corners of the rectangle, as a list of
          two points each in the format of GeoJSON 'Point' coordinates, or a
          list of two ee.Geometry objects describing a point, or a list of four
          numbers in the order xMin, yMin, xMax, yMax.
      proj: The projection of this geometry. If unspecified, the default is the
          projection of the input ee.Geometry, or EPSG:4326 if there are no
          ee.Geometry inputs.
      geodesic: If false, edges are straight in the projection. If true, edges
          are curved to follow the shortest path on the surface of the Earth.
          The default is the geodesic state of the inputs, or true if the
          inputs are numbers.
      evenOdd: If true, polygon interiors will be determined by the even/odd
          rule, where a point is inside if it crosses an odd number of edges to
          reach a point at infinity. Otherwise polygons use the left-inside
          rule, where interiors are on the left side of the shell's edges when
          walking the vertices in the given order. If unspecified, defaults to
          True.
      *args: For convenience, varargs may be used when all arguments are
          numbers. This allows creating EPSG:4326 Polygons given exactly four
          coordinates, e.g.,
          ee.Geometry.Rectangle(minLng, minLat, maxLng, maxLat).
      **kwargs: Keyword args that accept "xlo", "ylo", "xhi" and "yhi" for
          backward-compatibility.

    Returns:
      An ee.Geometry describing a rectangular polygon.


Constructs an ee.Geometry describing a LineString.

    Args:
      coords: A list of at least two points.  May be a list of coordinates in
          the GeoJSON 'LineString' format, a list of at least two ee.Geometry
          objects describing a point, or a list of at least four numbers
          defining the [x,y] coordinates of at least two points.
      proj: The projection of this geometry. If unspecified, the default is the
          projection of the input ee.Geometry, or EPSG:4326 if there are no
          ee.Geometry inputs.
      geodesic: If false, edges are straight in the projection. If true, edges
          are curved to follow the shortest path on the surface of the Earth.
          The default is the geodesic state of the inputs, or true if the
          inputs are numbers.
      maxError: Max error when input geometry must be reprojected to an
          explicitly requested result projection or geodesic state.
      *args: For convenience, varargs may be used when all arguments are
          numbers. This allows creating geodesic EPSG:4326 LineStrings given
          an even number of arguments, e.g.,
          ee.Geometry.LineString(aLng, aLat, bLng, bLat, ...).

    Returns:
      An ee.Geometry describing a LineString.


Constructs an ee.Geometry describing a LinearRing.

    If the last point is not equal to the first, a duplicate of the first
    point will be added at the end.

    Args:
      coords: A list of points in the ring. May be a list of coordinates in
          the GeoJSON 'LinearRing' format, a list of at least three ee.Geometry
          objects describing a point, or a list of at least six numbers defining
          the [x,y] coordinates of at least three points.
      proj: The projection of this geometry. If unspecified, the default is the
          projection of the input ee.Geometry, or EPSG:4326 if there are no
          ee.Geometry inputs.
      geodesic: If false, edges are straight in the projection. If true, edges
          are curved to follow the shortest path on the surface of the Earth.
          The default is the geodesic state of the inputs, or true if the
          inputs are numbers.
      maxError: Max error when input geometry must be reprojected to an
          explicitly requested result projection or geodesic state.
      *args: For convenience, varargs may be used when all arguments are
          numbers. This allows creating geodesic EPSG:4326 LinearRings given
          an even number of arguments, e.g.,
          ee.Geometry.LinearRing(aLng, aLat, bLng, bLat, ...).

    Returns:
      A dictionary representing a GeoJSON LinearRing.


Constructs an ee.Geometry describing a MultiLineString.

    Create a GeoJSON MultiLineString from either a list of points, or an array
    of lines (each an array of Points).  If a list of points is specified,
    only a single line is created.

    Args:
      coords: A list of linestrings. May be a list of coordinates in the
          GeoJSON 'MultiLineString' format, a list of at least two ee.Geometry
          objects describing a LineString, or a list of numbers defining a
          single linestring.
      proj: The projection of this geometry. If unspecified, the default is the
          projection of the input ee.Geometry, or EPSG:4326 if there are no
          ee.Geometry inputs.
      geodesic: If false, edges are straight in the projection. If true, edges
          are curved to follow the shortest path on the surface of the Earth.
          The default is the geodesic state of the inputs, or true if the
          inputs are numbers.
      maxError: Max error when input geometry must be reprojected to an
          explicitly requested result projection or geodesic state.
      *args: For convenience, varargs may be used when all arguments are
          numbers. This allows creating geodesic EPSG:4326 MultiLineStrings
          with a single LineString, given an even number of arguments, e.g.,
          ee.Geometry.MultiLineString(aLng, aLat, bLng, bLat, ...).

    Returns:
      An ee.Geometry describing a MultiLineString.


Constructs an ee.Geometry describing a polygon.

    Args:
      coords: A list of rings defining the boundaries of the polygon. May be a
          list of coordinates in the GeoJSON 'Polygon' format, a list of
          ee.Geometry describing a LinearRing, or a list of numbers defining a
          single polygon boundary.
      proj: The projection of this geometry. If unspecified, the default is the
          projection of the input ee.Geometry, or EPSG:4326 if there are no
          ee.Geometry inputs.
      geodesic: If false, edges are straight in the projection. If true, edges
          are curved to follow the shortest path on the surface of the Earth.
          The default is the geodesic state of the inputs, or true if the
          inputs are numbers.
      maxError: Max error when input geometry must be reprojected to an
          explicitly requested result projection or geodesic state.
      evenOdd: If true, polygon interiors will be determined by the even/odd
          rule, where a point is inside if it crosses an odd number of edges to
          reach a point at infinity. Otherwise polygons use the left-inside
          rule, where interiors are on the left side of the shell's edges when
          walking the vertices in the given order. If unspecified, defaults to
          True.
      *args: For convenience, varargs may be used when all arguments are
          numbers. This allows creating geodesic EPSG:4326 Polygons with a
          single LinearRing given an even number of arguments, e.g.,
          ee.Geometry.Polygon(aLng, aLat, bLng, bLat, ..., aLng, aLat).

    Returns:
      An ee.Geometry describing a polygon.


Constructs an ee.Geometry describing a MultiPolygon.

    If created from points, only one polygon can be specified.

    Args:
      coords: A list of polygons. May be a list of coordinates in the GeoJSON
          'MultiPolygon' format, a list of ee.Geometry objects describing a
          Polygon, or a list of numbers defining a single polygon boundary.
      proj: The projection of this geometry. If unspecified, the default is the
          projection of the input ee.Geometry, or EPSG:4326 if there are no
          ee.Geometry inputs.
      geodesic: If false, edges are straight in the projection. If true, edges
          are curved to follow the shortest path on the surface of the Earth.
          The default is the geodesic state of the inputs, or true if the
          inputs are numbers.
      maxError: Max error when input geometry must be reprojected to an
          explicitly requested result projection or geodesic state.
      evenOdd: If true, polygon interiors will be determined by the even/odd
          rule, where a point is inside if it crosses an odd number of edges to
          reach a point at infinity. Otherwise polygons use the left-inside
          rule, where interiors are on the left side of the shell's edges when
          walking the vertices in the given order. If unspecified, defaults to
          True.
      *args: For convenience, varargs may be used when all arguments are
          numbers. This allows creating geodesic EPSG:4326 MultiPolygons with
          a single Polygon with a single LinearRing given an even number of
          arguments, e.g.,
          ee.Geometry.MultiPolygon(aLng, aLat, bLng, bLat, ..., aLng, aLat).

    Returns:
      An ee.Geometry describing a MultiPolygon.


Returns a GeoJSON-compatible representation of the geometry.


Returns a server-side invocation of the appropriate constructor.


Returns a GeoJSON representation of the geometry.


Returns a GeoJSON string representation of the geometry.


Check if a geometry looks valid.

    Args:
      geometry: The geometry to check.

    Returns:
      True if the geometry looks valid.


Validate the coordinates of a geometry.

    Args:
      shape: The coordinates to validate.

    Returns:
      The number of nested arrays or -1 on error.


Create a line from a list of points.

    Args:
      coordinates: The points to convert.  Must be list of numbers of
          even length, in the format [x1, y1, x2, y2, ...]

    Returns:
      An array of pairs of points.


Parses arguments into a GeoJSON dictionary or a ComputedObject.

    Args:
      ctor_name: The name of the constructor to use.
      depth: The nesting depth at which points are found.
      args: The array of values to test.

    Returns:
      If the arguments are simple, a GeoJSON object describing the geometry.
      Otherwise a ComputedObject calling the appropriate constructor.


Returns whether any of the coordinates are computed values or geometries.

    Computed items must be resolved by the server (evaluated in the case of
    computed values, and processed to a single projection and geodesic state
    in the case of geometries.

    Args:
      coordinates: A nested list of ... of number coordinates.

    Returns:
      Whether all coordinates are lists or numbers.


Fixes the depth of the given coordinates.

    Checks that each element has the expected depth as all other elements
    at that depth.

    Args:
      depth: The desired depth.
      coords: The coordinates to fix.

    Returns:
      The fixed coordinates, with the deepest elements at the requested depth.

    Raises:
      EEException: if the depth is invalid and could not be fixed.


Returns all args, specified or not, checking for keywords.


Returns the area of the geometry.

    Returns the area of the geometry. Area of points and line strings is 0 and
    the area of multi geometries is the sum of the areas of their components
    (intersecting areas are counted multiple times).

    Args:
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: If specified, the result will be in the units of the coordinate
        system of this projection. Otherwise it will be in square meters.


Returns a point at the center of the highest-dimension components.

    Lower-dimensional components are ignored, so the centroid of a geometry
    containing two polygons, three lines and a point is equivalent to the
    centroid of a geometry containing just the two polygons.

    Args:
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: If specified, the result will be in this projection. Otherwise it
        will be in EPSG:4326.


Returns the point on the right input that is nearest to the left input.

    If either input is empty, null is returned. If both inputs are unbounded, an
    arbitrary point is returned. If one input is unbounded, an arbitrary point
    in the bounded input is returned.

    Args:
      right: The geometry used as the right operand of the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.

    Returns:
      An ee.Object.


Returns the points on the right input that are nearest to the left input.

    Returns a dictionary containing up to two entries representing a point on
    each input geometry that is closest to the other input geometry. If either
    geometry is empty, an empty dictionary is returned. If both geometries are
    unbounded, the dictionary has an arbitrary point for both 'left' and
    'right'. If one geometry is unbounded, the dictionary has an arbitrary point
    contained in the bounded geometry for both 'left' and 'right'.

    Args:
      right: The geometry used as the right operand of the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.

    Returns:
      An ee.Object.


Returns true if and only if one geometry is contained in the other.

    Args:
      right: The geometry used as the right operand of the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.

    Returns:
      An ee.Boolean.


Returns true if and only if one geometry contains the other.

    Args:
      right: The geometry used as the right operand of the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.

    Returns:
      An ee.Boolean.


Returns the convex hull of the given geometry.

    The convex hull of a single point is the point itself, the convex hull of
    collinear points is a line, and the convex hull of everything else is a
    polygon. Note that a degenerate polygon with all vertices on the same line
    will result in a line segment.

    Args:
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.


Returns a collection of features that cover this geometry.

    Each feature is a rectangle in the grid defined by the given projection.

    Args:
      proj: The projection in which to construct the grid. A feature is
        generated for each grid cell that intersects 'geometry', where cell
        corners are at integer-valued positions in the projection. If the
        projection is scaled in meters, the points will be on a grid of that
        size at the point of true scale.
      scale: Overrides the scale of the projection, if provided. May be required
        if the projection isn't already scaled.


Returns geometries cut into pieces along the given distances.

    Converts LineString, MultiLineString, and LinearRing geometries into a
    MultiLineString by cutting them into parts no longer than the given distance
    along their length. All other geometry types will be converted to an empty
    MultiLineString.

    Args:
      distances: Distances along each LineString to cut the line into separate
        pieces, measured in units of the given proj, or meters if proj is
        unspecified.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: Projection of the result and distance measurements, or EPSG:4326 if
        unspecified.


Returns the result of subtracting the 'right' geometry from the geometry.

    Args:
      right: The geometry used as the right operand of the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.


Returns true if and only if the geometries are disjoint.

    Args:
      right: The geometry used as the right operand of the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.

    Returns:
      An ee.Boolean.


Returns the union of the geometry.

    This leaves single geometries untouched, and unions multi geometries.

    Args:
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: If specified, the union will be performed in this projection.
        Otherwise it will be performed in a spherical coordinate system.


Returns the minimum distance between two geometries.

    Args:
      right: The geometry used as the right operand of the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.
      spherical: If true, the calculation will be done on the unit sphere. If
        false, the calculation will be elliptical, taking earth flattening into
        account. Ignored if proj is specified. Default is false.

    Returns:
      An ee.Float.


Returns true if the edges are geodesics for a spherical earth.

    Returns true if the geometry edges, if any, are geodesics along a spherical
    model of the earth; if false, any edges are straight lines in the
    projection.


Returns the Polygon corresponding to an S2 cell id.

    Args:
      cellId: The S2 cell id as 64 bit integer.


Returns the Polygon corresponding to an S2 cell id as a hex string.

    Args:
      cellToken: The S2 cell id as a hex string. Trailing zeros are required,
        e.g. the top level face containing Antarctica is 0xb000000000000000.


Returns false if edges are straight in the projection.

    If true, edges are curved to follow the shortest path on the surface of the
    Earth.


Returns the list of geometries in a GeometryCollection.

    For single geometries, returns a singleton list of the geometry .


Returns the intersection of the two geometries.

    Args:
      right: The geometry used as the right operand of the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.


Returns true if and only if the geometries intersect.

    Args:
      right: The geometry used as the right operand of the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.

    Returns:
      An ee.Boolean.


Returns the length of the linear parts of the geometry.

    Polygonal parts are ignored. The length of multi geometries is the sum of
    the lengths of their components.

    Args:
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: If specified, the result will be in the units of the coordinate
        system of this projection. Otherwise it will be in meters.


Returns the perimeter length of the polygonal parts of the geometry.

    The perimeter of multi geometries is the sum of the perimeters of their
    components.

    Args:
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: If specified, the result will be in the units of the coordinate
        system of this projection. Otherwise it will be in meters.


Returns a simplified geometry to within a given error margin.

    Note that this does not respect the error margin requested by the consumer
    of this algorithm, unless maxError is explicitly specified to be null.

    This overrides the default Earth Engine policy for propagating error
    margins, so regardless of the geometry accuracy requested from the output,
    the inputs will be requested with the error margin specified in the
    arguments to this algorithm. This results in consistent rendering at all
    zoom levels of a rendered vector map, but at lower zoom levels (i.e. zoomed
    out), the geometry won't be simplified, which may harm performance.

    Args:
      maxError: The maximum amount of error by which the result may differ from
        the input.
      proj: If specified, the result will be in this projection. Otherwise it
        will be in the same projection as the input. If the error margin is in
        projected units, the margin will be interpreted as units of this
        projection.


Returns the symmetric difference between two geometries.

    Args:
      right: The geometry used as the right operand of the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.


Returns the geometry Transformed to a specific projection.

    Args:
      proj: The target projection. Defaults to EPSG:4326. If this has a
        geographic CRS, the edges of the geometry will be interpreted as
        geodesics. Otherwise they will be interpreted as straight lines in the
        projection.
      maxError: The maximum projection error.


Returns the union of the two geometries.

    Args:
      right: The geometry used as the right operand of the operation.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.


Returns true if the geometries are within a specified distance.

    Args:
      right: The geometry used as the right operand of the operation.
      distance: The distance threshold. If a projection is specified, the
        distance is in units of that projected coordinate system, otherwise it
        is in meters.
      maxError: The maximum amount of error tolerated when performing any
        necessary reprojection.
      proj: The projection in which to perform the operation. If not specified,
        the operation will be performed in a spherical coordinate system, and
        linear distances will be in meters on the sphere.

    Returns:
      An ee.Boolean.


Returns an ee.Image with aspect in degrees from a terrain DEM.

    The local gradient is computed using the 4-connected neighbors of each
    pixel, so missing values will occur around the edges of an image.

    Args:
      input: An elevation image, in meters.


Returns an ee.Image with local minima filled.

    Only works on INT types.

    Args:
      image: The image to fill.
      borderValue: The border value.
      neighborhood: The size of the neighborhood to compute over.


Returns an ee.Image with the hill shadow.

    Creates a shadow band, with output 1 where pixels are illumunated and 0
    where they are shadowed. Takes as input an elevation band, azimuth and
    zenith of the light source in degrees, a neighborhood size, and whether or
    not to apply hysteresis when a shadow appears. Currently, this algorithm
    only works for Mercator projections, in which light rays are parallel.

    Args:
      image: The image to which to apply the shadow algorithm, in which each
        pixel should represent an elevation in meters.
      azimuth: Azimuth in degrees.
      zenith: Zenith in degrees.
      neighborhoodSize: Neighborhood size.
      hysteresis: Use hysteresis. Less physically accurate, but may generate
        better images.


Returns an ee.Image with a simple hillshade from a DEM.

    Args:
      input: An elevation image, in meters.
      azimuth: The illumination azimuth in degrees from north.
      elevation: The illumination elevation in degrees.


Returns slope, aspect, and a simple hillshade from a terrain DEM.

    Expects an image containing either a single band of elevation, measured in
    meters, or if there's more than one band, one named 'elevation'. Adds output
    bands named 'slope' and 'aspect' measured in degrees plus an unsigned byte
    output band named 'hillshade' for visualization. All other bands and
    metadata are copied from the input image. The local gradient is computed
    using the 4-connected neighbors of each pixel, so missing values will occur
    around the edges of an image.

    Args:
      input: An elevation image, in meters.


Returns slope in degrees from a terrain DEM.

    The local gradient is computed using the 4-connected neighbors of each
    pixel, so missing values will occur around the edges of an image.

    Args:
      input: An elevation image, in meters.


Parses an input consisting of comma-separated strings.


Parses an input consisting of comma-separated numbers.


Parses an input consisting of comma-separated pyramiding policies.


Decodes a number from a command line argument.


Returns time since the epoch in ms for the given UTC datetime object.


Returns a Cloud-formatted date for the given millisecond timestamp.


Decodes a date from a command line argument, returning msec since epoch".

  Args:
    string: See AssetSetCommand class comment for the allowable
      date formats.

  Returns:
    long, ms since epoch, or '' if the input is empty.

  Raises:
    argparse.ArgumentTypeError: if string does not conform to a legal
      date format.


Decodes a general key-value property from a command-line argument.

  Args:
    string: The string must have the form name=value or (type)name=value, where
      type is one of 'number', 'string', or 'date'. The value format for dates
      is YYYY-MM-DD[THH:MM:SS[.MS]].  The value 'null' is special: it evaluates
      to None unless it is cast to a string of 'null'.

  Returns:
    a tuple representing the property in the format (name, value)

  Raises:
    argparse.ArgumentTypeError: if the flag value could not be decoded or if
    the type is not recognized


Adds command line flags related to metadata properties to a parser.


Decodes metadata properties from args as a name->value dict.


Returns true if the given filenames are valid upload file URIs.


Prompts for an auth code, requests a token and saves it.


Saves the project to the config file.


Performs an ACL update.


Sets the permission for a given user/group.


Removes permissions for a given user/group.


Returns the appropriate account type for a user email.


Decodes and sanity-checks the permissions in the arguments.


Applies the given permission edits to the given acl.


Sets asset ACL to a canned ACL or one provided in a JSON file.


Runs the asset update.


Runs the asset copy.


Runs the list command.


Prints the listing of given assets.


Prints the contents of an asset and its children.


Runs the du command.


Returns the size of the given asset in bytes.


Attempts to delete the specified asset or asset collection.


Runs the TaskInfo command.


Lists tasks present for a user, maybe filtering by state.


Waits on the given tasks to complete or for a timeout to pass.


Decorator that temporarily switches over to the v1alpha API.


Checks the number of bands, creating them if there are none yet.


Starts the upload task, and waits for completion if requested.


Constructs an upload manifest from the command-line flags.


Creates an external image synchronously.


Extract a node mapping from a list or flag-specified JSON.


Validate command line args and extract in/out node mappings.


Extracts the types of the given node names from the GraphDef.


Wraps a SavedModel in EE RPC-friendly ops and saves a temporary copy.


Wraps a SavedModel in EE RPC-friendly ops and saves a copy of it.


Checks the status of TensorFlow installations.


Runs an eecli command.


Creates a GcsHelper using the same credentials EE authorizes with.


Loads the EE credentials and initializes the EE client.


Downloads recursively the contents at a GCS path to a temp directory.


Uploads a directory to cloud storage.


Waits for the specified task to finish, or a timeout to occur.


For each task specified in task_id_list, wait for that task or timeout.


Implements glob-like '*' wildcard completion for cloud storage objects.

  Args:
    source_files: A list of one or more cloud storage paths of the format
                  gs://[bucket]/[path-maybe-with-wildcards]

  Yields:
    cloud storage paths of the above format with '*' wildcards expanded.
  Raises:
    EEException: If badly formatted source_files
                 (e.g., missing gs://) are specified


Retrieve a list of cloud storage filepaths from the given bucket.

  Args:
    bucket: The cloud storage bucket to be queried
    prefix: Optional, a prefix used to select the objects to return
  Yields:
    Cloud storage filepaths matching the given bucket and prefix
  Raises:
    EEException:
      If there is an error in accessing the specified bucket


Converts Python 3 string or bytes object to string.


Verifies library initialization.


Verifies that we can fetch the client project from many locations.

    This also exercises the logic in data.get_persistent_credentials.


Verifies dynamic class initialization.


Verifies object promotion rules.


Verifies unbound method attachment to ee.Algorithms.


Verifies that non-ASCII characters in documentation work.


Verifies basic behavior of ee.Dictionary.


Test eq(), ne() and hash().


Verifies the behavior of the sort() and limit() methods.


Verifies the behavior of filter() method.


Verifies the behavior of the various filtering shortcut methods.


Verifies the behavior of the map() method.


Verifies that nested map() calls produce distinct variables.


Verifies the behavior of the iterate() method.


Verifies that nested function calls produce distinct variables.


Creates a mock HttpError with a 404 status code.


Verifies that addition of static and instance API functions.


Verifies that inherited non-client functions can be overridden.


Verifies that Task.start() calls the server appropriately.


Verifies the task created by Export.image() with a trivial region.


Verifies the task created by Export.image().


Verifies errors are thrown when incorrectly specifying skipEmptyTiles.


Verifies the Asset export task created by Export.image.toAsset().


Verifies the Cloud Storage export task created by Export.image().


Verifies the Drive destined task created by Export.image.toDrive().


Verifies the task created by Export.map.toCloudStorage().


Verifies Export.map.toCloudStorage() tasks with v1 parameters.


Verifies Export.map.toCloudStorage() tasks with v1alpha parameters.


Verifies the task created by Export.table().


Verifies that bogus parameters are rejected.


Verifies that table export accepts a list or tuple of selectors.


Verifies the Cloud Storage task created by Export.table().


Verifies the Drive destined task created by Export.table.toDrive().


Verifies the export task created by Export.table.toAsset().


Verifies the task created by Export.table() given a file format.


Verifies the export task created by Export.table.toFeatureView().


Verifies the task ingestion params created by toFeatureView().


Verifies a bad RankByOneThingRule throws an exception.


Verifies a bad RankingRule throws an exception.


Verifies a bad set of ingestion time params throws an exception.


Verifies the export task created by Export.table.toBigQuery().


Verifies a bad table name throws an exception.


Verifies the task created by Export.video().


Verifies the task created by Export.video.toCloudStorage().


Verifies the task created by Export.video.toDrive().


Verifies that the workload tag state is captured before start.


Overridden to check for profiling-related data.


Verifies basic behavior of ee.Number.


Computes the maximum nesting level of some dict, list, or str.


Verifies a complex serialization case.


Verifies serialization finds and removes repeated values.


Verifies Element.set() keyword argument interpretation.


Verifies that getMap() uses Collection.draw to rasterize Features.


Verifies that Functions can convert positional to named arguments.


Verifies that Functions can promote and verify their arguments.


Verifies the full function invocation flow.


Verifies properly formed function error message generation.


Verifies that a LineString with computed inputs can be constructed.


Verifies that a LinearRing with computed inputs can be constructed.


Verifies that a MultiLineString with computed inputs can be constructed.


Verifies that a MultiPoint with computed inputs can be constructed.


Verifies that a MultiPolygon with computed inputs can be constructed.


Verifies that a Point with computed inputs can be constructed.


Verifies that a Polygon with computed inputs can be constructed.


Verifies that Rectangles still allow keyword xlo/ylo/xhi/yhi args.


Verifies that a Rectangle with computed inputs can be constructed.


Verifies GeometryCollection constructor behavior with valid arguments.


Verifies that JSON parsing and generation preserves the geodesic flag.


Verifies the computed object behavior of the Geometry constructor.


Verifies that a computed coordinate produces a computed geometry.


Verifies that a geometry with a projection can be constructed.


Asserts that no warnings are thrown.


    Query kowalski for alerts with cutouts for a (list of) ZTFID(s)

    Parameters
    ----------
    ZTFID: string or list
        Object IDs to query for (e.g. ZTF22abwqedu)

    kowalski:
        a kowalski api object created with the kowalski library

    normalize (optional): bool
        normalize cutouts by the Frobenius norm (L2)

    programid:
        which program to pull alerts from (1=public, 2=collab, 3=caltech mode)

    verbose (optional): bool
        print diagnostics after each query

    save_raw (optional): str
        if provided, all query results will be individually saved to disk at
        this path before any processsing is done

    load_raw (optional): str
        if provided, check for existing file at this path before querying, load
        file and continue processing as if just queried

    Returns
    -------
    alerts: list of dicts
        each dict represents alert
        alert columns include jd, ra, dec, candid, acai and braii scores,
        magpsf, cutouts, etc.

    Adapted from: https://github.com/growth-astro/ztfrest/
    See here for ZTF alert packet feature definitions:
        https://zwickytransientfacility.github.io/ztf-avro-alert/schema.html

    This can also be done by querying from Fritz instead of Kowalski.


    Downloads alerts with cutouts from kowalski for query with query_name and
    list of ZTFIDs stored in query_df
    Saves triplets in a .npy and alert metadata in a .csv

    Parameters
    ----------
    query_df: DataFrame
        dataframe with column "ZTFID"

    query_name: str
        name of query

    label: int, array_like, or "compute"
        BTS / not BTS label to assign to each alert in saved csv
        if int (must be 0 or 1) assign all alerts provided label
        if array_like (length must match number of alerts) assign from array in order
        if "compute" assign all objects with any alert with magpsf < 18.5 label=1, otherwise 0

    normalize_cutouts (optional) - see query_kowalski()

    verbose (optional): bool

    save_raw, load_raw (optional) - see query_kowalski()

    Returns
    -------
    Nothing


    Crop 63x63 cutout to crop_to_size x crop_to_size pixels and normalize with
    L2-norm

    Parameters
    ----------
    cutout: array
        63x63 pixel array representing image cutout

    crop_to_size: int
        Integer representing desired image length/width

    Returns
    -------
    cutout: array
        image cutout cropped to crop_to_size x crop_to_size pixels and normalized


    Crop all cutouts in array of triplets to crop_to_size x crop_to_size
    and renormalize with L2-norm

    Parameters
    ----------
    triplets: array
        Array of triplets whose cutouts are to be cropped

    crop_to_size: int
        Integer representing desired image length/width

    Returns
    -------
    triplets: array
        Array of triplets each cutout has been cropped and renormalized


    Unpack binary fits files containing cutouts from kowalski and preprocess
    images to mask NaNs and remove corrupted images
    Helper function to query_kowalski()

    Parameters
    ----------
    alert: dict
        alert dictionary queried from kowlaski
        see query_kowalski()

    normalize (optional): bool
        normalize cutouts by the Frobenius norm (L2)

    Returns
    -------
    triplet: 63 x 63 x 3 array
        3 channel 63 x 63 image representing the science, reference, and
        difference cutouts

    drop: bool
        whether or not the image is found to be corrupted

    Adapted from https://github.com/dmitryduev/braai


    Takes in list of alerts with key 'triplet', returns triplet separated from
    alert metadata

    Parameters
    ----------
    alerts: list of dicts
        ZTF alerts packets on which to separate metadata and image cutouts

    Returns
    -------
    alerts: list of dicts
        ZTF alerts packets without images

    triplets: array of floats (Nx63x63x3)
        triplets separated from alerts


    Reruns latest version of braai, ZTF deep real bogus (Duev+2019), on all alerts

    Parameters
    ----------
    triplets: array, Nx63x63x3 (N=number of alerts)
        triplets of all alerts to be rerun

    Returns
    -------
    new_drb: array of floats
        new real/bogus scores for each alert


    Query for last non-detection before first detection

    Parameters
    ----------
    objid: str
        ZTFID objectId of source in question

    first_alert_jd: float
        jd of source's first detection

    Returns
    -------
    last_nondet_jd: float
        jd of last non-detection before first detection
        NaN if no leading non-detection found

    last_nondet_diffmaglim: float
        limiting magnitude of last non-detection before first detection
        NaN if no leading non-detection found


    Reorganizes dict structure, adds values for custom features, and reruns
    braai on provided alert packets

    Parameters
    ----------
    alerts: list of dicts
        alerts on which to make changes

    label: list of ints
        BTS/not-BTS labels to be added to alert packets

    new_drb: array of floats
        deep real bogus scores regenerated for each alert by latest version of
        braai (Duev+2019)
        see rerun_braai()

    Returns
    -------
    alert_df: DataFrame
        alerts represented as DataFrame with custom features, new drb scores,
        and labels added in


    Load candidates and triplets from all sets (i.e. trues, dims, etc.) of a
    specific split (i.e. train, val, test) and merge into a single file. Shuffle
    the merged data and save to disk.


    Load candidates and triplets from a specific set (i.e. trues, dims, etc.),
    apply cuts, and assign train/val/test splits. Save the triplets and candidates
    to disk.


    Query BTS candidates from 2021-2023 that were not saved to RCF
    and are not in RCFjunk

    Parameters
    ----------
    None

    Returns
    -------
    Nothing


    Queries the time at which each BTS source was saved to the BTS fritz group

    Parameters
    ----------
    None

    Returns
    -------
    Nothing


    Execute query to internal BTS sample explorer to fetch sources on predefined
    query.

    Parameters
    ----------
    query_name : str
        name of query to be executed

    overwrite: bool (optional)
        whether or not to replace existing {query_name}.csv file

    Returns
    -------
    Nothing


    Query ZTFIDs from BTS sample explorer and remove repeats from previous data

    Parameters
    ----------
    query_name : str
        name of query to be executed

    all_ZTFIDs : array
        running list of ZTFIDs already present in data

    overwrite : bool (optional)
        whether or not to replace existing {query_name}.csv file

    Returns
    -------
    query_df : pandas.DataFrame
        DataFrame containing information about query like query_df['ZTFID']

    all_ZTFIDs : array
        updated list of ZTFIDs present in data


    Read list of Type-Ia SN ZTFIDs and remove repeats from previous data

    Parameters
    ----------
    all_ZTFIDs : array
        running list of ZTFIDs already present in data

    Returns
    -------
    extIas : pandas.DataFrame
        DataFrame containing ZTFIDs of new externally identified Type-Ia SNe

    all_ZTFIDs : array
        updated list of ZTFIDs present in data


    Query ZTFIDs of unsaved BTS candidates from Fritz and remove repeats from
    previous data

    Parameters
    ----------
    all_ZTFIDs : array
        running list of ZTFIDs already present in data

    overwrite : bool (optional)
        whether or not to replace existing rejects.csv file

    Returns
    -------
    rejects : pandas.DataFrame
        DataFrame containing ZTFIDs of new BTS rejects

    all_ZTFIDs : array
        updated list of ZTFIDs present in data


    Compiles extensive list of ZTFIDs with multiple queries that comprises the
    sources in the BTSbot training set. Each query writes a file to disk at
    BTSbot/data/base_data/{query_name}.csv

    Known queries are ["trues", "vars", "dims", "rejects", "extIas"]

    Parameters
    ----------
    overwrite: bool
        whether or not to requery and replace existing {query_name}.csv file

    Returns
    -------
    Nothing


    Arguments
    ---------
    shppath : str
        Path to a shapefile or zip file containing a shapefile
    attrkey : str
        Column to group shapes by e.g., STUSPS of census (AL, NC, etc)
    gdnam : str
        Name of grid definition within gdpath (e.g., 12US1, 108NHEMI2)
    gdpath : str
        Path to a GRIDDESC file (optional for EPA domains 1US1, 4US1, 12US1,
        12US2, 36US3, 108NHEMI2, etc)
    outpath : str
        Defines where the output will be stored.
    outformat : str
        Either NETCDF4_CLASSIC or NETCDF3_CLASSIC (bigger, more compatible)
    prefix : str
        Variable names with be <prefix>_<attrvalue> (STUSPS_NC)
    srckey : str
        intersection_area, uses the area overlap.
        Anything else, uses srckey * intersection_area / shape_area
    overwrite : bool
        If True, overwrite without asking.
    verbose : int
        Level of verbosity


Decorator to return scalar outputs as a set


Decorator to transform angles from and to degrees if necessary


    NAME:

       radec_to_lb

    PURPOSE:

       transform from equatorial coordinates to Galactic coordinates

    INPUT:

       ra - right ascension

       dec - declination

       degree - (Bool) if True, ra and dec are given in degree and l and b will be as well

       epoch - epoch of ra,dec (right now only 2000.0 and 1950.0 are supported)

    OUTPUT:

       l,b

       For vector inputs [:,2]

    HISTORY:

       2009-11-12 - Written - Bovy (NYU)

       2014-06-14 - Re-written w/ numpy functions for speed and w/ decorators for beauty - Bovy (IAS)


    NAME:

       lb_to_radec

    PURPOSE:

       transform from Galactic coordinates to equatorial coordinates

    INPUT:

       l - Galactic longitude

       b - Galactic lattitude

       degree - (Bool) if True, l and b are given in degree and ra and dec will be as well

       epoch - epoch of target ra,dec (right now only 2000.0 and 1950.0 are supported)

    OUTPUT:

       ra,dec

       For vector inputs [:,2]

    HISTORY:

       2010-04-07 - Written - Bovy (NYU)

       2014-06-14 - Re-written w/ numpy functions for speed and w/ decorators for beauty - Bovy (IAS)


    NAME:

       lbd_to_XYZ

    PURPOSE:

       transform from spherical Galactic coordinates to rectangular Galactic coordinates (works with vector inputs)

    INPUT:

       l - Galactic longitude (rad)

       b - Galactic lattitude (rad)

       d - distance (arbitrary units)

       degree - (bool) if True, l and b are in degrees

    OUTPUT:

       [X,Y,Z] in whatever units d was in

       For vector inputs [:,3]

    HISTORY:

       2009-10-24- Written - Bovy (NYU)

       2014-06-14 - Re-written w/ numpy functions for speed and w/ decorators for beauty - Bovy (IAS)


    NAME:

       rectgal_to_sphergal

    PURPOSE:

       transform phase-space coordinates in rectangular Galactic coordinates to spherical Galactic coordinates (can take vector inputs)

    INPUT:

       X - component towards the Galactic Center (kpc)

       Y - component in the direction of Galactic rotation (kpc)

       Z - component towards the North Galactic Pole (kpc)

       vx - velocity towards the Galactic Center (km/s)

       vy - velocity in the direction of Galactic rotation (km/s)

       vz - velocity towards the North Galactic Pole (km/s)

       degree - (Bool) if True, return l and b in degrees

    OUTPUT:

       (l,b,d,vr,pmll,pmbb) in (rad,rad,kpc,km/s,mas/yr,mas/yr)

    HISTORY:

       2009-10-25 - Written - Bovy (NYU)


    NAME:

       sphergal_to_rectgal

    PURPOSE:

       transform phase-space coordinates in spherical Galactic coordinates to rectangular Galactic coordinates (can take vector inputs)

    INPUT:

       l - Galactic longitude (rad)

       b - Galactic lattitude (rad)

       d - distance (kpc)

       vr - line-of-sight velocity (km/s)

       pmll - proper motion in the Galactic longitude direction (mu_l*cos(b) ) (mas/yr)

       pmbb - proper motion in the Galactic lattitude (mas/yr)

       degree - (bool) if True, l and b are in degrees

    OUTPUT:

       (X,Y,Z,vx,vy,vz) in (kpc,kpc,kpc,km/s,km/s,km/s)

    HISTORY:

       2009-10-25 - Written - Bovy (NYU)


    NAME:

       vrpmllpmbb_to_vxvyvz

    PURPOSE:

       Transform velocities in the spherical Galactic coordinate frame to the rectangular Galactic coordinate frame (can take vector inputs)

    INPUT:

       vr - line-of-sight velocity (km/s)

       pmll - proper motion in the Galactic longitude (mu_l * cos(b))(mas/yr)

       pmbb - proper motion in the Galactic lattitude (mas/yr)

       l - Galactic longitude

       b - Galactic lattitude

       d - distance (kpc)

       XYZ - (bool) If True, then l,b,d is actually X,Y,Z (rectangular Galactic coordinates)

       degree - (bool) if True, l and b are in degrees

    OUTPUT:

       (vx,vy,vz) in (km/s,km/s,km/s)

       For vector inputs [:,3]

    HISTORY:

       2009-10-24 - Written - Bovy (NYU)

       2014-06-14 - Re-written w/ numpy functions for speed and w/ decorators for beauty - Bovy (IAS)


    NAME:

       vxvyvz_to_vrpmllpmbb

    PURPOSE:

       Transform velocities in the rectangular Galactic coordinate frame to the spherical Galactic coordinate frame (can take vector inputs)

    INPUT:

       vx - velocity towards the Galactic Center (km/s)

       vy - velocity in the direction of Galactic rotation (km/s)

       vz - velocity towards the North Galactic Pole (km/s)

       l - Galactic longitude

       b - Galactic lattitude

       d - distance (kpc)

       XYZ - (bool) If True, then l,b,d is actually X,Y,Z (rectangular Galactic coordinates)

       degree - (bool) if True, l and b are in degrees

    OUTPUT:

       (vr,pmll,pmbb) in (km/s,mas/yr,mas/yr); pmll = mu_l * cos(b)

       For vector inputs [:,3]

    HISTORY:

       2009-10-24 - Written - Bovy (NYU)

       2014-06-14 - Re-written w/ numpy functions for speed and w/ decorators for beauty - Bovy (IAS)


    NAME:

       XYZ_to_lbd

    PURPOSE:

       transform from rectangular Galactic coordinates to spherical Galactic coordinates (works with vector inputs)

    INPUT:

       X - component towards the Galactic Center (in kpc; though this obviously does not matter))

       Y - component in the direction of Galactic rotation (in kpc)

       Z - component towards the North Galactic Pole (kpc)

       degree - (Bool) if True, return l and b in degrees

    OUTPUT:

       [l,b,d] in (rad or degree,rad or degree,kpc)

       For vector inputs [:,3]

    HISTORY:

       2009-10-24 - Written - Bovy (NYU)

       2014-06-14 - Re-written w/ numpy functions for speed and w/ decorators for beauty - Bovy (IAS)


    NAME:

       pmrapmdec_to_pmllpmbb

    PURPOSE:

       rotate proper motions in (ra,dec) into proper motions in (l,b)

    INPUT:

       pmra - proper motion in ra (multplied with cos(dec)) [mas/yr]

       pmdec - proper motion in dec [mas/yr]

       ra - right ascension

       dec - declination

       degree - if True, ra and dec are given in degrees (default=False)

       epoch - epoch of ra,dec (right now only 2000.0 and 1950.0 are supported)

    OUTPUT:

       (pmll,pmbb) for vector inputs [:,2]

    HISTORY:

       2010-04-07 - Written - Bovy (NYU)

       2014-06-14 - Re-written w/ numpy functions for speed and w/ decorators for beauty - Bovy (IAS)


    NAME:

       pmllpmbb_to_pmrapmdec

    PURPOSE:

       rotate proper motions in (l,b) into proper motions in (ra,dec)

    INPUT:

       pmll - proper motion in l (multplied with cos(b)) [mas/yr]

       pmbb - proper motion in b [mas/yr]

       l - Galactic longitude

       b - Galactic lattitude

       degree - if True, l and b are given in degrees (default=False)

       epoch - epoch of ra,dec (right now only 2000.0 and 1950.0 are supported)

    OUTPUT:

       (pmra,pmdec), for vector inputs [:,2]

    HISTORY:

       2010-04-07 - Written - Bovy (NYU)

       2014-06-14 - Re-written w/ numpy functions for speed and w/ decorators for beauty - Bovy (IAS)


    NAME:

       cov_pmrapmdec_to_pmllpmbb

    PURPOSE:

       propagate the proper motions errors through the rotation from (ra,dec) to (l,b)

    INPUT:

       covar_pmradec - uncertainty covariance matrix of the proper motion in ra (multplied with cos(dec)) and dec [2,2] or [:,2,2]

       ra - right ascension

       dec - declination

       degree - if True, ra and dec are given in degrees (default=False)

       epoch - epoch of ra,dec (right now only 2000.0 and 1950.0 are supported)

    OUTPUT:

       covar_pmllbb [2,2] or [:,2,2]

    HISTORY:

       2010-04-12 - Written - Bovy (NYU)


    NAME:
       cov_pmradec_to_pmllbb_single
    PURPOSE:
       propagate the proper motions errors through the rotation from (ra,dec)
       to (l,b) for scalar inputs
    INPUT:
       covar_pmradec - uncertainty covariance matrix of the proper motion
                      in ra (multplied with cos(dec)) and dec [2,2] or [:,2,2]
       ra - right ascension
       dec - declination
       degree - if True, ra and dec are given in degrees (default=False)
       epoch - epoch of ra,dec (right now only 2000.0 and 1950.0 are supported)
    OUTPUT:
       cov_pmllbb
    HISTORY:
       2010-04-12 - Written - Bovy (NYU)


    NAME:

       cov_dvrpmllbb_to_vxyz

    PURPOSE:

       propagate distance, radial velocity, and proper motion uncertainties to Galactic coordinates

    INPUT:

       d - distance [kpc, as/mas for plx]

       e_d - distance uncertainty [kpc, [as/mas] for plx]

       e_vr  - low velocity uncertainty [km/s]

       pmll - proper motion in l (*cos(b)) [ [as/mas]/yr ]

       pmbb - proper motion in b [ [as/mas]/yr ]

       cov_pmllbb - uncertainty covariance for proper motion

       l - Galactic longitude

       b - Galactic lattitude

    KEYWORDS:

       plx - if True, d is a parallax, and e_d is a parallax uncertainty

       degree - if True, l and b are given in degree

    OUTPUT:

       cov(vx,vy,vz) [3,3] or [:,3,3]

    HISTORY:

       2010-04-12 - Written - Bovy (NYU)


    NAME:
       cov_dvrpmllbb_to_vxyz
    PURPOSE:
       propagate distance, radial velocity, and proper motion uncertainties to
       Galactic coordinates for scalar inputs
    INPUT:
       d - distance [kpc, as/mas for plx]
       e_d - distance uncertainty [kpc, [as/mas] for plx]
       e_vr  - low velocity uncertainty [km/s]
       pmll - proper motion in l (*cos(b)) [ [as/mas]/yr ]
       pmbb - proper motion in b [ [as/mas]/yr ]
       cov_pmllbb - uncertainty covariance for proper motion
       l - Galactic longitude [rad]
       b - Galactic lattitude [rad]
    OUTPUT:
       cov(vx,vy,vz) [3,3]
    HISTORY:
       2010-04-12 - Written - Bovy (NYU)


    NAME:

       XYZ_to_galcenrect

    PURPOSE:

       transform XYZ coordinates (wrt Sun) to rectangular Galactocentric coordinates

    INPUT:

       X - X

       Y - Y

       Z - Z

    OUTPUT:

       (Xg, Yg, Zg)

    HISTORY:

       2010-09-24 - Written - Bovy (NYU)


    NAME:

       galcenrect_to_XYZ

    PURPOSE:

       transform rectangular Galactocentric to XYZ coordinates (wrt Sun) coordinates

    INPUT:

       X, Y, Z - Galactocentric rectangular coordinates

    OUTPUT:

       (X, Y, Z)

    HISTORY:

       2011-02-23 - Written - Bovy (NYU)


    NAME:

       rect_to_cyl

    PURPOSE:

       convert from rectangular to cylindrical coordinates

    INPUT:

       X, Y, Z - rectangular coordinates

    OUTPUT:

       [:,3] R,phi,z

    HISTORY:

       2010-09-24 - Written - Bovy (NYU)


    NAME:

       cyl_to_rect

    PURPOSE:

       convert from cylindrical to rectangular coordinates

    INPUT:

       R, phi, Z - cylindrical coordinates

    OUTPUT:

       [:,3] X,Y,Z

    HISTORY:

       2011-02-23 - Written - Bovy (NYU)


    NAME:

       XYZ_to_galcencyl

    PURPOSE:

       transform XYZ coordinates (wrt Sun) to cylindrical Galactocentric coordinates

    INPUT:

       X - X

       Y - Y

       Z - Z

    OUTPUT:

       [:,3]= R,phi,z

    HISTORY:

       2010-09-24 - Written - Bovy (NYU)


    NAME:

       galcencyl_to_XYZ

    PURPOSE:

       transform cylindrical Galactocentric coordinates to XYZ coordinates (wrt Sun)

    INPUT:

       R, phi, Z - Galactocentric cylindrical coordinates

    OUTPUT:

       [:,3]= X,Y,Z

    HISTORY:

       2011-02-23 - Written - Bovy (NYU)


    NAME:

       vxvyvz_to_galcenrect

    PURPOSE:

       transform velocities in XYZ coordinates (wrt Sun) to rectangular Galactocentric coordinates for velocities

    INPUT:

       vx - U

       vy - V

       vz - W

       vsun - velocity of the sun in the GC frame ndarray[3]

    OUTPUT:

       [:,3]= vXg, vYg, vZg

    HISTORY:

       2010-09-24 - Written - Bovy (NYU)


    NAME:

       vxvyvz_to_galcencyl

    PURPOSE:

       transform velocities in XYZ coordinates (wrt Sun) to cylindrical Galactocentric coordinates for velocities

    INPUT:

       vx - U

       vy - V

       vz - W

       X - X in Galactocentric rectangular coordinates

       Y - Y in Galactocentric rectangular coordinates

       Z - Z in Galactocentric rectangular coordinates

       vsun - velocity of the sun in the GC frame ndarray[3]

       galcen - if True, then X,Y,Z are in cylindrical Galactocentric coordinates rather than rectangular coordinates

    OUTPUT:

       vRg, vTg, vZg

    HISTORY:

       2010-09-24 - Written - Bovy (NYU)


    NAME:

       galcenrect_to_vxvyvz

    PURPOSE:

       transform rectangular Galactocentric coordinates to XYZ coordinates (wrt Sun) for velocities

    INPUT:

       vXg - Galactocentric x-velocity

       vYg - Galactocentric y-velocity

       vZg - Galactocentric z-velocity

       vsun - velocity of the sun in the GC frame ndarray[3]

    OUTPUT:

       [:,3]= vx, vy, vz

    HISTORY:

       2011-02-24 - Written - Bovy (NYU)


    NAME:

       galcencyl_to_vxvyvz

    PURPOSE:

       transform cylindrical Galactocentric coordinates to XYZ (wrt Sun) coordinates for velocities

    INPUT:

       vR - Galactocentric radial velocity

       vT - Galactocentric tangential velocity

       vZ - Galactocentric vertical velocity

       phi - Galactocentric azimuth

       vsun - velocity of the sun in the GC frame ndarray[3]

    OUTPUT:

       vx,vy,vz

    HISTORY:

       2011-02-24 - Written - Bovy (NYU)


    NAME:

       rect_to_cyl_vec

    PURPOSE:

       transform vectors from rectangular to cylindrical coordinates vectors

    INPUT:

       vx -

       vy -

       vz -

       X - X

       Y - Y

       Z - Z

       cyl - if True, X,Y,Z are already cylindrical

    OUTPUT:

       vR,vT,vz

    HISTORY:

       2010-09-24 - Written - Bovy (NYU)


    NAME:

       cyl_to_rect_vec

    PURPOSE:

       transform vectors from cylindrical to rectangular coordinate vectors

    INPUT:

       vr - radial velocity

       vt - tangential velocity

       vz - vertical velocity

       phi - azimuth

    OUTPUT:

       vx,vy,vz

    HISTORY:

       2011-02-24 - Written - Bovy (NYU)


    NAME:

       cyl_to_rect_jac

    PURPOSE:

       calculate the Jacobian of the cylindrical to rectangular conversion

    INPUT:

       R, phi, Z- cylindrical coordinates

       vR, vT, vZ- cylindrical velocities

       if 6 inputs: R,vR,vT,z,vz,phi

       if 3: R, phi, Z

    OUTPUT:

       jacobian d(rect)/d(cyl)

    HISTORY:

       2013-12-09 - Written - Bovy (IAS)


    NAME:

       galcenrect_to_XYZ_jac
    PURPOSE:

       calculate the Jacobian of the Galactocentric rectangular to Galactic coordinates

    INPUT:

       X,Y,Z- Galactocentric rectangular coordinates

       vX, vY, vZ- Galactocentric rectangular velocities

       if 6 inputs: X,Y,Z,vX,vY,vZ

       if 3: X,Y,Z

    OUTPUT:

       jacobian d(galcen.)/d(Galactic)

    HISTORY:

       2013-12-09 - Written - Bovy (IAS)


    NAME:

       lbd_to_XYZ_jac

    PURPOSE:

       calculate the Jacobian of the Galactic spherical coordinates to Galactic rectangular coordinates transformation

    INPUT:

       l,b,D- Galactic spherical coordinates

       vlos,pmll,pmbb- Galactic spherical velocities (some as proper motions)

       if 6 inputs: l,b,D,vlos,pmll,pmbb

       if 3: l,b,D

       degree= (False) if True, l and b are in degrees

    OUTPUT:

       jacobian

    HISTORY:

       2013-12-09 - Written - Bovy (IAS)


    NAME:

       dl_to_rphi_2d

    PURPOSE:

       convert Galactic longitude and distance to Galactocentric radius and azimuth

    INPUT:

       d - distance

       l - Galactic longitude [rad/deg if degree]

    KEYWORDS:

       degree= (False): l is in degrees rather than rad

       ro= (1) Galactocentric radius of the observer

       phio= (0) Galactocentric azimuth of the observer [rad/deg if degree]

    OUTPUT:

       (R,phi); phi in degree if degree

    HISTORY:

       2012-01-04 - Written - Bovy (IAS)


    NAME:

       rphi_to_dl_2d

    PURPOSE:

       convert Galactocentric radius and azimuth to distance and Galactic longitude

    INPUT:

       R - Galactocentric radius

       phi - Galactocentric azimuth [rad/deg if degree]

    KEYWORDS:

       degree= (False): phi is in degrees rather than rad

       ro= (1) Galactocentric radius of the observer

       phio= (0) Galactocentric azimuth of the observer [rad/deg if degree]

    OUTPUT:

       (d,l); phi in degree if degree

    HISTORY:

       2012-01-04 - Written - Bovy (IAS)


    NAME:

       Rz_to_coshucosv

    PURPOSE:

       calculate prolate confocal cosh(u) and cos(v) coordinates from R,z, and delta

    INPUT:

       R - radius

       z - height

       delta= focus

    OUTPUT:

       (cosh(u),cos(v))

    HISTORY:

       2012-11-27 - Written - Bovy (IAS)


    NAME:

       Rz_to_uv

    PURPOSE:

       calculate prolate confocal u and v coordinates from R,z, and delta

    INPUT:

       R - radius

       z - height

       delta= focus

    OUTPUT:

       (u,v)

    HISTORY:

       2012-11-27 - Written - Bovy (IAS)


    NAME:

       uv_to_Rz

    PURPOSE:

       calculate R and z from prolate confocal u and v coordinates

    INPUT:

       u - confocal u

       v - confocal v

       delta= focus

    OUTPUT:

       (R,z)

    HISTORY:

       2012-11-27 - Written - Bovy (IAS)


This method does mGC3 pole-counts (Mateu et al. 2011) in a given pole-grid, for the given observational data

      Inputs
      ----------
      obs :   2D-array containing observational data (i.e. l,b,parallax,vrad,pm_lon,pm_lat)

      Parameters
      ----------
      pars  : Parameters dictionary - optional. This defines which columns contain each of the observables.
  	    Default value is None. In this case, a default parameter file is printed and default
  	    values are assumed for each parameter.

      Returns
      ----------
      pgrid : Updates the input pole_grid object counts (attributes pgrid.np_mgc3 and pgrid.np_gc3)


Main routine of PINK test image rotation


Main routine of PINK training


Check in argparse if file extensions are supported


 For cartesian map, it reads through the data and creates each neuron as a 1D array
        and then resizes it to the neuronSize print(neurons)


Visualization of PINK SOM


Main routine of PINK convert data binary file


        Returns a deep copy of a REBOUND simulation. You need to reset
        any function pointers on the copy.

        Returns
        -------
        A rebound.Simulation object.


        Start webserver on specified port.
        The default port is 1234.
        You can access a running server by opening a web browser
        at http://localhost:1234 or http://127.0.0.1:1234


Stop the webserver.


        Generate citations

        This function generates citations to papers relevant to the current
        setting of the simulation.


        Returns the current Simulationarchive filename in use.
        Do not set manually. Use sim.save_to_file() instead


        Prints a summary of the current status
        of the simulation.


        Get or set a function pointer for calculating additional forces in the simulation.

        The argument can be a python function or something that can
        be cast to a C function of type CFUNCTYPE(None,POINTER(Simulaton)).
        If the forces are velocity dependent, the flag
        force_is_velocity_dependent needs to be set to 1. Otherwise,
        the particle structures might contain incorrect velocity
        values.


        Get or set a function pointer for pre-timestep modifications.

        The argument can be a python function or something that can be cast to a C function or a
        python function.


        Get or set a function pointer for post-timestep modifications.

        The argument can be a python function or something that can be cast to a C function or a
        python function.


        Set a function pointer for a heartbeat function.
        The heartbeat function is called every timestep and can be used
        to monitor long simulations, check for stalled simulations and
        output debugging information.

        The argument can be a python function or something that can be
        cast to a C function or a python function.

        The function called will receive a pointer to the simulation
        object as its argument.

        Examples
        --------

        >>> import rebound
        >>> sim = rebound.Simulation()
        >>> sim.add(m=1.)
        >>> sim.add(m=1e-3, a=1)
        >>> def heartbeat(sim):
        >>>     # sim is a pointer to the simulation object,
        >>>     # thus use contents to access object data.
        >>>     # See ctypes documentation for details.
        >>>     print(sim.contents.t)
        >>> sim.heartbeat = heartbeat
        >>> sim.integrate(1.)


Get or set a function pointer that defined the coefficient of restitution.


        Get or set a function pointer for collision resolving routine.

        Possible options for setting:
          1) Function pointer
          2) "merge": two colliding particles will merge)
          3) "hardsphere": two colliding particles will bounce off using a set coefficient of restitution


Get or set a function pointer for freeing the ap pointer whenever sim.remove is called.


Get the current number of real (i.e. no variational/shadow) particles in the simulation.


        Get or set the integrator module.

        Available integrators include:

        - ``'IAS15'`` (default)
        - ``'WHFast'``
        - ``'SEI'``
        - ``'LEAPFROG'``
        - ``'JANUS'``
        - ``'MERCURIUS'``
        - ``'WHCKL'``
        - ``'WHCKM'``
        - ``'WHCKC'``
        - ``'SABA4'``
        - ``'SABACL4'``
        - ``'SABACM4'``
        - ``'SABA(10,6,4)'``
        - ``'EOS'``
        - ``'BS'``
        - ``'WHFast512'``
        - ``'TRACE'``
        - ``'none'``

        Check the online documentation for a full description of each of the integrators.


        Get or set the boundary module.

        Available boundary modules are:

        - ``'none'`` (default)
        - ``'open'``
        - ``'periodic'``
        - ``'shear'``

        Check the online documentation for a full description of each of the modules.


        Get or set the gravity module.

        Available gravity modules are:

        - ``'none'``
        - ``'basic'`` (default)
        - ``'compensated'``
        - ``'tree'``

        Check the online documentation for a full description of each of the modules.


        Get or set the collision module.

        Available collision modules are:

        - ``'none'`` (default)
        - ``'direct'``
        - ``'tree'``
        - ``'line'``
        - ``'linetree'``

        Check the online documentation for a full description of each of the modules.


        Tuple of the units for length, time and mass.  Can be set in any order, and strings are not case-sensitive.  See ipython_examples/Units.ipynb for more information.  You can check the units' exact values and add Additional units in rebound/rebound/units.py.  Units should be set before adding particles to the simulation (will give error otherwise).

        Currently supported Units
        -------------------------

        Times:
        Hr          : Hours
        Yr          : Julian years
        Jyr         : Julian years
        Sidereal_yr : Sidereal year
        Yr2pi       : Year divided by 2pi, with year defined as orbital period of planet at 1AU around 1Msun star
        Kyr         : Kiloyears (Julian)
        Myr         : Megayears (Julian)
        Gyr         : Gigayears (Julian)

        Lengths:
        M           : Meters
        Cm          : Centimeters
        Km          : Kilometers
        AU          : Astronomical Units

        Masses:
        Kg          : Kilograms
        Msun        : Solar masses
        Mmercury    : Mercury masses
        Mvenus      : Venus masses
        Mearth      : Earth masses
        Mmars       : Mars masses
        Mjupiter    : Jupiter masses
        Msaturn     : Saturn masses
        Muranus     : Neptune masses
        Mpluto      : Pluto masses

        Examples
        --------

        >>> sim = rebound.Simulation()
        >>> sim.units = ('yr', 'AU', 'Msun')


        Compares of this simulation to another simulation.

        Returns
        -------
        True if both simulations use the same units. False otherwise.


        Will convert the units for the simulation (i.e. convert G) as well as the particles' cartesian elements.
        Must have set sim.units ahead of calling this function, so REBOUND knows what units to convert from.

        Parameters
        ----------
        3 strings corresponding to units of time, length and mass.  Can be in any order and aren't case-sensitive.        You can add new units to rebound/rebound/units.py


        This function adds a set of variational particles to the simulation.

        If there are N real particles in the simulation, this functions adds N additional variational
        particles. To see how many particles (real and variational) are in a simulation, use ``'sim.N'``.
        To see how many variational particles are in a simulation use ``'sim.N_var'``.

        Currently Leapfrog, WHFast and IAS15 support first order variational equations. IAS15 also
        supports second order variational equations.

        Parameters
        ----------
        order : integer, optional
            By default, the function adds a set of first order variational particles to the simulation. Set this flag to 2 for second order.
        first_order : Variation, optional
            Second order variational equations depend on their corresponding first order variational equations.
            This parameter expects the Variation object corresponding to the first order variational equations.
        first_order_2 : Variation, optional
            Same as first_order. But allows to set two different indicies to calculated off-diagonal elements.
            If omitted, then first_order will be used for both first order equations.
        testparticle : int, optional
            If set to a value >= 0, then only one variational particle will be added and be treated as a test particle.

        Returns
        -------
        Returns Variation object (a copy--you can only modify it through its particles property or vary method).


        This function initialises the chaos indicator MEGNO particles and enables their integration.

        MEGNO is short for Mean Exponential Growth of Nearby orbits. It can be used to test
        if a system is chaotic or not. In the backend, the integrator is integrating an additional set
        of particles using the variational equation. Note that variational equations are better
        suited for this than shadow particles. MEGNO is currently only supported in the IAS15
        and WHFast integrators.

        This function also needs to be called if you are interested in the Lyapunov exponent as it is
        calculate with the help of MEGNO. See Rein and Tamayo 2015 for details on the implementation.

        For more information on MEGNO see e.g. https://dx.doi.org/10.1051/0004-6361:20011189


        Return the current MEGNO value.
        Note that you need to call init_megno() before the start of the simulation.


        Return the current Lyapunov Characteristic Number (LCN).
        Note that you need to call init_megno() before the start of the simulation.
        Different definitions of the LCN exist.  Here, we're following Eq 24 of
        Cincotta and Simo (2000): https://aas.aanda.org/articles/aas/abs/2000/20/h1686/h1686.html.
        To get a timescale (the Lyapunov timescale), take the inverse of this quantity.


        Adds a particle to REBOUND. Accepts one of the following:

        1) A single Particle structure.
        2) The particle's mass and a set of cartesian coordinates: m,x,y,z,vx,vy,vz.
        3) The primary as a Particle structure, the particle's mass and a set of orbital elements: primary,m,a,anom,e,omega,inv,Omega,MEAN (see :class:`.Orbit` for the definition of orbital elements).
        4) A name of an object (uses NASA Horizons to look up coordinates)
        5) A list of particles or names.


        Returns a Particles object that allows users to access particles like a dictionary using indices, hashes, or strings.

        The Particles object uses pointers and thus the contents update
        as the simulation progresses. Note that the pointers could change,
        for example when a particle is added or removed from the simulation.


Remove all particles from the simulation


        Removes a particle from the simulation.

        Parameters
        ----------
        index : int, optional
            Specify particle to remove by index.
        hash : c_uint32 or string, optional
            Specifiy particle to remove by hash (if a string is passed, the corresponding hash is calculated).
        keep_sorted : bool, optional
            By default, remove preserves the order of particles in the particles array.
            Might set it to zero in cases with many particles and many removals to speed things up.


        Calculate orbital parameters for all particles in the simulation.
        By default, this functions returns the orbits in Jacobi coordinates.

        If MEGNO is enabled, variational particles will be ignored.

        Parameters
        ----------

        primary     : rebound.Particle, optional
            Set the primary against which to reference the osculating orbit. Default (use Jacobi center of mass).
            For heliocentric coordinates, pass the central object to this parameter.
        jacobi_masses: bool
            Whether to use jacobi primary mass in orbit calculation. (Default: False)

        Returns
        -------
        Returns an array of Orbits of length N-1.


        Returns the center of momentum for all particles in the simulation.

        Parameters
        ----------
        first: int, optional
            If ``first`` is specified, only calculate the center of momentum starting
            from index=``first``.
        last : int or None, optional
            If ``last`` is specified only calculate the center of momentum up to
            (but excluding) index=``last``.  Same behavior as Python's range function.

        Examples
        --------
        >>> sim = rebound.Simulation()
        >>> sim.add(m=1, x=-20)
        >>> sim.add(m=1, x=-10)
        >>> sim.add(m=1, x=0)
        >>> sim.add(m=1, x=10)
        >>> sim.add(m=1, x=20)
        >>> com = sim.com()
        >>> com.x
        0.0
        >>> com = sim.com(first=2,last=4) # Considers indices 2,3
        >>> com.x
        5.0


        Fast way to access serialized particle data via numpy arrays.

        This function can directly set the values of numpy arrays to
        current particle data. This is significantly faster than accessing
        particle data via `sim.particles` as all the copying is done
        on the C side.
        No memory is allocated by this function.
        It expects correctly sized numpy arrays as arguments. The argument
        name indicates what kind of particle data is written to the array.

        Possible argument names are "hash", "m", "r", "xyz", "vxvyvz", and
        "xyzvxvyvz". The datatype for the "hash" array needs to be uint32.
        The other arrays expect a datatype of float64. The lengths of
        "hash", "m", "r" arrays need to be at least sim.N. The lengths of
        xyz and vxvyvz need to be at least 3*sim.N. The length of
        "xyzvxvyvz" arrays need to be 6*sim.N. Exceptions are raised
        otherwise.

        Note that this routine is only intended for special use cases
        where speed is an issue. For normal use, it is recommended to
        access particle data via the `sim.particles` array. Be aware of
        potential issues that arise by directly accesing the memory of
        numpy arrays (see numpy documentation for more details).

        Examples
        --------
        This sets an array to the xyz positions of all particles:

        >>> import numpy as np
        >>> a = np.zeros((sim.N,3),dtype="float64")
        >>> sim.serialize_particle_data(xyz=a)
        >>> print(a)

        To get all current radii of particles:

        >>> a = np.zeros(sim.N,dtype="float64")
        >>> sim.serialize_particle_data(r=a)
        >>> print(a)

        To get all current radii and hashes of particles:

        >>> a = np.zeros(sim.N,dtype="float64")
        >>> b = np.zeros(sim.N,dtype="uint32")
        >>> sim.serialize_particle_data(r=a,hash=b)
        >>> print(a,b)


        This function moves all particles in the simulation to the heliocentric frame.
        Note that the simulation will not stay in the heliocentric frame during integrations
        as the heliocentric frame is not an inertial frame.


        This function moves all particles in the simulation to a center of momentum frame.
        In that frame, the center of mass is at the origin and does not move.
        It makes sense to call this function at the beginning of the integration, especially
        for the high accuracy integrators IAS15 and WHFast.


Returns the sum of potential and kinetic energy of all particles in the simulation.


Returns a list of the three (x,y,z) components of the total angular momentum of all particles in the simulation.


Returns the gravitational timescale in code units. See Pham, Rein, Spiegel 2023 for details.


        Initialize the simulation box.

        This function only needs to be called it boundary conditions other than "none"
        are used. In such a case the boxsize must be known and is set with this function.

        Parameters
        ----------
        boxsize : float
            The size of one root box.
        N_root_x, N_root_y, N_root_z : int, optional
            The number of root boxes in each direction. The total size of the simulation box
            will be ``N_root_x * boxsize``, ``N_root_y * boxsize`` and ``N_root_z * boxsize``.
            By default, there will be exactly one root box in each direction.


        Saves a simulation to a file (Simulationarchive binary format).

        If just the filename is passed, then the simulation is saved immediately.
        You can also automate taking snapshots during a simulation. For that specify
        the interval at which outputs are required. You can do that using either
        `interval` (physical time), `walltime` (in seconds), or `step`
        (the number of timesteps in-between snapshots).

        Arguments
        ---------
        filename : str
            Filename of the binary file.
        interval : float
            Interval between outputs in code units.
        walltime : float
            Interval between outputs in wall time (seconds).
            Useful when using IAS15 with adaptive timesteps.
        step : int
            Interval between outputs in number of timesteps.
            Useful when outputs need to be spaced exactly.
        delete_file: bool
            False (default) appends to file if it exists.
            True deletes the file first.

        Examples
        --------
        The following example shows how to output a simulation and
        then read it back in.

        >>> sim = rebound.Simulation()
        >>> sim.add(m=1.)
        >>> sim.save_to_file("test.bin")
        >>> sim2 = rebound.Simulation("test.bin")

        The following example creates a simulation, then
        initializes the Simulationarchive and integrates
        it forward in time.

        >>> sim = rebound.Simulation()
        >>> sim.add(m=1.)
        >>> sim.add(m=1.e-3,x=1.,vy=1.)
        >>> sim.save_to_file("sa.bin",interval=1000.)
        >>> sim.integrate(1e8)

        The Simulationarchive can later be read in using the following syntax:

        >>> sa = rebound.Simulationarchive("sa.bin")
        >>> sim = sa[0]   # get the first snapshot in the SA file (initial conditions)
        >>> sim = sa[-1]  # get the last snapshot in the SA file


        Saves a screenshot of the current WebGL visualization to a file in png format.

        The web server needs to be started, and a web browser needs to be
        connected to the server in order to take screen shots.

        Arguments
        ---------
        filename : str
            Filename of the output file.

        Examples
        --------
        The following example take a screenshot of a simulation.

        >>> sim = rebound.Simulation()
        >>> sim.integrator = "whfast"
        >>> sim.add(m=1.)
        >>> sim.add(a=1.)
        >>> sim.widget() # this connects one client
        >>> sim.output_screenshot("screenshot.png")


        Perform exactly one integration step with REBOUND. This function is rarely needed.
        Instead, use integrate().


        Perform exactly N_steps integration steps with REBOUND. This function is rarely needed.
        Instead, use integrate().


        Main integration function. Call this function when you have setup your simulation and want to integrate it forward (or backward) in time. The function might be called many times to integrate the simulation in steps and create outputs in-between steps.

        Parameters
        ----------
        tmax : float
            The final time of your simulation. If the current time is 100, and tmax=200, then after the calling the integrate routine, the time has advanced to t=200. If tmax is larger than or equal to the current time, no integration will be performed.
        exact_finish_time: int, optional
            This argument determines whether REBOUND should try to finish at the exact time (tmax) you give it or if it is allowed to overshoot. Overshooting could happen if one starts at t=0, has a timestep of dt=10 and wants to integrate to tmax=25. With ``exact_finish_time=1``, the integrator will choose the last timestep such that t is exactly 25 after the integration, otherwise t=30. Note that changing the timestep does affect the accuracy of symplectic integrators negatively.

        Exceptions
        ----------
        Exceptions are thrown when no more particles are left in the simulation or when a generic integration error occured.
        If you specified exit_min_distance or exit_max_distance, then additional exceptions might thrown for escaping particles or particles that undergo a clos encounter.

        Examples
        --------
        The typical usage is as follows. Note the use of ``np.linspace`` to create equally spaced outputs.
        Using ``np.logspace`` can be used to easily produce logarithmically spaced outputs.

        >>> import numpy as np
        >>> for time in np.linspace(0,100.,10):
        >>>     sim.integrate(time)
        >>>     perform_output(sim)


        Call this function to stop an integration, for example
        from the heartbeat function.


Call this function to reset temporary integrator variables


Call this function if safe-mode is disabled and you need to synchronize particle positions and velocities between timesteps.


Call this function to update the tree structure manually after removing particles.


        Manually refreshes a widget.

        Note that this function can also be called using the wrapper function of
        the Simulation object: sim.refresh_widgets().