cedadev / nappy

NASA Ames Processing in PYthon (NAPPy) - a Python library for reading, writing and converting NASA Ames files.
BSD 3-Clause "New" or "Revised" License
9 stars 13 forks source link

Add support for NDACC AMES 2160 file variant. #14

Closed acapparelli closed 6 years ago

acapparelli commented 6 years ago

As per https://github.com/cedadev/nappy/issues/10, this pull request adds support for reading and writing the NDACC variant of the AMES 2160 file (each file has starts with a header line and the rest is in a similar format to the standard AMES 2160 files).

OpenNAFile can now be called with an optional ignore_header_lines argument, which specifies the number of lines to be skipped from the start of the file. These lines are stored in the instance variable, ignored_header_lines.

For writing, the ignored_header_lines is added to the na_dictionary_keys variable so that the headers are transferred to the writer. The header lines are written directly to the output file, so as to not interfere with the NLHEAD value.

I have added one example raw NDACC file, as well as a test for reading and writing.

cc'ing @tomkralidis for any additional comments

agstephens commented 6 years ago

Thanks @acapparelli , I have merged into master.