www.archive-org-2014.com » ORG » O » OPENDAP

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".

    Archived pages: 580 . Archive date: 2014-01.

  • Title: DODS Programmers Guide -- 1.2.4 Compound Types: Structure, Sequence, Function, Grid
    Descriptive info: Go backward to.. 1.. 2.. 3 Vector Types: Array, List.. Go up to.. 2 The Type Hierarchy.. Go forward to.. 2 Managing Connections.. 4 Compound Types: Structure, Sequence, Function, Grid.. The compound data types are used to build new types as aggregates of other types, including other compound types.. (Note that.. List.. and.. Array.. are compound types, as well, but contain only a single type of data.. ).. Structure.. ,.. Sequence.. Function.. all contain a list of.. BaseType.. objects.. However, they have different semantics; a Structure is a simple aggregate; nothing other than aggregation is implied, while Sequence and Function define templates for relational objects.. A Grid combines several.. objects so that nonlinear values may be applied to the indices of an array.. A Structure is an ordered collection of variables that conveys no relational information other than grouping.. The variables that are members of a Structure may be of different types.. In addition to the (possible) benefit of added organization, Structure may be used to supply information to the system that may be useful in optimizing the access or translation operations.. A.. is similar to a.. in that it consists of an ordered collection of variables which may be of different types.. However,  ...   of its variables it has an implied.. state.. ,.. or position in the sequence, in addition to the instance data values.. Table of relational data.. Name.. Age.. Weight.. James.. 32.. 165.. Charlie.. 7.. 65.. 4.. Bob.. 10.. 80.. For example given the the information in Table.. 4.. s_0.. is.. James.. 32.. 165.. s_1.. Charlie.. 7.. The data in the table might have the following Sequence declaration:.. Sequence { Str name; Int32 age; Float64 weight; } people;.. Grid.. is an association of an.. N.. dimensional.. with.. named vectors (.. map vectors.. ),.. each of which has the same number of elements as the corresponding dimension of the.. Each vector is used to map indices of one of the.. 's dimensions to a set of values which are normally non-integral (e.. g.. , floating point values).. Two map vectors may be members of different classes.. Grid =.. 0.. 31.. 5.. 1.. 30.. 8.. 29.. 2.. 3.. 9.. 7.. M =.. 3.. 4.. N =.. 67.. 68.. 92.. 95.. A sample Grid.. In.. figure.. , the grid element indicated by.. Grid[2][3].. corresponds to.. N[2].. M[3].. , or.. N = 92.. 3.. M = 3.. respectively.. The element has a value of 29.. 7.. Tom Sgouros, July 2, 2004..

    Original link path: /api/pguide-html/pguide_13.html
    Open archive

  • Title: DODS Programmers Guide -- 2 Managing Connections
    Descriptive info: Contents.. 2.. 1 Connect.. Because DODS uses a communication protocol (http) that does not maintain state information about the link between two processes, these connections are virtual, and all the information about them is maintainted by the client.. The toolkit contains two classes to help clients manage connections to one or more DODS servers.. One class,.. Connect.. stores information used when a connection is established.. It also allows a program to provide  ...   the DODS Toolkit,.. Connections.. , manages instances of the.. class.. It provides a mechanism for the client libraries to pass back to user programs the type of object (such as.. int.. , opaque pointer,.. ) they expect and then to use one of those objects to access the correct instance of.. is a template class.. That is, a client library uses the.. class to make an array of some sub-class of.. 2 Connections..

    Original link path: /api/pguide-html/pguide_14.html
    Open archive

  • Title: DODS Programmers Guide -- 2.1 Connect
    Descriptive info: The.. class manages one connection to either a remote data set, via a DODS data server, or a local access.. For each data set or file that the user program opens, there must be exactly one instance of.. Because information needed for local access is stored in an instance of.. , this class may also be used (sub-classed) for each client API that needs to maintain additional information about the connection.. 5.. In the API-specific child of.. additional members can be added to store state information that the client-library needs to maintain the virtual connection (See Section.. for more information on making virtual connections).. The Connect Class.. class is illustrated in.. 1.. These objects contain the following information:.. URL.. The URL with which the client library opens the connection with the DODS server.. DDS.. of the opened dataset.. This must be retrieved from the dataset.. DAS.. Gui.. object indicates a graphical widget on the client platform that displays information about the data transfer in progress..  ...   actually be called.. open.. but performs the function of opening a file or data set; e.. , NetCDF's.. ncopen.. ) it passes that URL to the.. member functions like.. request das.. request dds.. These member functions append an appropriate extension (.. das.. dds.. , for example) onto the URL and retrieve the resulting information from the server, the.. or.. for the dataset.. If you are re-implementing an API and must support function calls that modify how data is accessed (e.. , by creating array slices or by choosing one of a set of variables), then you will need to translate those requests into a DODS constraint expression.. You would then pass these synthesized constraint expressions to the.. Connect::request data.. member function.. (See.. Section.. for more information about constraint expressions.. The specialized version of.. is the place to put state information needed by a recoded API or other client.. This can be used, for example, to emulate an API that maintains a list of open files..

    Original link path: /api/pguide-html/pguide_15.html
    Open archive

  • Title: DODS Programmers Guide -- 2.2 Connections
    Descriptive info: 3 Using the DODS Library Classes.. The class.. is used to manage a set of instances of the class.. by providing a means to map an index or opaque pointer to an instance of.. When a new instance of.. (or a descendent of.. ; See Section.. ) is created, it is added to the.. object using the.. add connect.. returns an integer that can be used to access that instance of Connect at any time.. Similarly, when an instance of.. is to be deleted, the object can be referred to via the.. object and this index..

    Original link path: /api/pguide-html/pguide_16.html
    Open archive

  • Title: DODS Programmers Guide -- 3 Using the DODS Library Classes
    Descriptive info: 1 Sub-classing the Type Hierarchy.. In order to be used by real client-libraries and data servers, many of the classes in the DODS toolkit must be subclassed.. For example, the Type Hierarchy classes, which represent the data types in the DODS data model, are all abstract classes.. In order to use them in a program they must be subclassed.. class also must be subclassed if it to hold additional information about the connection.. 1 Sub-classing the Simple Types.. 2 Sub-classing the Vector Types.. 3 Sub-classing the Compound Types.. 2 Sub-classing the.. Class..

    Original link path: /api/pguide-html/pguide_17.html
    Open archive

  • Title: DODS Programmers Guide -- 3.1 Sub-classing the Type Hierarchy
    Descriptive info: In order to link a program with the DODS Toolkit library, the DAP's abstract classes must be subclassed and those subclasses must ensure that all of the member functions of those classes have valid definitions.. This is necessary because of C 's rules governing abstract classes.. The next three sections cover sub-classing the simple, vector and compound classes, respectively.. In addition, a sample set of classes (called the.. Test.. classes because they are used by the DAP tests) is included with the DAP distribution.. You can read the source code for those classes to find out how they were created.. Each of the sub-classed types must supply:.. A constructor that takes a.. String.. argument and returns an object with that name.. A virtual destructor.. A copy function called.. ptr duplicate.. read.. function, to read data from a disk and load it into the type class object.. member function returns a pointer to a new instance of the type of  ...   that.. is a virtual function so an object which is a descendent of.. will get the most specific definition of that function.. function is much more complicated to write than.. , and the difficulty varies depending on the data type to be read.. However, this function is only used on the server side of the system and not by the client.. That is, it can be implemented with a null function body if all you are building is a client library.. function takes two arguments, the dataset name, and an error flag.. It must read from that dataset the values specified by the current constraint expression.. The error flag is passed by reference so that read can set its value and callers can test it.. contains a number of member functions to facilitate writing a read function.. The return value of.. is TRUE is there is more data to be read (by additional calls to.. ) or FALSE otherwise..

    Original link path: /api/pguide-html/pguide_18.html
    Open archive

  • Title: DODS Programmers Guide -- 3.1.1 Sub-classing the Simple Types
    Descriptive info: Creating a.. function for the simple type classes is a fairly straightforward operation.. Simply read the function using the data access API's standard protocol, and use the type class's.. val2buf.. function to load the data into the type object.. The following function is taken from the DODS implementation of the.. NetCDF.. data access library.. (See the file.. src/nc-dods/NCByte.. cc.. NCByte::read(const String dataset, int error) { int varid; /* variable Id */ nc_type datatype; /* variable data type */ long cor[MAX_NC_DIMS]; /* corner coordinates */ int num_dim; /* number of dim.. in variable */ long nels = -1; /* number of elements in buffer */ int id; if (read_p()) // already done return true; int ncid = lncopen(dataset, NC_NOWRITE); /* netCDF id */ if (ncid == -1) { cerr "ncopen failed on " dataset endl; return false; } varid = lncvarid( ncid, name()); (void)lncvarinq( ncid, varid, (char *)0, datatype, num_dim, (int *)0, (int *)0); if(nels == -1){ for (id =  ...   lncopen().. function call is simply the.. ncopen().. function from the.. library.. Also, the.. lncvarid.. function is renamed.. ncvarid.. and so on.. The names have been changed to avoid link-time problems.. (Remember that the whole point of this exercise is to create a new.. function and its friends.. line 33.. This sets the flag tested with the.. read p.. function.. line 35.. This command transfers values from the dataset's variable to the DODS instance.. This is the point where the read actually happens.. Note the use of.. dods byte.. in the code example.. The DODS configuration process creates definitions for the simple data types like this one.. They are stored in.. config dap.. h.. member function is used by the constraint expression evaluator to extract data from a dataset during evaluation of the constraint expression.. This is particularly important to remember because the.. member function for a simple data type will be called when reading an aggregate type such as..

    Original link path: /api/pguide-html/pguide_19.html
    Open archive

  • Title: DODS Programmers Guide -- 3.1.2 Sub-classing the Vector Types
    Descriptive info: The vector data types require the same abstract member functions be defined as the simple types.. The definition for.. is also the same for vector as for simple types.. However, the.. member function for the vector types (classes.. ) is more complicated than for the simple types because vectors of values are represented in two ways in DODS, depending on the type of variable in the vector.. Arrays are stored as C would store them for the simple types such as.. Byte.. Int32.. Float64.. However, compound types are stored as arrays of the DODS C objects (with the exception of arrays themselves, but more on that later).. When reading an array of Byte values, the.. member function should be passed a pointer to values stored in a contiguous piece of memory.. For example, when.. is called to read a variable.. byte-array.. , it must determine how much memory to allocate to hold that much information, use.. to allocate an adequate amount  ...   function.. set vec.. An.. object containing a 3x4 array of.. objects will actually point to 12 different instances of that class.. object containing.. objects contains only one instance of the.. class, as a template for the array elements.. Arrays in DODS are unlike arrays in C in that an array object may have more than one dimension.. In terms of the way a value is stored, however, an Array is a single dimensional object.. When an Array is declared as having two or more dimensions, those are mapped onto a single vector.. To access the element.. A_ij.. of array.. A.. , you must know the size of the first dimension,.. I.. , and use the expression.. i * I + j.. to compute the offset into the vector.. Since the class.. is a single dimension array without.. declared.. size (the size of each value of the List object is stored in the object) the rules for.. 's read member function apply..

    Original link path: /api/pguide-html/pguide_20.html
    Open archive

  • Title: DODS Programmers Guide -- 3.1.3 Sub-classing the Compound Types
    Descriptive info: member function of the compound data types simply iterates over the contained variables calling their.. member functions.. In the future, this definition will move into the supplied classes (That is,.. will no longer be a abstract member function for the compound types.. ).. The two constructor types.. are different from all the other types in the DAP in that they have.. That is, the value of a sequence depends on how many values have been read previously.. This is very different from an array where the.. i.. th.. element has the same value regardless of what has happened before.. When you write implementations for.. in the.. classes, you must be sure to write those member functions so that they can be called repeatedly and that each call to read returns the next  ...   constraint expression based on the values and, if they constraint expression is satisfied, calling the serialize member function.. See the member function.. DDS::send.. (See section.. for more information on evaluation of constraint expressions).. If, for some reason, it is not possible to write.. so that it gets called once for each sequence value.. 6.. , then you must re-implement.. so that its functions are performed.. For example, you could implement.. Sequence::read.. so that the entire sequence is read in and overload.. Sequence::serialize.. Sequence::deserialize.. so that the next set of values are sent/received.. You would then build a send that called the.. member function once and extracted each successive value, evaluated the constraint expression using on that value and used the result of that evaluation to determine whether to send the value or not..

    Original link path: /api/pguide-html/pguide_21.html
    Open archive

  • Title: DODS Programmers Guide -- 3.2 Sub-classing the Connect Class
    Descriptive info: 4 Using the Toolkit.. The DODS API defines a connection-less protocol in which a server keeps no information for a client in between data requests.. This is in contrast to most data access APIs, which maintain state information about the files or datasets that a user program currently has open.. To simulate an API's connection, the client library for that API must create a.. virtual connection.. using information about the data set it has read from the server.. That is, the client library must maintain the.. illusion.. of a connection (state) for each open data object (typically a file) even though no such connection actually exists.. DODS provides the.. class to make this a simple process.. This class contains a variety of information about a dataset and its location on the internet, including the dataset's URL.. Most of the information necessary to fake a connection is contained here.. Data access APIs differ widely however, and it is usually necessary to add some information to the.. class to make a workable virtual connection.. This information can be stored in the subclassed.. The API's "open" call must be completely recoded so that the.. objects, as well as any other information, are requested from the dataset server and stored locally in whatever form is most convenient.. Figure.. shows the sub-class of.. used to store information extracted from the DAS and DDS objects (for the.. library), and used to simulate the storage of information in the original API.. class NCConnect: public Connect { private: int _ncid; int _nvars; int _ndims; String _dim_name[MAX_NC_DIMS]; int _dim_size[MAX_NC_DIMS]; int _das_loc[MAX_NC_VARS]; void init_list(int i); void  ...   size[MAX NC DIMS].. An array containing the size of each dimension found.. das loc[MAX NC VARS].. An index into a table of attributes.. This additional data allows the client library to emulate most of the.. query functions properly and.. locally.. Now look at the recoded open call of the.. library in.. The new function has exactly the same type as the original implementation; it takes the same number and type of arguments and returns the same type.. The first operation performed by the new open call is to create a.. object (actually an.. NCConnect.. object) using the arguments passed to the open call.. After.. the open call creates the new.. object, it makes sure that the user is not trying to open the remote dataset for writing and, if they are not, reads the.. from the dataset.. Once read, the.. objects are parsed using.. 's member functions.. parse das loc.. parse dims.. These two member functions, along with the additional state variables in.. , effectively create the virtual connection.. Subsequent calls to the client library for information about the variables (e.. , their size, names, etc.. ) will be answered using information stored in the symbol table in the.. object.. int ncopen(const char *path, int cmode) { int id; NCConnect *c = new NCConnect(path); if(cmode != NC_NOWRITE) { delete c; return(-1); } c- request_das(); c- request_dds(); c- parse_das_loc(); c- parse_dims(); return(conns.. add_connect(c)) ; }.. The recoded open call of NetCDF.. The code above checks to see whether the user is trying to open a connection for writing.. Since DODS is a read-only protocol, this attempt must fail..

    Original link path: /api/pguide-html/pguide_22.html
    Open archive

  • Title: DODS Programmers Guide -- 4 Using the Toolkit
    Descriptive info: 1 Data Servers.. This chapter describes how to use the toolkit software to build new client libraries and data servers.. Before beginning to build either part of a new DODS application, it is very important to be intimate with the details of the API to be replaced.. To.. create a client library that can.. replace.. the original API implementation at.. link time.. means that the client library must present exactly the same interface as the original library.. This includes, to the extent that they are widely used, any undocumented features of the original implementation that manifest themselves as symbols that require link-time resolution.. Building a client-library requires great understanding of the existing implementation as well as current use of the target API.. build a good data server for files or data sets encoded using an API it is important to understand the data model(s) the API supports and how they relate to the DODS data models.. Each of the various data types that the API supports must be translated into a DODS data type (i.. , one of the DODS classes that descend from.. ).. However, there is often not a one-to-one match between the API's types and the DODS types.. Thus, the data server author must decide  ...   or to group only those which actually are explicitly grouped using whatever the API provides.. If you choose the latter then any data sets which follow the convention will lose information.. When building the data server it is important to keep such tradeoffs in mind.. The following sections discuss the specifics of building a data server and a client library.. The existing NetCDF server and client library are used as examples.. Many APIs are very similar in their overall organization.. The source code used for these examples can be found in.. (DODS ROOT)/src/nc-dods/.. Much of the NetCDF example will be relevant to your task, even if your target API is significantly different.. (DODS ROOT)/src/jg-dods/.. directory contains both a data server and client library for the.. Joint Geophysical Ocean Flux Study.. relational data system.. 1 The Dispatch CGI.. 2 The.. filter programs.. 3 The Data filter.. 4 The Usage Filter.. 5 Documenting Your Work.. 2 Client Libraries.. 1 Rewriting the Open and Close Functions.. 2 Getting Information about Variables.. 3 Reading the Values of Variables from a Dataset.. 4 Functions that Write to Data Sets.. 5 Adding Local Access to a DODS Client Library.. 3 Using Constraints.. 1 How Constraint Expressions are Evaluated.. 2 Different Ways of Using Constraint Expressions..

    Original link path: /api/pguide-html/pguide_23.html
    Open archive





  • Archived pages: 580