resqpy.olio.load_data.load_corp_array_from_file

resqpy.olio.load_data.load_corp_array_from_file(file_name, extent_kji=None, corp_bin=False, swap_bytes=True, max_lines_for_keyword=100, comment_char=None, data_free_of_comments=False, use_binary=False, eight_mode=False, use_numbers_only=None)[source]

Loads a nexus corner point (CORP) array from a file, returns a 7D numpy array in pagoda ordering.

Parameters:
  • file_name – The name of an ascii file holding the CORP data (no other keywords with numeric data should be in the file); write access to the directory is likely to be needed if use_binary is True

  • extent_kji – The extent of the grid as a list or a 3 element numpy array, in the order [NK, NJ, NI]. If extent_kji is None, the extent is figured out from the data. It must be given for 1D or 2D models

  • corp_bin (boolean, default False) – if True, input file is in bespoke corp binary format, otherwise ascii

  • swap_bytes (boolean, default True) – if True, byte ordering of corp bin data is reversed; only relevant if corp_bin is True

  • max_lines_for_keyword – the maximum number of lines to search for CORP keyword; set to zero if file is known to be data only

  • comment_char – A single character string which is interpreted as introducing a comment

  • data_free_of_comments – If True, once the numeric data is encountered, it is assumed that there are no further comments (allowing a faster load)

  • use_binary – If True, a more recent file containing a pure binary copy of the data is looked for first, in the same directory; if found, the data is loaded directly from that file; if not found, the binary file is created after the ascii has been loaded (ready for next time)

  • eight_mode – If True, the data is assumed to be in CORP EIGHT ordering; otherwise the normal ordering (The code does not look for keywords.); this is not automatically determined from any keyword in the file

  • use_numbers_only – no longer in use, ignored

Returns:

A numpy array containing the CORP data in 7D pagoda protocol ordering. The extent of the grid, and hence shape of the array is determined from the corner point data unless extent_kji has been specified.