Orbits

class rubin_sim.moving_objects.Orbits

Bases: object

Orbits reads, checks for required values, and stores orbit parameters for moving objects.

Instantiate the class and then use read_orbits or set_orbits to set the orbit values.

self.orbits stores the orbital parameters, as a pandas dataframe. self.dataCols defines the columns required, although obj_id, H, g, and sed_filename are optional.

Methods Summary

assign_sed(orbits[, random_seed])

Assign either a C or S type SED, depending on the semi-major axis of the object.

read_orbits(orbit_file[, delim, skiprows])

Read orbits from a file, generating a pandas dataframe containing columns matching dataCols, for the appropriate orbital parameter format (currently accepts COM, KEP or CAR formats).

set_orbits(orbits)

Set and validate orbital parameters contain all required values.

update_orbits(neworb)

Update existing orbits with new values, leaving OrbitIds, H, g, and sed_filenames in place.

Methods Documentation

assign_sed(orbits, random_seed=None)

Assign either a C or S type SED, depending on the semi-major axis of the object. P(C type) = 0 (a<2); 0.5*a - 1 (2<a<4); 1 (a > 4), based on figure 23 from Ivezic et al 2001 (AJ, 122, 2749).

Parameters:
orbitspd.DataFrame, pd.Series or np.ndarray

Array-like object containing orbital parameter information.

Returns:
sedvalsnp.ndarray

Array containing the SED type for each object in ‘orbits’.

read_orbits(orbit_file, delim=None, skiprows=None)

Read orbits from a file, generating a pandas dataframe containing columns matching dataCols, for the appropriate orbital parameter format (currently accepts COM, KEP or CAR formats).

After reading and standardizing the column names, calls self.set_orbits to validate the orbital parameters. Expects angles in orbital element formats to be in degrees.

Note that readOrbits uses pandas.read_csv to read the data file with the orbital parameters. Thus, it should have column headers specifying the column names .. unless skiprows = -1 or there is just no header line at all. in which case it is assumed to be a standard DES format file, with no header line.

Parameters:
orbit_filestr

The name of the input file containing orbital parameter information.

delimstr, optional

The delimiter for the input orbit file. Default is None, will use delim_whitespace=True.

skiprowsint, optional

The number of rows to skip before reading the header information for pandas. Default is None, which will trigger a check of the file to look for the header columns.

set_orbits(orbits)

Set and validate orbital parameters contain all required values.

Sets self.orbits and self.orb_format. If objid is not present in orbits, a sequential series of integers will be used. If H is not present in orbits, a default value of 20 will be used. If g is not present in orbits, a default value of 0.15 will be used. If sed_filename is not present in orbits, either C or S type will be assigned, according to the semi-major axis value.

Parameters:
orbitspd.DataFrame, pd.Series or np.ndarray

Array-like object containing orbital parameter information.

update_orbits(neworb)

Update existing orbits with new values, leaving OrbitIds, H, g, and sed_filenames in place.

Example use: transform orbital parameters (using PyOrbEphemerides) and then replace original values. Example use: propagate orbital parameters (using PyOrbEphemerides) and then replace original values.

Parameters:
neworb: `pd.DataFrame`