Ejemplo n.º 1
0
def current_playlist( request, *args, **keywords ):
    c = RequestContext( request )

    with MPDClient().connect( 'localhost', 6600 ) as mpd:
        c['songs'] = mpd.playlistinfo()

    logger.debug( c['songs'] )

    #Cleanup song information
    for song in c['songs']:
        song['filename'] = path.basename( song['file'] )
        song['time'] = formatTime( song['time'] )
    return c
Ejemplo n.º 2
0
def current_playlist(request, *args, **keywords):
    c = RequestContext(request)

    with MPDClient().connect('localhost', 6600) as mpd:
        c['songs'] = mpd.playlistinfo()

    logger.debug(c['songs'])

    #Cleanup song information
    for song in c['songs']:
        song['filename'] = path.basename(song['file'])
        song['time'] = formatTime(song['time'])
    return c
Ejemplo n.º 3
0
def songs(request, artist=None, album=None, *args, **keywords):
    c = RequestContext(request)
    logger.info("songs")

    commands = []
    c['breadcrumbs'] = [
        {
            'text': 'browse',
            'target': reverse('browse')
        },
    ]
    if artist:
        c['breadcrumbs'].append({
            'text': 'artists',
            'target': reverse('artists')
        })
        commands.extend(['artist', artist])
        if album:
            c['breadcrumbs'].append({
                'text':
                artist,
                'target':
                reverse('albums_by_artist', kwargs={'artist': artist})
            })
    elif album:
        c['breadcrumbs'].append({
            'text': 'albums',
            'target': reverse('albums')
        })
        commands.extend(['album', album])

    else:
        commands = ['any', '']
    logger.info(commands)

    with MPDClient().connect("localhost", 6600) as mpd:
        c['songs'] = mpd.find(*commands)

    #Cleanup song information
    for song in c['songs']:
        song['filename'] = path.basename(song['file'])
        song['time'] = formatTime(song['time'])
    return c
Ejemplo n.º 4
0
def songs( request, artist=None, album=None, *args, **keywords ):
    c = RequestContext( request )
    logger.info( "songs" )

    commands = []
    c['breadcrumbs'] = [
        { 'text': 'browse', 'target': reverse( 'browse' ) },
    ]
    if artist:
        c['breadcrumbs'].append( {
            'text': 'artists',
            'target':reverse( 'artists' )
        } )
        commands.extend( ['artist', artist] )
        if album:
            c['breadcrumbs'].append( {
                'text': artist,
                'target':reverse( 'albums_by_artist', kwargs={ 'artist': artist } )
            } )
    elif album:
        c['breadcrumbs'].append( {
            'text': 'albums',
            'target':reverse( 'albums' )
        } )
        commands.extend( [ 'album', album ] )

    else:
        commands = ['any', '']
    logger.info( commands )

    with MPDClient().connect( "localhost", 6600 ) as mpd:
        c['songs'] = mpd.find( *commands )

    #Cleanup song information
    for song in c['songs']:
        song['filename'] = path.basename( song['file'] )
        song['time'] = formatTime( song['time'] )
    return c
Ejemplo n.º 5
0
import utilities as ut
import numpy as np
#import sys

#np.set_printoptions(threshold=sys.maxsize)
dataFilePath = "2000_01_01 00_00_00 CARDINO.csv"

#load the ringdown time constants "Taus" in microseconds
tau_Data = ut.loadCardinoData(dataFilePath, columns="Taus")
#load the time stamp data
time_Data = ut.loadCardinoData(dataFilePath, columns="TimeStamp")
#format the time into a suitable timeseries array in units of seconds
time_Series = ut.formatTime(time_Data)

#The red ringdown times are in the first two columns of tau_Data
redTau_Data = tau_Data[:, 0:2]
#load the flags for zeroing th red channels
redState = ut.loadCardinoData(dataFilePath, columns="Red State")
#get the median values for each zeroing event on the red channels
redZeros = ut.getZeroingAvg(redTau_Data, redState)
#Use the red zeroing flags to determine which zeroing we should use for each time point.
redZero_Array = ut.performZeroing(redZeros, redState)
#Calcuate epsilon for the two red channels in units of M
epRed = ut.calculateEpsilon(redTau_Data, redZero_Array)
#discard all the data that isn't "normal" state by converting it to np.nan.
epRed_norm = ut.selectZeroState(epRed, redState)
#Could plot this data as follows
#ut.plotCardino(time_Series,epRed_norm,ylabel="Epsilon (m)",title="Attenuation Coefficients",customLabel=['Ep N2O5','Ep NO3'],xlim=[195,560],ylim=[-1,1])

#The blue ringdown times are in the second two columns of tau_Data
blueTau_Data = tau_Data[:, 2:4]