lsst.pipe.tasks gcf790cdeb6+e07a3617c0
Loading...
Searching...
No Matches
lsst.pipe.tasks.associationUtils Namespace Reference

Functions

 toIndex (nside, ra, dec)
 
 toRaDec (nside, index)
 
 eq2xyz (ra, dec)
 
 eq2xyzVec (ra, dec)
 
 convert_spherical (ra, dec)
 
 convert_spherical_array (array)
 
 query_disc (nside, ra, dec, max_rad, min_rad=0)
 
 obj_id_to_ss_object_id (objID)
 
 packed_obj_id_to_ss_object_id (objID)
 
 ss_object_id_to_obj_id (ssObjectID, packed=False)
 
str pack_mpc_designation (str designation)
 
Time _unpack_mpc_date (str epoch_pf)
 
Time convert_mpc_packed_dates (npt.ArrayLike pf_tt)
 
str pack_numbered_designation (str designation)
 
str pack_provisional_designation (str designation)
 
str pack_survey_designation (str designation)
 
str unpack_numbered_designation (str designation_pf)
 
str unpack_provisional_designation (str designation_pf)
 
str unpack_survey_designation (str designation_pf)
 
str unpack_mpc_designation (str designation_pf)
 

Variables

str BASE62 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
 
dict BASE62_MAP = {BASE62[i]: i for i in range(len(BASE62))}
 

Detailed Description

Utilities for interfacing with hpgeom. Originally implemented in
http://github.com/LSSTDESC/dia_pipe and then translated to hpgeom.

Function Documentation

◆ _unpack_mpc_date()

Time lsst.pipe.tasks.associationUtils._unpack_mpc_date ( str epoch_pf)
protected

Definition at line 327 of file associationUtils.py.

◆ convert_mpc_packed_dates()

Time lsst.pipe.tasks.associationUtils.convert_mpc_packed_dates ( npt.ArrayLike pf_tt)
Convert MPC packed form dates (in the TT time scale) to
MJDs in TT. See: https://minorplanetcenter.net/iau/info/PackedDates.html
for details on the packed date format.

Parameters
----------
pf_tt : `~numpy.ndarray` (N)
    MPC-style packed form epochs in the TT time scale.

Returns
-------
mjd_tt : `~astropy.time.core.Time` (N)
    Epochs in TT MJDs.

Definition at line 350 of file associationUtils.py.

◆ convert_spherical()

lsst.pipe.tasks.associationUtils.convert_spherical ( ra,
dec )
Convert from ra,dec to spherical coordinates.

Used in query_disc.

Parameters
----------
ra : `float`
    RA in radians.
dec : `float`
    Declination in radians

Definition at line 126 of file associationUtils.py.

◆ convert_spherical_array()

lsst.pipe.tasks.associationUtils.convert_spherical_array ( array)
Convert from and a array ra,dec to spherical coordinates.

Used in query_disc

Parameters
----------
array : `numpy.ndarray`, (N, 2)
    (N, 2) Array of RA, DEC values.

Returns
-------
vecs : `numpy.ndarray`, (N, 3)
    Vectors on the unit sphere

Definition at line 143 of file associationUtils.py.

◆ eq2xyz()

lsst.pipe.tasks.associationUtils.eq2xyz ( ra,
dec )
Convert from equatorial ra,dec in degrees to x,y,z on unit sphere.

Parameters
----------
ra : `float`
    RA in degrees.
dec : `float`
    Declination in degrees

Returns
-------
xyz : `numpy.ndarray`, (3,)
    Float xyz positions on the unit sphere.

Definition at line 74 of file associationUtils.py.

◆ eq2xyzVec()

lsst.pipe.tasks.associationUtils.eq2xyzVec ( ra,
dec )
Convert equatorial ra,dec in degrees to x,y,z on the unit sphere
parameters

Vectorized version of ``eq2xyz``

Parameters
----------
ra : array_like, (N,)
    Array of RA in degrees.
dec : array_like, (N,)
    Declination in degrees

Returns
-------
vec : `numpy.ndarray`, (N,3)
    Array of unitsphere 3-vectors.

Definition at line 98 of file associationUtils.py.

◆ obj_id_to_ss_object_id()

lsst.pipe.tasks.associationUtils.obj_id_to_ss_object_id ( objID)

Definition at line 200 of file associationUtils.py.

◆ pack_mpc_designation()

str lsst.pipe.tasks.associationUtils.pack_mpc_designation ( str designation)
B612 code to pack a unpacked MPC designation. For example,
provisional designation 1998 SS162 will be packed to J98SG2S.
Permanent designation 323 will be packed to 00323.

TODO: add support for comet and natural satellite designations

Parameters
----------
designation : str
    MPC unpacked designation.

Returns
-------
designation_pf : str
    MPC packed form designation.

Raises
------
ValueError : If designation cannot be packed.

Definition at line 273 of file associationUtils.py.

◆ pack_numbered_designation()

str lsst.pipe.tasks.associationUtils.pack_numbered_designation ( str designation)
Pack a numbered MPC designation.

Examples of numbered designations:
    Numbered      Packed
    3202          03202
    50000         50000
    100345        A0345
    360017        a0017
    203289        K3289
    620000        ~0000
    620061        ~000z
    3140113       ~AZaz
    15396335      ~zzzz

Parameters
----------
designation : str
    MPC numbered designation.

Returns
-------
designation_pf : str
    MPC packed numbered designation.

Raises
------
ValueError : If the numbered designation cannot be packed.
    If the numbered designation is larger than 15396335.

Definition at line 373 of file associationUtils.py.

◆ pack_provisional_designation()

str lsst.pipe.tasks.associationUtils.pack_provisional_designation ( str designation)
Pack a provisional MPC designation.

Examples of provisional designations:
    Provisional   Packed
    1995 XA       J95X00A
    1995 XL1      J95X01L
    1995 FB13     J95F13B
    1998 SQ108    J98SA8Q
    1998 SV127    J98SC7V
    1998 SS162    J98SG2S
    2099 AZ193    K99AJ3Z
    2008 AA360    K08Aa0A
    2007 TA418    K07Tf8A

Parameters
----------
designation : str
    MPC provisional designation.

Returns
-------
designation_pf : str
    MPC packed provisional designation.

Raises
------
ValueError : If the provisional designation cannot be packed.
    The provisional designations is not at least 6 characters long.
    The first 4 characters of the provisional designation are not a year.
    The 5th character of the provisional designation is not a space.
    The provisional designation contains a hyphen.
    The half-month letter is I or Z.

Definition at line 426 of file associationUtils.py.

◆ pack_survey_designation()

str lsst.pipe.tasks.associationUtils.pack_survey_designation ( str designation)
Pack a survey MPC designation.

Examples of survey designations:
    Survey       Packed
    2040 P-L     PLS2040
    3138 T-1     T1S3138
    1010 T-2     T2S1010
    4101 T-3     T3S4101

Parameters
----------
designation : str
    MPC survey designation.

Returns
-------
designation_pf : str
    MPC packed survey designation.

Raises
------
ValueError : If the survey designation cannot be packed.
    The survey designation does not start with P-L, T-1, T-2, or T-3.

Definition at line 498 of file associationUtils.py.

◆ packed_obj_id_to_ss_object_id()

lsst.pipe.tasks.associationUtils.packed_obj_id_to_ss_object_id ( objID)
Convert from Minor Planet Center packed provisional object ID to
Rubin ssObjectID.

Parameters
----------
objID : `str`
    Minor Planet Center packed provisional designation for a small solar
    system object. Must be fewer than eight characters.

Returns
-------
ssObjectID : `int`
    Rubin ssObjectID

Raises
------
ValueError
    Raised if either objID is shorter than 7 or longer than 8 characters or contains
    illegal objID characters

Definition at line 206 of file associationUtils.py.

◆ query_disc()

lsst.pipe.tasks.associationUtils.query_disc ( nside,
ra,
dec,
max_rad,
min_rad = 0 )
Get the list of healpix indices within max_rad, min_rad given in radians
around ra,dec given in degrees

Parameters
----------
nside : `int`
    Resolution of the healpixels to search/return.
ra : `float`
    RA in degrees.
dec : `float`
    Declination in degrees
max_rad : `float`
    Max distance in radians to search nearby healpixels.
min_rad : `float`, optional
    Minimum distance in radians to search healpixels. Default = 0.

Definition at line 163 of file associationUtils.py.

◆ ss_object_id_to_obj_id()

lsst.pipe.tasks.associationUtils.ss_object_id_to_obj_id ( ssObjectID,
packed = False )
Convert from Rubin ssObjectID to Minor Planet Center packed provisional
object ID.

Parameters
----------
ssObjectID : `int`
    Rubin ssObjectID

Returns
-------
objID : `str`
    Minor Planet Center packed provisional designation.

Raises
------

Definition at line 241 of file associationUtils.py.

◆ toIndex()

lsst.pipe.tasks.associationUtils.toIndex ( nside,
ra,
dec )
Return healpix index given ra, dec in degrees

Parameters
----------
nside : `int`
    Power of 2 nside healpix resolution.
ra : `float`
    RA in degrees.
dec : `float`
    Declination in degrees

Returns
-------
index : `int`
    Unique healpix pixel ID containing point RA, DEC at resolution nside.

Definition at line 35 of file associationUtils.py.

◆ toRaDec()

lsst.pipe.tasks.associationUtils.toRaDec ( nside,
index )
Convert from healpix index to ra,dec in degrees

Parameters
----------
nside : `int`
    Resolution of healpixel "grid".
index : `int`
    Index of the healpix pixel we want to find the location of.

Returns
-------
pos : `numpy.ndarray`, (2,)
    RA and DEC of healpix pixel location in degrees.

Definition at line 55 of file associationUtils.py.

◆ unpack_mpc_designation()

str lsst.pipe.tasks.associationUtils.unpack_mpc_designation ( str designation_pf)
Unpack a packed MPC designation. For example, provisional
designation J98SG2S will be unpacked to 1998 SS162. Permanent
designation 00323 will be unpacked to 323.

TODO: add support for comet and natural satellite designations

Parameters
----------
designation_pf : str
    MPC packed form designation.

Returns
-------
designation : str
    MPC unpacked designation.

Raises
------
ValueError : If designation_pf cannot be unpacked.

Definition at line 694 of file associationUtils.py.

◆ unpack_numbered_designation()

str lsst.pipe.tasks.associationUtils.unpack_numbered_designation ( str designation_pf)
Unpack a numbered MPC designation.

Examples of numbered designations:
    Numbered      Unpacked
    03202         3202
    50000         50000
    A0345         100345
    a0017         360017
    K3289         203289
    ~0000         620000
    ~000z         620061
    ~AZaz         3140113
    ~zzzz         15396335

Parameters
----------
designation_pf : str
    MPC packed numbered designation.

Returns
-------
designation : str
    MPC unpacked numbered designation.

Raises
------
ValueError : If the numbered designation cannot be unpacked.
    The packed numbered designation is not at least 4 characters long.

Definition at line 540 of file associationUtils.py.

◆ unpack_provisional_designation()

str lsst.pipe.tasks.associationUtils.unpack_provisional_designation ( str designation_pf)
Unpack a provisional MPC designation.

Examples of provisional designations:
    Provisional   Unpacked
    J95X00A       1995 XA
    J95X01L       1995 XL1
    J95F13B       1995 FB13
    J98SA8Q       1998 SQ108
    J98SC7V       1998 SV127
    J98SG2S       1998 SS162
    K99AJ3Z       2099 AZ193
    K08Aa0A       2008 AA360
    K07Tf8A       2007 TA418

Parameters
----------
designation_pf : str
    MPC packed provisional designation.

Returns
-------
designation : str
    MPC unpacked provisional designation.

Raises
------
ValueError : If the provisional designation cannot be unpacked.
    The packed provisional designation is not 7 characters long.
    The packed provisional designation does not have a year.

Definition at line 596 of file associationUtils.py.

◆ unpack_survey_designation()

str lsst.pipe.tasks.associationUtils.unpack_survey_designation ( str designation_pf)
Unpack a survey MPC designation.

Examples of survey designations:
    Survey       Packed
    PLS2040      2040 P-L
    T1S3138      3138 T-1
    T2S1010      1010 T-2
    T3S4101      4101 T-3

Parameters
----------
designation_pf : str
    MPC packed survey designation.

Returns
-------
designation : str
    MPC unpacked survey designation.

Raises
------
ValueError : If the survey designation cannot be unpacked.
    The packed survey designation does not start with PLS, T1S, T2S, or T3S.

Definition at line 651 of file associationUtils.py.

Variable Documentation

◆ BASE62

str lsst.pipe.tasks.associationUtils.BASE62 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"

Definition at line 323 of file associationUtils.py.

◆ BASE62_MAP

dict lsst.pipe.tasks.associationUtils.BASE62_MAP = {BASE62[i]: i for i in range(len(BASE62))}

Definition at line 324 of file associationUtils.py.