|
John Morgan
Physics 3301 - Scientific Computations University of Sydney |
|
Stage I
Virtual Model of Positions of 100 Closest Hipparcos Stars |
|
The first step was to collect position data for the 100 closest Hipparcos stars. That being stars with a parallax greater than 131.12 miliarcseconds or a distance from our solar system of less than 24.875 light years. The data was collected from The Hipparcos Main Catalogue via the
VizieR Catalog Search Website. The data was acquired in celestial spherical coordinates. The right ascension and declination were in degrees and the parallaxes were in miliarcseconds. In order to create a virtual 3 dimensional visualization of these stars, it was necessary to convert the celestial spherical coordinates into cartesian coordinates. This was achieved using basic spherical trigonometry and assuming our sun to be at the x, y, z origin (0,0,0).
These are the calculations that were used: |
|
The x, y, z origin of the trigonometric half-sphere to the left represents our solar system.
In this figure a star's Right Ascension (RA) is represented by , its Declination (Dec) is represented by , and the stellar distance (R) is represented by .
|
| HIP# | RA (deg) | Dec (deg) | Parallax (mas) |
|---|---|---|---|
| 71681 | 219.91412833 | -60.83947139 | 742.12 |
| 71683 | 219.92041034 | -60.83514707 | 742.12 |
| 70890 | 217.44894751 | -62.68135207 | 772.33 |
Parallax = (In milliarcseconds)
1 / = R (In milliparsecs)
R * 1000 = R (In parsecs) R * 3.2616 = R (In light years) |
X = R Sin Cos
|
Y = R Sin Sin
|
Z = R Cos
|
| HIP# | X (ly) | Y (ly) | Z (ly) |
|---|---|---|---|
| 71681 | 2.943733010 | 2.462576453 | 2.141488287 |
| 71683 | 2.943339026 | 2.462795468 | 2.141777945 |
| 70890 | 3.773543507 | 2.284549197 | 1.938128126 |
| The cartesian coordinate data was outputted to a file in particular format that would be read by the visualization software. The software used was MDMovie, by Jerry p. Greenberg. To view the full table of formatted cartesian coordinate data for all 100 stars, click here. |
|
Once the data was read into MDMovie a virtual 3 dimensional on screen model of the 100 closest Hipparcos stars was constructed. The radius of the Sun was extremely exaggerated so it would stand out.
~ 3-D Virtual Model ~ Note: This will only work if your browser is equipped with the virtual world plugin. |
#!/usr/local/bin/perl
$finName = "RVdata"; #ARRAY
open( FILEINPUT, "<$finName" ); #OPEN FILE FOR INPUT
$foutName = "RVclean"; #ARRAY
open( FILEOUTPUT, ">$foutName" ); #OPEN FILE FOR OUTPUT
for ($i=0; $i<118300; $i++)
#while ( $line = ) #LOOP
{
$line = ;
@myList = split( /\s+/, $line );
if ( @myList[0] eq "" )
{
if ( @myList[2] ne "" )
{
print FILEOUTPUT "@myList[2] 000.0\n";
}
} elsif( @myList[1] ne "" )
{
print FILEOUTPUT "@myList[1] @myList[0]\n";
}
}#end while loop
#include
#include
ofstream fout("RVfinal");
ifstream fin("RVsorted");
int main()
{
double HIP, RV;
double star[17071][2];
for(int i=0; i<17071; i++)
{
fin>>HIP>>RV;
star[i][0] = HIP;
star[i][1] = RV;
if(star[i][0] == star[i-1][0])
{
star[i][1] = (star[i][1] + star[i-1][1]) / 2;
star[i-1][1]= star[i][1];
}//end if
}//end while
fout.precision(7);
for(int j=0; j<17071; j++)
{
if(star[j][0] != star[j-1][0])
{
fout<
#!/usr/local/bin/perl
$finRV = "RVfinal";
$finHIP = "fullHIP";
$foutName = "finalData";
open( RV_FILEINPUT, "<$finRV" );
open( FILEOUTPUT, ">$foutName" );
open( HIP_FILEINPUT, "<$finHIP" );
for ($i=1; $i<16770; $i++)
{
$RV_line = ;
@RV_List = split( /\s+/, $RV_line );
while( @HIP_List[0] < @RV_List[0] )
{
$HIP_line = ;
@HIP_List = split( /\s+/, $HIP_line );
chop ( $HIP_line );
print FILEOUTPUT "$HIP_line ";
if ( @HIP_List[0] eq @RV_List[0] )
{
print "$i out of 16769 found, HIP#@HIP_List[0] = @RV_List[0]\n";
print FILEOUTPUT " @RV_List[1]\n";
}else {print FILEOUTPUT "0\n";}
}#end j for loop
}#end i for loop
print "DONE!\n";
#!/usr/local/bin/perl
$fin = "sfinalData1";
$fout = "finalData2";
$jout = "junk";
open( FILEINPUT, "<$fin" );
open( GOODOUTPUT, ">$fout" );
open( JUNKOUTPUT, ">$jout" );
$j=1;
$i=1;
while( $line = )
{
$temp=@List[0];
@List = split( /\s+/, $line );
chop ( $line );
if (@List[0] eq $temp )
{
print JUNKOUTPUT "$line\n";
print "$i\n";
$i++;
}else{print GOODOUTPUT "$line\n";}
}#end while loop
print "DONE!\n";
#!/usr/local/bin/perl
$finName = "finalData2"; #ARRAY
open( FILEINPUT, "<$finName" ); #OPEN FILE FOR INPUT
$foutName = "closeStars"; #ARRAY
open( FILEOUTPUT, ">$foutName" ); #OPEN FILE FOR OUTPUT
for ($i=0; $i<116873; $i++)
{
$line = ;
@myList = split( /\s+/, $line );
if ( @myList[4] > 65.232 )
{
print FILEOUTPUT "$line";
}
print "$i\n";
}#end while loop
| RA2 = RA1 + pmRA/N |
| Dec2 = Dec1 + pmDec/N |
| N = 3600, which is the conversion factor for milliarcseconds -> 1000 deg/yr |
| R2 = R1 + RV * C |
| C = 0.003335640952, which is the conversion factor for km/s -> 1000 ly/yr |
//////////////////////////////////////////////////////////////////////////
///////////////////////////// John Morgan ////////////////////////////////
/////////////////////// Scientific Computing Project /////////////////////
////////////////////////////// Stars.cpp /////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#include // includes basic operations class
#include // includes file streaming class
#include
#define M_PI
//////////////////////////////////START OF CLASS/////////////////////////////////
////////////////////////////////start class defintion/////////////////////////////////////
class starClass
{
public:
starClass();
//default constructor
starClass(double& cnstHIP, double& cnstVmag, double& cnstRA,
double& cnstDec, double& cnstDist);
//Constructor, sets values to the private data members
//Precondition: values are compatible with their cooresponding data types
//Postcondition: private data members contain star data and spherical coord data
void SphereToCart();
//Converts star postion from spherical coordinates to cartesian coordinates
//Precondition: first three varialbles contain spherical data
//Postcondition: last three varialbles contain cartesian data
void GetCartCoord(double& cnstX, double& cnstY, double& cnstZ);
//Gets the cartesian coordinate values of the star
//Precondition: cartesian coordinate contain data, ie 'SphereToCart' has run
//Postcondition: cartesian coordinates are given in light years
void GetSphereCoord(double& cnstDist, double& cnstRA, double& cnstDec);
//Gets the spherical coordinate values of the star
//Precondition: sperical coordinat data was inputed
//Postcondition: spherical coordinates are given
double ReturnHIP();
//returns the star's Hiparcos number as an integer data type
//Precondition: HIP was inputed by the constructor
//Postcondition: HIP is returned
double ReturnVmag();
//returns the star's visual magnitude as a float double data type
//Precondition: Vmag was inputed by the constructor
//Postcondition: Vmag is returned
private:
double HIP; // star's Hiparcos catalog number
double Vmag; // star's visual magnitude
double Dist; // stars distance in light years
double RA; // star's right ascencion in degrees
double Dec; // star's declination in degrees
double X; // star's x coordinate assuming a 3D cartesian coordinate system
// with our sun at the origin, our equator parallel to the (x,y)
// plane, and with a scale in light years
double Y; // star's y coordinate assuming a 3D cartesian coordinate system
// with our sun at the origin, our equator parallel to the (x,y)
// plane, and with a scale in light years
double Z; // star's z coordinate assuming a 3D cartesian coordinate system
// with our sun at the origin, our equator parallel to the (x,y)
// plane, and with a scale in light years
};
////////////////////////////////// end class definition /////////////////////////////////
////////////////////////////////// start class implementation//////////////////////////
starClass::starClass()
{
HIP = 0;
Vmag = Dist = RA = Dec = X = Y = Z = 0;
}// end default constructor StarClass()
starClass::starClass(double& cnstHIP, double& cnstVmag, double& cnstRA,
double& cnstDec, double& cnstDist)
{
HIP = 0;
Vmag = Dist = RA = Dec = X = Y = Z = 0;
HIP = cnstHIP;
Vmag = cnstVmag;
Dist = cnstDist;
RA = cnstRA;
Dec= cnstDec;
}//end constructor StarClass()
void starClass::SphereToCart()
{
X = (Dist)*( sin( (M_PI/180.0) * (90-Dec) ) ) * ( cos( (M_PI/180.0)*RA ) );
Y = (Dist)*( sin( (M_PI/180.0) * (90-Dec) ) ) * ( sin( (M_PI/180.0)*RA ) );
Z = (Dist)*( cos( (M_PI/180.0) * (90-Dec) ) );
}//end SphereToCart
void starClass::GetCartCoord(double& cnstX, double& cnstY, double& cnstZ)
{
cnstX=X;
cnstY=Y;
cnstZ=Z;
}// end GetCoord()
void starClass::GetSphereCoord(double& cnstDist, double& cnstRA, double& cnstDec)
{
cnstDist=Dist;
cnstRA=RA;
cnstDec=Dec;
}//end GetSphereCoord()
double starClass::ReturnHIP()
{
return HIP;
}//end
double starClass::ReturnVmag()
{
return Vmag;
}
////////////////////////////////////end class implementation////////////////////////////////
////////////////////////////////////////END CLASS///////////////////////////////////////////
///////////////////////////////////////START MAIN PROGRAM////////////////////////////////////
ofstream foutvis("visualData"); // creates or opens a file to write to
ifstream finhip; // opens a file to read from
int main()
{
int numstars=0;
int frames=0;
double LY = 3.2616; //convesion factor for parsecs to Light Years
double convert = 0.003335640952; //convertion factor for km/sec into 1000LY/year
double HIP[490], Vmag[490], fixedVmag[490], Plx[490][1000], RA[490][1000],
Dec[490][1000], pmRA[490], pmDec[490], e_Plx[490], Dist[490][1000], B_V[490], RV[490];
double X, Y, Z;
cout<<"# of stars(<=490)? ";
cin>>numstars;
foutvis<<"\n"<<320<<" "<<320<<"\n";
finhip.open("localStars");
for(int starIndex=0; starIndex < numstars; starIndex++)
{
finhip>>HIP[starIndex]>>Vmag[starIndex]>>RA[starIndex][0]
>>Dec[starIndex][0]>>Plx[starIndex][0]>>pmRA[starIndex]
>>pmDec[starIndex]>>e_Plx[starIndex]>>B_V[starIndex]>>RV[starIndex];
}
finhip.close();
for(int i=0; i< numstars; i++)
{
if(RV[i]!=0)
{
fixedVmag[i] = (Vmag[i] + 10)/100;
foutvis<>frames;
for(int frameIndex=0; frameIndex < frames; frameIndex++)
{
foutvis< 360.0)
RA[starIndex][frameIndex] = RA[starIndex][frameIndex] - 360.0;
Dec[starIndex][frameIndex] = Dec[starIndex][frameIndex-1] +
(pmDec[starIndex]/3600.0);
if(Dec[starIndex][frameIndex] < -90.0)
Dec[starIndex][frameIndex] = Dec[starIndex][frameIndex] + 180.0;
if(Dec[starIndex][frameIndex] > 90.0)
Dec[starIndex][frameIndex] = Dec[starIndex][frameIndex] - 180.0;
Dist[starIndex][frameIndex] = Dist[starIndex][frameIndex-1] +
(RV[starIndex] * convert);
}//end else
starClass MyStarClass(HIP[starIndex], Vmag[starIndex], RA[starIndex][frameIndex],
Dec[starIndex][frameIndex], Dist[starIndex][frameIndex]);
MyStarClass.SphereToCart();
MyStarClass.GetCartCoord(X, Y, Z);
foutvis.precision(11);
if((X!=0)&&(Y!=0)&&(Z!=0))
foutvis<
In the final animation model, any stars that had incomplete data, including radial velocity, were omitted. Any star lacking a radial velocity in a multi-star system, in which the stars had independant HIP numbers, was omitted. Some multi-star systems are therefore represented by only one star.
The animation model is a 100x100x100 Light Year scale model with our sun at the center. The velocities are 1000 times the actual
velocity, each frame represents 1 year, and it plays at 25 frames per second. Hence,
each second of the animation model represents 25,000 years. The model is oriented so that the positive z axes is
perpendicular to and projecting from the screen. In other words, you are facing the the earth's Northern pole, so the plane of the solar sytem is at about a 23 degree tilt from parallel with the screen.

|
|
| Accuracy Of Model |
|
1. The error in the Hipparcos parrallax data increases as the the parallax gets smaller. A graphical representation of these errors was created. At the outer edge of the still model, because of the scale used, the error is too small to be detected. In the animated model the outer edge of the model (50ly) has a somewhat significant error of about 1-5 ly. 2. The motions of the stars in the animated model are relative to our solar system. Our solar system is moving, so it should not be assumed that these are the true velocities of the stars. 3. In the animation model all and any acceleration of a star was ignored. This includes any accelerating affects a multi-star system may have on the velocities of the individual stars. Ignoring any acceleration also allows for the likely false assumption that the stars are moving in a straight line relative to the solar system. Lastly, it allows for the likely false assumption that the star's current velocity will not change in time, thus moving at a constant rate in a constant direction. |
|
|
| Conclusion |
| The model is not a perfect representation of the paths the stars will actually take, but it does demonstrate the apparent motions relative to our solar system. The most constructive aspect of this project was the acquiring, processing, and calculating of the astronomical data. That process has made this author aware of the difficulties and technicalities of using a computer to model a natural system. |
|
|
| Hipparcos Space Astrometry Mission |
| John Morgan |
| Physics 3301 - Scientific Computations |
| University of Sydney |
|
jmor0359@vislab.usyd.edu.au
|
| ~ HOME ~ |