 
   onSubjectSelect: (e, subject) =>
     # console.log 'onSubjectSelect(): '
+    console.log("selecting subject")
     @subject = subject
     @classification = new Classification {subject}
     @loadSubjectData()


    if @sim_count%2 == 0
      Subject.group = "5417014b3ae7400bda000002"
      Subject.fetch 1, (subjects) =>
        console.log "got sim subjects ", subjects
    else
      Subject.group = "5417014a3ae7400bda000001"
      @Subject.next()

    # @el.find('#finished-marking').fadeIn()
    # @el.find('#finished-feedback').fadeIn()

  calcKnownTransits:(data)=>
    first_event = data.metadata.first_trans_event
    no_points = data.x.length
    console.log "data range ", data.x[no_points-1]-data.x[0], " planet peroid ", data.metadata.planet_period, "no points " ,  no_points*1.0

    start = parseInt(first_event.split(":")[0])
    end   = parseInt(first_event.split(":")[1])
    period = data.metadata.planet_period
    startX = data.x[start]
    endX   = data.x[end]
    console.log "data ", data.x, start, end
    console.log "startx ", startX, " end x ", endX
    dur = endX - startX
    mid = (endX + startX)/2.0

    in_range = true
    i= 0


    @known_transits = []

    # while in_range
    #   if (startX + (i*period)) > data.x[no_points-1]
    #     in_range = false
    #   else
    #     @known_transits.push([startX + (i * period) - data.x[0] , endX + (i * period) - data.x[0] ])
    #     i+=1



  insertMetadata: ->
    # ukirt data
    @ra      = @subject.coords[0]
