4.4.4. General Utils

pyprom.lib.util.dottedDecimaltoDegrees(coordinate)[source]

Converts dotted Decimal coordinate to a DMS

Parameters

coordinate (float) – dd coordinate to convert.

Returns

degrees, minutes, seconds

Return type

int, int, int

pyprom.lib.util.degreesToDottedDecimal(deg, mnt=0, sec=0)[source]

Accepts dms and converts to dd

Parameters
  • deg (int) – degrees

  • mnt (int) – minutes

  • sec (int) – seconds

Returns

dotted decimal format

Return type

float

pyprom.lib.util.coordinateHashToList(coordianteHash)[source]

Converts a coordinateHash to a list of coordinates.

Parameters

coordianteHash – a hash using {x1:[y1:True,y2:True..],x1:[y1:True,y2:True..]} format

Returns

list coordinates [[x1,y1],[x1,y2]….]

pyprom.lib.util.coordinateHashToGridPointList(coordinateHash)[source]

Converts a coordinateHash to a pyprom.lib.locations.gridpoint.GridPoint list.

Parameters

coordinateHash (dict) – a hash using {x1:[y1:True,y2:True..],x1:[y1:True,y2:True..]} format

Returns

list of BaseGridPoint objects.

pyprom.lib.util.compressRepetetiveChars(string)[source]

Accepts String like “HHLHHHLL” and removes continuous redundant chars “HLHL”

Parameters

string (str) – “H” and “L” string

Returns

condensed non repeating string.

pyprom.lib.util.seconds_to_arcseconds(seconds)[source]

Convert Seconds to Arc Seconds

Parameters

seconds (float) –

Returns

converts seconds into arcseconds.

pyprom.lib.util.arcseconds_to_seconds(arcseconds)[source]

Convert Arc Seconds to Seconds.

Parameters

arcseconds

Returns

converts arcseconds into seconds.

pyprom.lib.util.randomString(length=12)[source]

Creates Random string.

Parameters

length (int) – string length

Returns

random string of length characters.