| 1 |
johnpye |
816 |
/*-------------------------------------------------------------------- |
| 2 |
|
|
* $Id: sun.h,v 1.4 2004/01/12 17:18:04 arve Exp $ |
| 3 |
|
|
* |
| 4 |
|
|
* This file is part of libRadtran. |
| 5 |
|
|
* Copyright (c) 1997-2001 by Arve Kylling and Bernhard Mayer. |
| 6 |
|
|
* |
| 7 |
|
|
* ######### Contact info: http://www.libradtran.org ######### |
| 8 |
|
|
* |
| 9 |
|
|
* This program is free software; you can redistribute it and/or |
| 10 |
|
|
* modify it under the terms of the GNU General Public License |
| 11 |
|
|
* as published by the Free Software Foundation; either version 2 |
| 12 |
|
|
* of the License, or (at your option) any later version. |
| 13 |
|
|
* |
| 14 |
|
|
* This program is distributed in the hope that it will be useful, |
| 15 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 |
|
|
* GNU General Public License for more details. |
| 18 |
|
|
* |
| 19 |
|
|
* You should have received a copy of the GNU General Public License |
| 20 |
|
|
* along with this program; if not, write to the Free Software |
| 21 |
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, |
| 22 |
|
|
* Boston, MA 02111-1307, USA. |
| 23 |
|
|
*--------------------------------------------------------------------*/ |
| 24 |
|
|
|
| 25 |
|
|
#ifndef __sun_h |
| 26 |
|
|
#define __sun_h |
| 27 |
|
|
|
| 28 |
|
|
#if defined (__cplusplus) |
| 29 |
|
|
extern "C" { |
| 30 |
|
|
#endif |
| 31 |
|
|
|
| 32 |
|
|
|
| 33 |
|
|
/* error messages */ |
| 34 |
|
|
#define ERROR_NO_ZENITH -1 |
| 35 |
|
|
|
| 36 |
|
|
|
| 37 |
|
|
/* prototypes */ |
| 38 |
|
|
|
| 39 |
|
|
double eccentricity (int day); /* day of year */ |
| 40 |
|
|
|
| 41 |
|
|
double declination (int day); /* day of year */ |
| 42 |
|
|
|
| 43 |
|
|
int equation_of_time (int day); /* day of year */ |
| 44 |
|
|
|
| 45 |
|
|
int LAT (int time, /* standard time */ |
| 46 |
|
|
int day, /* day of year */ |
| 47 |
|
|
double longitude, /* longitude */ |
| 48 |
|
|
double long_std); /* standard longitude */ |
| 49 |
|
|
|
| 50 |
|
|
double hour_angle (int time); /* local apparent time */ |
| 51 |
|
|
|
| 52 |
|
|
double solar_zenith (int time, /* standard time */ |
| 53 |
|
|
int day, /* day of year */ |
| 54 |
|
|
double latitude, /* latitude */ |
| 55 |
|
|
double longitude, /* longitude */ |
| 56 |
|
|
double long_std); /* standard longitude */ |
| 57 |
|
|
|
| 58 |
|
|
double solar_azimuth (int time, /* standard time */ |
| 59 |
|
|
int day, /* day of year */ |
| 60 |
|
|
double latitude, /* latitude */ |
| 61 |
|
|
double longitude, /* longitude */ |
| 62 |
|
|
double long_std); /* standard longitude */ |
| 63 |
|
|
|
| 64 |
|
|
int zenith2time (int day, /* day of year */ |
| 65 |
|
|
double zenith_angle, /* zenith angle [deg] */ |
| 66 |
|
|
double latitude, /* latitude [deg] */ |
| 67 |
|
|
double longitude, /* longitude [deg] */ |
| 68 |
|
|
double long_std, /* standard longitude */ |
| 69 |
|
|
int *time1, /* first time */ |
| 70 |
|
|
int *time2); /* second time */ |
| 71 |
|
|
|
| 72 |
|
|
int day_of_year (int day, /* day of month (1..31) */ |
| 73 |
|
|
int month); /* month (1..12) */ |
| 74 |
|
|
|
| 75 |
|
|
char *time2str (char *timestr, /* buffer for timestr */ |
| 76 |
|
|
int hour, /* hour */ |
| 77 |
|
|
int min, /* minute */ |
| 78 |
|
|
int sec); /* second */ |
| 79 |
|
|
|
| 80 |
|
|
int Gregorian2Julian (int d, int m, int y, int *jd); |
| 81 |
|
|
int Julian2Gregorian (int *d, int *m, int *y, int jd); |
| 82 |
|
|
|
| 83 |
|
|
int location (char *locstr, double *a, double *o, double *s); |
| 84 |
|
|
|
| 85 |
|
|
#if defined (__cplusplus) |
| 86 |
|
|
} |
| 87 |
|
|
#endif |
| 88 |
|
|
|
| 89 |
|
|
|
| 90 |
|
|
#endif |
| 91 |
|
|
|
| 92 |
|
|
|
| 93 |
|
|
|
| 94 |
|
|
|
| 95 |
|
|
|
| 96 |
|
|
|
| 97 |
|
|
|