unwrap_objid

pydl.photoop.photoobj.unwrap_objid(objid)[source]

Unwrap CAS-style objID into run, camcol, field, id, rerun.

See sdss_objid() for details on how the bits within an objID are assigned.

Parameters:
objidnumpy.ndarray

An array containing 64-bit integers or strings. If strings are passed, they will be converted to integers internally.

Returns:
numpy.recarray

A record array with the same length as objid, with the columns ‘skyversion’, ‘rerun’, ‘run’, ‘camcol’, ‘firstfield’, ‘frame’, ‘id’.

Raises:
ValueError

If the input objID has a type that can’t be converted into 64-bit integer.

Notes

For historical reasons, the inverse of this function, sdss_objid() is not in the same namespace as this function.

‘frame’ is used instead of ‘field’ because record arrays have a method of the same name.

Examples

>>> from numpy import array
>>> from pydl.photoop.photoobj import unwrap_objid
>>> unwrap_objid(array([1237661382772195474]))
rec.array([(2, 301, 3704, 3, 0, 91, 146)],
      dtype=[('skyversion', '<i4'), ('rerun', '<i4'), ('run', '<i4'), ('camcol', '<i4'), ('firstfield', '<i4'), ('frame', '<i4'), ('id', '<i4')])