layup.comet

Attributes

ASSIST_TIMEFRAME_MAX_MJD

ASSIST_TIMEFRAME_MIN_MJD

logger

INPUT_READERS

Functions

_remove_spc(data)

Removes Short Period Comets (SPCs) from the input data

_assist_integrate(sim, ex, dt, ephem[, include_assist])

Integrates the simulation across a specified time, and returns the orbits before and after integrating.

_direction_of_integration(sim, ex, step, ephem[, ...])

Determines if the simulation is approaching or receding from d=250au, and from this sets the timestep to be positive or negative in order to approach this distance.

_apply_comet(data, args[, aux, cache_dir, ...])

Determines original orbit for comets

comet(data[, num_workers, cache_dir, ...])

_apply_comet wrapper with support for parallel processing

comet_cli(input, output_file_stem[, file_format, ...])

Determines original orbit for comets with support for parallel processing.

Module Contents

ASSIST_TIMEFRAME_MAX_MJD = 236455[source]
ASSIST_TIMEFRAME_MIN_MJD = -163545[source]
logger[source]
INPUT_READERS[source]
_remove_spc(data)[source]

Removes Short Period Comets (SPCs) from the input data

Parameters:

data (numpy structured array) – The data to remove SPCs from.

Returns:

data – The data with SPCs removed.

Return type:

numpy structured array

_assist_integrate(sim, ex, dt, ephem, include_assist=True)[source]

Integrates the simulation across a specified time, and returns the orbits before and after integrating.

Parameters:
  • sim (REBOUND simulation) – The data to use comet function on.

  • ephem (ASSIST Ephem Object) – The ASSIST Ephemeris.

  • ex (ASSIST Extras object) – The ASSIST extras.

  • dt (int) – The timestep to integrate across.

  • include_assist (bool, optional) – If True, the simulation will run the integration through ASSIST, otherwise it will be a pure REBOUND integration. Default is True.

Returns:

  • oi (REBOUND Orbit instance) – The orbit of the simulated particle before integration.

  • of (REBOUND Orbit instance) – The orbit of the simulated particle after integration.

  • sim (REBOUND simulation) – The simulation after integration.

_direction_of_integration(sim, ex, step, ephem, include_assist=True)[source]

Determines if the simulation is approaching or receding from d=250au, and from this sets the timestep to be positive or negative in order to approach this distance.

Parameters:
  • sim (REBOUND simulation) – The data to use comet function on.

  • step (int) – The timestep to integrate across.

  • ephem (ASSIST Ephem Object) – The ASSIST Ephemeris.

  • ex (ASSIST Extras object) – The ASSIST extras.

  • dt (int) – The timestep to integrate across.

  • include_assist (bool, optional) – If True, the simulation will run the integration through ASSIST, otherwise it will be a pure REBOUND integration. Default is True.

Returns:

  • dt (int) – The timestep modified to be positive or negative, depending on the direction the comet must be integrated to get to d=250au

  • oi (REBOUND Orbit instance) – The orbit of the simulated particle before integration.

  • of (REBOUND Orbit instance) – The orbit of the simulated particle after integration.

_apply_comet(data, args, aux=None, cache_dir=None, primary_id_column_name=None)[source]

Determines original orbit for comets

Parameters:
  • data (numpy structured array) – The data to use comet function on.

  • args (argparse) – The argparse object that was created when running from the CLI.

  • aux (AuxiliaryConfigs object) – The LayUp auxiliary arguments

  • cache_dir (str, optional) – The base directory for downloaded files.

  • primary_id_column_name (str, optional) – The name of the column in the data that contains the primary ID of the object.

Returns:

output – The comet data output

Return type:

numpy structured array

comet(data, num_workers=1, cache_dir=None, primary_id_column_name='ObjID', args=None, aux=None)[source]

_apply_comet wrapper with support for parallel processing

Parameters:
  • data (numpy structured array) – The data to use comet function on.

  • num_workers (int, optional (default=1)) – The number of workers to use for parallel processing.

  • primary_id_column_name (str, optional (default="ObjID")) – The name of the column in the data that contains the primary ID of the object.

Returns:

data – The comet data output

Return type:

numpy structured array

comet_cli(input: str, output_file_stem: str, file_format: Literal['csv', 'hdf5'] = 'csv', chunk_size: int = 10000, num_workers: int = -1, cli_args: dict = None, aux=None)[source]

Determines original orbit for comets with support for parallel processing.

Note that the output file will be written in the caller’s current working directory.

inputstr

The path to the input file.

output_file_stemstr

The stem of the output file.

file_formatstr, optional (default=”csv”)

The format of the output file. Must be one of: “csv”, “hdf5”

chunk_sizeint, optional (default=10_000)

The number of rows to read in at a time.

num_workersint, optional (default=-1)

The number of workers to use for parallel processing of the individual chunk. If -1, the number of workers will be set to the number of CPUs on the system.

cli_argsargparse, optional (default=None)

The argparse object that was created when running from the CLI.