import pickle


def loadRadianceObj(savefile=None):
    """
    Load the pickled radiance object for further use
    Usage (once you're in the correct local directory)::
        
        demo = bifacial_radiance.loadRadianceObj(savefile)
    
    Parameters
    ----------
    savefile : str
        Optional savefile name. Otherwise default to `save.pickle`
            
    """
    
    if savefile is None:
        savefile = 'save.pickle'
    with open(savefile,'rb') as f:
        loadObj= pickle.load(f)
    
    print('Loaded file {}'.format(savefile))
    return loadObj