cta_metainfo.h

Go to the documentation of this file.
00001 /*
00002 COSTA: Problem solving environment for data assimilation
00003 Copyright (C) 2005  Nils van Velzen
00004 
00005 This library is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU Lesser General Public
00007 License as published by the Free Software Foundation; either
00008 version 2.1 of the License, or (at your option) any later version.
00009 
00010 This library 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 GNU
00013 Lesser General Public License for more details.
00014 
00015 You should have received a copy of the GNU Lesser General Public
00016 License along with this library; if not, write to the Free Software
00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 /**
00021 \file  cta_obsdescr.h
00022 \brief Interface description of the COSTA default observation descriptor component. For user implementation see cta_usr_obs_descr.h.
00023 
00024 CTA_ObsDescr is used for describing observations.
00025 */
00026 
00027 #ifndef CTA_METAINFO_H
00028 #define CTA_METAINFO_H
00029 #include "cta_system.h"
00030 #include "cta_handles.h"
00031 #include "cta_datatypes.h"
00032 #include "cta_functions.h"
00033 #include "cta_string.h"
00034 #include "cta_vector.h"
00035 #include "cta_matrix.h"
00036 
00037 /* Function Handle */
00038 typedef CTA_Handle CTA_Grid;
00039 typedef CTA_Handle CTA_Metainfo;
00040 typedef CTA_Handle CTA_MetainfoClass;
00041 
00042 #include "cta_sobs.h"
00043 
00044 /* parameters for different functions */
00045 #define CTA_METAINFO_CREATE_SIZE         ( 1)
00046 #define CTA_METAINFO_CREATE_INIT         ( 2)
00047 #define CTA_METAINFO_FREE                ( 3)
00048 #define CTA_METAINFO_GET_REST            ( 4)
00049 #define CTA_METAINFO_GET_KEYS            ( 5)
00050 #define CTA_METAINFO_COUNT_OBSERVATIONS  ( 6)
00051 #define CTA_METAINFO_COUNT_PROPERTIES    ( 7)
00052 #define CTA_METAINFO_EXPORT              ( 8)
00053 #define CTA_METAINFO_NUMFUNC             ( 9)
00054 
00055 
00056 
00057 
00058 typedef struct {
00059 char name[CTA_STRLEN_TAG];
00060   int type;
00061   int nx, ny, nz,nsize;
00062 double x_origin, y_origin, z_origin;
00063 double dx,dy,dz;
00064    char refdimp[10][80];              // possible reference to  tree node where coordinates are
00065 } CTAI_Gridm;
00066 
00067 /* EXPLANATION TYPE OF GRID:
00068 -99: undefined
00069 -3: 3D regular grid, only by reference 
00070 -2: 2D regular grid, only by reference 
00071 -1: 1D regular grid, only by reference 
00072 1: 1D regular grid
00073 2: 2D regular grid
00074 3: 3D regular grid
00075 10: curve (?)
00076 */
00077 
00078 #ifdef __cplusplus
00079 extern "C" {
00080 #endif
00081 
00082 
00083 
00084 /** \brief Create a new class (=implementation) of a COSTA observation description component.
00085  *
00086  * \param name       I  name of the new observation description class
00087  * \param h_func     I  COSTA function handles for functions that implement class,
00088  *                      missing functions must have value CTA_NULL
00089  * \param hobsdscrcl O  receives handle of new observation description class
00090  * \return error status: CTA_OK if successful
00091  */
00092 CTAEXPORT int CTA_Metainfo_DefineClass(const char *name,
00093    const CTA_Func h_func[CTA_METAINFO_NUMFUNC],
00094    CTA_MetainfoClass *hobsdscrcl);
00095 
00096 /** \brief Create a new observation description instance.
00097  *
00098  * \param hsobscl   I  class of new observation description
00099  * \param usrdat    IO data of the stochastic observer for which
00100                        a descriptor is to be created
00101  * \param hobsdscr  O  receives handle of created observation description object
00102  * \return error status: CTA_OK if successful
00103  */
00104  CTAEXPORT int CTA_Metainfo_Create( CTA_Metainfo *hobsdscr);
00105 // int CTA_Metainfo_Create( CTA_MetainfoClass hsobscl,
00106 //                          CTA_Handle usrdat, CTA_Metainfo *hobsdscr);
00107 
00108 ///** \brief Check whether given stochastic observer corresponds to this observation description
00109 // *
00110 // * \param hobsdscr  I  handle of observation description
00111 // * \param hsobs     I  handle of stochastic observer
00112 // * \return error status: CTA_OK if successful
00113 // */
00114 //int CTA_Metainfo_Check_SObs( CTA_Metainfo hobsdscr, CTA_StochObs hsobs);
00115 
00116 /** \brief Get properties/values that correspond to a given key.
00117  *
00118  * \param hobsdscr   I  handle of observation description
00119  * \param Key        I  key for which the value is asked
00120  * \param Properties IO COSTA-vector that is to receive the values
00121  * \param datatype   I  data type of elements in properties vector, must be the same as of queried properties
00122  * \return error status: CTA_OK if successful
00123  */
00124 CTAEXPORT int CTA_Metainfo_SetUnit( CTA_Metainfo hobsdscr,  char* Key); 
00125 
00126 /** \brief Get all keys names.
00127  *
00128  * \param hobsdscr   I  handle of observation description
00129  * \param Keys       O  receives all keys (COSTA-string vector); must exist before calling and be large enough
00130  * \return error status: CTA_OK if successful
00131  */
00132 
00133 
00134 /** \brief set tag of metainfo
00135 
00136 */
00137 CTAEXPORT int CTA_Metainfo_SetTag(CTA_Metainfo hobsdescr,  char* tagname);
00138 
00139 
00140 CTAEXPORT int CTA_Metainfo_Free(
00141    CTA_Metainfo *hobsdscr  /* Handle of observation description */
00142    );
00143 
00144 
00145 CTAEXPORT int CTA_Metainfo_SetRest(CTA_Metainfo hobsdescr, int *rest);
00146 
00147 CTAEXPORT int CTA_Metainfo_SetGrid(CTA_Metainfo hobsdescr, CTAI_Gridm *hgrid);
00148 
00149 CTAEXPORT int CTA_Metainfo_GetGrid(CTA_Metainfo hobsdescr, CTAI_Gridm *hgrid);
00150 
00151 CTAEXPORT int CTA_Metainfo_Copy(CTA_Metainfo hmeta_x, CTA_Metainfo hmeta_y);
00152 
00153 CTAEXPORT int CTA_Metainfo_GetRest(CTA_Metainfo hobsdescr, int *rest);
00154 
00155 CTAEXPORT int CTA_Metainfo_GetTag(CTA_Metainfo hobsdescr,  char *tagname);
00156 
00157 CTAEXPORT int CTA_Metainfo_SetBelongsTo(CTA_Metainfo hobsdescr,  char* tagname);
00158 
00159 CTAEXPORT int CTA_Metainfo_GetBelongsTo(CTA_Metainfo hobsdescr,  char *tagname);
00160 
00161 CTAEXPORT int CTAI_Grid_Interpolate(CTAI_Gridm gridy, CTAI_Gridm gridx, CTA_Vector vecx, CTA_Vector vecx_to_y);
00162 
00163 CTAEXPORT int CTA_Metainfo_Export(CTA_Metainfo minfo, CTA_Handle usrdata);
00164 
00165 CTAEXPORT int CTA_Metainfo_GetUnit(CTA_Metainfo hobsdescr,  char *nameofunit);
00166 
00167 /* tijdelijk */
00168 int CTA_Metainfo_setRegGrid(CTA_Metainfo hdescr, char *name, 
00169                             int nx, int ny, int nz,
00170                             double x_origin, double y_origin,
00171                             double z_origin,
00172                             double dx, double dy, double dz);
00173 
00174 int CTA_Metainfo_getRegGrid(CTA_Metainfo hdescr, char *name, 
00175                             int *nx, int *ny, int *nz,
00176                             double *x_origin, double *y_origin,
00177                             double *z_origin,
00178                             double *dx, double *dy, double *dz);
00179 
00180 #ifdef __cplusplus
00181 }
00182 #endif
00183 
00184 
00185 #endif

Generated on Mon Apr 6 14:05:58 2009 for COSTA by  doxygen 1.5.2