Sunday, January 6, 2019

Convert "Decimal degrees (DD)" to "Degree Minutes and Seconds (DMS)" with Python

Often times, students may find themselves stuck on how to convert integers to degrees minutes and seconds (like i once was), surprising, it is one of the easiest task you'll learn on this post today.

Several methods can be used to accomplish this, the methods i'll discuss today include:


  1. Simple mathematical calculator method (Casio calculator)
  2. Manual method
  3. Python Algorithm script
Steps.


1. Using Python Algorithm

>>> def DDtoDMS(value):
        #print "THE VALUE TO CONVERTIS : ", value
        D = float(value)
        D = int(D)
        #print(D)
        m = float(float(value) - int(D))
        #print(m)
        M = int(float(m*60))
        #print(M)
        S = round(((m*60)-M)*60, 2)
        #print(S)
        #print( "%rd %rm %rs" %(D,M,S))
A GUI python program of the above code can be downloaded HERE!




2.Manual Method
  • For the degrees use the whole number part of the decimal
  • For the minutes multiply the remaining decimal by 60. Use the whole number part of the answer as minutes.
  • For the seconds multiply the new remaining decimal by 60

3. Using Casio calculator

  • On your casio (fx xxx) scientific calculator, simply put ON the calculator and enter the Decimal values.
  • Now press the black button on the third row and second column.
  • Note: If it does not give the DMS, press the shift button before the DMS button.


Thanks for reading!

Wednesday, January 2, 2019

Survey Linear-Accuracy Calculator (Written in Python Programming Language)

This is a linear-accuracy calculator for surveying and non-survey practitioners.

This program was design for educational purpose but credits should be given to the rightful owner (@yakubuharuna11@gmail.com).
source code and procedure for usage of the program are all available here.

Info
Python Version used:    '3.7.1'
GUI framework:           wxpython version '4.0.3'
Other modules used:     math

Note: The program is still being Tested.

Download the full program


Full image of the program


The required perimeters of the program include Misclosures (in Northing and Easting found from traverse computation)

When these data are entered correctly, the program returns the Linear Accuracy On-Clicking the Compute button.




The complete python source code can be downloaded HERE!

Please share your thoughts about this program and recommendations.