CDF_EPOCH_COMPARE ----------------- The CDF_EPOCH_COMPARE function compares a source epoch, either a scalar or an array of epoch values (date and time), against a base epoch, also a scalar or an array of values. The epoch can be one of the CDF formats, CDF_EPOCH, CDF_EPOCH16 and CDF_TIME_TT2000. While data of type CDF_EPOCH and CDF_EPOCH16 can be compared with each other, data in CDF_TIME_TT2000 can only be compared with the data of same type. If the base epoch is a scalar, it is used to compare with all values in the first epoch. If the base epoch is an array, same element in the source and base epoch array is compared. If a third argument, endepoch, is provided, the baseepoch and endepoch are used as the starting and ending epoch that the source epoch will be checked against. Calling the function with two arguments: It returns a scalar value or an array values of integer of 1, 0, or -1, depending on the source epoch. If the value of the first epoch is greater (later date and time) than the base epoch, 1 is set. If the value of the first epoch is the same as the base epoch, 0 is set. If the value of the first epoch is less (earlier date and time) than the base epoch, -1 is set. Returns: A scalar or array of integers of 1 : if epoch1 > baseepoch 0 : if epoch1 = baseepoch -1 : if epoch1 < baseepoch Calling the function with three arguments: It returns a scalar value or an array values of integer of 1 or 0. If the value of the source epoch falls within the starting and ending epoch 1 is set. Otherwise, 0 is set. Returns: A scalar or array of integers of 1 : if baseepoch <= epoch1 <= endepoch 0 : otherwise Syntax Result = CDF_EPOCH_COMPARE(epoch, baseepoch [,endepoch]) Arguments epoch A single or an array of epoch value(s) returned from call to CDF_EPOCH,/compute, CDF_EPOCH16,/compute for CDF_EPOCH or CDF_EPOCH16 data type, or CDF_TT2000,/compute for CDF_TIME_TT2000 data type, CDF_VARGET, or CDF_VARGET1. baseepoch A single or an array of epoch value(s) returned from call to CDF_EPOCH,/compute, CDF_EPOCH16,/compute for CDF_EPOCH or CDF_EPOCH16 data type, or CDF_TT2000,/compute for CDF_TIME_TT2000 data type, CDF_VARGET, or CDF_VARGET1. endepoch A single or an array of epoch value(s) returned from call to CDF_EPOCH,/compute, CDF_EPOCH16,/compute for CDF_EPOCH or CDF_EPOCH16 data type, or CDF_TT2000,/compute for CDF_TIME_TT2000 data type, CDF_VARGET, or CDF_VARGET1. This field has to be of the same data type and dimensionality as baseepoch. Keywords None Examples ; For CDF_EPOCH data type cdf_varget, id, "Epoch", ep, rec_count=1000,/zvariable cdf_epoch, base, 2005,6,1,10,18,17,2,/compute ret= cdf_epoch_compare(ep,base) help, ret ; For CDF_TIME_TT2000 data type cdf_varget, id2, "Epoch", ep2, rec_count=1000,/zvariable cdf_tt2000, base2, 2005,6,1,10,18,17,2,3,4,/compute ret2= cdf_epoch_compare(ep2,base2) help, ret2 ; For CDF_EPOCH data type cdf_varget, id3, "Epoch", ep3, rec_count=1000,/zvariable cdf_epoch, starting, 2005,6,1,10,18,17,2,/compute cdf_epoch, ending, 2005,6,10,10,18,17,2,/compute ret3= cdf_epoch_compare(ep3,starting,ending) help, ret3 Version History Introduced: CDF V3.4.0