RAVE
|
KNMI's sun scanning functionality. More...
#include "scansun.h"
Functions | |
int | getDoubleAttribute (RaveCoreObject *obj, const char *aname, double *tmpd) |
Returns a double attribute value from any polar object type. | |
int | getDoubleArrayAttribute (PolarScan_t *scan, const char *aname, double **array, PolarScanParam_t *param) |
Returns a double attribute array from a polar scan object. | |
void | fill_toplevelmeta (RaveCoreObject *object, SCANMETA *meta) |
Reads metadata into the SCANMETA structure from top-level object, whether it be volume or scan, where required metadata are located in top-level 'how'. | |
void | fill_meta (PolarScan_t *scan, PolarScanParam_t *param, SCANMETA *meta) |
Reads metadata into the SCANMETA structure from volume, scan, param. | |
double | ElevHeig2Rang (double elev, float heig) |
This function calculates the height and range from the Radar corresponding to a point with a known elevation and on-ground distance from the Radar. | |
void | datetime (long date1, long time1, long ss, long *date2, long *time2) |
This function returns the date/time of (date1,time1) and 'ss' later. | |
double | refraction (double *elev) |
This function calculates the refraction correction of the solar position. | |
void | solar_elev_azim (double lon, double lat, long yyyymmdd, long hhmmss, double *elev, double *azim, double *relev) |
This function calculates the solar elevation and azimuth using the geographical position, date, and time. | |
void | readoutTiming (SCANMETA *meta, int ia, long *date, long *time, double *timer) |
Determines the exact observation times based on acquired readout times for each ray. | |
int | processData (PolarScan_t *scan, SCANMETA *meta, RaveList_t *list) |
Finds sun hits in reflectivity data. | |
void | outputMeta (SCANMETA *meta) |
Debug function that writes metadata to file. | |
int | processScan (PolarScan_t *scan, SCANMETA *meta, RaveList_t *list) |
Helper function that calls processReflectivity for each of a number of given parameters/quantities. | |
int | scansunFromObject (RaveCoreObject *object, Rave_ObjectType ot, RaveList_t *list, char **source) |
Masterminds the scanning of polar data and determination of sun hits, from object in memory. | |
int | scansun (const char *filename, RaveList_t *list, char **source) |
Masterminds the scanning of polar data and determination of sun hits. | |
KNMI's sun scanning functionality.
void datetime | ( | long | date1, |
long | time1, | ||
long | ss, | ||
long * | date2, | ||
long * | time2 ) |
This function returns the date/time of (date1,time1) and 'ss' later.
The date should be given in yyyymmhh format and the time in hhmmss format. The time lapse between the input and output date/time is given in seconds.
[in] | date1 | - long int of the input date |
[in] | time1 | - long int of the input time |
[in] | date2 | - long int of the output date |
[in] | time2 | - long int of the output time |
double ElevHeig2Rang | ( | double | elev, |
float | heig ) |
This function calculates the height and range from the Radar corresponding to a point with a known elevation and on-ground distance from the Radar.
The formulae used are exact. For details see lab book.
[in] | elev | - Elevation angle as a double |
[in] | heig | - Height (above the radar) in meters |
void fill_meta | ( | PolarScan_t * | scan, |
PolarScanParam_t * | dbzh, | ||
SCANMETA * | meta ) |
Reads metadata into the SCANMETA structure from volume, scan, param.
[in] | scan | - PolarScan_t object containing the sweep |
[in] | dbzh | - PolarScanParam_t object containing the sweep's parameter |
[in] | meta | - SCANMETA struct that will be filled with metadata |
void fill_toplevelmeta | ( | RaveCoreObject * | object, |
SCANMETA * | meta ) |
Reads metadata into the SCANMETA structure from top-level object, whether it be volume or scan, where required metadata are located in top-level 'how'.
[in] | object | - RaveCoreObject containing either volume or scan |
[in] | meta | - SCANMETA struct that will be filled with metadata |
int getDoubleArrayAttribute | ( | PolarScan_t * | scan, |
const char * | aname, | ||
double ** | array, | ||
PolarScanParam_t * | param ) |
Returns a double attribute array from a polar scan object.
[in] | obj | - a polar scan |
[in] | aname | - a string of the attribute to retrieve |
[in] | array | - the double array to retrieve |
[in] | param | - if attribute not found in scan, try this parameter. May be NULL and in that case, only scan will be checked. |
int getDoubleAttribute | ( | RaveCoreObject * | obj, |
const char * | aname, | ||
double * | tmpd ) |
Returns a double attribute value from any polar object type.
[in] | obj | - a polar volume, scan, or scan parameter |
[in] | aname | - a string of the attribute to retrieve |
[in] | tmpd | - the double value to retrieve |
void outputMeta | ( | SCANMETA * | meta | ) |
Debug function that writes metadata to file.
[in] | meta | - internal metadata structure |
int processData | ( | PolarScan_t * | scan, |
SCANMETA * | meta, | ||
RaveList_t * | list ) |
Finds sun hits in reflectivity data.
[in] | scan | - polar scan object |
[in] | meta | - internal metadata structure |
[in] | list | - RAVE list object containing hits |
int processScan | ( | PolarScan_t * | scan, |
SCANMETA * | meta, | ||
RaveList_t * | list ) |
Helper function that calls processReflectivity for each of a number of given parameters/quantities.
Called internally by scansun.
[in] | scan | - polar scan object |
[in] | meta | - internal metadata structure |
[in] | list | - RAVE list object containing hits |
void readoutTiming | ( | SCANMETA * | meta, |
int | ia, | ||
long * | date, | ||
long * | time, | ||
double * | timer ) |
Determines the exact observation times based on acquired readout times for each ray.
[in] | meta | - internal metadata structure |
[in] | the | index of the ray (azimuth), as an int |
[in] | date | in the form YYYYMMDD as a long |
[in] | time | in the form HHMMSS as a long |
[in] | sub-second | time (r="remainder") as a double |
double refraction | ( | double * | elev | ) |
This function calculates the refraction correction of the solar position.
The function uses the true elevation, i.e., the calculated elevation of the sun in degrees. Formulas derived from the Equivalent Earth Model are used to calculated the refraction in degrees. (Holleman & Huuskonen, 2013, Rad. Sci.)
int scansun | ( | const char * | filename, |
RaveList_t * | list, | ||
char ** | source ) |
Masterminds the scanning of polar data and determination of sun hits.
[in] | filename | - string containing the name (and path if somewhere else) of the file to process |
[out] | list | - RaveList_t object for holding one or more sets of return values |
[out] | source | - string containing the value of /what/source |
int scansunFromObject | ( | RaveCoreObject * | object, |
Rave_ObjectType | ot, | ||
RaveList_t * | list, | ||
char ** | source ) |
Masterminds the scanning of polar data and determination of sun hits, from object in memory.
[in] | object | - Polar scan or volume object in memory |
[in] | ot | - Object type identifier enum, preferably Rave_ObjectType_SCAN or Rave_ObjectType_PVOL |
[out] | list | - RaveList_t object for holding one or more sets of return values |
[out] | source | - string containing the value of /what/source |
void solar_elev_azim | ( | double | lon, |
double | lat, | ||
long | yyyymmdd, | ||
long | hhmmss, | ||
double * | elev, | ||
double * | azim, | ||
double * | relev ) |
This function calculates the solar elevation and azimuth using the geographical position, date, and time.
The equations and constants are taken from the WMO guide on Meteorological Instruments and Methods of Observations (CIMO, WMO no. 8), annex 7.D. The equations have been slightly modified and extended to include the calculation of both the sine and cosine of the azimuth. Modified slightly further to include the refracted (perceived) elevation angle.
[in] | lon | - double containing the longitude position |
[in] | lat | - double containing the latitude position |
[in] | yyyymmdd | - year-month-day as a long |
[in] | hhmmss | - hour-minute-second as a long |
[out] | elev | - elevation angle above the horizon in degrees, as a pointer to a double |
[out] | azim | - azimuth angle clockwise from true north, as a pointer to a double |
[out] | relev | - refracted elevation angle, based on elev, as a pointer to a double |