mithengereverse8.frink

Download or view mithengereverse8.frink in plain text format


/** Reverse-engineering of Dick Koolish's pictures, January 2019.  Note that
    this program, unlike other programs in the "mithengereverse" series, is
    only a *partial* reverse-engineering of MIT's Infinite Corridor's azimuth.
    It is used to take EXIF data from a series of pictures, correct their
    times based on a photograph of the "true" time, and then provide raw
    calculations of the sun's position at the time the pictures were actually
    made.  To turn this into a corridor azimuth measurement, we need to know
    where in the corridor that the camera was positioned and measure distances
    from the sun to known references in the corridor.
*/


use sun.frink
use mithengecorridor.frink

// These photos are at:
// http://www.dickkoolish.com/rmk_page/pictures_013119.html

// To fetch relevant pictures:
//   curl -o "IMG_#1.jpg" //IMG_[8732-8749].jpg" TARGET="_blank">http://www.dickkoolish.com/rmk_page/RMK_Pictures/SX40-01-31-19//IMG_[8732-8749].jpg


// And dump the EXIF data:
//   exiftool -T -filename -createdate . > origdates.txt

// date from phone's EXIF data:
// //IMG_8733.jpg" TARGET="_blank">http://www.dickkoolish.com/rmk_page/RMK_Pictures/SX40-01-31-19//IMG_8733.jpg
camdate1 = # 2019-01-31 16:31:16 US/Eastern #

// "Actual" time taken from the GPS/atomic screen, assuming good time source:
actdate1 = # 2019-01-31 16:32:37 US/Eastern #

// "Actual" Julian day, taken from the screen, assuming good time source:
//actdateJ = JD[2458515.39765 days]
//println["Julian date is $actdateJ"]  // This verfies within less than a second

correction = actdate1 - camdate1

println["Camera correction is $correction.  This is the time you have to ADD to the EXIF data to get the correct time."]

// EXIF time from IMG_8737.jpg:
// //IMG_8737.jpg" TARGET="_blank">http://www.dickkoolish.com/rmk_page/RMK_Pictures/SX40-01-31-19//IMG_8737.jpg

// EXIF date format that we don't parse because of dumb colons in date
### yyyy:MM:dd HH:mm:ss ###
outfmt = ### yyyy-MM-dd HH:mm:ss ###

temp = F[18]          // From historical record
pressure = 30.2 inHg  // From historical record

println["filename\tcorrected time (EST)\tsun altitude\tsun center az.\tsun left az."]
for line = sort[lines["file:/home/eliasen/prog/mithenge/origdates.txt"]]
{
   [filename, date] = split["\t", line]
   d = parseDate["$date US/Eastern"]
   correctedDate = d + correction

   print["$filename\t" + (correctedDate -> [outfmt, "US/Eastern"]) + "\t"]
   [az, alt] = refractedSunAzimuthAltitude[correctedDate, lat, long, temp, pressure]
   az = (az + 180 degrees) mod circle
   print[formatFix[alt, "deg", 6] + "\t"]
   print[formatFix[az, "deg", 6] + "\t"]
   sunRadius = sunRadiusAngle[correctedDate]
//   print[formatFix[sunRadius, "deg", 6] + "\t"]
   left = az - sunRadius
   println[formatFix[left, "deg", 6]]
}


Download or view mithengereverse8.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 19966 days, 9 hours, 18 minutes ago.