diff --git a/data/solar_conditions.py b/data/solar_conditions.py index b422a14..bd73a68 100644 --- a/data/solar_conditions.py +++ b/data/solar_conditions.py @@ -6,9 +6,9 @@ from dataclasses import dataclass # the first entry whose threshold the value meets or exceeds is used. BLACKOUT_DESCRIPTIONS = { - "X": "Extreme HF radio blackout on entire sunlit side", - "M": "Wide area HF radio blackout on sunlit side", - "C": "Occasional loss of HF communications on sunlit side", + "X": "Wide area HF radio blackout across sunlit side", + "M": "Occasional loss of HF communications on sunlit side", + "C": "Low absorption of HF signals on sunlit side", "B": "No significant radio blackout", "A": "No impact", } diff --git a/solarconditionsproviders/hamqsl.py b/solarconditionsproviders/hamqsl.py index 6f98bd2..3d01300 100644 --- a/solarconditionsproviders/hamqsl.py +++ b/solarconditionsproviders/hamqsl.py @@ -94,11 +94,11 @@ class HamQSL(HTTPSolarConditionsProvider): "aurora_latitude": float_val("latdegree"), "solar_wind": float_val("solarwind"), "magnetic_field": float_val("magneticfield"), - "geomag_field": (lambda v: "Unsettled" if v == "Unsettld" else v)(text("geomagfield").title()) if text("geomagfield") else None, + "geomag_field": (lambda v: "Unsettled" if v == "Unsettld" else v)(text("geomagfield").title()), "geomag_noise": text("signalnoise"), "hf_conditions": hf_conditions, "vhf_conditions": { - "vhf_aurora_northern_hemi": vhf_map.get(("vhf-aurora", "northern_hemi")), + "vhf_aurora_northern_hemi": vhf_map.get(("vhf-aurora", "northern_hemi")).title().replace("Lat Aur", "Latitude"), "es_2m_europe": vhf_map.get(("E-Skip", "europe")), "es_4m_europe": vhf_map.get(("E-Skip", "europe_4m")), "es_6m_europe": vhf_map.get(("E-Skip", "europe_6m")), diff --git a/spotproviders/parksnpeaks.py b/spotproviders/parksnpeaks.py index 566e6e7..ae63201 100644 --- a/spotproviders/parksnpeaks.py +++ b/spotproviders/parksnpeaks.py @@ -22,42 +22,43 @@ class ParksNPeaks(HTTPSpotProvider): def _http_response_to_spots(self, http_response): new_spots = [] # Iterate through source data - for source_spot in http_response.json(): - # Convert to our spot format - spot = Spot(source=self.name, - source_id=source_spot["actID"], - dx_call=source_spot["actCallsign"].upper(), - de_call=source_spot["actSpoter"].upper() if source_spot["actSpoter"] != "" else None, - # typo exists in API - freq=float(source_spot["actFreq"].replace(",", "")) * 1000000 if ( - source_spot["actFreq"] != "") else None, - # Seen PNP spots with empty frequency, and with comma-separated thousands digits - mode=source_spot["actMode"].upper(), - comment=source_spot["actComments"], - time=datetime.strptime(source_spot["actTime"], "%Y-%m-%d %H:%M:%S").replace( - tzinfo=pytz.UTC).timestamp()) + if http_response and http_response != "": + for source_spot in http_response.json(): + # Convert to our spot format + spot = Spot(source=self.name, + source_id=source_spot["actID"], + dx_call=source_spot["actCallsign"].upper(), + de_call=source_spot["actSpoter"].upper() if source_spot["actSpoter"] != "" else None, + # typo exists in API + freq=float(source_spot["actFreq"].replace(",", "")) * 1000000 if ( + source_spot["actFreq"] != "") else None, + # Seen PNP spots with empty frequency, and with comma-separated thousands digits + mode=source_spot["actMode"].upper(), + comment=source_spot["actComments"], + time=datetime.strptime(source_spot["actTime"], "%Y-%m-%d %H:%M:%S").replace( + tzinfo=pytz.UTC).timestamp()) - # Extract a de_call if it's in the comment but not in the "actSpoter" field - m = re.search(r"\(de ([A-Za-z0-9]*)\)", spot.comment) - if not spot.de_call and m: - spot.de_call = m.group(1) + # Extract a de_call if it's in the comment but not in the "actSpoter" field + m = re.search(r"\(de ([A-Za-z0-9]*)\)", spot.comment) + if not spot.de_call and m: + spot.de_call = m.group(1) - # Record SIG information. Sometimes we get a "SIG" of "QRP", which we ignore as it's not a programme with a - # defined set of references - sig = source_spot["actClass"].upper() - sig_ref = source_spot["actSiteID"] - if sig and sig != "" and sig != "QRP" and sig_ref and sig_ref != "": - spot.sig = sig - spot.sig_refs = [SIGRef(id=source_spot["actSiteID"], sig=source_spot["actClass"].upper())] + # Record SIG information. Sometimes we get a "SIG" of "QRP", which we ignore as it's not a programme with a + # defined set of references + sig = source_spot["actClass"].upper() + sig_ref = source_spot["actSiteID"] + if sig and sig != "" and sig != "QRP" and sig_ref and sig_ref != "": + spot.sig = sig + spot.sig_refs = [SIGRef(id=source_spot["actSiteID"], sig=source_spot["actClass"].upper())] - # Free text location is not present in all spots, so only add it if it's set - if "actLocation" in source_spot and source_spot["actLocation"] != "": - spot.sig_refs[0].name = source_spot["actLocation"] + # Free text location is not present in all spots, so only add it if it's set + if "actLocation" in source_spot and source_spot["actLocation"] != "": + spot.sig_refs[0].name = source_spot["actLocation"] - # Log a warning for the developer if PnP gives us an unknown programme we've never seen before - if sig not in ["POTA", "SOTA", "WWFF", "SIOTA", "ZLOTA", "KRMNPA"]: - logging.warning("PNP spot found with sig " + sig + ", developer needs to add support for this!") + # Log a warning for the developer if PnP gives us an unknown programme we've never seen before + if sig not in ["POTA", "SOTA", "WWFF", "SIOTA", "ZLOTA", "KRMNPA"]: + logging.warning("PNP spot found with sig " + sig + ", developer needs to add support for this!") - # Add new spot to the list - new_spots.append(spot) + # Add new spot to the list + new_spots.append(spot) return new_spots diff --git a/templates/about.html b/templates/about.html index f02d61d..5f8a1bd 100644 --- a/templates/about.html +++ b/templates/about.html @@ -67,7 +67,7 @@
This software is dedicated to the memory of Tom G1PJB, SK, a friend and colleague who sadly passed away around the time I started writing it in Autumn 2025. I was looking forward to showing it to you when it was done.
- + {% end %} \ No newline at end of file diff --git a/templates/add_spot.html b/templates/add_spot.html index f87c35a..a8a430d 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -69,8 +69,8 @@ - - + + {% end %} \ No newline at end of file diff --git a/templates/alerts.html b/templates/alerts.html index 504d549..9a89095 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -56,8 +56,8 @@ - - + + {% end %} \ No newline at end of file diff --git a/templates/bands.html b/templates/bands.html index d77f2c3..f6e397c 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -62,9 +62,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 9729d50..803376f 100644 --- a/templates/base.html +++ b/templates/base.html @@ -46,10 +46,10 @@ crossorigin="anonymous"> - - - - + + + + diff --git a/templates/conditions.html b/templates/conditions.html index de1cde2..1ba1c4f 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -96,12 +96,49 @@ Solar Weather