clone

a desktop tv and program guide for over-the-air broadcasts: what's on air, what your tuner gets, live tv, recordings

main
airwaves / internal / lineup / lineuptest / denver.go
denver.go 3.9K
1// Package lineuptest holds a report, listings and an HDHomeRun's lineup2// for downtown Denver: the stations on Lookout Mountain whose RF channels3// the tuner's scan found, and some it didn't (KMGH on VHF RF 7, KUSA's4// main channel, KWGN's ATSC 3.0 signal).5package lineuptest67import (8 "time"910 "airwaves/internal/atsc3"11 "airwaves/internal/fcc"12 "airwaves/internal/geo"13 "airwaves/internal/guide"14 "airwaves/internal/lineup"15 "airwaves/internal/reception"16)1718// Point is downtown Denver.19var Point = geo.Point{Lat: 39.74, Lon: -104.99}2021// lookout is the Lookout Mountain antenna farm.22var lookout = geo.Point{Lat: 39.7299, Lon: -105.2361}2324func station(call string, fac, rf, virtual int, kw float64) lineup.Station {25 return lineup.Station{26 Facility: fcc.Facility{27 CallSign: call, BaseCall: fcc.BaseCall(call), Service: "DTV", RFChannel: rf, VirtualChannel: virtual, Status: "LIC",28 City: "Denver", State: "CO", FacilityID: fac, ERPkW: kw, HAATm: 330, Point: lookout, DistanceKm: 21.1, BearingDeg: 267.9,29 },30 Band: fcc.Band(rf),31 Signal: map[string]reception.Estimate{},32 }33}3435// Report is what is on record around downtown Denver, without estimates.36func Report() *lineup.Report {37 rep := &lineup.Report{38 Generated: time.Now(),39 Place: geo.Place{ZIP: "80302", Name: "Boulder", State: "CO", Point: geo.Point{Lat: 40.04, Lon: -105.28}},40 Point: Point,41 RadiusKm: 160,42 Stations: []lineup.Station{43 station("KMGH-TV", 40875, 7, 7, 30),44 station("KETD", 83289, 15, 53, 400),45 station("KUSA", 23074, 16, 9, 1000),46 station("KTFD-DT", 68695, 28, 50, 500),47 station("KDEN-TV", 10178, 29, 25, 475),48 station("KTVD", 68581, 31, 20, 1000),49 station("KCEC", 125, 32, 14, 450),50 station("KRMA-TV", 14040, 33, 6, 1000),51 station("KWGN-TV", 35883, 34, 2, 1000),52 station("KCNC-TV", 47903, 35, 4, 1000),53 station("KDVR", 126, 36, 31, 1000),54 },55 ATSC3: []atsc3.Host{{56 Market: "Denver, Colorado", CallSign: "KWGN-TV", FacilityID: 35883, RF: "34", Launched: "2020-07-14", Simulcast: "KDVR",57 Services: []atsc3.Service{58 {Display: "02-1", Major: 2, Minor: 1, Network: "CW", Name: "KWGN", ATSC1Call: "KDVR", ATSC1Display: "02-1"},59 {Display: "31-1", Major: 31, Minor: 1, Network: "FOX", Name: "KDVR", ATSC1Call: "KDVR", ATSC1Display: "31-1"},60 {Display: "04-1", Major: 4, Minor: 1, Network: "CBS", Name: "KCNC", ATSC1Call: "KCNC-TV", ATSC1Display: "04-1"},61 },62 }},63 Sources: []lineup.Source{{Name: "FCC TV Query", URL: "https://www.fcc.gov/media/television/tv-query", Use: "Licensed transmitters"}},64 Warnings: []string{},65 }66 // A low-power station on KTVD's RF channel, nearer but on another67 // virtual channel: not where 20.x comes from.68 lp := station("K31AB-D", 999001, 31, 0, 3)69 lp.Service, lp.DistanceKm, lp.BearingDeg = "LPD", 8, 9070 rep.Stations = append(rep.Stations, lp)71 return rep72}7374// Guide is the listings: the main channels, and some subchannels.75func Guide() *guide.Guide {76 now := time.Now().Truncate(time.Hour)77 ch := func(id, number, call, network string) guide.Channel {78 return guide.Channel{ID: id, Number: number, CallSign: call, Network: network, Logo: "https://example.com/" + id + ".png"}79 }80 g := &guide.Guide{81 Lineup: guide.LineupID("80302"), Start: now, End: now.Add(6 * time.Hour), Fetched: now,82 Channels: []guide.Channel{83 ch("g2", "2.1", "KWGNDT", "CW"),84 ch("g4", "4.1", "KCNCDT", "CBS"),85 ch("g6", "6.1", "KRMADT", "PBS"),86 ch("g7", "7.1", "KMGHDT", "ABC"),87 ch("g9", "9.1", "KUSADT", "NBC"),88 ch("g94", "9.4", "KUSADT4", "NBC"),89 ch("g14", "14.1", "KCECDT", "Univision"),90 ch("g20", "20.1", "KTVDDT", "MyNetworkTV"),91 ch("g31", "31.1", "KDVRDT", "FOX"),92 },93 Programs: map[string][]guide.Program{},94 }95 for _, c := range g.Channels {96 g.Programs[c.ID] = []guide.Program{97 {Start: now, End: now.Add(time.Hour), Title: c.CallSign + " News", ProgramID: "EP" + c.ID},98 {Start: now.Add(time.Hour), End: now.Add(2 * time.Hour), Title: c.Network + " Movie", ProgramID: "MV" + c.ID},99 }100 }101 return g102}