ewdb_api_AssociateChanWithComp()

Prototype: |
int ewdb_api_AssociateChanWithComp( | EWDBid idComp, EWDBid idChan, double tStart, double tEnd, EWDBid * pidCompT, EWDBid * pidChanT);
Source File: | src/oracle/schema-working/src/infra/ewdb_api_AssociateChanWithComp.c
Description: | Function creates an association between a channel and a component for a specified time interval. The function can fail if a relationship exists between the specified component and an alternative channel, or between the specified channel and an alternative component, during an overlapping time period. NOTE THIS FUNCTION IS UNSUPPORTED. Please contact someone in the Earthworm DB development group if you need to set specific component/channel time based relationships. ewdb_internal_SetChanParams() is also available(and not recommended for use). The relationship between a component and a channel is complex to implement. I believe the issues that cause the pidCompT and pidChanT variables to be written to, have been cleared up, and they are no longer applicable; however, I am not sure of this, so please be sure to pass valid pointers until better documentation can be made available. davidk 2000/05/04. Davidk 07/27/2001
Note: | The following is believed to be out of date, but is the best information available at this time: A channel can be associated with at most one component at a given time. If the channel that the caller is trying to bind a component to is already bound to another component during an overlapping time interval, then the call will fail, and the idComp of the first component found that has an overlapping association with that channel will be returned. Currently, if there are any existing chan relationships during the time period described by tStart,tEnd, for the given idChan, then the idChanT of the first ChanT relationship record will be returned in pidChanT along with an error condition. Davidk 07/27/2001
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_FAILURE | Fatal error. See logfile for details.
EWDB_RETURN_SUCCESS | Success.
PARAMETER INFO
Parameter | Type | Description
idComp | EWDBid | The DB identifier of the component(Comp) record the caller wants to associate with a channel.
idChan | EWDBid | The DB identifier of the channel(Chan) record the caller wants to associate with a component.
tStart | double | The start of the time interval for which the caller wants to associate the component and channel. Expressed as seconds since 1970.
tEnd | double | The end of the time interval for which the caller wants to associate the component and channel. Expressed as seconds since 1970.
pidCompT | EWDBid * | A pointer to a EWDBid where the function will write information if the call fails.
pidChanT | EWDBid * | A pointer to a EWDBid where the function will write information if the call fails.
Group: | EWDB_API_LIB
Sub Group: | COOKED_INFRASTRUCTURE_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h

ewdb_api_CreateChannel()

Prototype: |
int ewdb_api_CreateChannel( | EWDBid * pidChan, char * szComment);
Description: | Function creates a channel in the DB. A channel identifies the entire path of a seismic signal from ground motion to completed waveform. The function writes the DB ID of the newly created channel to pidChan. Because most of a channel's properties are variable over time, this function does not take much as input, as it only creates a channel with its fixed attribute(s). This function should be used to generate a new idChan that can be used in conjunction with other functions for creating components and setting time based attributes of components and channels.
Note: | THIS FUNCTION IS UNSUPPORTED! A channel(Chan) represents a unique data path from ground motion to finished waveform. It is associated with a Component sensor, and all of the signal altering devices that the sensor's signal passes through before becoming a finished set of waveforms.
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_FAILURE | Fatal error. See logfile for details.
EWDB_RETURN_SUCCESS | Success.
PARAMETER INFO
Parameter | Type | Description
pidChan | EWDBid * | A pointer to a EWDBid where the function will write The DB identifier of the Channel it created.
szComment | char * | Optional comment regarding the component. It may be blank, and should be a maximum of 4k characters. It may not be NULL!
Group: | EWDB_API_LIB
Sub Group: | COOKED_INFRASTRUCTURE_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h

ewdb_api_CreateCompTForSCNLT()

Prototype: |
int ewdb_api_CreateCompTForSCNLT( | EWDBid * pidChan, char * szSta, char * szComp, char * szNet, char * szLoc, double tStart, double tEnd);
Description: | This function is misnamed. It actually creates an association between an SCNL and a channel for a given time period. It is called CreateCompTForSCNLT() because it creates a component time interval(CompT) record as part of the process of creating a component and a channel, and associating the two together for a given time period. The function returns the idChan of the newly created channel with which the SCNL has been associated for the supplied time interval. The DB ID of the component(Comp) and the component time interval(CompT) are not returned. The caller can retrieve the idComp and idCompT by calling ewdb_api_GetComponentInfo() with the idChan of the newly created channel, and tStart or tEnd. The caller can change the location/orientation of the component by calling ewdb_api_SetCompParams() after calling ewdb_api_CreateCompTForSCNLT().
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_FAILURE | Fatal error. See logfile for details.
EWDB_RETURN_SUCCESS | Success
PARAMETER INFO
Parameter | Type | Description
pidChan | EWDBid * | Pointer to an EWDBid where the function will write the idChan of the newly created channel, associated with the SCNL.
szSta | char * | The Station Code of the SCNL.
szComp | char * | The Component(Channel) Code of the SCNL.
szNet | char * | The Network Code of the SCNL.
szLoc | char * | The Location Code of the SCNL.
tStart | double | The start of the validity time range for the given SCNL. Seconds since 1970.
tEnd | double | The end of the validity time range for the given SCNL. Seconds since 1970.
Group: | EWDB_API_LIB
Sub Group: | COOKED_INFRASTRUCTURE_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h

ewdb_api_CreateComponent()

Prototype: |
int ewdb_api_CreateComponent( | EWDBid * pidComp, char * sSta, char * sComp, char * sNet, char * sLoc, char * szComment);
Description: | Function creates a component sensor in the DB with an SCN and optionally L. It associates the component with a site identified by (Sta,Net). It returns the DB ID of the newly created component. If a component already exists with the specified SCNL, then a new component is not created and the idComp of the existing component is returned.
Note: | A component(Comp) represents a seismic sensor in the field. It is represented by SCN and optionaly L, and has location properties(Lat,Lon, and Elev) and orientation properties(Azimuth and Dip). If a component with matching SCNL already exists, then the call will succeed and return the idComp of the existing component. A new component will not be created! The comment is currently ignored.
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_FAILURE | Fatal error. See logfile for details.
EWDB_RETURN_SUCCESS | Success.
PARAMETER INFO
Parameter | Type | Description
pidComp | EWDBid * | A pointer to a EWDBid where the function will write The DB identifier of the Component it created.
sSta | char * | SEEDlike Station code for the component. It may not be blank or NULL, and should be a maximum of 7 characters.
sComp | char * | SEEDlike Component code for the component. The field may not be blank or NULL and should be a maximum of 9 characters.
sNet | char * | SEEDlike Network code for the component. It may not be blank or NULL and should be a maximum of 9 characters.
sLoc | char * | Optional SEEDlike Location code for the component. It may not be blank or NULL and should be a maximum of 9 characters.
szComment | char * | Optional comment regarding the component. May be blank, and should be a maximum of 4k characters. It may not be NULL!
Group: | EWDB_API_LIB
Sub Group: | COOKED_INFRASTRUCTURE_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h

ewdb_api_CreateTransformFunction()

Prototype: |
int ewdb_api_CreateTransformFunction( | EWDBid * pidCookedTF, EWDB_TransformFunctionStruct * pCookedTF);
Description: | Function inserts a caller provided poles/zeroes based transform function into the DB. The transform Function is used to transform recorded waveforms back into ground motion. The function writes the DB id of the newly created transform function to pidCookedTF.
Note: | The transform function can be associated with multipe channel time intervals using EWDB_SetTransformFuncForChanT().
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_FAILURE | Fatal error. See logfile for details.
EWDB_RETURN_SUCCESS | Success.
PARAMETER INFO
Parameter | Type | Description
pidCookedTF | EWDBid * | Pointer to an EWDBid where the function will write the DB ID of the newly created poles and zeroes based cooked transform function(CookedTF).
pCookedTF | EWDB_TransformFunctionStruct * | Pointer to a caller filled EWDB_TransformFunctionStruct that contains the transform function and associated information that the caller wants to insert into the DB.
Group: | EWDB_API_LIB
Sub Group: | COOKED_INFRASTRUCTURE_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h

ewdb_api_GetComponentInfo()

Prototype: |
int ewdb_api_GetComponentInfo( | EWDBid idChan, int tParamsTime, EWDB_StationStruct * pStation);
Description: | Function retrieves a EWDB_StationStruct full of information about the component associated with a channel at a give time.
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_FAILURE | Fatal error. See logfile for details.
EWDB_RETURN_SUCCESS | Success.
PARAMETER INFO
Parameter | Type | Description
idChan | EWDBid | The DB identifier of the channel for which the caller wants information.
tParamsTime | int | Point in time for which the caller wants component parameter information. A time is required because some parameters are variable over time.
pStation | EWDB_StationStruct * | A pointer to a EWDB_StationStruct (allocated by the caller) where the function will write the component parameter information for the given channel and time.
Group: | EWDB_API_LIB
Sub Group: | COOKED_INFRASTRUCTURE_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h

ewdb_api_GetStationList()

Prototype: |
int ewdb_api_GetStationList( | double MinLat, double MaxLat, double MinLon, double MaxLon, double ReqTime, EWDB_StationStruct * pBuffer, int * pNumStationsFound, int * pNumStationsRetrieved, int BufferLen);
Description: | This function retrieves a list of component/channels given a lat/lon box and time of interest. Component attributes for the given time are included. (MinLat,MinLon) and (MaxLat,MaxLon) define two vertices of a box. The function retrieves the list of stations within the box.
Note: | Be careful of the effects of negative Lat/Lon on Min/Max!! Use ewdb_api_GetStationListWithoutLocation() to retrieve all stations available in the database at a given time. It does not impose a lat/lon box.
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_FAILURE | Returned when the caller passes an invalid set of criteria.
EWDB_RETURN_SUCCESS | Success.
EWDB_RETURN_WARNING | Partial success. A list of stations was retrieved, but the caller's buffer was not large enough to accomadate all of the stations found. See pNumStationsFound for the number of stations found and pNumStationsRetrieved for the number of stations placed in the caller's buffer.
PARAMETER INFO
Parameter | Type | Description
MinLat | double | Minimum lattitude coordinate of stations to be retrieved. Lattitude is expressed in degrees.
MaxLat | double | Maximum lattitude coordinate of stations to be retrieved. Lattitude is expressed in degrees.
MinLon | double | Minimum longitude coordinate of stations to be retrieved. Longitude is expressed in degrees.
MaxLon | double | Maximum longitude coordinate of stations to be retrieved. Longitude is expressed in degrees.
ReqTime | double | Time of interest. The list of active components changes over time. Reqtime identifies the historical point in time for which the caller wants a station list. Time is expressed in seconds since 1970.
pBuffer | EWDB_StationStruct * | Buffer allocated by the caller, in which the function will place information for each of the stations matching the caller's criteria.
pNumStationsFound | int * | Pointer to an integer where the function will write the number of stations found to match the calller's criteria.
pNumStationsRetrieved | int * | Pointer to an integer where the function will write the number of arrivals placed in the callers buffer(pBuffer).
BufferLen | int | Size of the pBuffer buffer as a multiple of EWDB_StationStruct. (example: 15 structs)
Group: | EWDB_API_LIB
Sub Group: | COOKED_INFRASTRUCTURE_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h

ewdb_api_GetStationListWithoutLocation()

Prototype: |
int ewdb_api_GetStationListWithoutLocation( | double ReqTime, EWDB_StationStruct * pBuffer, int * pNumStationsFound, int * pNumStationsRetrieved, int BufferLen);
Description: | This function retrieves a list of component/channels given a time of interest. This function is the same as ewdb_api_GetStationList(), except that it does not impose a Lat/Lon box.
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_FAILURE | Returned when the caller passes an invalid set of criteria.
EWDB_RETURN_SUCCESS | Success.
EWDB_RETURN_WARNING | Partial success. A list of stations was retrieved, but the caller's buffer was not large enough to accomadate all of the stations found. See pNumStationsFound for the number of stations found and pNumStationsRetrieved for the number of stations placed in the caller's buffer.
PARAMETER INFO
Parameter | Type | Description
ReqTime | double | Time of interest. The list of active components changes over time. Reqtime identifies the historical point in time for which the caller wants a station list. Time is expressed in seconds since 1970.
pBuffer | EWDB_StationStruct * | Buffer allocated by the caller, in which the function will place information for each of the stations matching the caller's criteria.
pNumStationsFound | int * | Pointer to an integer where the function will write the number of stations found to match the calller's criteria.
pNumStationsRetrieved | int * | Pointer to an integer where the function will write the number of arrivals placed in the callers buffer(pBuffer).
BufferLen | int | Size of the pBuffer buffer as a multiple of EWDB_StationStruct. (example: 15 structs)
Group: | EWDB_API_LIB
Sub Group: | COOKED_INFRASTRUCTURE_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h

ewdb_api_GetTransformFunctionForChan()

Prototype: |
int ewdb_api_GetTransformFunctionForChan( | EWDBid idChan, time_t tTime, EWDB_ChanTCTFStruct * pChanCTF);
Source File: | src/oracle/schema-working/src/infra/ewdb_api_GetTransformFunctionForChan.c
Description: | Function retrieves the poles/zeroes based transform function, gain and sample rate for a given channel and time. The transform Function is used to transform recorded waveforms back into ground motion.
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_FAILURE | Fatal error. See logfile for details.
EWDB_RETURN_SUCCESS | Success.
PARAMETER INFO
Parameter | Type | Description
idChan | EWDBid | The DB ID of the channel for which the caller wants to retrieve a cooked transform function.
tTime | time_t | Point in time for which the caller wants a cooked transform function for the channel. A time is required because the transform function varies over time as device properties are changed or the channel is altered.
pChanCTF | EWDB_ChanTCTFStruct * | Pointer to a caller allocated EWDB_ChanTCTFStruct where the function will write the cooked transform function and associated "channel specific response information" requested by the caller.
Group: | EWDB_API_LIB
Sub Group: | COOKED_INFRASTRUCTURE_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h

ewdb_api_GetidChanT()

Prototype: |
int ewdb_api_GetidChanT( | EWDBid idChan, double tTime, EWDBid * pidChanT);
Description: | Function retrieves the identifier of the channel time interval associated with the given channel and time.
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_FAILURE | Fatal error. See logfile for details.
EWDB_RETURN_SUCCESS | Success.
PARAMETER INFO
Parameter | Type | Description
idChan | EWDBid | The DB identifier of the channel for which the caller wants a channel time interval(ChanT) identifier.
tTime | double | Point in time for which the caller wants a time interval identifier for the channel.
pidChanT | EWDBid * | A pointer to a EWDBid where the function will write The DB identifier of the requested channel time interval(ChanT).
Group: | EWDB_API_LIB
Sub Group: | COOKED_INFRASTRUCTURE_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h

ewdb_api_GetidChansFromSCNLT()

Prototype: |
int ewdb_api_GetidChansFromSCNLT( | EWDBid * pBuffer, char * IN_szSta, char * IN_szComp, char * IN_szNet, char * IN_szLoc, double * IN_tOff, double * IN_tOn, int * pNumChansFound, int * pNumChansRetrieved, int BufferLen);
Description: | The function retrieves a list of idChans that are valid for the given SCNL and time range. Wildcards ("*") may be used for any of the S, C, N, and L codes. The function will return all idChans that are associated with the components that have codes matching the given SCNL, during a time period that overlaps with (IN_tOn - IN_tOff).
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_FAILURE | Fatal error. See logfile for details.
EWDB_RETURN_SUCCESS | Success.
EWDB_RETURN_WARNING | Partial success. A list of idChans was retrieved, but the caller's buffer was not large enough to accomadate all of the idChans found. See pNumChansFound for the number of idChans found and pNumChansRetrieved for the number of chans placed in the caller's buffer.
PARAMETER INFO
Parameter | Type | Description
pBuffer | EWDBid * | Buffer allocated by the caller, where the function will write the list idChans that match the given SCNL and Time range.
IN_szSta | char * | SEEDlike Station code for the SNCL. It may not be blank or NULL, and should be a maximum of 7 characters. "*" may be used as a wildcard that will match all Station codes.
IN_szComp | char * | SEEDlike Component code for the SCNL. The field may not be blank or NULL and should be a maximum of 9 characters. "*" may be used as a wildcard that will match all Component codes.
IN_szNet | char * | SEEDlike Network code for the SCNL. It may not be blank or NULL and should be a maximum of 9 characters. "*" may be used as a wildcard that will match all Network codes.
IN_szLoc | char * | Optional SEEDlike Location code for the component. It may not be NULL (Use a blank string "" to indicate a NULL location code. It should be a maximum of 9 characters. "*" may be used as a wildcard that will match all Location codes.
IN_tOff | double * | End time of the time range of interest. Expressed as seconds since 1970.
IN_tOn | double * | Start time of the time range of interest. Expressed as seconds since 1970.
pNumChansFound | int * | Pointer to an integer where the function will write the number of idChans found to match the SCNL and time range.
pNumChansRetrieved | int * | Pointer to an integer where the function will write the number of idChans placed in the callers buffer(pBuffer).
BufferLen | int | Size of the pBuffer buffer as a multiple of EWDBid. (example: 15 EWDBids)
Group: | EWDB_API_LIB
Sub Group: | COOKED_INFRASTRUCTURE_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h

ewdb_api_SetCompParams()

Prototype: |
int ewdb_api_SetCompParams( | EWDB_StationStruct * pStation, double tOn, double tOff, EWDBid * pidCompT, char * szComment);
Description: | Function sets the variable parameters of a component for a given time interval. The caller specifies the component by filling in the SCNL codes in pStation. Variable parameters include (lat,lon), elevation, and the orientation of the component. It will write the DB ID of the newly created/updated Component Time Interval record to to pidCompT.
Note: | pStation->idComp is ignored by this function. The component must be specified using the SCNL codes, not by a DB idComp.
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_FAILURE | Fatal error. See logfile for details.
EWDB_RETURN_SUCCESS | Success.
PARAMETER INFO
Parameter | Type | Description
pStation | EWDB_StationStruct * | Pointer to a EWDB_StationStruct that contains the parameters that the caller wishes to set for the component for the given time interval.
tOn | double | The start of the time interval for which the caller wants to the component parameters to be valid. Expressed as seconds since 1970.
tOff | double | The end of the time interval for which the caller wants to the component parameters to be valid. Expressed as seconds since 1970.
pidCompT | EWDBid * | A pointer to a EWDBid where the function will write the DB ID of the updated or newly created Component Time Interval.
szComment | char * | Optional comment regarding the Component Time Interval. It may be blank, and should be a maximum of 4k characters. It may not be NULL!
Group: | EWDB_API_LIB
Sub Group: | COOKED_INFRASTRUCTURE_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h

ewdb_api_SetTransformFuncForChanT()

Prototype: |
int ewdb_api_SetTransformFuncForChanT( | EWDBid idChanT, double dGain, EWDBid idCookedTF, double dSampRate);
Description: | Function associates an existing transform function with a Channel for a given time period. Records the gain and sample-rate that are specific to the channel.
Note: | To create a transform function for a channel, you must call two API functions. You must first call ewdb_api_CreateTransformFunction() to create the transfer function. Then you must call ewdb_api_SetTransformFuncForChanT() (using the idCookedTF that you got back from the create function call) for each "channel time interval" with which you wish to associate the transfer function.
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_FAILURE | Fatal error. See logfile for details.
EWDB_RETURN_SUCCESS | Success.
PARAMETER INFO
Parameter | Type | Description
idChanT | EWDBid | The DB identifier of the channel time interval(ChanT) with which the caller wants to associate a Poles and Zeroes transform function(CookedTF).
dGain | double | The signal gain for the channel time interval. Expressed as a double floating point multiplicative scalar.
idCookedTF | EWDBid | The DB identifier of the existing poles and zeroes based cooked transfer function, that the caller wants to associate with a given channel time interval(ChanT).
dSampRate | double | Digital sample rate of the data spouted out of the channel. Expressed as samples per second.
Group: | EWDB_API_LIB
Sub Group: | COOKED_INFRASTRUCTURE_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h