PLplot  5.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
qsastime_extra.h
Go to the documentation of this file.
1 #ifndef _QSASTIME_EXTRA_H_
2 #define _QSASTIME_EXTRA_H_
3 //
4 // This software originally contributed under the LGPL in January 2009 to
5 // PLplot by the
6 // Cluster Science Centre
7 // QSAS team,
8 // Imperial College, London
9 // Copyright (C) 2009 Imperial College, London
10 //
11 // This file is part of PLplot.
12 //
13 // PLplot is free software; you can redistribute it and/or modify
14 // it under the terms of the GNU Library General Public License as published
15 // by the Free Software Foundation; either version 2 of the License, or
16 // (at your option) any later version.
17 //
18 // PLplot is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU Library General Public License for more details.
22 //
23 // You should have received a copy of the GNU Library General Public License
24 // along with PLplot; if not, write to the Free Software
25 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 //
27 //
28 
29 // MJD measures from the start of 17 Nov 1858
30 
31 // These utilities use the Gregorian calendar after 4 Oct 1582 (Julian) i.e. from 15 Oct 1582 Gregorian
32 // Note C libraries use Gregorian only from 14 Sept 1752
33 // More detailed discussion can be found at http://aa.usno.navy.mil/data/docs/JulianDate.php
34 // These routines have been compared with the results of the US Naval Observatory online converter.
35 // Modified Julian Date (MJD) = Julian Date (JD) - 2400000.5
36 //
37 // In all routines, specifying a day, hour, minute or second field greater than would be valid is
38 // handled with modulo arithmetic and safe.
39 // Thus 2006-12-32 00:62:00.0 will safely, and correctly, be treated as 2007-01-01 01:02:00.0
40 //
41 //
42 
43 #include <stdio.h>
44 #include <stdlib.h>
45 #include <string.h>
46 // include header file for dll definitions
47 #include "qsastimeP.h"
48 
49 QSASTIMEDLLIMPEXP void setFromDOY( int year, int doy, int hour, int min, double sec, MJDtime *MJD, int forceJulian );
50 QSASTIMEDLLIMPEXP void setFromBCE( int yearBCE, int month, int day, int hour, int min, double sec, MJDtime *MJD, int forceJulian );
51 QSASTIMEDLLIMPEXP void setFromMJD( double ModifiedJulianDate, MJDtime *MJD );
52 QSASTIMEDLLIMPEXP void setFromCDFepoch( double cdfepoch, MJDtime *MJD );
53 QSASTIMEDLLIMPEXP void setFromJD( double JulianDate, MJDtime *MJD );
54 QSASTIMEDLLIMPEXP int setFromISOstring( const char* ISOstring, MJDtime *MJD, int forceJulian );
55 QSASTIMEDLLIMPEXP double getMJD( MJDtime *MJD );
56 QSASTIMEDLLIMPEXP double getJD( MJDtime *MJD );
57 QSASTIMEDLLIMPEXP double getDiffDays( MJDtime *MJD1, MJDtime *MJD2 );
58 QSASTIMEDLLIMPEXP double getDiffSecs( MJDtime *MJD1, MJDtime *MJD2 );
60 QSASTIMEDLLIMPEXP const char * getISOString( MJDtime *MJD, int delim, int forceJulian );
61 //** Warning getISOString is not thread safe **
62 
63 #endif