|
POSC Specifications Version 2.2 |
Getting Started Awk BEGIN |
Below is the entire portion of the BEGIN portion. Note that in addition to the explained LOOKUP and coordinate system information, the BEGIN also contains a set of code tables to be used in a later loop.
# uses /posc/data/util/awkprint
# usage:
# gawk -f /home/bobbitt/utils/awkprint -f g_well table2 > (output)
BEGIN {
FS = "\t"
topof[1] = "B46"
topof[2] = "C38"
topof[3] = "D11"
topof[4] = "D18"
topof[5] = "E41"
topof[6] = "E49"
topof[7] = "F11"
topof[8] = "F21"
topof[9] = "F37"
topof[10] = "F39"
plookup("actual","ref_existence_kind","name","actual")
plookup("loc_field","ref_naming_system","kind","local field")
plookup("ilab","ref_source","name","ILAB")
plookup("earth2d","ref_coordinate_system_constraint","name","earth 2d")
plookup("mdsys","ref_coordinate_system_constraint","name","measured depth system")
plookup("vertsys","ref_coordinate_system_constraint","name","vertical system")
plookup("kbpt","ref_wellbore_point","name","kelly bushing")
plookup("pick","ref_wellbore_point","name","geologic pick")
plookup("inside","ref_object_intersection","kind","inside")
plookup("is_within","ref_well_surface_feature_role","kind","is located within")
plookup("mdepth","ref_quantity_property","name","measured depth")
plookup("twotime","ref_quantity_property","name","seismic time")
plookup("sealevel","local_spatial_coordinate_system","identifier","sea level elevation")
plookup("stratton_field","regulatory_field","identifier","Stratton-Agua Dulce field")
plookup("stratton_area","general_surface_area","identifier","Stratton Agua Dulce field")
# Create a reference entity value
pifnexist("labelaa","csorig","ref_other_earth_point","kind","coordinate system origin")
pentity("ref_other_earth_point","csorig")
pstring("kind","coordinate system origin")
pstring("description","A point that serves as an origin to a coordinate system.")
pinstanceh("source","ilab")
printf("\n")
printf("LABEL\tlabelaa\n")
printf("\n")
# Create the coordinate system
pentity("general_earth_surface_point","swcorner")
pstring("identifier","SW Corner, Stratton Field area")
pstring("description","The South West Corner of the seismic survey supplied by the BEG, in the Stratton Field. Location unknown.")
pinstanceh("ref_other_earth_point","csorig")
printf("\n")
pentity("general_coordinate_system_axis","xaxis")
pinstancev("ref_quantity_property","ref_quantity_property","name","x")
pinstanceh("source","ilab")
printf("\n")
pentity("general_coordinate_system_axis","yaxis")
pinstancev("ref_quantity_property","ref_quantity_property","name","y")
pinstanceh("source","ilab")
printf("\n")
pentity("local_spatial_coordinate_system","xysystem")
pstring("identifier","Stratton local coordinate system")
pinstanceh("ref_coordinate_system_constraint","earth2d")
pinstanceh("source","ilab")
pstring("description","Local 2d coordinate system with origin at southwestern corner of the Stratton field. Supplied by the BEG")
printf("ATTRIBUTE\tcoordinate_system_axis\tDAE_AGG_LIST\tDAE_C_INSTANCE\n")
printf("VALUE\tHANDLE\txaxis\n")
printf("VALUE\tHANDLE\tyaxis\n")
printf("ATTRIBUTE\tearth_surface_feature\tDAE_AGG_SET\tDAE_C_INSTANCE\n")
printf("VALUE\tHANDLE\tstratton_field\n")
pinstanceh("vertex","swcorner")
printf("\n")
# Form the vertical time coordinate system
pentity("vertical_time_system_axis","vtaxis")
pinstanceh("ref_quantity_property","twotime")
pstring("description","Two way P wave travel time from sea level")
pinstancev("vertical_datum","geoid","identifier","Mean Sea Level")
printf("\n")
pentity("local_spatial_coordinate_system","timesystem")
pstring("identifier","Two way time system")
pinstanceh("ref_coordinate_system_constraint","vertsys")
pinstanceh("source","ilab")
printf("ATTRIBUTE\tcoordinate_system_axis\tDAE_AGG_LIST\tDAE_C_INSTANCE\n")
printf("VALUE\tHANDLE\tvtaxis\n")
printf("\n")
}
Following is the EntityLoader command file that is created from the BEGIN portion:
LOOKUP actual VALUE ref_existence_kind name actual LOOKUP loc_field VALUE ref_naming_system kind local field LOOKUP ilab VALUE ref_source name ILAB LOOKUP earth2d VALUE ref_coordinate_system_constraint name earth 2d LOOKUP mdsys VALUE ref_coordinate_system_constraint name measured depth system LOOKUP vertsys VALUE ref_coordinate_system_constraint name vertical system LOOKUP kbpt VALUE ref_wellbore_point name kelly bushing LOOKUP pick VALUE ref_wellbore_point name geologic pick LOOKUP inside VALUE ref_object_intersection kind inside LOOKUP is_within VALUE ref_well_surface_feature_role kind is located within LOOKUP mdepth VALUE ref_quantity_property name measured depth LOOKUP twotime VALUE ref_quantity_property name seismic time LOOKUP sealevel VALUE local_spatial_coordinate_system identifier sea level elevation LOOKUP stratton_field VALUE regulatory_field identifier Stratton-Agua Dulce field LOOKUP stratton_area VALUE general_surface_area identifier Stratton Agua Dulce field IF_NEXISTS labelaa csorig VALUE ref_other_earth_point kind coordinate system origin ENTITY ref_other_earth_point csorig ATTRIBUTE kind DAE_C_STRING VALUE coordinate system origin ATTRIBUTE description DAE_C_STRING VALUE A point that serves as an origin to a coordinate system. ATTRIBUTE source DAE_C_INSTANCE VALUE HANDLE ilab LABEL labelaa ENTITY general_earth_surface_point swcorner ATTRIBUTE identifier DAE_C_STRING VALUE SW Corner, Stratton Field area ATTRIBUTE description DAE_C_STRING VALUE The South West Corner of the seismic survey supplied by the BEG, in the Stratton Field. Location unknown. ATTRIBUTE ref_other_earth_point DAE_C_INSTANCE VALUE HANDLE csorig ENTITY general_coordinate_system_axis xaxis ATTRIBUTE ref_quantity_property DAE_C_INSTANCE VALUE ref_quantity_property name x ATTRIBUTE source DAE_C_INSTANCE VALUE HANDLE ilab ENTITY general_coordinate_system_axis yaxis ATTRIBUTE ref_quantity_property DAE_C_INSTANCE VALUE ref_quantity_property name y ATTRIBUTE source DAE_C_INSTANCE VALUE HANDLE ilab ENTITY local_spatial_coordinate_system xysystem ATTRIBUTE identifier DAE_C_STRING VALUE Stratton local coordinate system ATTRIBUTE ref_coordinate_system_constraint DAE_C_INSTANCE VALUE HANDLE earth2d ATTRIBUTE source DAE_C_INSTANCE VALUE HANDLE ilab ATTRIBUTE description DAE_C_STRING VALUE Local 2d coordinate system with origin at southwestern corner of the Stratton field. Supplied by the BEG ATTRIBUTE coordinate_system_axis DAE_AGG_LIST DAE_C_INSTANCE VALUE HANDLE xaxis VALUE HANDLE yaxis ATTRIBUTE earth_surface_feature DAE_AGG_SET DAE_C_INSTANCE VALUE HANDLE stratton_field ATTRIBUTE vertex DAE_C_INSTANCE VALUE HANDLE swcorner ENTITY vertical_time_system_axis vtaxis ATTRIBUTE ref_quantity_property DAE_C_INSTANCE VALUE HANDLE twotime ATTRIBUTE description DAE_C_STRING VALUE Two way P wave travel time from sea level ATTRIBUTE vertical_datum DAE_C_INSTANCE VALUE geoid identifier Mean Sea Level ENTITY local_spatial_coordinate_system timesystem ATTRIBUTE identifier DAE_C_STRING VALUE Two way time system ATTRIBUTE ref_coordinate_system_constraint DAE_C_INSTANCE VALUE HANDLE vertsys ATTRIBUTE source DAE_C_INSTANCE VALUE HANDLE ilab ATTRIBUTE coordinate_system_axis DAE_AGG_LIST DAE_C_INSTANCE VALUE HANDLE vtaxis