/** @file  slalib.h
*
*  @brief Simple wrapper of the required fortran SLALIB functions
*
*  @ingroup AstroImage
*
*  @author Robert DeSonia, MHPCC
*
*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
*  @date $Date: 2005-02-07 23:26:24 $
*
*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
*/

#ifndef SLALIB_H
#define SLALIB_H

#include "config.h"

#define fslaAoppa F77_FUNC_(sla_aoppa,SLA_AOPPA)
extern void fslaAoppa(
        const double* date,
        const double* dut,
        const double* elongm,
        const double* phim,
        const double* him,
        const double* xp,
        const double* yp,
        const double* tdk,
        const double* pmb,
        const double* rh,
        const double* wl,
        const double* tlr,
        double* AOPRMS
    );

#define fslaAopqk F77_FUNC_(sla_aopqk,SLA_AOPQK)
extern void fslaAopqk(
        const double* RAP,
        const double* DAP,
        double* AOPRMS,
        double* AOB,
        double* ZOB,
        double* HOB,
        double* DOB,
        double* ROB
    );

#define fslaOapqk F77_FUNC_(sla_oapqk,SLA_OAPQK)
extern void fslaOapqk(
        char* TYPE,
        const double* OB1,
        const double* OB2,
        double* AOPRMS,
        double* RAP,
        double* DAP
    );

#define fslaAirmas F77_FUNC_(sla_airmas,SLA_AIRMAS)
extern double fslaAirmas(
        const double* zenithDistance
    );

/*
    void slaAoppa(date, dut, elongm, phim, hm, xp, yp, tdk, pmb, rh, wl, tlr, aoprms)
    
    PARAMETERS
    
    double date
    double dut
    double elongm
    double phim
    double hm
    double xp
    double yp
    double tdk
    double pmb
    double rh
    double wl
    double tlr
    double *aoprms
*/
#define slaAoppa(date,dut,elongm,phim,him,xp,yp,tdk,pmb,rh,wl,tlr,AOPRMS) \
fslaAoppa(&date,&dut,&elongm,&phim,&him,&xp,&yp,&tdk,&pmb,&rh,&wl,&tlr,AOPRMS)

/*
    void slaAopqk(rap, dap, aoprms, aob, zob, hob, dob, rob)
    
    PARAMETERS
    
    double rap
    double dap
    double *aoprms
    double *aob
    double *zob
    double *hob
    double *dob
    double *rob
*/

#define slaAopqk(RAP,DAP,AOPRMS,AOB,ZOB,HOB,DOB,ROB) \
fslaAopqk(&RAP,&DAP,AOPRMS,AOB,ZOB,HOB,DOB,ROB)

/*
    void slaOapqk(type, ob1, ob2, aoprms, rap, dap)
    
    PARAMETERS
    
    char *type
    double ob1
    double ob2
    double *aoprms
    double *rap
    double *dap
*/

#define slaOapqk(TYPE, OB1, OB2, AOPRMS, RAP, DAP) \
fslaOapqk(TYPE, &OB1, &OB2, AOPRMS, RAP, DAP)

/*
    double slaAirmas(zd)
    
    PARAMETERS
    
    double zd
*/
#define slaAirmas(ZD) fslaAirmas(&ZD)

#endif
