Message Boards Message Boards

1 Reply
1 Total Likes
View groups...
Share this post:

Labling properties in curated data output

Posted 10 years ago
Hi, I was experimenting with a search function a few hours ago and after a system crash I lost my train of thought and can't re-solve my problem.
I was listing properties of Exoplanets using AstronomicalData, having the properties labled by the name of the planet. It was a very simple function however I can't seem to replicate the effect.

I can produce a similar effect by using defined name values like this;
In[]:=  $planets = {"CoRoT11b", "CoRoT12b", "CoRoT13b", "HATP32b", "Kepler12b", "OGLETR10b", "OGLE2TRL9b"};
        # -> AstronomicalData[#, "Radius"] & /@ $planets
Out[]:= {CoRoT11b -> 1.02*10^8, CoRoT12b -> 1.03*10^8, CoRoT13b -> 6.33*10^7, HATP32b -> 1.46*10^8,
        Kepler12b -> 1.21*10^8, OGLETR10b -> 8.94*10^7, OGLE2TRL9b -> 1.15*10^8}

I cannot get the same output format which I had previously, when I supplement defined names of Exoplanets by the class "Exoplanet" I get an undesired result like this;
In[]:= $planets = {"Exoplanet"};
       (# -> AstronomicalData[#, "Radius"] & /@ $planets)

Out[]:= {"Exoplanet" ->
           {... 7.72*10^7, 6.51*10^7, 1.28*10^8, 9.92*10^7, 9.16*10^7 ...}}

Where from the generated output it only lists values of the Exoplanets, with the class defined as the word. I know it's simple, it took me 10 seconds previously, for the life of me I can't get it correct again.
Note: If you need to test the code please realize that a vast majority of data is unavaliable, eg. Missing["NotAvailable"]. I used valid data in the examples for aesthetic purposes with ... as an example of values being farmed from a sample of data.
POSTED BY: Ashley James
Posted 10 years ago
I'm not sure what I was trying to achieve with that syntax, It was supposed to be;
$planets = AstronomicalData["Exoplanets"];
# -> AstronomicalData[#, "Radius"] & /@ $planets
However I solved my problem which now reads as;
# -> AstronomicalData[#, "Radius"] & /@ AstronomicalData["Exoplanet"]
POSTED BY: Ashley James
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract