Skip to content

Add 4m band plan#6

Open
ianrenton wants to merge 1 commit intoham2k:mainfrom
ianrenton:feature/4m-band
Open

Add 4m band plan#6
ianrenton wants to merge 1 commit intoham2k:mainfrom
ianrenton:feature/4m-band

Conversation

@ianrenton
Copy link

@ianrenton ianrenton commented Apr 21, 2025

Hi,

Following a brief discussion between Rich M7GET, Steve M1SDH and myself on the OARC Discord, I thought I would put in a PR for adding a 4m band blan to PoLo (and any other software that uses lib-operation-data).

The challenge however is that the 4m band allocation varies a lot between countries (see Wikipedia) and there is almost no allocation for this band outside Europe.

I have put in a first attempt, which matches the UK band plan, but I'm not clear on exactly what the countries field does and whether I should be using it - it currently seems to just be used to remove all default modes on HF segments for Australian users. Can I use this to set up completely different segments per country on 4m?

If you're happy with the RSGB 4m band plan being in there and available to all, this PR should be enough already, but if you would like me to refine it to include the country-by-country allocations, and/or mask it out to make it clearer that there is no allocation in other countries, could you please suggest how the countries field should be used for this?

Thanks

@ianrenton ianrenton changed the title Add 4m band Add 4m band plan Apr 21, 2025
@kwirk
Copy link
Contributor

kwirk commented Apr 21, 2025

Can I use this to set up completely different segments per country on 4m?

Yeah, the code which matches for modes sorts the results where those having matching country codes are prioritised higher (see below), and should also filter out non-matching county segments. So given each country is so different, I think the segments have "gb" country code for UK, and also "im", "je" and "gg" for the Crown Dependencies.

export function modeForFrequency(frequency, { ituRegion, countryCode, entityPrefix } = {}) {
const segments = AllSegments.filter(segment => (
(segment.mhz[0] <= frequency && segment.mhz[1] >= frequency) &&
(!entityPrefix || Object.keys(segment.entities).length === 0 || segment.entities[entityPrefix]) &&
(!countryCode || Object.keys(segment.countries).length === 0 || segment.countries[countryCode]) &&
(!ituRegion || Object.keys(segment.regions).length === 0 || segment.regions[ituRegion])
))
const sortedSegments = segments.sort((a, b) => {
if ((a.priority ?? 0) < (b.priority ?? 0)) return 1
if ((a.priority ?? 0) > (b.priority ?? 0)) return -1
if (entityPrefix && !a.entities[entityPrefix] && b.entities[entityPrefix]) return 1
if (entityPrefix && a.entities[entityPrefix] && !b.entities[entityPrefix]) return -1
if (countryCode && !a.countries[countryCode] && b.countries[countryCode]) return 1
if (countryCode && a.countries[countryCode] && !b.countries[countryCode]) return -1
if (ituRegion && !a.regions[ituRegion] && b.regions[ituRegion]) return 1
if (ituRegion && a.regions[ituRegion] && !b.regions[ituRegion]) return -1
return a.width - b.width
})
return sortedSegments[0]?.mode
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants