diff --git a/GEOSldas_App/util/inputs/mwRTM_params/Preprocess_L2DCA_mwRTM_params_to_dailymat.m b/GEOSldas_App/util/inputs/mwRTM_params/Preprocess_L2DCA_mwRTM_params_to_dailymat.m index 061229b..45c39c3 100644 --- a/GEOSldas_App/util/inputs/mwRTM_params/Preprocess_L2DCA_mwRTM_params_to_dailymat.m +++ b/GEOSldas_App/util/inputs/mwRTM_params/Preprocess_L2DCA_mwRTM_params_to_dailymat.m @@ -189,7 +189,7 @@ % round date_time to nearest 3 hourly UTC utc_t2k = round(double(L2_utc_seconds)/L2_dtstep)*L2_dtstep; - [yr, doy, mm, dd, hr, mn] = J2000_to_DateTime( utc_t2k ); + [yr, mm, dd, hr, mn, ss, doy, pen] = J2000_to_DateTime( utc_t2k ); % use points for current UTC day only idx = find(yr == date_time.year & mm == date_time.month & ... diff --git a/GEOSldas_App/util/shared/matlab/J2000_to_DateTime.m b/GEOSldas_App/util/shared/matlab/J2000_to_DateTime.m index d2e52d2..48f1319 100644 --- a/GEOSldas_App/util/shared/matlab/J2000_to_DateTime.m +++ b/GEOSldas_App/util/shared/matlab/J2000_to_DateTime.m @@ -28,11 +28,12 @@ % Loop through elements of J2000_seconds for now. In future, should vectorize % augment_date_time.m, is_leap_year.m, days_in_month.m, get_dofyr_pentad.m +date_time_base = augment_date_time( round(J2000_seconds(1)), date_time_epoch ); + for ii = 1:N % add (rounded) J2000_seconds to date_time_epoch - - date_time = augment_date_time( round(J2000_seconds), date_time_epoch ); + date_time = augment_date_time( round(J2000_seconds(ii)-J2000_seconds(1)), date_time_base ); yr( ii) = date_time.year ; mm( ii) = date_time.month ;