examples/sct_example2.c

Go to the documentation of this file.
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 
00022 #include <stdio.h>
00023 #include "scitime.h"
00024 
00034 int main(int argc, char** argv)
00035 {
00036     sct_time start;
00037     sct_time stop;
00038     sct_time walker;
00039     long deltasecs;
00040     double totalDeltaSecs;
00041     sct_time deltaElement;
00042 
00043     //Set start epoch...
00044     sct_set_mjd2000(&start, 200.0);
00045     //Set end epoch...
00046     sct_set_mjd2000(&stop,  202.0);
00047 
00048     //Initialise epoch walker...
00049     sct_copy(&walker,&start);
00050 
00051     //Get total number of seconds between stop and start
00052     sct_diff(&deltaElement,&stop,&start);
00053     sct_get_delta_secs(&deltaElement,&totalDeltaSecs);
00054 
00055     for(deltasecs = 0; deltasecs < totalDeltaSecs; deltasecs+=600L)
00056     {
00057         //Dump element content to output...
00058         sct_print(&walker);
00059 
00060         //Update walker...
00061         sct_add_deltaDSF(&walker, &start, 0L, deltasecs, 0L);
00062     }
00063 
00064     return 0;
00065 }

Generated on Sun May 20 15:32:42 2007 for scitime by  doxygen 1.5.1