nappy/nc_interface/na_to_cdms.py
def convert(self):
        """
        Reads the NASA Ames file object and converts to CDMS objects.
        Returns (variable_list, aux_variable_list, global_attributes_list).
        All these can be readily written to a CDMS File object.
        """
        if self.converted:
            log.info("Already converted to CDMS objects so not re-doing.")
            return (self.cdms_variables, self.cdms_aux_variables, self.global_attributes)

        self.na_file_obj.readData()

        # Convert global attribute
        self._mapNACommentsToGlobalAttributes()

        # Convert axes
        if not hasattr(self, 'cdms_axes'):  self._convertCdmsAxes()

        # Convert main variables
        if not hasattr(self, 'cdms_variables'):  self._convertCdmsVariables()

        # Then do auxiliary variables
        if hasattr(self.na_file_obj, "NAUXV") and (type(self.na_file_obj.NAUXV) == type(1) and self.na_file_obj.NAUXV > 0):   # Are there any auxiliary variables?
            if not hasattr(self, 'cdms_aux_variables'):  
                self._convertCdmsAuxVariables()
        else:
            self.cdms_aux_variables = []
            
        self.converted = True
        return (self.cdms_variables, self.cdms_aux_variables, self.global_attributes)

        Reads the NASA Ames file object and converts to CDMS objects.
        Returns (variable_list, aux_variable_list, global_attributes_list).
        All these can be readily written to a CDMS File object.
        
Reads the NASA Ames file object and converts to CDMS objects.
Reads the NASA Ames file object and converts to CDMS objects .
def convert(self):
        if self.converted:
            log.info("Already converted to CDMS objects so not re-doing.")
            return (self.cdms_variables, self.cdms_aux_variables, self.global_attributes)
        self.na_file_obj.readData()
        self._mapNACommentsToGlobalAttributes()
        if not hasattr(self, 'cdms_axes'):  self._convertCdmsAxes()
        if not hasattr(self, 'cdms_variables'):  self._convertCdmsVariables()
        if hasattr(self.na_file_obj, "NAUXV") and (type(self.na_file_obj.NAUXV) == type(1) and self.na_file_obj.NAUXV > 0):   
            if not hasattr(self, 'cdms_aux_variables'):  
                self._convertCdmsAuxVariables()
        else:
            self.cdms_aux_variables = []
        self.converted = True
        return (self.cdms_variables, self.cdms_aux_variables, self.global_attributes)
def convert ( self ) : if self . converted : log . info ( "Already converted to CDMS objects so not re-doing." ) return ( self . cdms_variables , self . cdms_aux_variables , self . global_attributes ) self . na_file_obj . readData ( ) self . _mapNACommentsToGlobalAttributes ( ) if not hasattr ( self , 'cdms_axes' ) : self . _convertCdmsAxes ( ) if not hasattr ( self , 'cdms_variables' ) : self . _convertCdmsVariables ( ) if hasattr ( self . na_file_obj , "NAUXV" ) and ( type ( self . na_file_obj . NAUXV ) == type ( 1 ) and self . na_file_obj . NAUXV > 0 ) : if not hasattr ( self , 'cdms_aux_variables' ) : self . _convertCdmsAuxVariables ( ) else : self . cdms_aux_variables = [ ] self . converted = True return ( self . cdms_variables , self . cdms_aux_variables , self . global_attributes )
Reads the NASA Ames file object and converts to CDMS objects.
Reads the NASA Ames file object and converts to CDMS objects .
"""
        Reads the NASA Ames file object and converts to CDMS objects.
        Returns (variable_list, aux_variable_list, global_attributes_list).
        All these can be readily written to a CDMS File object.
        """ # Convert global attribute # Convert axes # Convert main variables # Then do auxiliary variables # Are there any auxiliary variables?
self