casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
pks_maths.h
Go to the documentation of this file.
00001 //#---------------------------------------------------------------------------
00002 //# pks_maths.h: Mathematical functions for Parkes single dish data reduction
00003 //#---------------------------------------------------------------------------
00004 //# livedata - processing pipeline for single-dish, multibeam spectral data.
00005 //# Copyright (C) 2000-2009, Australia Telescope National Facility, CSIRO
00006 //#
00007 //# This file is part of livedata.
00008 //#
00009 //# livedata is free software: you can redistribute it and/or modify it under
00010 //# the terms of the GNU General Public License as published by the Free
00011 //# Software Foundation, either version 3 of the License, or (at your option)
00012 //# any later version.
00013 //#
00014 //# livedata is distributed in the hope that it will be useful, but WITHOUT
00015 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00016 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
00017 //# more details.
00018 //#
00019 //# You should have received a copy of the GNU General Public License along
00020 //# with livedata.  If not, see <http://www.gnu.org/licenses/>.
00021 //#
00022 //# Correspondence concerning livedata may be directed to:
00023 //#        Internet email: mcalabre@atnf.csiro.au
00024 //#        Postal address: Dr. Mark Calabretta
00025 //#                        Australia Telescope National Facility, CSIRO
00026 //#                        PO Box 76
00027 //#                        Epping NSW 1710
00028 //#                        AUSTRALIA
00029 //#
00030 //# http://www.atnf.csiro.au/computing/software/livedata.html
00031 //# $Id: pks_maths.h,v 1.7 2009-09-29 07:45:02 cal103 Exp $
00032 //#---------------------------------------------------------------------------
00033 //# Original: 2004/07/16 Mark Calabretta
00034 //#---------------------------------------------------------------------------
00035 #ifndef ATNF_PKS_MATHS_H
00036 #define ATNF_PKS_MATHS_H
00037 
00038 // AIPS++ includes.
00039 #include <casa/aips.h>
00040 #include <casa/Arrays/Vector.h>
00041 
00042 
00043 #include <casa/namespace.h>
00044 
00045 // Global mathematical functions for single-dish data reduction.
00046 
00047 // Nearest integral value.
00048 Int nint(Double v);
00049 Double anint(Double v);
00050 
00051 // Round value v to the nearest integral multiple of precision p.
00052 Double round(Double v, Double p);
00053 
00054 // Compute the weighted median value of an array.
00055 Float  median(const Vector<Float> &v, const Vector<Float> &wgt);
00056 
00057 // Angular distance between two directions (angles in radian).
00058 Double angularDist(Double lng1, Double lat1, Double lng2, Double lat2);
00059 
00060 // Generalized position angle of the field point (lng,lat) from reference
00061 // point (lng0,lat0) and the angular distance between them (angles in radian).
00062 void distPA(Double lng0, Double lat0, Double lng, Double lat, Double &dist,
00063             Double &pa);
00064 
00065 // Euler angle based transformation of spherical coordinates (radian).
00066 void eulerx(Double lng0, Double lat0, Double phi0, Double theta, Double phi,
00067             Double &lng1, Double &lat1);
00068 
00069 // Low precision coordinates of the sun.
00070 void sol(Double mjd, Double &elng, Double &ra, Double &dec);
00071 
00072 // Low precision Greenwich mean and apparent sidereal time (radian); UT1 is
00073 // given in MJD form.
00074 void gst(Double ut1, Double &gmst, Double &gast);
00075 
00076 // Convert (ra,dec) to (az,el).  Position as a Cartesian triplet (m), UT1 in
00077 // MJD form, and all angles in radian.
00078 void azel(const Vector<Double> position, Double ut1, Double ra, Double dec,
00079           Double &az, Double &el);
00080 
00081 // Compute the Solar elevation (radian) using the above functions.
00082 Double solel(const Vector<Double> position, Double ut1);
00083 
00084 #endif