assignment help,

This is the place for queries that don't fit in any of the other categories.

assignment help,

Postby beilman419798 » Wed Dec 04, 2013 5:18 pm

This assignment will take a file (text) containing the latitudes of airports in Kansas and convert them to degrees. The converted data will be output to an external text file. You will then us another text file which contains the (x,y) coordinates of 12 airports in Kansas and determine the nearest neighbor to each airport. This data will be used to plot a graph of all airports and their relative locations.

Function 1:

Write a function FileDMS2FileDD(dmsFile, ddFile), which reads the latitudes in
text file dmsFile, converts them into decimal degrees, and saves the decimal degrees to the text file ddFile. The text file dmsFile has four columns that are separated by space. The first column is the names of the points and the other 3 columns are the latitudes in degrees, minutes and seconds respectively. The output text file ddFile should have two columns. The first column is the names of the points and the second column is the decimal degrees of the points. You can use the latitudes of twelve Kansas airports in the file KansasAirportLatitudesInDMS.txt to test your function.


Function 2:

Write a function NearestNeighbor(pointsFile, nnpointsFile), which finds the nearest
neighbors for the points in the text file pointsFile and writes the nearest neighbor
information to the text file nnpointsFile. The text file pointsFile has three columns that are separated by comma. The first column is the unique IDs of the points and the other two columns are the x and y coordinates of the points respectively. The output text file
nnpointsFile also has three columns and separated by comma. The first column stores the IDs of the points. The second column stores the IDs of their nearest neighbors and the third column stores the distance to their nearest neighbors. You can use the points in file
Points.txt to test your function.

Function 3:

Using the data file created in the previous function create a plot of the positions of each airport (see example plot).










Data

KansasAirportLatitudesInDMS.txt

LBL 37 2 39.153
DDC 37 45 47.225
GCK 37 55 39.065
GBD 38 20 39.905
ICT 37 38 59.869
AAO 37 44 51.196
EWK 38 3 25.593
GLD 39 22 14.225
HYS 38 50 41.771
SLN 38 47 29.335
FOE 38 57 3.436
MHK 39 8 27.502


Points.txt

1,44.44,75.38
2,38.77,26.25
3,76.79,51.09
4,79.72,70.21
5,19.50,89.20
6,49.49,95.97
7,45.11,55.17
8,64.98,14.72
9,71.23,15.78
10,75.71,26.49
11,28.33,84.23
12,68.29,26.17
13,65.85,81.61
14,17.10,25.11
15,12.78,93.00
16,50.34,35.65
17,96.01,20.46
18,34.70,25.86
19,58.94,61.99
20,23.16,47.86

any help would be greatly appreciated.
thanks roger
Last edited by Yoriz on Wed Dec 04, 2013 5:39 pm, edited 1 time in total.
Reason: First post lock
beilman419798
 
Posts: 2
Joined: Wed Dec 04, 2013 5:08 pm

Re: assignment help,

Postby Yoriz » Wed Dec 04, 2013 5:41 pm

Hi welcome to the forum, please read the 'new users read this' link in my signature.
Which part of your code are you having problems with?
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 782
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: assignment help,

Postby stranac » Wed Dec 04, 2013 5:44 pm

You use the def keyword to create a function.

If you want more help than that, show us what you have tried.
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1118
Joined: Thu Feb 07, 2013 3:42 pm


Return to General Coding Help

Who is online

Users browsing this forum: Baldyr and 2 guests