"@(#)na2vbbk.doc 1.7 - 01/07/12 NGS" ---------------------------------------------------------------------- DOCUMENTATION for NGS program na2vbbk ---------------------------------------------------------------------- PROGRAM FUNCTION: ---------------------------------------------------------------------- Program na2vbbk performs file format conversion from a Leica/Wild NA2000/3000 series digital level output file format to a NGS vertical bluebook format. Minimal data checks are performed. PROGRAM MODIFICATIONS: ---------------------------------------------------------------------- 2000aug09 v1.5 Left-justified the temperature fields in 41, 43 records; fixed temperature field width to 4 characters. 2001feb02 v1.6 Added comment records, as defined as a '#' in 1st column. 2001jun29 v1.7 Allowed 4101 records to follow 4199 records, allowing change of operator at end of section to make a *40* record. Observer added to start and end of section reports. PROGRAM OPERATION: ---------------------------------------------------------------------- Entering the program name with less than two or more than four parameters displays program version, date, and usage. The command line requires an input file, and the observation technique. An option exists for Weather System: "WS"(default) or "SW" An option exists for Temperature Scale: "C" (default) or "F" Observation technique may be: 2 (BF) single sighting: backsight, foresight 4 (BFFB) double sighting: sight, relevel instrument, sight again Weather System is assumed as per the Bluebook format, Wind/Sun ("WS") The format from na3000, Sun/Wind, is deprecated, but accomodated. The report file gives order as Wind/Sun, and is marked as such. Temperature is assumed Celsius. If Fahrenheit temperature scale is used, then an optional parameter (F) must be added to indicate same and convert. The report file gives temperatures in Celsius. If temperature option is used, weather system option MUST be used. Sample command lines are: na2vbbk l123451.hgz_edbls 4 na2vbbk l123451.hgz_edbls 4 WS na2vbbk l123452.hgz_edbls 2 SW F At program start, messages are printed to the screen: program name, version and program release date Input data file = Output bluebook file = Output report file = A normal job completion is indicated by the screen message: "Normal end of na2vbbk. Bye!" Program results must be carefully reviewed. No data check is performed regarding conformance to FGCC leveling standards. Y2K STATEMENT: Input datafiles have YYMMDD only: they do not have century. The output vertical bluebook will not have century. Individuals who use this program, and who are familiar with dates of field operations, must add a *10* record with eight(8) digit dates of beginning and end of field observations. This program must be revised when the vertical bluebook changes to an eight(8) digit date. PROGRAM STANDARDS: ---------------------------------------------------------------------- This program follows the Leica/Wild NA2002/NA3003 format version 3.2, 08.96 (August 1996). This program assumes that the user is following the Federal Geodetic Control Committee (FGCC) specifications and procedures for differential leveling. This program provides no checks for adherence to this standard. The following code block records are to be used with program na2vbbk, and are required to prepare the field abstract. All entries must be integer numeric. [ The following text is modified from file na3000.doc ] [ - see order of wind and sun codes ] CODE BLOCK 1 Beginning of an observation session for each observer: Data word 1 (I6): Date, MMDDYY Data word 2 (I4): Time, HHMM - based on a 24 hour clock Data Word 3 (I2): Wind and Sun Codes, wind/sun - see list below NOTE: now follows bluebook, not previous readme, order Data Word 4 (I3): Observer's Number CODE BLOCK 2 Instrumentation data: Data Word 1 (I8): Instrument Serial Number Data Word 2 (I8): Collimation Error, units = 10 * seconds of arc Data Word 3 (I8): Rod 1 Serial Number Data Word 4 (I8): Rod 2 Serial Number CODE BLOCK 11 Beginning of an observation section: Data Word 1 (I4): Time, HHMM - based on a 24 hour clock Data Word 2 (I2): Wind and Sun Codes, wind/sun - see list below NOTE: now follows bluebook, not previous readme order Data Word 3 (I4): Survey Point Serial Number (SPSN) of Initial Backsight Station Data Word 4 (I8): Rod Number (1 or 2) on Initial Backsight Station CODE BLOCK 22 Reject the entire previous setup observation sequence: Data Word 1 through 4 - blank CODE BLOCK 33 To indicate a valid setup and record temperature probe values: Data Word 1 (I3): Lower Temperature Probe, units = 10 * decimal degrees Data Word 2 (I3): Upper Temperature Probe, units = 10 * decimal degrees Data Word 3 (I3): blank for Celsius units 1 for Fahrenheit units Data Word 4 : blank CODE BLOCK 99 Ending of an observation section: Data word 1 (I4): Time, HHMM - based on a 24 hour clock Data Word 2 (I2): Wind and Sun Codes, wind/sun - see list below NOTE: order now follows bluebook, not previous readme Data Word 3 (I4): Survey Point Serial Number (SPSN) of Final Foresight Station Data Word 4 (I8): Rod Number (1 or 2) on Final Foresight Station CODE BLOCK 9999 Ending of an observation session for each observer: Data word 1 (I6): Date, MMDDYY Data word 2 (I4): Time, HHMM - based on a 24 hour clock Data Word 3 (I2): Wind and Sun Codes, wind/sun - see list below NOTE: now follows bluebook, not previous readme, order Data Word 4 (I3): Observer's Number Special CODE BLOCKS Levelling method 1 (=BF BF ...) 410010+?......1 and Levelling method 2 (=BFFB BFFB ...) 410010+?......2 are used only as a check. For backward compatibility with previous digital level formats, the user must specify leveling method on the command line. If user specified method conflicts with a special code block, an ERROR is printed and the program exits. Repeated measurements of "xxx" 410012+?....xxx xxx = 330/331/332/333/335/336 are valid ONLY if overwriting the immediately preceding observation. It is preferred to reject an entire setup with a Code Block 22. If a repeat code block is found, a message with the line number is printed to the screen. Comment Records Any record that begins with a pound symbol ('#') in the first column will be ignored, and may be used for user inserted comments. WIND/SUN CODES ------------------------------- See Blue Book, Vol II, pg 6-23, 6-37. (think _W_eather _S_ystem) Wind Codes: 0 Average wind speed less than 10 km/hr (6 mi/hr) 1 Average wind speed 10 to 25 km/hr (6 to 15 mi/hr) 2 Average wind speed more than 25 km/hr (15 mi/hr) Sun Codes: 0 Less than 25 percent of setups in sunny conditions 1 25 to 75 percent of setups in sunny conditions 1 More than 75 percent of setups in sunny conditions PROGRAM METHOD: ---------------------------------------------------------------------- Data check: ------------------------------- A data check is performed to determine instrument type by checking backsight staff readings of an "11-83" record type, at the Data Word Index type 331, character 6, just before the "+". If a "6" is found, then a NA2000 series level is indicated and heights are reported with four(4) digits right of decimal. If a "8" is found, then a NA3000 series level is indicated and heights are reported with five(5) digits right of decimal. As soon as the instrument type is found, searching stops and the data file is reset to the beginning. If no Data Word Index type 331 can be found in the data set(no obs'ns), then an error message is printed and the program ends. A data check is performed to check leveling technique, either 2 or 4 sightings. The This check is valid only with datafiles that adhere to the August 1996 format. Earlier format standards that do not have internal data to perform this check will produce no error message. The report file should be inspected for unusual listing. Records greater than 80 characters exceed expected length and generate an error message. Process: ------------------------------- Data loop: ------------------------------ Successive lines of the datafile are read, with an expected order. Any lines found out of order results in a printed error message, and the data line, for inspection, and the program ends with output bluebook file removed. The report file remains, for inspection. For example, only one temperature record is expected. A reobservation of the temperature will result in an error. ---------- Expected records: ---------- ---------- A "41-91" record, ie: 410027+?......1 indicates leveling method 1 (=BF BF ...). If the observation type is not 2, then an error message is printed to the screen, the output bluebook and report files are removed and the program ends. This check is valid only with datafiles that adhere to the August 1996 format. Earlier format standards that do not have internal data to perform this check and will produce no error message. In such a case, the report file should be inspected for unusual listing. ---------- A "41-92" record, ie: 410045+?......2 indicates leveling method 2 (=BFFB BFFB ...). If the observation type is not 4, then an error message is printed to the screen, the output bluebook and report files are removed and the program ends. This check is valid only with datafiles that adhere to the August 1996 format. Earlier format standards that do not have internal data to perform this check and will produce no error message. In such a case, the report file should be inspected for unusual listing. ---------- A "41-93" record, ie: 410045+!....xxx indicates a repeated measurement of type "xxx". The number of observations is decremented, so the next observation will overwrite the previous observation. A message with the line number is printed to the screen. This check is valid only with datafiles that adhere to the August 1996 format. A "41-22" record is prefered for rejecting observation sets. ---------- A "41-01" record, ie: 410001+00000001 42....+00060694 43....+00001212 44....+00000002 45....+00005767 mmddyy hhmm wind-^^-sun cop has start of session data, which yields information for: 40 record: calibration date, calibration time rod equipment code is set = "396" micrometer code is set = blank 41 record: crew chief of party The calibration date is used for run date on 41 and 43 records. used for the 40, 41 and 43 records. The sun and wind codes are not used; the values at start of section are used. As this record appears only at the start of a section, a toggle is set to print a 40 record (equipment data) ---------- A "41-02" record, ie: 410002+00000002 42....+00091112 43....-00000024 44....+00001000 45....+00001001 inst S/N collim rod1 S/N rod2 S/N has additional instrument information for the 40 record, with instrument serial number, tangent of collimation error (units = mm/meter), and two rod serial numbers. A three line header, starting "Start of Session..." are printed to the message file. ---------- A "41-11" record, ie: 410003+00000011 42....+00001213 43....+00000012 44....+00001400 45....+00000001 start hhmm wind-^^-sun spsn start rod# has start of section data, including start time, wind code, sun code, start SPSN, and rod number. A three line header, starting "Section starts on..." are printed to the report file. NOTE: the order in the input record is "wind,sun" cc46,cc47 and adheres to the standard set forth by the Blue Book Vol II (Vertical) but is different from that used with programs nasingle and na3000. ---------- A "41-22" record, ie: 410009+00000022 ... indicates a rejected observation. "REJECT" is printed to the report file. Corrections are applied to: - Sum of elevation differences - Sum of distances observed - Sum of distance differences - Sum of number of observation sets - Sum of upper temperature readings - Sum of lower temperature readings - Sum of number of temperature readings ---------- A "41-33" record, ie: 410009+00000033 42....+00000191 43....+00000192 loTemp hiTemp indicates a temperature record. Upper and lower temperature observations are read, and corrected to Celsius from Fahrenheit, if required. A warning messages are printed to screen only if either temp is below -10.0 C (14 F), or above 40 C (104 F). Temperatures in Celsius are printed in the report file. If the difference between the upper and lower temperatures is greater than 3.0 C, then two(2) asterisks are printed on the extreme right side of the report file. A running sum of upper probe temperatures and lower probe temperatures is found and stored. The average of the current record's temperatures is found. At the beginning of the section, the average of the first record's upper and lower temperatures are used as the starting temperature in the 41 record. At the end of a section, the average of the last record's upper and lower temperatures are used as the ending temperature in the 41 record. At the end of a section, the average of lower probe temperatures is set as the low_probe_temp the average of upper probe temperatures is set as the upper_probe_temp and these values are printed in the report file as "Mean section temperatures:" ---------- A "41-0099" record, ie: 410069+00000099 42....+00001317 43....+00000012 44....+00001401 45....+00000001 end hhmm wind -^^-sun end spsn end rod# indicates a end of section record. NOTE: the order in the input record is "wind,sun" cc46,cc47 and adheres to the standard set forth by the Blue Book Vol II (Vertical) but is different from that used with programs nasingle and na3000. 41 and 43 records are printed. For the 41 record: - time zone is set blank - temperature scale is set as per command line; default is "C" (Celsius) - stadia code is set "F" (Full) - distance units are set "KM" (kilometers) - elevation units are set "MT" (meters) - end temperature is the average of the last temperature record's upper and lower temperature observations. - beginning and ending section wind codes are averaged and rounded UP to the nearest integer (wind1=1,wind2=2,windAve=2) and hence states a "worst-case" condition. - beginning and ending section sun codes are averaged and rounded UP to the nearest integer (sun1=2, sun2=3, sunAve=3) and hence states a "worst-case" condition. - sum of distances to backsight are rounded to the nearest integer - sum of distances to foresight are rounded to the nearest integer - the running distance in kilometers is reported - the sum of elevation differences is reported For the 43 record: - field refraction correction is set blank - field rod correction is set blank - mid-probe temperature is set blank - reject flag is set blank - temperature scale is set "C" (Celsius) - temperature code is set "O" (Observed) - the running sum of the lower and the upper temperature probes are separately averaged then rounded to the nearest tenth of a degree. A report file entry is printed with: - "Mean section temperatures", for upper and lower temperature probe observations, as also appearing on the 43 record - SPSN of end of section station - time at end of section - wind and sun codes at end of section (not averaged) - rod number on the end of section mark/station BLUEBOOK entries are printed, for a 41, then a 43 record for the section. Observation and record data structures are cleared and reinitialized for the next section. ---------- A "41-9999" record, ie: 410144+00009999 42....+00060694 43....+00001420 44....+00000012 45....+00005767 end mmddyy end hhmm wind -^^-sun cop indicates a end of session record. "End of Session" is printed to the report file. The ending date, time, wind code, sun code, and crew chief of party are printed to the report file. None of this data is used with the bluebook file. A line of asterisks are printed before advancing a page. ---------- A "11-83" record, ie: 110137+00000000 83..16+00000000 ht instr is an instrument height record. Note this field is manually entered, and is often not filled, because only height of stations and turning points are usually needed. Instrument height may be observed as a field check. Instrument height, rounded to the closest centimeter, is read. Probe heights and time zone are set to blanks and a *40* record is recorded in the bluebook file. ---------- A "11-32" record, is a horizontal and vertical observation record, ie: 110138+00000000 32..00+00016640 331106+00015052 52..06+0003+000 dist=16.640m 1st bs--^^^ dh=1.5052m 110139+00000001 32..00+00016080 332106+00015609 52..06+0003+001 83..06-00000557 dist=16.080m 1st fs--^^^ dh=1.5609m 0.1 mm = 0.0001m (NA2002) --^ Note precision and units by the key in the 6th space of data word: 6 = meter last digit = 0.1 mm 8 = meter last digit = 0.01 mm (NA3003 only) 0 = meter last digit = 1. mm 1 = foot last digit = 0.001 ft 7 = foot last digit = 0.0001 ft (NA3003 only) 9 = inch last digit = 0.0005 in (NA3003 only) Metric units are expected, and a warning is printed if not. The expected observation types, as given by the Word Index at column 33 are: obs_type=2 (BF) 331, 332 obs_type=4 (BFFB) 331, 332, 336, 335 However, files have been submitted with coded observation types: obs_type=4 (BFFB) 331, 332, 331, 332 so variable assignment is based on observation type(2/4) and observation number within the set, rather than the field coded Word Index. ------------------------------ If the number of observations equals the observation type, then reduction is performed. Vertical Reduction: ------------------ For two(2) observations per setup: average elevation difference equals backsight - foresight. For four(4) observations per setup: elevDifAve = ( (bsVert[0]-fsVert[0]) + (bsVert[1]-fsVert[1]) ) / 2 Also: bsVertAve = ( bsVert[0] + bsVert[1] ) / 2 fsVertAve = ( fsVert[0] + fsVert[1] ) / 2 bsVertDif = ( bsVert[0] - bsVert[1] ) fsVertDif = ( fsVert[0] - fsVert[1] ) Horizontal Reduction: -------------------- For two(2) observations per setup: bsDistAve = obs.bsDist[0]; fsDistAve = obs.fsDist[0]; For four(4) observations per setup: bsDistAve = (bsDist[0] + bsDist[1]) / 2.0 fsDistAve = (fsDist[0] + fsDist[1]) / 2.0 bsDistDif = bsDist[0] - bsDist[1]; fsDistDif = fsDist[0] - fsDist[1]; Then for both techniques: bsDistSum += obs.bsDistAve; fsDistSum += obs.fsDistAve; distObs = obs.bsDistAve + obs.fsDistAve; distObsSum += obs.distObs; distDif = obs.bsDistAve - obs.fsDistAve; distDifSum += obs.distDif; A line is sent to the report file with: elevDifAve average elevation difference elevDifSum sum of elevation differences distDif difference between fore and back sights distances (imbalance) distDifSum running total of sighting distance imbalance bsDistSum running total of backsight distances fsDistSum running total of foresight distances distObs distance observed this setup (meters) distObsSum running total of distance observed (kilometers) Proper job completion results with the message to screen: "Normal end of program" "Normal end of na2vbbk. Bye!" PROGRAMMERS NOTES: ---------------------------------------------------------------------- 1) Program version is SCCS based: If a function is significantly modified, edit then delta the main program to increment the version and reset the program release date. na2vbbk.doc - end ----------------------------------------------------------------------