nappy/nc_interface/nc_to_na.py
def _writeNAFileSubsetsWithinSizeLimit(self, this_na_dict, file_name, delimiter, 
                      float_format, size_limit, annotation):
        """
        If self.size_limit is specified and FFI is 1001 we can chunk the output into 
        different files in a NASA Ames compliant way. 
        Returns list of file names of outputs written.
        """
        file_names = []
        var_list = this_na_dict["V"]
        array_length = len(var_list[0])
        nvol_info = divmod(array_length, size_limit)
        nvol = nvol_info[0]

        # create the number of volumes (files) that need to be written.
        if nvol_info[1] > 0: nvol = nvol + 1

        start = 0
        letter_count = 0
        ivol = 0

        # Loop through until full array length has been written to a set of files.
        while start < array_length:
            ivol = ivol + 1
            end = start + size_limit

            if end > array_length:
                end = array_length

            current_block = []
            # Write new V array
            for v in var_list:
                current_block.append(v[start:end])

            # Adjust X accordingly in the na dictionary, because independent variable has been reduced in size
            na_dict_copy = nappy.utils.common_utils.modifyNADictCopy(this_na_dict, current_block, 
                                                                      start, end, ivol, nvol)
            # Append a letter to the file name for writing this block to
            file_name_plus_letter = "%s-%.3d.na" % (file_name[:-3], ivol)
            file_list.append(file_name_plus_letter)

            # Write data to output file
            x = nappy.openNAFile(file_name_plus_letter, 'w', na_dict_copy)
            x.write(delimiter=delimiter, float_format=float_format, annotation=annotation)
            x.close()

            msg = "\nOutput files split on size limit: %s\nFilename used: %s" % (size_limit, file_name_plus_letter)
            if DEBUG: log.debug(msg)
            self.output_message.append(msg)
            letter_count = letter_count + 1
            start = end

            file_names.append(file_name_plus_letter) 

        return file_names

        If self.size_limit is specified and FFI is 1001 we can chunk the output into 
        different files in a NASA Ames compliant way. 
        Returns list of file names of outputs written.
        
If self.size_limit is specified and FFI is 1001 we can chunk the output into
different files in a NASA Ames compliant way.
Returns list of file names of outputs written.
If self . size_limit is specified and FFI is 1001 we can chunk the output into different files in a NASA Ames compliant way . Returns list of file names of outputs written .
def _writeNAFileSubsetsWithinSizeLimit(self, this_na_dict, file_name, delimiter, 
                      float_format, size_limit, annotation):
        file_names = []
        var_list = this_na_dict["V"]
        array_length = len(var_list[0])
        nvol_info = divmod(array_length, size_limit)
        nvol = nvol_info[0]
        if nvol_info[1] > 0: nvol = nvol + 1
        start = 0
        letter_count = 0
        ivol = 0
        while start < array_length:
            ivol = ivol + 1
            end = start + size_limit
            if end > array_length:
                end = array_length
            current_block = []
            for v in var_list:
                current_block.append(v[start:end])
            na_dict_copy = nappy.utils.common_utils.modifyNADictCopy(this_na_dict, current_block, 
                                                                      start, end, ivol, nvol)
            file_name_plus_letter = "%s-%.3d.na" % (file_name[:-3], ivol)
            file_list.append(file_name_plus_letter)
            x = nappy.openNAFile(file_name_plus_letter, 'w', na_dict_copy)
            x.write(delimiter=delimiter, float_format=float_format, annotation=annotation)
            x.close()
            msg = "\nOutput files split on size limit: %s\nFilename used: %s" % (size_limit, file_name_plus_letter)
            if DEBUG: log.debug(msg)
            self.output_message.append(msg)
            letter_count = letter_count + 1
            start = end
            file_names.append(file_name_plus_letter) 
        return file_names
def _writeNAFileSubsetsWithinSizeLimit ( self , this_na_dict , file_name , delimiter , float_format , size_limit , annotation ) : file_names = [ ] var_list = this_na_dict [ "V" ] array_length = len ( var_list [ 0 ] ) nvol_info = divmod ( array_length , size_limit ) nvol = nvol_info [ 0 ] if nvol_info [ 1 ] > 0 : nvol = nvol + 1 start = 0 letter_count = 0 ivol = 0 while start < array_length : ivol = ivol + 1 end = start + size_limit if end > array_length : end = array_length current_block = [ ] for v in var_list : current_block . append ( v [ start : end ] ) na_dict_copy = nappy . utils . common_utils . modifyNADictCopy ( this_na_dict , current_block , start , end , ivol , nvol ) file_name_plus_letter = "%s-%.3d.na" % ( file_name [ : - 3 ] , ivol ) file_list . append ( file_name_plus_letter ) x = nappy . openNAFile ( file_name_plus_letter , 'w' , na_dict_copy ) x . write ( delimiter = delimiter , float_format = float_format , annotation = annotation ) x . close ( ) msg = "\nOutput files split on size limit: %s\nFilename used: %s" % ( size_limit , file_name_plus_letter ) if DEBUG : log . debug ( msg ) self . output_message . append ( msg ) letter_count = letter_count + 1 start = end file_names . append ( file_name_plus_letter ) return file_names
If self.size_limit is specified and FFI is 1001 we can chunk the output into
different files in a NASA Ames compliant way.
If self . size_limit is specified and FFI is 1001 we can chunk the output into different files in a NASA Ames compliant way .
"""
        If self.size_limit is specified and FFI is 1001 we can chunk the output into 
        different files in a NASA Ames compliant way. 
        Returns list of file names of outputs written.
        """ # create the number of volumes (files) that need to be written.
 # Loop through until full array length has been written to a set of files.
 # Write new V array
 # Adjust X accordingly in the na dictionary, because independent variable has been reduced in size
 # Append a letter to the file name for writing this block to
 # Write data to output file

self
this_na_dict
file_name
delimiter
float_format
size_limit
annotation