nappy/nc_interface/nc_to_na.py
def _readCDMSFile(self, var_ids=None, exclude_vars=[]):
        """
        Reads the file and returns all the CDMS variables in a list as well
        as the global attributes: (cdms_variable_list, global_atts_list)
        If var_ids is defined then only get those.
        """
        fin = cdms.open(self.nc_file)
        cdms_variables = []

        # Make sure var_ids is a list
        if type(var_ids) == type("string"):
            var_ids = [var_ids]

        for var_id in fin.listvariables():
            if var_ids == None or var_id in var_ids:
                if var_id not in exclude_vars:

                    # Check whether singleton variable, if so create variable
                    vm = fin[var_id]
                    var = fin(var_id)
                   
                    if hasattr(vm, "rank") and vm.rank() == 0:
                        var = cdms.createVariable(numpy.array(float(fin(var_id))), id=vm.id, attributes=vm.attributes)

                    cdms_variables.append(var)

        globals = fin.attributes.items()
        return (cdms_variables, globals)

        Reads the file and returns all the CDMS variables in a list as well
        as the global attributes: (cdms_variable_list, global_atts_list)
        If var_ids is defined then only get those.
        
Reads the file and returns all the CDMS variables in a list as well
as the global attributes: (cdms_variable_list, global_atts_list)
If var_ids is defined then only get those.
Reads the file and returns all the CDMS variables in a list as well as the global attributes : ( cdms_variable_list global_atts_list ) If var_ids is defined then only get those .
def _readCDMSFile(self, var_ids=None, exclude_vars=[]):
        fin = cdms.open(self.nc_file)
        cdms_variables = []
        if type(var_ids) == type("string"):
            var_ids = [var_ids]
        for var_id in fin.listvariables():
            if var_ids == None or var_id in var_ids:
                if var_id not in exclude_vars:
                    vm = fin[var_id]
                    var = fin(var_id)
                    if hasattr(vm, "rank") and vm.rank() == 0:
                        var = cdms.createVariable(numpy.array(float(fin(var_id))), id=vm.id, attributes=vm.attributes)
                    cdms_variables.append(var)
        globals = fin.attributes.items()
        return (cdms_variables, globals)
def _readCDMSFile ( self , var_ids = None , exclude_vars = [ ] ) : fin = cdms . open ( self . nc_file ) cdms_variables = [ ] if type ( var_ids ) == type ( "string" ) : var_ids = [ var_ids ] for var_id in fin . listvariables ( ) : if var_ids == None or var_id in var_ids : if var_id not in exclude_vars : vm = fin [ var_id ] var = fin ( var_id ) if hasattr ( vm , "rank" ) and vm . rank ( ) == 0 : var = cdms . createVariable ( numpy . array ( float ( fin ( var_id ) ) ) , id = vm . id , attributes = vm . attributes ) cdms_variables . append ( var ) globals = fin . attributes . items ( ) return ( cdms_variables , globals )
Reads the file and returns all the CDMS variables in a list as well
as the global attributes: (cdms_variable_list, global_atts_list)
If var_ids is defined then only get those.
Reads the file and returns all the CDMS variables in a list as well as the global attributes : ( cdms_variable_list global_atts_list ) If var_ids is defined then only get those .
"""
        Reads the file and returns all the CDMS variables in a list as well
        as the global attributes: (cdms_variable_list, global_atts_list)
        If var_ids is defined then only get those.
        """ # Make sure var_ids is a list
 # Check whether singleton variable, if so create variable

self
var_ids
exclude_vars