Extracting a Random Sample from the Star Files on Site

I've been using Astro 2 for a bit over a year now and I've gotten a pretty good, if painstaking, map of the human part of my universe created. I fear that work is going to be largely obviated by what I'm asking about.

I constructed the original map out of an excel file of stars that wasn't importable to the program-it was a long, painstaking process, but I did it.

I find myself now confronted with the rest of space, and was wondering how to go about something-it's entirely possible this is more an excel question than an astrosynthesis question.

I want to take one of the CSV files, specifically the HIP astro chart 500ly file, and extract, say, 1500 stars from it, weighted heavily towards F, G, and K type stars. The locations of Earth's minor colonies aren't that big a deal for the purposes of the map, and I can manually add any of the major systems that are excluded from the list.

How in god's name would I go about doing that. I confess a stunning lack of knowledge when it comes to a lot of software, especially including Excel, and I don't want to do anything that would screw up the file that I'm importing.


So, uh...help? :?:

Comments

  • Yes, it's more of an Excel situation. One method would be to add a column to check the spectral type in each row to see it it starts with "F", "G" or "K", have it output a "1" (or something) if it does, nothing if it doesn't. Then do a sort on that column, and you'll have them separated. This way however will return all of the "FGK" stars in that file, including a lot of giants. If you don't want those and only main-sequence stars, then you'll also will have to check to see if the spectral type ends in "V". The problem is that that series of files is simply a data dump of the Hipparcos catalog, and the format of the included spectral types are all over the place, they follow same method, e.g. some don't have the luminosity class and are just "G5", "K2", etc., so you''ll won't get them all. Not only that, but as I've found out when making my series of star data files, a lot of the listed spectral types are now wrong. Hipparcos didn't meaure spectra, so the values come from older sources, which frequently used earlier innaccurate parallaxes.

    Another method uses the fact that the data file you want to use includes the absolute magnitude in the "Notes" column. You can extract it and then convert it to a numerical value. Then do a check, seeing if it falls within the range of, say, 3.5 to 7.6. This method will get only main-sequence stars (the dwarfs, luminosity class "V") from the middle-F to lower-K types, the range can be expanded in either or both directions if you want the hotter F stars and/or the cooler K stars.

    Neither method produces a random sample, just a straight extraction of stars meeting a certain criteria (if you need help in writing the formulas, I can provide it as well since I did it a lot in making my files). You'll have to furthur process the extracted subset to your needs.
  • I hadn't thought of the absolute magnitude trick, that's actually pretty slick.

    I'm not so worried about red dwarfs-aside from a handful very close to Earth that are used primarily because they're very close to Earth, they're ignored as real estate by everyone. The nearest non-human homeworlds in the setting are 90-100 light years away, and once we get to that distance it's all guess work with red dwarfs anyway, so if I feel the need to place one I can just place it and not feel guilty.

    Is there a way to extract those absolute magnitude values out of the notes into their own column easily?

    One could probably create a column that randomly did math to values in certain columns-say, add the X and Z values together, divide by the Y value, and then add the absolute magnitude to create a 'random' number that I could then just sort the column by and take a selection out of.

    The file I originally used was the "HabHYG" file that I think was on Winchell Chung's website...which has its coordinates skewed compared to the other files, and also required I enter everything by hand. Which was less than fun.
  • Yes, the absolute magnitude is one of the most important values to know about a star, and is the key to determining whether it is a giant or a main-sequence dwarf. It is dependent on the distance, which of course is dependent upon having accurate parallax measurements. In making my own data files, I actually calculated (more like looked up in a table) my own spectral type for the stars based on the absolute magnitude, mainly to simplify and standardize things, since classifying the real stars can get rather messy (they don't behave in a nice oderly fashion). I was pleased to see that my values actually closely agree for the most part with "reality". You can also calculate the abs. magnitude yourself by using the apparent magnitude and parallax, the formula is Apparent Mag+5-(5*LOG10(1000/Parallax)), where the parallax is in milliarcseconds (i.e. 500 instead of .500); this is what I actually did in my files, since I wanted it to be recalculated if I changed the apparent mag and/or parallax, rather than being a fixed value.

    Which data file are you currently using? Is it one of the hip.astro.chart series that's in the download section (which you seemed to indicate)? Upon furthur examination, extracting the abs. mag. from the notes column will be more trickier than I first thought. The abs. mag doesn't follow a fixed 6-character format, like "+/-xx.xx", which is four digits (2 whole number, 2 decimal places) with a "+" or "-" sign in front, so you can't do a simple fixed RIGHT function of the last 6 characters (values less than 10 only have a single digit in fron of the decimal point, with no leading zero that would have made things easier). Also, there is a period and extra space at the end of the column entries, so that makes it even trickier without removing the garbage first. No, I would instead use the HYG database (or the HabHYG), also available on Winchell Chung's site. It has the abs. mag. as a numerical value in its own column, easy to use. The HabHYG file also has a numerical abs. mag value, but that's about the only thing I would use from that file, as the distances and coordinates are too severely rounded off for serious use. And yeah, AstroSyn's coordinate system does vary from the standard heliocentric galactic system, but it's easy to convert. AS's "X" is the same as galactic "X", but AS's "Y" is the galactic "Z", and AS's "Z" is the negative galactic "Y". I used the HYG and HabCat databases in making my own files, actually made my own "HabHYG" by looking up the HYG's Hipparcos numbers in the HabCat and returning a "1" if they were in it. The HYG's distances are in parsecs, but those are easily converted to the parallax value.
  • I did the HabHyg file originally, actually, and I'm 'okay' with rounded values. My issue is that the file isn't exportable directly into Astrosysnthesis, I have to enter those by hand. To be perfectly honest, if I had to enter 2K odd stars by hand I'd probably shoot myself, and I don't know how to convert HabHyg into a format that's compatible with Astrosynthesis so I can just use the handy-dandy import function.

    I have absolutely no problem painstakingly creating and naming a ton of worlds, moons, and whatever else myself, but god help me if I have to do that much data entry. :shock:
  • You actually can convert the HabHYG file to AstroSyn's format without doing too much work, just have to delete some columns and rearrange the others in the right order. The coordinates are provided, just need to transpose them as I described. The HabHYG numbers can be used as AstroSyn's ID numbers, the problem is that any multiple/binary stars with their components both listed (like Alpha Centauri) will appear in AstroSyn as separate stars, and not as a Multiple system unless the ID numbers are made the same (that was a a main driving reason I made my own files, none of the others available had multiple stars formatted as such). You'll have to add a star-type column (The "Star", "Multiple", "White Dwarf" options, you can make them all "Star" for simplicity) and a color column (to make them all red use #FFFFFF). The Mass, Radius and Luminosity columns can be left blank, as also the Notes column.

    With a little extra work in Excel, you can make a spreadsheet that automates the ID numbering and System-type columns, and even select a color based on spectral type (or absolute magnitude). You'll have to add a temporary column whose entries are a flag that identifies a Multiple system type. This is what I did with my files, I automatically created those values, along with a bunch of other data, then had the Notes column automatically created as well by combining cells from many other columns.

    In case you want a look, my files are the "Space" series: Space1 60ly, Space2 60-78ly, Space3 78-90ly and Space4 90-100 ly.
  • I don't mind doing a bit of tweaking to consolidate the random binaries that wind up getting selected. I guess I should try and figure out how to convert the HabHYG file into something Astrosynthesis can read. I tried to open your file, I got some sort of error message when I did.
  • Garrett wrote:
    I don't mind doing a bit of tweaking to consolidate the random binaries that wind up getting selected. I guess I should try and figure out how to convert the HabHYG file into something Astrosynthesis can read. I tried to open your file, I got some sort of error message when I did.

    The zips contain a .csv file (in AstroSyn format) and several .ods files, which is the OpenOffice.org format (version 3.2.1). I don't actually use Excel now, but instead OpenOffice, since it's compatible and most importantly, free (I refuse to pay what Micro$oft wants). The zips were made with Vista, but they should be ordinary .zip files.
  • Believe me, if I didn't get Office free from Stony Brook in my Undergrad days, I wouldn't be using it.

    I'll keep playing with it, this is a medium-long term project after all. At this rate Astrosynthesis 3 may well be out before I'm ready to really get into it anyway. :D

Leave a Comment