xml/XsilStd.hh

00001 #ifndef _LIGO_XSILSTD_H
00002 #define _LIGO_XSILSTD_H
00003 /*----------------------------------------------------------------------*/
00004 /*                                                                      */
00005 /* Module Name: xsilStd                                                 */
00006 /*                                                                      */
00007 /* Module Description: Utility classes for LIGO-LW input/output.        */
00008 /*                                                                      */
00009 /* Revision History:                                                    */
00010 /* Rel   Date     Programmer    Comments                                */
00011 /* 0.1   10Jun00  D. Sigg       First release                           */
00012 /*                                                                      */
00013 /* Documentation References:                                            */
00014 /*      Man Pages: xsilStd.html                                         */
00015 /*      References: none                                                */
00016 /*                                                                      */
00017 /* Author Information:                                                  */
00018 /* Name          Telephone       Fax             e-mail                 */
00019 /* Daniel Sigg   (509) 372-8132  (509) 372-8137  sigg_d@ligo.mit.edu    */
00020 /*                                                                      */
00021 /*                                                                      */
00022 /*                      -------------------                             */
00023 /*                                                                      */
00024 /*                             LIGO                                     */
00025 /*                                                                      */
00026 /*        THE LASER INTERFEROMETER GRAVITATIONAL WAVE OBSERVATORY.      */
00027 /*                                                                      */
00028 /*                     (C) The LIGO Project, 1999.                      */
00029 /*                                                                      */
00030 /*                                                                      */
00031 /* Caltech                              MIT                             */
00032 /* LIGO Project MS 51-33                LIGO Project NW-17 161          */
00033 /* Pasadena CA 91125                    Cambridge MA 01239              */
00034 /*                                                                      */
00035 /* LIGO Hanford Observatory             LIGO Livingston Observatory     */
00036 /* P.O. Box 1970 S9-02                  19100 LIGO Lane Rd.             */
00037 /* Richland WA 99352                    Livingston, LA 70754            */
00038 /*                                                                      */
00039 /*----------------------------------------------------------------------*/
00040 
00041 #include "xml/Xsil.hh"
00042 
00043    class BasicDataDescriptor;
00044 
00045 namespace xml {
00046 
00047 
00056    class xsilStd {
00057    public:
00059       enum DataType {
00061       kTimeSeries = 0,
00063       kSpectrum = 1,
00065       kTransferFunction = 2,
00067       kCoefficients = 3,
00069       kHistogram = 4
00070       };
00071    
00073       class datainfo {
00074       public:
00076          typedef std::vector<std::string> chnlist;
00078          DataType       fType;
00080          int            fSubtype;
00082          chnlist        fAChn;
00084          chnlist        fBChn;
00086          int            fN;
00088          int            fM;
00090          unsigned long  fSec;
00092          unsigned long  fNSec;
00094          double         fDt;
00096          double         fF0;
00098          double         fDf;
00100          double         fBW;
00102          int            fAverages;
00104          int            fMeasurementNumber;
00106          datainfo () {
00107             init(); }
00109          void init ();
00110       };
00111    
00121       static bool GetDataType (const char* graphtype, DataType& type,
00122                         int& subtype);
00130       static bool GetGraphType (DataType type,
00131                         int subtype, std::string& graphtype);
00132    
00138       static std::string Typename (DataType type);
00144       static DataType Typeid (const char* type);
00145    
00152       static int DataSubtypeXY (DataType type, int subtype);
00153    
00162       static bool analyzeName (const std::string& name,
00163                         std::string& n, int& index1, int& index2);
00164    
00172       static std::string makeName (const std::string& Name, 
00173                         int index1 = -1, int index2 = -1);
00174    
00182       static bool GetDataInfo (const char* xml, datainfo& info);
00183    
00195       static bool GetDataInfo (const BasicDataDescriptor* desc,
00196                         int& dim1, int& dim2, bool& complex,
00197                         bool& XYdata);
00198    
00217       static bool GetDataInfo (const BasicDataDescriptor* desc,
00218                         int& dim1, int& dim2, bool& complex, bool& XYdata, 
00219                         const float** dataptr, bool& cpy, 
00220                         bool compress = false, bool forceXY = false);
00221    
00240       static bool GetDataInfo (const BasicDataDescriptor* desc,
00241                         int& dim1, int& dim2, bool& complex, bool& XYdata, 
00242                         const double** dataptr, bool& cpy, 
00243                         bool compress = false, bool forceXY = false);
00244    };
00245 
00246 
00247 }
00248 
00249 #endif // _LIGO_XSILSTD_H

Generated on Sun Mar 8 19:20:53 2009 for dmt by  doxygen 1.5.4