00001 /*************************************************************************** 00002 * Copyright (C) 2007 by Aleksander Morgado Juez * 00003 * scitime@aleksander_morgado.mm.st * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU Library General Public License as * 00007 * published by the Free Software Foundation; either version 2 of the * 00008 * License, or (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU Library General Public * 00016 * License along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 00021 #include <stdio.h> 00022 #include "scitime.h" 00023 00033 int main(int argc, char** argv) 00034 { 00035 sct_time start; 00036 sct_time stop; 00037 sct_time walker; 00038 long deltasecs; 00039 00040 //Set start epoch... 00041 sct_set_mjd2000(&start, 200.0); 00042 //Set end epoch... 00043 sct_set_mjd2000(&stop, 202.0); 00044 //Set wanted delta... 00045 deltasecs = 600L; //10 minutes 00046 00047 //Initialise epoch walker... 00048 sct_copy(&walker,&start); 00049 00050 //Start while loop. Epochs which are close to each other within a 1 sec 00051 // interval will be considered equal. 00052 while(sct_compare(&walker, &stop, 1.0) <= 0) 00053 { 00054 //Dump element content to output... 00055 sct_print(&walker); 00056 00057 //Update walker... 00058 sct_add_deltaDSF(&walker, &walker, 0L, deltasecs, 0L); 00059 } 00060 00061 return 0; 00062 } 00063