pupeno / repeater_world

Ham radio repeater website and database (open source, free data).
https://repeater.world
GNU Affero General Public License v3.0
25 stars 2 forks source link

Be smarter about frequency units #291

Open pupeno opened 1 year ago

pupeno commented 1 year ago

For some repeaters, MHz and kHz doesn't work and we should use GHz and MHz instead. Bandwidth is expressed in kHz. all of these frequencies should be processed by a single method that returns a reasonable representation depending on the size of the magnitude.

b4ux1t3 commented 4 months ago

I've done this for other projects in the past, I'd love to take a crack at this.

pupeno commented 4 months ago

@b4ux1t3 excellent!

I believe these are the methods that need re-writing/merging: https://github.com/pupeno/repeater_world/blob/bc7ce0b97c7708189aa0088b236c0daa6303ecf6/lib/repeater_utils.rb#L16-L28

I think just making sure we never go into 4 digits to the left of the floating point will yield the right result (1.6GHz vs 1600MHz), but I'm not 100% sure.

If you want, I can give you a tour of the source code.

b4ux1t3 commented 4 months ago

I may just take you up on that, I'll take a stab at this over the weekend first and see how it goes.

pupeno commented 4 months ago

@b4ux1t3 I just sent you a private mastodon message.