User's Guide

Utility to convert an ASCII DDR file to binary format.

Function:

Converts an ASCII DDR file to binary format.

Parameters:

INFILE
Name of the input ASCII file to convert to a DDR. If the file does not exist (or ascii2ddr does not have permission to read this file), it will append a ".prt" extension to the given filename and attempt to access that file. This is done because .prt is the default extension dspddr puts on its output ASCII files (and the files converted by ascii2ddr must be created by running dspddr on a normal DDR file).

OUT
Output DDR file. This is the name to give the binary DDR file being created.

Examples:

  1. LAS> ascii2ddr infile=test.txt out=ddr1

    ASCII2DDR will parse the contents of the test.txt file, retrieving the information that is needed to create a binary DDR file. The values are validated and modified, if needed, to conform to the format of the binary DDR file. The ddr1.ddr file will then be created.

  2. LAS> ascii2ddr infile=test out=ddr2

    ASCII2DDR will first check if the file test, in the working directory, has read access. If it does not, it will next check if the file test.prt, in the working directory, has read access. If one of those is found to exist and allow itself to be read, ASCII2DDR will parse the contents of the test[.prt] file, retrieving the information that is needed to create a binary DDR file. The values are validated and modified, if needed, to conform to the format of the binary DDR file. The ddr2.ddr file will then be created.

Description/Algorithm:

ASCII2DDR parses an ASCII DDR file, retrieving the values from each DDR and Band DDR field. The values are checked for validity. If any critical fields are found to contain an invalid value, the application will terminate with a fatal error message. Noncritical fields found to contain an invalid value will be dealt with appropriately with warning messages issued to notify the user of the changes made. The DDR values from the ASCII file are placed into a DDR structure and the Band DDR values are placed into BDDR struture(s). When the ASCII DDR file has been parsed completely, the DDR structure and BDDR structure(s) will be used to create the binary DDR file.

Nonfatal Error Messages:

  1. [ascii2ddr-bandnum] Invalid band number <xx>; band record #<yy> not processed

    The indicated band number (<xx>) is not valid. This will cause the band record <yy> to be skipped and not included in the output DDR file.

  2. [ascii2ddr-bandrec] Excess band records exist in the ASCII DDR file

    The number of bands as indicated by the "NB" field at the beginning of the DDR file does not match the actual number of band records found in the file.

  3. [ascii2ddr-close] Error closing the ASCII DDR file

    A fatal error has already occurred and an error occurred when closing the ASCII DDR file.

  4. [ascii2ddr-delflg] $DELFLG is set; deleting all output files created by this application

    The cleanup routine was executed and all files created by ascii2ddr are being deleted. This occurs either due to a fatal error during processing or due to the user manually halting the application.

  5. [ascii2ddr-format] Acquisition date not in the LAS DDR date format (band <xx>)

    The acquisition date retrieved from band record <xx> is not in the LAS DDR date format (dd-mmm-yy).

  6. [ascii2ddr-format] Acquisition time not in the LAS DDR time format (band <xx>)

    The acquisition time retrieved from band record <xx> is not in the LAS DDR time format (hhmm:ss).

  7. [ascii2ddr-inc] Invalid increment; set to 1.0 and validity flag set to UNKNOWN

    Either the line or sample increment value was invalid. To indicate this, their validity flag has been changed to INVALID and the increment value that was invalid was reset to 1.0.

  8. [ascii2ddr-info] Using ascii ddr file <xxxxx>

    The specified ascii ddr file was not found to exist on disk or it was not readable. ascii2ddr appended the ".prt" extension to the file name and was able to access that file; this is the file that will be converted.

  9. [ascii2ddr-inval] Invalid <xxxxxxx>; validity flag set to INVALID (band <yy>)

    The indicated DDR field (<xxxxxxx>) value was invalid. To indicate this, its validity flag has being changed to INVALID. This message will apply to those 8 DDR fields that have validity flags as well as to the BDDR min/max intensity values. The band indication will only be listed when indicating a min/max intensity value was found invalid. In that case, the <yy> represents which band contained the invalid value.

  10. [ascii2ddr-lastmod] Error updating last modified date/time in DDR

    The last modified date and time could not be updated properly. The attempt made to update these values using c_lused failed. Check the preceding error message for the specific error that occured.

  11. [ascii2ddr-length] <xxxxxxx> string too long; truncated to <yyy> chars (band <zz>)

    The indicated string field (<xxxxxxx>) was longer than the maximum string length allowed by the DDR or BDDR structure. The string has been truncated to the indicated number of characters (<yyy>). The band indication will only be listed when indicating a string value in a band record was too long. In that case, the <zz> represents which band contained the string.

  12. [ascii2ddr-mastlin] Invalid master line value; reset to 1

    The master line value was invalid. Its value has been reset to 1.

  13. [ascii2ddr-mastsam] Invalid master sample value; reset to 1

    The master sample value was invalid. Its value has been reset to 1.

  14. [ascii2ddr-minmax] Min intensity was invalid; Max value not validated (band <xx>)

    The minimum intensity value was found to be invalid. Therefore, the validity flag is already going to be INVALID, so there is no point in validating the maximum intensity value. The <xx> represents which band record contained the invalid value.

  15. [ascii2ddr-minmax] Max value less than min; validity flag set to INVALID (band <xx>)

    The intensity values have been validated and the maximum value was determined to be less than the minimum value. To indicate this, their validity flag has been changed to INVALID. The <xx> represents which band record contained the invalid values.

  16. [ascii2ddr-modflag] <xxxxxxx> validity flag being set to UNKNOWN

    The indicated Band DDR field's (<xxxxxxx>) validity flag was not valid and is therefore being set to UNKNOWN (rather than INVALID because that is not a recognized validity flag value for the Band DDR flags).

  17. [ascii2ddr-modflag] <xxxxxxx> validity flag being set to INVALID

    The indicated DDR field's (<xxxxxxx>) validity flag was not valid and is therefore being set to INVALID.

  18. [ascii2ddr-projpar] Could not validate projection parameters due to invalid projection code

    The projection code was invalid, hence it is impossible to validate the projection parameters. The projection parameters and their validity flag will be copied to the output DDR unmodified.

  19. [ascii2ddr-retbddr] Error encountered retrieving <xxxxx>; set to <yyyyy> (band <zz>)

    An error occurred while parsing band record #<zz> for the value of field <xxxxx>. The field value has been set to the value indicated by <yyyyy>.

  20. [ascii2ddr-retddr] Error encountered retrieving <xxxxx>; set to <yyyyy>

    An error occurred while parsing the ASCII DDR file for the value of field <xxxxx>. The field value has been set to the value indicated by <yyyyy>.

  21. [ascii2ddr-valflg] Unrecognized validity flag for <xxxxxxx> (band <yy>)

    The indicated DDR field's (<xxxxxxx>) validity flag was not valid. This message will apply to those 8 DDR fields that have validity flags as well as to the BDDR min/max intensity values' validity flags. The band indication will only be listed when indicating a min/max validity flag is invalid. In that case, the <yy> represents which band contained the invalid flag.

Fatal Error Messages:

  1. [ascii2ddr-alloc] Error allocating dynamic memory

    There was an error allocating memory for the band ddr structures. If the error persists, contact the system administrator.

  2. [ascii2ddr-bandstr] Error placing band <xx>'s band record into a band structure

    The appropriate band ddr structure was not found for placing the indicated band number's band record into. Possible memory corruption could have occurred. Contact LAS support.

  3. [ascii2ddr-close] Error closing the ASCII DDR file

    Unable to close the ASCII DDR file.

  4. [ascii2ddr-eof] Unexpected EOF reached while parsing ASCII DDR file

    An EOF was reached before all the band records could be retrieved. The same number of band records is expected to be in the file as is indicated by the "NB" field at the beginning of the DDR file.

  5. [ascii2ddr-exist] OUT file <xxxxxxx> already exists

    The file specified for the output DDR already exists. Either remove the file and re-run the application or specify a different output file name.

  6. [ascii2ddr-fatal] Fatal error encountered

    A fatal error occured durring processing. Check the preceding error message for the specific error that occured.

  7. [ascii2ddr-host] Error creating host path name

    An error occurred while attempting to create the full host path name for the file specified in parameter OUT. Verify any path specification is correct and check directory permissions.

  8. [ascii2ddr-infile] Error retrieving parameter INFILE

    An error occurred while attempting to retrieve the parameter INFILE. Verify that the file exists on disk and check the file permissions.

  9. [ascii2ddr-invalid] Invalid <xxxxxxx>

    This indicated critical field value is invalid. The DDR will be useless without this value, so processing has been aborted.

  10. [ascii2ddr-open] Error opening file <xxxxxxx>

    An error occurred opening the input ASCII DDR file for reading. Check the file name and file permissions.

  11. [ascii2ddr-parse] Error retrieving critical DDR fields

    An error occurred while retrieving the critical DDR field values (those that must be valid or else the application exists with a fatal error). Check the preceding error message for the specific error that occurred.

  12. [ascii2ddr-parse] Error retrieving non-critical DDR fields

    An error occurred while retrieving the non-critical DDR field values. Check the preceding error message for the specific error that occurred.

  13. [ascii2ddr-parse] Error retrieving Band DDR fields

    An error occurred while retrieving the Band DDR field values. Check the preceding error message for the specific error that occurred.

  14. [ascii2ddr-read] Error reading from ASCII DDR file

    A general read error occurred while trying to read the next line from the DDR file. Verify the file is in the proper format (that format used by dspddr). This error could be a result of EOF being reached prematurely.

  15. [ascii2ddr-signal] Error setting the signal handlers for the TAE standard signals

    The signal handler routine could not be setup properly. The attempt made to set these using c_install_cleanup_handler failed. Check the preceding error message for the specific error that occured.

  16. [ascii2ddr-write] Error writing to the DDR file

    An error occurred while writing to the output DDR file. Check disk space. If the error persists, contact the system administrator.

User Notes:

    None.