Commit c4a23f1c authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

grbDefTime: bug fix for ival

parent 9ea3e3d9
......@@ -1730,12 +1730,17 @@ void grbDefTime(int *isec1, int date, int time, int numavg, int timeID)
decode_date(date, &year, &month, &day);
decode_time(time, &hour, &minute);
printf("date time %d %d %g\n", date, time, value);
printf("date time %d %d\n", date, time);
printf("year %d, month %d, day %d, hour %d, minute %d\n", year, month, day, hour, minute);
encode_juldaysec(year, month, day, hour, minute, &julday2, &secofday2);
(void) julday_sub(julday1, secofday1, julday2, secofday2, &days, &secs);
/* ival = (int) ((days*86400.0 + secs)/factor); */
if ( (int) fmod(days*86400.0 + secs, factor) )
ival = -1;
ival = (int) ((days*86400.0 + secs)/factor);
if ( ival < 0 || ival > 255 ) timetype = TAXIS_ABSOLUTE;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment