Message Boards Message Boards

0
|
12601 Views
|
6 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Need help importing data from a file.

Posted 9 years ago
Attachments:
POSTED BY: Nathan Lundholm
6 Replies
Attachments:
POSTED BY: Bill Lewis

I really do need help badly. I am clueless. I'm about ready to just give up.

POSTED BY: Nathan Lundholm

{ C, Name, ti, tf, x, y, z, xdot, ydot, zdot, xsig, ysig, zsig, xdotsig, ydotsig, zdotsig } For each satellite there's many lines, each is a different time of day, I think 15 minutes apart? Right now we're only worried about the first line for each satellite. We need Name, x, y, z. We then need to put a peg on a map for X, Y, and Z for each satellite, and label each peg with Name. Here's the issue, the file is in ECEF... not latitude/longtiude.

POSTED BY: Nathan Lundholm

Ok, please put the names in Mathematica format: { name1, name2, name3, etc}, and I'll give it another try.

POSTED BY: Bill Lewis

If you look again I provided the names for all 16 columns... you missed C and Name apparently.

POSTED BY: Nathan Lundholm

Suggestions:

First, you are better off with Dataset[] and Association[] than List[], especially if you have V10.2 or even V10.1. Dataset[] had a steep learning curve but much better tractability and very much better response time.

Second: this will some effort -- maybe a few days or a week's worth considering that you have not done this before.

Your input file is apparently intended for Excel. I'd suggest that you import it into Excel and take another look at it. Your listed column names are: ti tf x y z xdot ydot zdot xsig ysig zsig xdotsig ydotsig zdotsig. There are 14 names, but '2-8=-1=-1_pos.txt' has 16 columns. Suggest using Excel to get the same number to delete some columns, or else add more names to your list. Once you get the columns right, I'd suggest exporting the file as .csv, which is more tractable than a .txt file, just as good practice.

If you lack Excel, try posting again.

Once that is done, you can import the file using SemanticImport[]. I'd suggest some variant on: SetDirectory[<wherever the file is>.] symbolName=SemanticImport[<filename>, <| col1name->"Text", col2Name->"Text",col3Name->"Integer", col4Name->"Real", and the rest of the columns Real.|>]; ResetDirectory[];

That should give you a Dataset[] with named columns. If you want to change symbolName, see Dataset[]. If you want units on the values, see Quantity[].

Once you're that far, try re-posting. If you want to continue on your own, look at guide/MapsAndCartography. Mapping isn't that hard to do once you get your data organized.

Good luck!

POSTED BY: Bill Lewis
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract