def atciqn(rc, dc, pr, pd, px,rv, astrom, ldbody): if len(rc) != len(astrom): raise _erfa.error('shape of arguments are not compatible') if len(rc) != len(ldbody): raise _erfa.error('shape of arguments are not compatible') check_args(rc, dc, pr, pd, px, rv) check_astrom(astrom) check_ldbody(ldbody) return _erfa.atciqn(rc, dc, pr, pd, px,rv, astrom, ldbody)
def check_args(*args): for t in args: if type(t) is not np.ndarray: raise _erfa.error('arguments are not of type of ndarray') try: if t.shape[0] != args[0].shape[0]: raise _erfa.error('shape of arguments are not compatible') except IndexError: raise _erfa.error('cannot compute ndarray of length 0')
def check_ldbody(ldbody): if type(ldbody) is not type(list()): raise _erfa.error('ldbody argument should be a list') if type(ldbody[0]) is not type(list()): raise _erfa.error('ldbody argument should be a list') for l in ldbody: for i in l: if type(i) is not LDBODY: raise _erfa.error('ldbody argument is not of type LDBODY') if type(i.pv) is not np.ndarray: raise _erfa.error('LDBODY pv is not of type of ndarray')
def check_astrom(astrom): if type(astrom) is not type(list()): raise _erfa.error('astrom argument should be a list') for a in astrom: if type(a) is not ASTROM: raise _erfa.error('astrom argument is not of type ASTROM') if (type(a.eb) is not np.ndarray and \ type(a.eh) is not np.ndarray and \ type(a.v) is not np.ndarray and \ type(a.bpn) is not np.ndarray): raise _erfa.error('astrom is not of type of ndarray')
def aticqn(ri, di, astrom, ldbody): if len(ri) != len(astrom): raise _erfa.error('shape of arguments are not compatible') check_args(ri, di) check_astrom(astrom) check_ldbody(ldbody) return _erfa.aticqn(ri, di, astrom, ldbody)
def aper13(ut11, ut12, astrom): '''aper13(ut11, ut12, astrom) -> astrom In the star-independent astrometry parameters, update only the Earth rotation angle. The caller provides UT1, (n.b. not UTC).''' if len(ut11) != len(astrom): raise _erfa.error('shape of arguments are not compatible') check_args(ut11, ut12) check_astrom(astrom) era = era00(ut11, ut12) return aper(era, astrom)
def dtf2d(scale, iy, im, id, ihr, imn, sec): scale = scale.upper() if scale not in ('TAI', 'TCB', 'TCG', 'TDB', 'TT', 'UT1', 'UTC'): raise _erfa.error('unknown time scale: %s'%scale) check_args(iy, im, id, ihr, imn, sec) iy = cast_to_int32(iy) im = cast_to_int32(im) id = cast_to_int32(id) ihr = cast_to_int32(ihr) imn = cast_to_int32(imn) return _erfa.dtf2d(scale, iy, im, id, ihr, imn, sec)
def aper(theta, astrom): '''aper(theta, astrom) -> astrom In the star-independent astrometry parameters, update only the Earth rotation angle, supplied by the caller explicitly.''' if len(theta) != len(astrom): raise _erfa.error('shape of arguments are not compatible') check_args(theta) check_astrom(astrom) result = [] for i in range(len(theta)): result.append(_aper(theta[i], astrom[i])) return result
def d2dtf(scale, ndp, d1, d2): scale = scale.upper() if scale not in ('TAI', 'TCB', 'TCG', 'TDB', 'TT', 'UT1', 'UTC'): raise _erfa.error('unknown time scale: %s'%scale) check_args(d1, d2) return _erfa.d2dtf(scale, ndp, d1, d2)
def ldn(ldbody, ob, sc): if len(ob) != len(ldbody): raise _erfa.error('shape of arguments are not compatible') check_args(ob, sc) check_ldbody(ldbody) return _erfa.ldn(ldbody, ob, sc)
def atciqz(rc, dc, astrom): if len(rc) != len(astrom): raise _erfa.error('shape of arguments are not compatible') check_args(rc, dc) check_astrom(astrom) return _erfa.atciqz(rc, dc, astrom)