QUESTION re NODES, SCRIPTS (noob) - plotting points from data

The reason one star is missing is because of line 180 in the blend above. I did it on purpose since there is no error checking when reading the data file. Just add 1 blank line at the very bottom of the starData.csv file

OR


   while i != numStars:

just change it to


   while i != (numStars + 1):

I wouldn’t do both.

Ricky, If you realy interested in more accuracy of the script, no need reinventing the wheel. Just drop my code all together and download the “Naval Observatory Vector Astrometry Software (NOVAS)” for working with actual star data. They have several links to the actual star data. Whis has much more information attached to it.

Read the docs about the data format of the particular star file/s you get. Actual mission files give all the information, including names, positions, rotation, etc of the stars.

sorry I check the site but having problem finding where the data is located ?
in which section do you find the stars data and formats ?

the format you use is not the one discussed earlier !
we need to keep one format if possible !

thanks
happy bl

You will need to google " star ephemeris ". I would only trust .edu and .gov domains as havving accurate unmodified data. I’ve been using the following sites:

http://ephemeris.com/links.html
http://ned.ipac.caltech.edu/
http://cdsweb.u-strasbg.fr/astroWeb/astroweb.html

for conversion info I like to use http://www.ngs.noaa.gov/GEOID/ , any onther source I feel is inaccurate and confusing especialy wikipedia and search engines.

That being stated, I think we hijacked jayfromclevelan’s thread. More modification to the code posted will not surve his purpose and his question is already answered to the best of my knowledge. Maybe we should start a new thread, refering to this one as needed, in a more appropriate forum heading.

I already have data example from earlier post
only thing now is to make certain that the coordinates drawn in blender are realist

will continue checking that this week

happy bl

I appreciate that you guys are trying to help, but you are both WAAAAAAAAYY over my head! I’m sorry if I gave the wrong impression that I was some kind of hotshot programmer who understands all this stuff you keep throwing at me! I’m a TOTAL NOOB! Really! You’ve got to believe me! I only JUST downloaded Blender in the last couple weeks!

All I wanted to know was whether my problem was POSSIBLE in Blender/Python, not for someone to write a whole script, and I expect to invest MONTHS in figuring it all out! Also, I really don’t have time for this forum chat! I only asked a basic, general question in the first place! Thank you for your answer!

I will be happy to send you guys my position data, in either degrees or radians, but this stupid forum does not permit me to upload. Please send me an email at *DELETED and I will gladly send you a .csv file. Thanks for understanding. (PLEASE SEND PM FOR ADDRESS)

it is an interesting small project and not that complicated
just have to make certain how the spherical coordinates are done in blender

ounce it is confirm then well there are many things that you can do

but just being able to render real stars in sky for a blender scene is already very nice !
and can’t wait to get it rendering !

one thing would be nice to get stars function of you location on earth and date - time

happy bl

Jorge, I spent a lot of time reading that script you provided, and I think understand it in principle, that it’s supposed to read out the .csv data and loop through plotting the objects. But I just do not have the programming skills to make it run. I put the .csv file in my Blender folder, indicated the path in your script, and tried to run the script. I got this error:


Since the path was correct, and not knowing what to do to fix that, I tried deleting that line and got this error:


My system is a very ordinary 32 bit Win 7 machine, which I use for creating Word documents for my real job. Nothing fancy around here.

FWIW, I’ve been wanting to make headway on this star plotting project since 2002. It’s practically a miracle that I was able to get that file working in 2003, which produced the image in my first post. I have not attempted any sort of programming since that time. I took a programming class in college in 1984, and learned at that time that whatever brains you programmers possess, I do not. Since '03, I have been looking on and off for a USER FRIENDLY 3D program that I could use for this project, to create stars. I’ve had much bad advice since then, from “experts” who either did not know of any such 3D software, or who referred me to programs that cost upwards of $10,000. When I recently saw Blender, I thought it finally might be the answer. However, this program requires so much of a learning curve, that I doubt whether this will be the answer. I’d be grateful if someone could please recommend some affordable, user-friendly commercial software with these sorts of capabilities. Thanks

blender is the only good free soft for 3D modelisation
there are sketchup but too simple not enough features ect…

keep going with blender and it takes time to learn it d
but o some of the intro at CGcookie and over time you will get it !
and it is much more powerful and totally free !

happy bl

OK, after playing around with that one script found online, I actually managed to get some results from Blender. I modified the script to insert the equatorial coordinate equations, and then made variables for DEC and RA that incremented with each loop. The end result is a globe with spheres placed at DEC and RA, every 22.5 degrees.

I’m really happy with getting this far without knowing the programming language. If only there could be a way to read these DEC and RA positions out of a .csv file, then these equations should plot the constellations. The scaling is not an issue at the moment. Here’s the blender file (assuming the UI works).

globe16.blend (2.77 MB)

Thanks for your help, gentlemen. Please pardon my drama while I labor with the learning curve.


did a quick test for 1000 stars with color and object name

but as I suspected it took like 11 secondes

happy bl

Attachments


Wow, that’s impressive! So you got that to generate from data? Any chance I can see your script? How do you get the .csv info to read into Blender? I was wondering if my .csv file needed to be in a certain format. This is still the big “state secret” that everybody seems to know, yet I cannot find anything online about how to do that.

Also, did you get the big .csv file I emailed you yesterday? I’m having email problems and need to know if it went through.

You asked about color. The BSC does not include that information. That’s not a concern for my project, and I don’t know offhand where such info is available.

You also asked about scaling. The actual magnitude ratio (2.5118) did not display properly in my original file, so I had to fiddle with those numbers manually to arrive at an “eyeball” estimate, based on my own experience. This is the code I came up with at the time, from that ActionScript:

_root["starr"+i]._xscale = (6-(coord[i][0]))*3;
_root["starr"+i]._yscale = (6-(coord[i][0]))*3;

The scaling in x and y worked out to be the number 6, minus the magnitude value, and that difference times 3. This gave a good visual result in ActionScript and Flash, though it might be different in Blender. Again, I did this work a dozen years ago, and have not tried to write a script in the meantime.

Anyway, that looks really nice, hope you can let me see what you did.

http://www.pasteall.org/blend/34036

@ Eppo your Box is full to the top !LOL

did use the 1000 file not the first one!
had to modify the file read for it

and still doing some features in file and need to debug it a little
but should be inside a day and will upload it !

color I just made like 5 colors function of Mag
but it can be left to one color !

size I think may have to be corrected when testing with camera render !
not certain how it will render yet !
depends at what distance stars are set
the further the bigger of they wont show in render !

by the way I redone new method and now can draw the 1000 stars inside 1 second
so much faster .

happy bl

Thanks Eppo, what is the purpose of that globe17 file? Have you been working on a similar problem, plotting stars from data? Looks like you really know what you’re doing!

Ricky, I understand about the size/distance issue, been thinking of that myself. I wanted to worry first about properly positioning the stars into constellations before worrying about the sizes. For my purposes, the stars should be as far away from the origin as possible in the Blender 3D space, to minimize parallax. Again, I was hoping to end up with a 3D model where the camera could be located at the origin and pointed in any direction, to correspond to the view of constellations as seen in the sky. If the “stars” (spheres) are too close, they will not appear natural. Thanks for your interest in this project.

yes but as i said will probably have to test with render to see what size is required
but this is after I’m done with the set up right now
so size is or later

still debugging script

happy bl

I was reading thread and then you asked if csv could be read somehow…Bright Star Catalog wasn’t hard to find; data read from this should be a bit different though - you would need to fetch needed bytes after line read according to ReadMe description.
Hope helps somehow.
Not that i know much about Stellar Mechanics or Python, more like training of the GrayMatter :wink:

@RickyBlender lol, i’m on my way to clean it out…

That is why I posted the link to NOVAS_py http://aa.usno.navy.mil/software/novas/novas_py/novaspy_intro.php but you need actual star chart data as gathered by the satalites and radio observatories throught the world. The only problem is that NOVAS is intended to be run in Python, not Blender. I already have it installed along with all the databases they have available through pypi install which isn’t available in Blenders embedded Python, they removed it to save space.

NOVAS code is NOT copyright, as most US government works, so you can use it to see how they calculate the positions of stars based on date and time. They cover years -3000 to +3000 but only in certain HUGE data sets. As soon as I find something, I’ll post it.

Stars bright !
normal max distance in bl in 10 000 meters

but when rendering it has to see the light from these stars and at such a distance might need to make stars bigger and more light on it
to at least be able to see the stars
so not certain what size and brightness will be required

but not certain what it would change on the parallax thing !

but if at 10 000 it should be small enough hopefully

happy bl

Instead of the \ you need to put \ instead, in the file path, the way you entered it is being considered an escape sequence and erroring out. Post any more errors if you come accros any.

Just to clarify, the line


myStarFilePath = 'C:\Users\user\Documents\Blender\starData.csv'

should actualy read


myStarFilePath = 'C:\\Users\\user\\Documents\\Blender\\starData.csv'

keep that always in mind when working with python paths.

Also from the first image, make sure that the very last lines look like the following, it looks messed up from that image:


################
# no need to editing anything below yet
numStars = readStarData(myStarFilePath)

processStars()

The code at the end is required or the script wont run, the functions are defined with " def somefunction(): ". the last few lines are calling the functions I defined.

numStars = readStarData(myStarFilePath)

is where the file is actualy read in and all the data is stored into a variable.

processStars()

is where we take that data, now in memory, and make viewable objects in 3D.