Package: pympc
pympcPerform checks for the presence of minor bodies at astronomical locations for a given epoch.Installationpip install pympcor download/clone source and:python setup.py installSetupFirst we need to import the package and grab the orbit element catalogue. This must be done at least
once prior to any searches and can be run to overwrite the catalogues with the latest versions.
The default call signature is shown.importpympcxephem_cat=pympc.update_catalogue()print(xephem_cat)# e.g. /tmp/mpcorb_xephem.csvThe catalogue downloaded will be thempcorbcatalogue
from the Minor Planet Center.The Near Earth Asteroid and Comets catalogues will be downloaded and used to update thempcorbentries based on
the values of theinclude_neaandinclude_cometsarguments (both default toTrue).It will create a csv file for each catalogue downloaded in thexephem database formatand return
the filepath to this file. By default the file will be saved in the user's temporary directory - this can
be changed by setting thecat_dirargument.UsageHaving downloaded the catalogue (seeSetup), we can now search for minor bodies at a given location.Interactive searchingWithin an interpretor session, define a search location, epoch and radius and run the search.importastropy.unitsasufromastropy.timeimportTimera=230.028*u.degdec=-11.774*u.degepoch=Time("2019-01-01T00:00")search_radius=5*u.arcminobservatory=950# observatory code for La Palmapympc.minor_planet_check(ra,dec,epoch,search_radius,observatory=observatory)Results are returned as an astropy table.The above example uses explicit quantities, but if passed simple float arguments, and the program will assume the
units (see comments below andpympc.minor_planet_check()docstring for unit assumptions).ra=230.028# assumed degreesdec=-11.774# assumed degreesepoch=58484.# assumed MJDsearch_radius=30# assumed arcsecondsobservatory=950# observatory code for La Palmapympc.minor_planet_check(ra,dec,epoch,search_radius,observatory=observatory)By default, the search will use a default filepath for the catalogue. if the file has been moved - or a
customcat_dirwas passed topympc.update_catalogue()- then the filepath can be specified.pympc.minor_planet_check(ra,dec,epoch,search_radius,xephem_filepath='/path/to/mpcorb_xphem.csv',observatory=observatory)Defining an observerBy default, if theobservatoryargument is not passed, the program will return geocentric coordinates. However, for
relatively nearby objects like minor bodies, there can be signicant parallax introduced by the location of an observer
on the Earth's surface. For this reason it is crucial to pass either anobservatory codeor a tuple containing the observatory
information. See the documentation forpympc.minor_planet_check()for more details.Speed and multiprocessingThe check should take of order a second or two, depending on multiprocessing capabilities.The private function which actually performs the calculation is_minor_planet_check()(note leading underscore).
This can be called directly, to avoid the overhead associated with converting input arguments inminor_planet_check(),
if you provide them directly as required (see_minor_planet_check()docstring). Note that in this case a list of
tuples is returned, rather than an astropy table.By default the program will calculate positions of bodies in the catalogue multiprocessed. To switch this off setchunk_size = 0, i.e.:pympc.minor_planet_check(ra,dec,epoch,search_radius,chunk_size=0)Console script searchingInstallation of the package will create aminor_planet_checkscript, which can be accessed
from the command line. The options follow the same as the interactive searching, and results
are displayed as a table. For help on the command line use:minor_planet_check--helpIt is not currently possible to pass a custom set of observatory coordinates to the script -
an existing observatory code must be passed.LimitationsThe orbits are propagated followingxephem(via thepyephempackage), and this does not account for perturbations of the orbits. Thus,
the accuracy of the position is dependent on the time difference between the epoch of the orbit elements and the epoch
at which the search is being performed. Epoch differences between orbital elements calculation and observation of
around a month or two are fine for typical positional accuracies of less than a few arcsecond for the vast
majority of minor bodies. Note, however, that a small number of bodies (those undergoing strong perturbations and
close to Earth) maybe quite inaccurate (arcminutes). A fuller analysis is given innotebooks/positional_accuracy.ipynb.Thexephempackage can only provide geocentric astrometric positions.pympcwill calculate the topocentric
correction as a post-processing to the initial position. The simple geometric correction applied is more than sufficient
for the overwhelming majority of minor bodies, but for some near earth objects the correction can be large and the
relatively simple treatment bypympcmay not be sufficient. Additionally, in order to find matches in geocentric
positions prior to applying the topocentric correction, a buffer is added to the search radius - this should capture
the vast majority of cases where the geocentric position is outside the seach radius but the topocentric position is
within it - although no guarantees. To work around this you can artifically inflate your search radius and filter
yourself afterwards.The filtering of matches based on magnitude viamax_magargument tominor_planet_check()is limited by the accuracy
of the magnitude information in the database so some buffer should be applied to the desired magnitude cutoff to allow
for this.AcknowledgementsThis package makes use of data and/or services provided by the International Astronomical Union'sMinor Planet Center.Orbit elements are also sourced fromLowell Observatory, which is funded by the
Lowell Observatory Endowment and NASA PDART grant NNX16AG52G.Based from a package developed by Chris Klein and Duncan Galloway.