Opens a TMY2 file for reading and reads in the header data. More...
Functions | |
double | tmy2_reader::calc_solar (COMPASS_PTS cpt, short doy, double lat, double sol_time, double dnr, double dhr, double ghr, double gnd_ref, double vert_angle) |
obtain records | |
void | tmy2_reader::close () |
Closes the readers internal file pointer. | |
int | tmy2_reader::header_info (char *city, char *state, int *degrees, int *minutes, int *long_deg, int *long_min) |
Populate the given arguments with data from the tmy2 file header. | |
int | tmy2_reader::next () |
Store the current line in a buffer for later reading by read_data. | |
int | tmy2_reader::open (const char *file) |
Open the file for reading. | |
int | tmy2_reader::read_data (double *dnr, double *dhr, double *ghr, double *tdb, double *rh, int *month, int *day, int *hour, double *wind=0, double *winddir=0, double *precip=0, double *snowDepth=0, double *pressure=0, double *extra_terr_dni=0, double *extra_terr_ghi=0, double *tot_sky_cov=0, double *opq_sky_cov=0) |
Populate the given arguments with data from the buffer. |
Opens a TMY2 file for reading and reads in the header data.
Some of the data in the header is used in solar radiation calculations, so this data needs to be held in memory for future use. This also sets the file pointer used for later reads.
http://rredc.nrel.gov/solar/pubs/tmy2/tab3-2.html
double tmy2_reader::calc_solar | ( | COMPASS_PTS | cpt, | |
short | doy, | |||
double | lat, | |||
double | sol_time, | |||
double | dnr, | |||
double | dhr, | |||
double | ghr, | |||
double | gnd_ref, | |||
double | vert_angle = 90 | |||
) | [inherited] |
obtain records
Calculate the solar radation for a surface facing the given compass point.
cpt | compass point of the direction the surface is facing | |
doy | day of year | |
lat | latitude of the surface | |
sol_time | the solar time of day | |
dnr | Direct Normal Radiation | |
dhr | Diffuse Horizontal Radiation | |
ghr | Global Horizontal Radiation | |
gnd_ref | Ground Reflectivity | |
vert_angle | the angle of the surface relative to the horizon (Default is 90 degrees) |
Definition at line 495 of file climate.cpp.
int tmy2_reader::header_info | ( | char * | city, | |
char * | state, | |||
int * | degrees, | |||
int * | minutes, | |||
int * | long_deg, | |||
int * | long_min | |||
) | [inherited] |
Populate the given arguments with data from the tmy2 file header.
Passes the header data by reference out to the calling function.
city | ||
state | ||
degrees | latitude degrees | |
minutes | latitude minutes | |
long_deg | longitude degrees | |
long_min | longitude minutes | |
city | the city the data represents | |
state | the state the city is located in | |
degrees | latitude degrees | |
minutes | latitude minutes | |
long_deg | longitude degrees | |
long_min | longitude minutes |
Definition at line 370 of file climate.cpp.
int tmy2_reader::next | ( | ) | [inherited] |
Store the current line in a buffer for later reading by read_data.
Reads the next line in and stores it in a character buffer.
Definition at line 349 of file climate.cpp.
int tmy2_reader::open | ( | const char * | file | ) | [inherited] |
Open the file for reading.
This will read in the header information and position the file reader at the first data line in the file.
This call will throw an exception if the file fails to open
file | the name of the TMY2 file to open |
Definition at line 254 of file climate.cpp.
int tmy2_reader::read_data | ( | double * | dnr, | |
double * | dhr, | |||
double * | ghr, | |||
double * | tdb, | |||
double * | rh, | |||
int * | month, | |||
int * | day, | |||
int * | hour, | |||
double * | wind = 0 , |
|||
double * | winddir = 0 , |
|||
double * | precip = 0 , |
|||
double * | snowDepth = 0 , |
|||
double * | pressure = 0 , |
|||
double * | extra_terr_dni = 0 , |
|||
double * | extra_terr_ghi = 0 , |
|||
double * | tot_sky_cov = 0 , |
|||
double * | opq_sky_cov = 0 | |||
) | [inherited] |
Populate the given arguments with data from the buffer.
Parses the data stored in the internal buffer.
dnr | - Direct Normal Radiation | |
dhr | - Diffuse Horizontal Radiation | |
rh | Relative Humidity | |
tdb | - Dry Bulb Temperature | |
month | - Month of the observation | |
day | - Day of the observation | |
hour | - hour of the observation | |
wind | Wind speed (optional) | |
pressure | - atmospheric pressure | |
extra_terr_dni | - Extra terrestrial direct normal irradiance (top of atmosphere) | |
dnr | Direct Normal Radiation | |
dhr | Diffuse Horizontal Radiation | |
tdb | Bulb temperature | |
rh | Relative Humidity | |
month | month of year | |
day | day of month | |
hour | hour of day |
Definition at line 393 of file climate.cpp.