pepys_import.core.formats package¶
Submodules¶
pepys_import.core.formats.file_data module¶
pepys_import.core.formats.location module¶
- class pepys_import.core.formats.location.Location(errors=None, error_type=None)[source]¶
Bases:
object
- check_valid()[source]¶
Checks whether the location is valid (ie. has both a latitude and a longitude)
- Returns
Validity
- Return type
Boolean
- convert_point()[source]¶
- Returns formatted latitude and longitude values. The format is as follows:
DD(D) MM SS.SS H (Degrees Minutes Seconds Hemisphere)
- decimal_degrees_to_degrees_minutes_seconds()[source]¶
Converts decimal degrees of latitude and longitude values to degrees, minutes, and seconds
- property latitude¶
Returns the latitude of the Location object, in decimal degrees
- Returns
Latitude
- Return type
float
- property longitude¶
Returns the longitude of the Location object, in decimal degrees
- Returns
Longitude
- Return type
float
- set_from_wkb(wkb_string)[source]¶
Sets the location from a Well-Known Binary blob
- Parameters
wkb_string (String) – String containing Well-Known Binary blog in hex format
- set_from_wkt_string(wkt_string)[source]¶
Sets the location from a Well-Known Text string
- Parameters
wkt_string (String) – Well-Known Text
- set_latitude_decimal_degrees(latitude)[source]¶
Sets the latitude of the Location object to a latitude given in decimal degrees
- Parameters
latitude (float) – Latitude to set to, in decimal degrees (use +/- values for North/South)
- Returns
Whether latitude was set successfully
- Return type
Boolean
- set_latitude_dms(degrees, minutes, seconds, hemisphere)[source]¶
Sets the latitude value of the Location object to a latitude given in degrees, minutes and seconds format.
- Parameters
degrees (float) – Degrees of latitude (must be positive float)
minutes (float) – Minutes of latitude (must be positive float)
seconds (float) – Seconds of latitude (must be positive float)
hemisphere (String) – Hemisphere of latitude (must be “N” or “S”)
- Returns
Whether latitude was set successfully
- Return type
Boolean
- set_longitude_decimal_degrees(longitude)[source]¶
Sets the longitude value of the Location object to a longitude given in decimal degrees
- Parameters
longitude (float) – Longitude to set to, in decimal degrees (use +/- values for East/West)
- Returns
Whether longitude was set successfully
- Return type
Boolean
- set_longitude_dms(degrees, minutes, seconds, hemisphere)[source]¶
Sets the longitude value of the Location object to a longitude given in degrees, minutes and seconds format.
- Parameters
degrees (float) – Degrees of longitude (must be positive float)
minutes (float) – Minutes of longitude (must be positive float)
seconds (float) – Seconds of longitude (must be positive float)
hemisphere (String) – Hemisphere of longitude (must be “E” or “W”)
- Returns
Whether longitude was set successfully
- Return type
Boolean