Group Abstract Group Abstract

Message Boards Message Boards

0
|
11.1K Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Difficulty with StarData

POSTED BY: David Vasholz
2 Replies

Thank you for your response. Your suggestions have improved the performance of the script, so that it runs roughly twice as fast. Sometimes there are wild variations in speed, and I have attached a pdf file that shows the results for 10 trials.

Attachments:
POSTED BY: David Vasholz

Change the online data pull to a single query

onlineData = StarData[EntityClass["Star", "NakedEyeStar"],
   {"Name", "ApparentMagnitude", "Declination", "RightAscension"}];

The sorting can be streamlined

data = SortBy[onlineData, #[[2]] &];

data2 = data /. {n_String, m_, dec_, ra_} :> {n, m, UnitConvert[dec], 
     UnitConvert[ra], dec, ra};

data3 = data2 /. Quantity[a_, "Radians"] :> a;
data3 = data3 /. {n_String, m_, decrad_, rarad_, dec_, ra_} :> {n, 
     m, {dec, ra}, {\[Pi]/2 - decrad, rarad}};

data3 = Transpose@Prepend[Transpose@data3, Range@Length@data3];

starTable = 
  Prepend[data3, {"Index", "Name", "Magnitude", 
    "{Declination, Right Ascension}", ToString@{\[Theta], \[Phi]}}];
POSTED BY: Robert Hanlon
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard