Message Boards Message Boards


Filter data from StarData based on Distance from Sun?

Posted 1 year ago
1 Reply
0 Total Likes

I am trying to get the name of stars that are in a range of distances from the Sun. The Input I have tried is:

EntityValue[EntityClass["Star", {"DistanceFromSun"->Between[{Quantity[10,"LightYears"],
Quantity[20, "LightYears"]}]}],  {"Name","DistanceFromSun"}]

which returns empty set. I've also used StarData instead of EnityValue, but I get the same result. Looking around in the documentation, I found an example in ParticleData that appears similar:

Quantity[900, "Megaelectronvolts"/"SpeedOfLight"^2], 
Quantity[1000, "Megaelectronvolts"/"SpeedOfLight"^2]}]}],{"Name","Mass"}]

which returns 9 particles.

Using Wolfram|Alpha to get a code example, I input:

List of stars with a distance from the sun between 10 lightyears and 20 lightyears

and several other variations. It doesn't understand my query. I have tried the Natural Language to no avail. Is there something I'm missing or does each property have a different way of filtering values?

Welcome to Wolfram Community! Please make sure you know the rules:

The rules explain how to format your code properly. If you do not format code, it may become corrupted and useless to other members. Please EDIT your posts and make sure code blocks start on a new paragraph and look framed and colored like this.

int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]

enter image description here

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract