Skip to main content

KML and Datasette: Automated Elevation Profiles


Automating yesterday's post. Here are the steps to add elevation profile paths to any QSO map:

  1. Duplicate the datasette-haversine-point-to-path repository, renaming it datasette-gis-partial-path
    1. This should expose a method for lat and a separate method for lng
    2. The inputs should be the beginning and end of the path and the number of meters the elevation path should extend
    3. The package will use haversine. It will also repackage a few of the earthmid methods
  2. Given the inputs, calculate the entire QSO path length using the haversine method. Then, divide the total distance by the input partial distance to get the number of 'partial' length segments exist in the the entire path.
  3. Call partial_path_lng and partial_path_lat to get the coordinates of the end of the first segment.
  4. Add a new linestring to the kml template. The segment starts at the transmitting station and ends at the coordinates returned in step 3 above. Label the new segment with the receive station's callsign and the word 'elevation'. Give the elevation segment the same time stamp as the full QSO timestamp.
Just a reminder, the idea is to create a linestring that is shorter than the entire QSO path so that the elevation profile near the transmitting station is easy to visualize in Google Earth Pro.

Scheduling
Work started at 06:50 PST 03/31/2024
Debugging syntax issue 7:33 same day
7:34 installed!


7:41 wrong number of arguments
7:46 used lat3 and lon3 incorrectly
7:57 bad args
7:58 not passing fractional parts argument correctly
8:01 forgot to bring over partial_path_lng
8:03 wrong tx location
8:08 Success!!!!!


vs yesterday's manual results:

Here's the query

select
  tx_lng,
  tx_lat,
  rx_lng,
  rx_lat,
  rm_rnb_history_pres.timestamp,
  rm_rnb_history_pres.dB,
  rm_rnb_history_pres.Spotter,
  haversine(tx_lat, tx_lng, rx_lat, rx_lng) as total_path,
  gis_partial_path_lat(tx_lat, tx_lng, rx_lat, rx_lng, 200) as el_lat,
  gis_partial_path_lng(tx_lat, tx_lng, rx_lat, rx_lng, 200) as el_lng,
  id
from
  rm_rnb_history_pres
where
  (rm_rnb_history_pres.timestamp < '2023-01-31' and rm_rnb_history_pres.timestamp > '2023-01-29')
  and dB = 0
order by
  rm_rnb_history_pres.timestamp desc


8:44 starting back up on the kml template to add elevation every time

9:07 new template almost there, need to name each elevation line with the Spotter field

9:11 fixed template elevation line html, but they're also missing???

9:14 elevation line misplaced inside other placemark, but worked before? Oh well?

9:16 forgot to remove fixed coordinates in query from original demo

9:26 Success!!!!! Can now get profiles for any station on any outing!

From Caballo in February


and



Sweden from the Organs last December

'Cruces from the Organs should be more interesting, 

so let's get a longer path using 2km instead of 200 meters for the partial path
  gis_partial_path_lat(tx_lat, tx_lng, rx_lat, rx_lng, 2000) as el_lat,
  gis_partial_path_lng(tx_lat, tx_lng, rx_lat, rx_lng, 2000) as el_lng,




And finally, for today, from January of 2023. Kinda cool!


9:51 Done playing with examples for day :) 



























Comments

Popular posts from this blog

More Cowbell! Record Production using Google Forms and Charts

First, the what : This article shows how to embed a new Google Form into any web page. To demonstrate ths, a chart and form that allow blog readers to control the recording levels of each instrument in Blue Oyster Cult's "(Don't Fear) The Reaper" is used. HTML code from the Google version of the form included on this page is shown and the parts that need to be modified are highlighted. Next, the why : Google recently released an e-mail form feature that allows users of Google Documents to create an e-mail a form that automatically places each user's input into an associated spreadsheet. As it turns out, with a little bit of work, the forms that are created by Google Docs can be embedded into any web page. Now, The Goods: Click on the instrument you want turned up, click the submit button and then refresh the page. Through the magic of Google Forms as soon as you click on submit and refresh this web page, the data chart will update immediately. Turn up the:

Cool Math Tricks: Deriving the Divergence, (Del or Nabla) into New (Cylindrical) Coordinate Systems

Now available as a Kindle ebook for 99 cents ! Get a spiffy ebook, and fund more physics The following is a pretty lengthy procedure, but converting the divergence, (nabla, del) operator between coordinate systems comes up pretty often. While there are tables for converting between common coordinate systems , there seem to be fewer explanations of the procedure for deriving the conversion, so here goes! What do we actually want? To convert the Cartesian nabla to the nabla for another coordinate system, say… cylindrical coordinates. What we’ll need: 1. The Cartesian Nabla: 2. A set of equations relating the Cartesian coordinates to cylindrical coordinates: 3. A set of equations relating the Cartesian basis vectors to the basis vectors of the new coordinate system: How to do it: Use the chain rule for differentiation to convert the derivatives with respect to the Cartesian variables to derivatives with respect to the cylindrical variables. The chain

The Valentine's Day Magnetic Monopole

There's an assymetry to the form of the two Maxwell's equations shown in picture 1.  While the divergence of the electric field is proportional to the electric charge density at a given point, the divergence of the magnetic field is equal to zero.  This is typically explained in the following way.  While we know that electrons, the fundamental electric charge carriers exist, evidence seems to indicate that magnetic monopoles, the particles that would carry magnetic 'charge', either don't exist, or, the energies required to create them are so high that they are exceedingly rare.  That doesn't stop us from looking for them though! Keeping with the theme of Fairbank[1] and his academic progeny over the semester break, today's post is about the discovery of a magnetic monopole candidate event by one of the Fairbank's graduate students, Blas Cabrera[2].  Cabrera was utilizing a loop type of magnetic monopole detector.  Its operation is in concept very sim