PLplot
5.10.0
|
00001 #ifndef _QSASTIME_EXTRA_H_ 00002 #define _QSASTIME_EXTRA_H_ 00003 // 00004 // This software originally contributed under the LGPL in January 2009 to 00005 // PLplot by the 00006 // Cluster Science Centre 00007 // QSAS team, 00008 // Imperial College, London 00009 // Copyright (C) 2009 Imperial College, London 00010 // 00011 // This file is part of PLplot. 00012 // 00013 // PLplot is free software; you can redistribute it and/or modify 00014 // it under the terms of the GNU Library General Public License as published 00015 // by the Free Software Foundation; either version 2 of the License, or 00016 // (at your option) any later version. 00017 // 00018 // PLplot is distributed in the hope that it will be useful, 00019 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 // GNU Library General Public License for more details. 00022 // 00023 // You should have received a copy of the GNU Library General Public License 00024 // along with PLplot; if not, write to the Free Software 00025 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00026 // 00027 // 00028 00029 // MJD measures from the start of 17 Nov 1858 00030 00031 // These utilities use the Gregorian calendar after 4 Oct 1582 (Julian) i.e. from 15 Oct 1582 Gregorian 00032 // Note C libraries use Gregorian only from 14 Sept 1752 00033 // More detailed discussion can be found at http://aa.usno.navy.mil/data/docs/JulianDate.php 00034 // These routines have been compared with the results of the US Naval Observatory online converter. 00035 // Modified Julian Date (MJD) = Julian Date (JD) - 2400000.5 00036 // 00037 // In all routines, specifying a day, hour, minute or second field greater than would be valid is 00038 // handled with modulo arithmetic and safe. 00039 // Thus 2006-12-32 00:62:00.0 will safely, and correctly, be treated as 2007-01-01 01:02:00.0 00040 // 00041 // 00042 00043 #include <stdio.h> 00044 #include <stdlib.h> 00045 #include <string.h> 00046 // include header file for dll definitions 00047 #include "qsastimeP.h" 00048 00049 QSASTIMEDLLIMPEXP void setFromDOY( int year, int doy, int hour, int min, double sec, MJDtime *MJD, int forceJulian ); 00050 QSASTIMEDLLIMPEXP void setFromBCE( int yearBCE, int month, int day, int hour, int min, double sec, MJDtime *MJD, int forceJulian ); 00051 QSASTIMEDLLIMPEXP void setFromMJD( double ModifiedJulianDate, MJDtime *MJD ); 00052 QSASTIMEDLLIMPEXP void setFromCDFepoch( double cdfepoch, MJDtime *MJD ); 00053 QSASTIMEDLLIMPEXP void setFromJD( double JulianDate, MJDtime *MJD ); 00054 QSASTIMEDLLIMPEXP int setFromISOstring( const char* ISOstring, MJDtime *MJD, int forceJulian ); 00055 QSASTIMEDLLIMPEXP double getMJD( MJDtime *MJD ); 00056 QSASTIMEDLLIMPEXP double getJD( MJDtime *MJD ); 00057 QSASTIMEDLLIMPEXP double getDiffDays( MJDtime *MJD1, MJDtime *MJD2 ); 00058 QSASTIMEDLLIMPEXP double getDiffSecs( MJDtime *MJD1, MJDtime *MJD2 ); 00059 QSASTIMEDLLIMPEXP double getCDFepoch( MJDtime *MJD ); 00060 QSASTIMEDLLIMPEXP const char * getISOString( MJDtime *MJD, int delim, int forceJulian ); 00061 //** Warning getISOString is not thread safe ** 00062 00063 #endif