| Prototype: |
|
| Source File: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |
| Description: |
Function retrieves a list of amplitudes of a given type that are associated with a given DB Event. Use idEvent to define the DB Event for which you want a list of associated amplitudes. If you want station information for the channel associated with each amplitude, allocate space for pStationBuffer, otherwise set pStationBuffer to NULL, and station information will not be retrieved. |
| Note: |
This function only retrieves amplitudes that are directly associated with an Event. It will not retrieve amplitudes that have been associated with an Event via a Magnitude. |
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 amplitudes was retrieved, but the caller's buffer was not large enough to accomadate all of the amplitudes found. See pNumAmpsFound for the number of arrivals found and pNumAmpsRetrieved for the number of amplitudes placed in the caller's buffer. |
|
PARAMETER INFO |
| Parameter |
Type |
Description |
| idEvent |
EWDBid |
DB identifier of the Event for which the caller wants a list of associated amplitudes. |
| iAmpType |
AMPLITUDE_TYPE |
Type of amplitude the caller is searching for. "Amplitude Type" constants are defined in . |
| pAmpBuffer |
EWDB_PeakAmpStruct * |
Buffer allocated by the caller, where the function will write the list of amplitudes retrieved. |
| pStationBuffer |
EWDB_StationStruct * |
Buffer allocated by the caller, where the function will write the list of station/channel info associated with the amplitudes retrieved. If pStationBuffer is set to NULL by the caller, then the function will not attempt to retrieve Station information for the retrieved amplitudes. If pStationBuffer is NOT NULL, then the function will fill out an EWDB_StationStruct for the channel associated with each amplitude. |
| pNumAmpsFound |
int * |
Pointer to an integer where the function will write the number of amplitudes found. |
| pNumAmpsRetrieved |
int * |
Pointer to an integer where the function will write the number of amplitudes retrieved and placed in the caller's buffer(pAmpBuffer). |
| iBufferLen |
int |
Size of the pAmpBuffer buffer in as a multiple of EWDB_PeakAmpStruct. (example: 15 structs) If pStationBuffer is not NULL, then it must also contain space for this many EWDB_StationStruct records. |
|
|
| Group: |
EWDB_API_LIB |
| Sub Group: |
PARAMETRIC_API |
| Language: |
C |
| Location: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |
| Prototype: |
|
| Source File: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |
| Description: |
Function retrieves a list of amplitudes of a given type that are associated with a given DB Origin. Use idOrigin to define the DB Origin for which you want a list of associated amplitudes. If you want station information for the channel associated with each amplitude, allocate space for pStationBuffer, otherwise set pStationBuffer to NULL, and station information will not be retrieved. |
| Note: |
This function only retrieves amplitudes that are directly associated with an Origin, or the Event with which that Origin is associated. It will not retrieve amplitudes that have been associated with an Origin via a Magnitude. |
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 amplitudes was retrieved, but the caller's buffer was not large enough to accomadate all of the amplitudes found. See pNumAmpsFound for the number of arrivals found and pNumAmpsRetrieved for the number of amplitudes placed in the caller's buffer. |
|
PARAMETER INFO |
| Parameter |
Type |
Description |
| idOrigin |
EWDBid |
DB identifier of the Origin for which the caller wants a list of associated amplitudes. |
| iAmpType |
AMPLITUDE_TYPE |
Type of amplitude the caller is searching for. "Amplitude Type" constants are defined in . |
| pAmpBuffer |
EWDB_PeakAmpStruct * |
Buffer allocated by the caller, where the function will write the list of amplitudes retrieved. |
| pStationBuffer |
EWDB_StationStruct * |
Buffer allocated by the caller, where the function will write the list of station/channel info associated with the amplitudes retrieved. If pStationBuffer is set to NULL by the caller, then the function will not attempt to retrieve Station information for the retrieved amplitudes. If pStationBuffer is NOT NULL, then the function will fill out an EWDB_StationStruct for the channel associated with each amplitude. |
| pNumAmpsFound |
int * |
Pointer to an integer where the function will write the number of amplitudes found. |
| pNumAmpsRetrieved |
int * |
Pointer to an integer where the function will write the number of amplitudes retrieved and placed in the caller's buffer(pAmpBuffer). |
| iBufferLen |
int |
Size of the pAmpBuffer buffer in as a multiple of EWDB_PeakAmpStruct. (example: 15 structs) If pStationBuffer is not NULL, then it must also contain space for this many EWDB_StationStruct records. |
|
|
| Group: |
EWDB_API_LIB |
| Sub Group: |
PARAMETRIC_API |
| Language: |
C |
| Location: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |
| Prototype: |
| int ewdb_api_GetAmpsByTime( |
time_t tStart, time_t tEnd, AMPLITUDE_TYPE iAmpType, EWDB_PeakAmpStruct * pAmpBuffer, EWDB_StationStruct * pStationBuffer, int * pNumAmpsFound, int * pNumAmpsRetrieved, int iBufferLen); |
|
| Source File: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |
| Description: |
Function retrieves a list of amplitudes of a given type for a given time window. Use tStart and tEnd to specify the time window for which you are interested in amplitudes. If you want station information for the channel associated with each amplitude, allocate space for pStationBuffer, otherwise set pStationBuffer to NULL, and station information will not be retrieved. |
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 amplitudes was retrieved, but the caller's buffer was not large enough to accomadate all of the amplitudes found. See pNumAmpsFound for the number of arrivals found and pNumAmpsRetrieved for the number of amplitudes placed in the caller's buffer. |
|
PARAMETER INFO |
| Parameter |
Type |
Description |
| tStart |
time_t |
Start time of criteria window. (Secs since 1970) |
| tEnd |
time_t |
End time of criteria window. (Secs since 1970) |
| iAmpType |
AMPLITUDE_TYPE |
Type of amplitude the caller is searching for. "Amplitude Type" constants are defined in . |
| pAmpBuffer |
EWDB_PeakAmpStruct * |
Buffer allocated by the caller, where the function will write the list of amplitudes retrieved. |
| pStationBuffer |
EWDB_StationStruct * |
Buffer allocated by the caller, where the function will write the list of station/channel info associated with the amplitudes retrieved. If pStationBuffer is set to NULL by the caller, then the function will not attempt to retrieve Station information for the retrieved amplitudes. If pStationBuffer is NOT NULL, then the function will fill out an EWDB_StationStruct for the channel associated with each amplitude. |
| pNumAmpsFound |
int * |
Pointer to an integer where the function will write the number of amplitudes found. |
| pNumAmpsRetrieved |
int * |
Pointer to an integer where the function will write the number of amplitudes retrieved and placed in the caller's buffer(pAmpBuffer). |
| iBufferLen |
int |
Size of the pAmpBuffer buffer in as a multiple of EWDB_PeakAmpStruct. (example: 15 structs) If pStationBuffer is not NULL, then it must also contain space for this many EWDB_StationStruct records. |
|
|
| Group: |
EWDB_API_LIB |
| Sub Group: |
PARAMETRIC_API |
| Language: |
C |
| Location: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |
| Prototype: |
| int ewdb_api_GetArrivals( |
EWDBid idOrigin, EWDB_ArrivalStruct * pArrivals, int * pNumArrivalsFound, int * pNumArrivalsRetrieved, int BufferLen); |
|
| Description: |
The function retrieves a list of arrivals that are associated with a given origin. See EWDB_ArrivalStruct for a description of the information retrieved for each associated arrival. |
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 arrivals was retrieved, but the caller's buffer was not large enough to accomadate all of the arrivals found. See pNumArrivalsFound for the number of arrivals found and pNumArrivalsRetrieved for the number of arrivals placed in the caller's buffer. |
|
PARAMETER INFO |
| Parameter |
Type |
Description |
| idOrigin |
EWDBid |
This function retrieves a list of arrivals associated with an origin. idOrigin is the database ID of the origin for which the caller wants a list of arrivals. |
| pArrivals |
EWDB_ArrivalStruct * |
Buffer allocated by the caller, where the function will write the list of arrivals. |
| pNumArrivalsFound |
int * |
Pointer to an integer where the function will write the number of found arrivals. |
| pNumArrivalsRetrieved |
int * |
Pointer to an integer where the function will write the number of arrivals placed in the callers buffer(pArrivals). |
| BufferLen |
int |
Size of the pArrivals buffer as a multiple of EWDB_ArrivalStruct. (example: 15 structs) |
|
|
| Group: |
EWDB_API_LIB |
| Sub Group: |
PARAMETRIC_API |
| Language: |
C |
| Location: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |
| Prototype: |
|
| Description: |
Returns the list of all events in the database, in a given time range, that meet the criteria specified in pCriteria. For each Event found to meet the given criteria, an EWDB_EventListStruct is returned. This is the primary function used for searching for a subset of the events in the DB. |
RETURN CODE INFO |
| Return Type: |
int |
| Return Value |
Description |
| EWDB_RETURN_SUCCESS |
A list of events was successfully retrieved. |
| EWDB_RETURN_FAILURE |
The function experienced a fatal error while retrieving a list of events. |
| -x < -1 |
(-x) is returned where x > 1 when the size of the caller's buffer is insufficient to hold all of the events that matched the caller's criteria. x is the size of the buffer required to retrieve all of the events that were found. The function places as many events as possible into the caller's existing buffer. This is not a failure condition, just a warning that the caller did not receive all of the requested data. |
|
PARAMETER INFO |
| Parameter |
Type |
Description |
| pBuffer |
EWDB_EventListStruct * |
Buffer allocated by the caller, in which the function will place the list of events matching the caller's criteria. |
| len |
int |
Length of pBuffer as a multiple of EWDB_EventListStruct. |
| StartTime |
int |
Minimum(oldest) time acceptable for an event. Expressed as seconds since 1970(time_t). |
| EndTime |
int |
Maximum(youngest) time acceptable for an event. Expressed as seconds since 1970(time_t). |
| pCriteria |
EWDB_EventListStruct * |
Pointer to the EWDB_EventListStruct that contains part of the selection criteria for the list, including: minimum lattitude, minimum longitude, minimum depth, minimum magnitude, and source limitations. Source criteria is: "*" events from all sources "**" events from only human sources "" (blank string)all automatic sources Any other string will be matched against the source identifier, such as the logo of the earthworm module that created a solution, or the dblogin of a human reviewer. |
| pMaxEvent |
EWDB_EventListStruct * |
Pointer to the EWDB_EventListStruct that contains part of the selection criteria for the list, including: maximum lattitude, maximum longitude, maximum depth, and maximum magnitude. |
| pNumEvents |
int * |
Pointer to an integer where the function writes the number of events it put in pBuffer. |
|
|
| Group: |
EWDB_API_LIB |
| Sub Group: |
PARAMETRIC_API |
| Language: |
C |
| Location: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |
| Prototype: |
| int ewdb_api_GetMagsForOrigin( |
EWDBid IN_idOrigin, EWDB_MagStruct * pMags, int * pNumMagsFound, int * pNumMagsRetrieved, int IN_BufferRecLen); |
|
| Source File: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |
| Description: |
Optionally, write a description of what the function does and how it behaves. |
| Note: |
Optionally, write a note about the function here. |
RETURN CODE INFO |
| Return Type: |
int |
| Return Value |
Description |
| Default_Return_Value |
Description of the default return value |
|
PARAMETER INFO |
| Parameter |
Type |
Description |
| IN_idOrigin |
EWDBid |
Optional description of (IN_idOrigin) |
| pMags |
EWDB_MagStruct * |
Optional description of (pMags) |
| pNumMagsFound |
int * |
Optional description of (pNumMagsFound) |
| pNumMagsRetrieved |
int * |
Optional description of (pNumMagsRetrieved) |
| IN_BufferRecLen |
int |
Optional description of (IN_BufferRecLen) |
|
|
| Group: |
EWDB_API_LIB |
| Sub Group: |
PARAMETRIC_API |
| Language: |
C |
| Location: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |
| Prototype: |
| int ewdb_api_GetOriginsForEvent( |
EWDBid IN_idEvent, EWDB_OriginStruct * pOrigins, int * pNumOriginsFound, int * pNumOriginsRetrieved, int IN_BufferRecLen); |
|
| Description: |
This function retrieves information for each Origin that is associated with the event(idEvent) given by the caller. |
| Note: |
Then entire EWDB_OriginStruct is not filled! Only the following fields are filled by this function: idOrigin, tOrigin, dLat, dLon, dDepth, iAssocPh, iUsedPh, iFixedDepth, sSource, and sRealSource. |
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 |
Origin records found successfully, but one or more records were unable to be retrieved. Most likely indicates that the caller's buffer is not large enough to hold all of the records found. |
|
PARAMETER INFO |
| Parameter |
Type |
Description |
| IN_idEvent |
EWDBid |
Event for which the caller wishes to retrieve origins. |
| pOrigins |
EWDB_OriginStruct * |
Pointer to a buffer (allocated by the caller) where the function will put information for the Origins found for the given Event. |
| pNumOriginsFound |
int * |
Pointer to an integer (caller allocated) where the function will write the number of origins found for the given idEvent. Note: this is not the number actually retrieved. |
| pNumOriginsRetrieved |
int * |
Pointer to an integer (caller allocated) where the function will write the number of origins retrieved into the caller's buffer for the given idEvent |
| IN_BufferRecLen |
int |
The size of the pOrigins buffer allocated by the caller. (In terms of number of EWDB_OriginStruct records) |
|
|
| Group: |
EWDB_API_LIB |
| Sub Group: |
PARAMETRIC_API |
| Language: |
C |
| Location: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |
| Prototype: |
|
| Description: |
Function retrieves the DB IDs for the preferred summary information(origin, magnitude, and mechanism) for the Event identified by idEvent. |
RETURN CODE INFO |
| Return Type: |
int |
|
PARAMETER INFO |
| Parameter |
Type |
Description |
| idEvent |
EWDBid |
The DB identifier for the Event for which the caller wants summary info. |
| pidOrigin |
EWDBid * |
Pointer to a EWDBid where the function will write the DB ID of the preferred origin for the Event. 0 will be written as the ID if there is no preferred origin for the given Event. |
| pidMagnitude |
EWDBid * |
Pointer to a EWDBid where the function will write the DB ID of the preferred magnitude for the Event. 0 will be written as the ID if there is no preferred magnitude for the given event. |
| pidMech |
EWDBid * |
Pointer to a EWDBid where the function will write the DB ID of the preferred mechanism for the Event. 0 will be written as the ID if there is no preferred mechanism for the given event. (Note: Mechanism are currently only supported in a trivial manner) |
|
|
| Group: |
EWDB_API_LIB |
| Sub Group: |
PARAMETRIC_API |
| Language: |
C |
| Location: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |
| Prototype: |
| int ewdb_api_GetStaMags( |
EWDBid idMagnitude, EWDB_StationMagStruct * pStaMags, int * pNumStaMagsFound, int * pNumStaMagsRetrieved, int BufferLen); |
|
| Description: |
The function retrieves a list of station magnitudes that are associated with a given summary magnitude. See EWDB_StationMagStruct for a description of the information retrieved for each associated station magnitude. |
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 station magnitudes was retrieved, but the caller's buffer was not large enough to accomadate all of the station magnitudes found. See pNumStaMagsFound for the number of station magnitudes found and pNumStaMagsRetrieved for the number of station magnitudes placed in the caller's buffer. |
|
PARAMETER INFO |
| Parameter |
Type |
Description |
| idMagnitude |
EWDBid |
This function retrieves a list of station magnitudes associated with an summary magnitude. idMagnitude is the database ID of the magnitude for which the caller wants a list of station magnitudes. |
| pStaMags |
EWDB_StationMagStruct * |
Buffer allocated by the caller, where the function will write the list of station magnitudes. |
| pNumStaMagsFound |
int * |
Pointer to an integer where the function will write the number of station magnitudes found. |
| pNumStaMagsRetrieved |
int * |
Pointer to an integer where the function will write the number of station magnitudes placed in the caller's buffer(pStaMags). |
| BufferLen |
int |
Size of the pStaMags buffer as a multiple of EWDB_StationMagStruct. (example: 15 structs) |
|
|
| Group: |
EWDB_API_LIB |
| Sub Group: |
PARAMETRIC_API |
| Language: |
C |
| Location: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |
| Prototype: |
|
| Source File: |
src/oracle/schema-working/src/parametric/ewdb_api_InsertcodaWithMag.c |
| Description: |
Function creates a coda duration based station magnitude from the caller supplied information in pCodaDur. The function assumes that the caller has supplied all station magnitude information including summary magnitude data in the EWDB_StationMagStruct. The caller need not fill in PeakAmp related information as it is inappropriate. The pCodaDur->idMagnitude and pCodaDur->StaMagUnion.CodaDur.idPick values must be valid existing Magnitude and Pick DB IDs respectively. The pCodaDur->idChan value must also be filled in with the DB ID of a valid existing channel. Upon successful completion, the function writes the DB IDs of the newly created coda duration, coda termination, and station magnitude to pCodaDur->idCodaDur, pCodaDur->idTCoda, and pCodaDur->idMagLink respectively. This function performs a full insertion of a coda, complete with how that coda (duration) contributed to an overall duration magnitude. |
| Note: |
You should use this function instead of using ewdb_internal_CreateTCoda(), ewdb_internal_CreateCodaDur, and ewdb_internal_CreateStaMag(), unless you are VERY SURE that you know what you are doing, and know exactly how to use those functions. |
RETURN CODE INFO |
| Return Type: |
int |
|
PARAMETER INFO |
|
|
| Group: |
EWDB_API_LIB |
| Sub Group: |
PARAMETRIC_API |
| Language: |
C |
| Location: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |
| Prototype: |
|
| Source File: |
src/oracle/schema-working/src/parametric/ewdb_api_InsertPeakAmpWithMag.c |
| Description: |
Function creates a peak amplitude based station magnitude from the caller supplied information in pPeakAmp. The function assumes that the caller has supplied all station magnitude information including summary magnitude data in the EWDB_StationMagStruct. The caller need not fill in CodaDur related information as it is inappropriate. This function performs a full insertion of an amplitude, complete with how that amplitude contributed to an overall magnitude. |
| Note: |
You should use this function instead of using ewdb_internal_CreatePeakAmp(), and ewdb_internal_CreateStaMag(), unless you are VERY SURE that you know what you are doing, and know exactly how to use those functions. |
RETURN CODE INFO |
| Return Type: |
int |
|
PARAMETER INFO |
| Parameter |
Type |
Description |
| pPeakAmp |
EWDB_StationMagStruct * |
Pointer to a EWDB_PhaseAmpStruct filled by the caller. |
|
|
| Group: |
EWDB_API_LIB |
| Sub Group: |
PARAMETRIC_API |
| Language: |
C |
| Location: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |
| Prototype: |
| int ewdb_api_UpdateComment( |
char * szFieldTypeName, EWDBid idCore, char * szUpdatedComment); |
|
| Description: |
Updates a comment for any record in the DB. Enter the tablename and the record ID for the table that the comment belongs to, and the function will update the comment for that record. This requires that the caller know DB layout, which is a bad thing. What we need is a lookup table for the comment types, and we can perform a conversion from the lookup table to the actual DB table type within the DB. |
RETURN CODE INFO |
| Return Type: |
int |
|
PARAMETER INFO |
| Parameter |
Type |
Description |
| szFieldTypeName |
char * |
Name of the table to updated |
| idCore |
EWDBid |
id of the record to update |
| szUpdatedComment |
char * |
Text of the updated comment. |
|
|
| Group: |
EWDB_API_LIB |
| Sub Group: |
PARAMETRIC_API |
| Language: |
C |
| Location: |
./src/oracle/schema-working/src/include/ewdb_ora_api.h |