Geeky Problem That Needs a Solution.

Feb 17, 2009 11:40

So, for various reasons I'm not going to get into right now, I need a 3-D starmap. I have (or can get) the astronomical data that lists the spectral type of stars and their XYZ coordinates. What I need to do is quasi-randomly select about 150 stars from that list within about a hundred light years of Earth, skewed heavily towards F, G, and K ( Read more... )

Leave a comment

Comments 8

themissingy February 17 2009, 19:21:36 UTC
You can use the rand() function in excel (I am assuming that the data you can get is in comma-delimited format or other Excel-importable) to generate a column of random numbers and then, say, sort by the randomized column and select the top 150.
That should fake randomness well enough.

Reply

slacker22 February 17 2009, 20:03:42 UTC
That could work, my problem is that I want to selectively weight it to certain values in a category, so, say, 120 out of 150 of those results are of those three types, and only 30 are outside of those three values.

And yeah, it's an excel sheet.

Reply

themissingy February 17 2009, 20:09:54 UTC
Create a column for "Type", use if(condition, then, else) to assign "1" or "2" to this column depending on what your original type was. For example, =IF(OR(A1=123,A1=456,A1=789),1,2).
Then sort by both, "Type" and "Random"; pick out 120 off the top of the Type=1; pick out remaining 30 off the top of Type=2; stick them in a different spreadsheet.

Reply

slacker22 February 17 2009, 21:21:59 UTC
...I'm going to have Irina help me on that, but I think I get what you're saying. Yes.

(I'm just not much for excel, it's the only Microsoft Office product that continues to baffle me years later)

Reply


striknein February 23 2009, 03:00:31 UTC
You couldn't have run out of passwords already.

Reply

slacker22 February 23 2009, 17:13:41 UTC
lol, no, I have a few hundred more to go.

Reply


Leave a comment

Up