inlined some functions and avoid repeated conversion factor calculation when using period_asfreq_arr in period.c