File:Algol-type variable binary star animation 3.gif

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Algol-type_variable_binary_star_animation_3.gif(640 × 480 pixels, file size: 1.98 MB, MIME type: image/gif, looped, 72 frames, 7.2 s)

Captions

Captions

Animation and light curve of Algol-type binary eclipsing variable srat,

Summary[edit]

Description
English: Algol-type binary. Yekllow star is cooler and fainter. Smaller blue-white star is brighter. Yellow, big star is fainter. Stars eclipse each other.
Date
Source Own work
Author Merikanto

Pov-Ray 3.8 source code of animation

Make animation from output images with imagemagick in win 11 (you must install ImageMagick and posible set path)

magick convert  -delay 10 -loop 0 *.png algol_type_binary_animation_1.gif


Python 3 code

    1. generate light curve+img animation images from double star images
    1. python3 script
    2. 28.9.2023 0000.0000B

import math import numpy as np from scipy import interpolate import matplotlib.pyplot as plt import matplotlib.image as mpimg


inputbase1=".\\pngs\\" outputbase1=".\\pngs3\\"

imagebase1="doublestar1"

animsize=72

animcoeff1=72/360


x0=2*np.array([00,30,60,95,125,160,180,220,250,280,300,330,360]) y0=300+100*(np.array([4,4,4,4,6,4,4,4,5,4,4,4,4])-4) x2 = np.linspace(0,360,360)*2

  1. y2=np.interp(x2, x0, y0)
  2. y2= cubic_interpolate(x2,x0,y0)

tck = interpolate.splrep(x0, y0, s=0)

y2 = interpolate.splev(x2, tck, der=0)

  1. print(y2)

for n in range(1, 360,5): angel1=n nummero1=int(animcoeff1*angel1)+1 in_imagename1=inputbase1+imagebase1+str(nummero1).zfill(2)+".png" out_imagename1=outputbase1+imagebase1+str(nummero1).zfill(2)+".png" x3=angel1*2 y3=y2[int(angel1)] print(n, angel1,y3) img = mpimg.imread(in_imagename1) imgplot = plt.imshow(img) plt.scatter(x3,y3,color="red",s=400) plt.yticks(ticks=np.array([0,200,400,600]),labels=["0","3","6","9"]) plt.xticks(ticks=np.array([0,90,180,270,360])*2,labels=["0","90","180","270","360"]) plt.plot(x2,y2, color="yellow", lw=5) plt.savefig(out_imagename1) #plt.show() #plt.scatter(x3,y3,color="black",s=400)


Animation .ini file

POV-Ray animation ini file

Antialias=Off Antialias_Threshold=0.1 Antialias_Depth=2

Input_File_Name="doublestar1.pov"

Initial_Frame=1 Final_Frame=72 Initial_Clock=0 Final_Clock=360

Cyclic_Animation=on Pause_when_Done=off

Drawing souble star oobjects, POV-Ray 3.8 source code



///////////////////////////// // // Algol type double star // //pov-ray 3.8 source code // // 27.9.2023 v 0000.0001 // /////////////////////////////

  1. include "functions.inc"
  1. declare taunolla=clock+90;
  1. declare tau1=radians(taunolla);
  2. declare tau2=radians(taunolla+180.0);
  1. declare ra=1.2;
  2. declare rb=1.2;
  3. declare ax = sin(tau1)*ra+0.5;
  4. declare ay = cos(tau1)*ra;
  1. declare bx = sin(tau2)*rb-0.5;
  2. declare by = cos(tau2)*rb;
  1. declare Orange=<1,0.5,0>;
  2. declare Yellow=<1,1,0>;
  1. declare White=<1,1,1>;
  2. declare Blue=<0.8,0.8,1>;
  3. declare Black=<0.0,0.0,0.0>;
  4. declare Grey=<0.5,0.5,0.5>;


  1. declare atm_thickness1=0.1 ;


camera { location <0,10,-80> look_at 0 angle 4.5 }


  1. macro convection_cells(c)

crackle pigment_map{ [0.0 rgb c*0.2] [0.2 rgb c] [0.9 rgb c] [1.0 rgb 1.0]

} warp{turbulence 0.3}

  1. end



// yellowish star

#declare stara1= union {
  sphere
  { 
  0, 1

// translate <ax,0,ay>


  texture{
        pigment{
         // ripples
           granite scale 1/10
          // wrinkles
            scale 1 turbulence 0.3
          color_map {
                 [0.0 color <1,0.5,0> ]
               //  [0.1 color Grey   ]
               //  [0.2 color Yellow    ]
                 [1.0 color <1,1,0>   ]
                } // cmap
   
 
      } // pig
 
     finish {
     ambient 1
     diffuse 0.01
     reflection 0.01
      } // fin
  
  } // tex
    
    
    
  } // sphere

// halo 1

sphere

  { 
  
  0, 1 hollow no_shadow
  


    pigment {
    rgbt 1 }
    interior
    { media
      { emission 1/1
        density
        { 
            function {
          //    1*exp(-1*(sqrt(x*x+(y)*(y)+z*z)- 1 - 0.00001)/atm_thickness1)    
          // exp(-sqrt((x*x+y*y+z*z)-0) )*0.3
            pow( 2*sqrt(x*x+y*y+z*z),-6 )
           }
        
       density_map  
          
          { 
               [0 rgb 0.0001*<1,1,0>] 
               [0.01 rgb 0.003*<1,1,0>] 
               [.5 rgb <1,1>*1/2]
               [1 rgb <1,1,0>*1.5]
          }
       


      }
        samples 30,30 intervals 1 confidence .1 // quite fast settings
        method 3
      }
      
      
    }
       scale 1.75


  }  

}

// bluish star


  1. declare stara2=union {


  sphere
  { 
  0, 1


 texture {
 pigment {
	crackle

pigment_map{ [0.0 rgb <1/100,1/100,1>*2]


[1.0 rgb <8/10,8/10,1>*2]

} warp{turbulence 0.75}

 }
 scale 0.1
 }
 
     finish {
     ambient 10
     diffuse 0.01
     reflection 0.01
      } // fin


     scale 1/2
  } // sphere
   sphere
   { 
  
  0, 1 hollow no_shadow


    pigment {
    rgbt 1 }
    interior
    { media
      { emission 1.5
        density
        {
              function {
            

// exp(-1.5*(sqrt(x*x+y*y+z*z)-0) )

  pow( 2*sqrt(x*x+y*y+z*z),-4 )
   }
   density_map
          { 
           [0 rgb 0.01*<0.5,0.5,1>] 
           [0.125 rgb 0.1*<0.5,0.5,1>] 
           [.5 rgb <0.5,0.5,1>*1/2]
           [1 rgb <0.5,0.5,1>*1.5]
          }


        }
        samples 30,30 intervals 2 confidence .001 // quite fast settings
        method 3
      }
    }
    
       scale 1/2
       scale 2


  }

}


// stars


object {stara1

       translate <ax,0,ay>

}


object {stara2
       translate <bx,0,by>

}





OLD codestuff:


This animation is made with povray,linux bash, python and ctioga2.

Note: you must modify these scripts to run animation correctly.

Povray n6.pov

declare taunolla=clock+80;

  1. declare tau=radians(taunolla);
  2. declare tau2=radians(taunolla+180.0);
  1. declare ra=1.5;
  2. declare rb=1.5;
  3. declare ax = sin(tau)*ra+0.5;
  4. declare ay = cos(tau)*ra;
  1. declare bx = sin(tau2)*rb-0.5;
  2. declare by = cos(tau2)*rb;
  1. declare Orange=<1,0.5,0>;
  2. declare Yellow=<1,1,0>;
  1. declare White=<1,1,1>;
  2. declare Blue=<0.8,0.8,1>;
  3. declare Black=<0.0,0.0,0.0>;
  4. declare Grey=<0.5,0.5,0.5>;
  1. macro convection_cells(c)

crackle pigment_map{ [0.0 rgb c*0.2] [0.2 rgb c] [0.9 rgb c] [1.0 rgb 1.0]

} warp{turbulence 0.3}

  1. end
camera { location <0,0,-70> look_at 0 angle 5 }
  sphere
  { 
  0, 1
  translate <ax,0,ay> 
 
 /*
 texture {
 pigment {
	crackle

pigment_map{ [0.0 rgb Orange] [0.2 rgb Yellow] [0.9 rgb Yellow] [1.0 rgb 1.0]

} warp{turbulence 0.3}

 }
 scale 0.05
 }
 
     finish {
     ambient 0.7
     diffuse 0.01
     reflection 0.01
      } // fin
    
    */
  texture{
        pigment{
          ripples scale 0.1 turbulence 1.5
          color_map {
                 [0.0 color Black ]
                 [0.1 color Grey   ]
                 [0.2 color Yellow    ]
                 [1.0 color Yellow   ]
                } // cmap
   
 
      } // pig
 
     finish {
     ambient 0.7
     diffuse 0.01
     reflection 0.01
      } // fin
  
  } // tex
    
    
    
  } // sphere

// halo 1

sphere

  { 
  
  0, 1.3 hollow no_shadow
  

/*

  normal {
  wrinkles 0.3
  }
 */
  
    pigment {
    rgbt 1 }
    interior
    { media
      { emission 1/1
        density
        { spherical density_map
          { [0 rgb 0]
             [0.125 rgb Yellow*0.003]
          [0.25 rgb Yellow*0.02]
          [.75 rgb Yellow*.3]
          [1 rgb 2]
          }
        }
        samples 1,1 intervals 1 confidence .1 // quite fast settings
        method 3
      }
      
      
    }
       scale 2
    translate <ax,0,ay>


  }
  sphere
  { 
  0, 0.5
  translate <bx,0,by> 
    
 texture {
 pigment {
	crackle

pigment_map{ [0.0 rgb Blue] [0.2 rgb White] [0.9 rgb White] [1.0 rgb 1.0]

} warp{turbulence 0.3}

 }
 scale 0.05
 }
 
     finish {
     ambient 0.7
     diffuse 0.01
     reflection 0.01
      } // fin

/*

  texture{
        pigment{
          ripples scale 0.1 turbulence 1.5
          color_map {
                 [0.0 color White ]
                 [0.4 color White   ]
                 [0.5 color Blue    ]
                 [1.0 color Blue   ]
                } // cmap
   
 
      } // pig
 
     finish {
     ambient 1.0
     diffuse 0.01
     reflection 0.01
      } // fin
  
  } // tex
  • /
  } // sphere

sphere

  { 
  
  0, 0.5 hollow no_shadow


    pigment {
    rgbt 1 }
    interior
    { media
      { emission 1/1
        density
        { spherical density_map
          { [0 rgb 0][.5 rgb Blue*.5][1 rgb 1.5]
          }
        }
        samples 1,1 intervals 1 confidence .1 // quite fast settings
        method 3
      }
    }
    
 
       scale 1.35
    translate <bx,0,by>


  }

Povray ini

POV-Ray animation ini file

Antialias=Off Antialias_Threshold=0.1 Antialias_Depth=2

Input_File_Name="n6.pov"

Initial_Frame=1 Final_Frame=72 Initial_Clock=0 Final_Clock=360

Cyclic_Animation=on Pause_when_Done=off

Run bash

    1. sudo apt install plotutils ctioga2 imagemagick
    2. do manually coarse light curve
  1. #spline -n 72 kirka1.txt > kirka2.txt

rm *.png povray n6.ini cp *.png ./anim_sources convert -delay 20 -loop 0 *.png algol_type_binary_animation_1.gif

    1. note correct mogrify error
      1. /etc/ImageMagick-6/policy.xml
  1. modify coder line to this <policy domain="coder" rights="none" pattern="PDF" />
    1. add this line
    2. <policy domain="coder" rights="read|write" pattern="LABEL" />
  1. mogrify -verbose -density 500 -resize 800 -format png ./*.pdf

python taco2.py

cd animator bash makepdf.bash cd ..

Python ctioga files generator "taco2.py"

    1. python .txt light curve, png files
    2. ctioga2 file(s) ganerator

import csv

phases = [] mags = []

def write_taco_faili(kuvapolku, tiogapolku, phase, mag):

myfile = open(tiogapolku, 'w') #myfile.write("draw-image "+kuvanimi+" 0.1,1 6,-1 /transparency=0.4\n") #/myfile.write("draw-marker "+str(x)+","+str(y)+" Circle /color blue\n") myfile.write("page-size 10cmx7.5cm\n") #myfile.write(str(13)) myfile.write("xy-plot\n") myfile.write("yrange 8:0\n") myfile.write("axis-style right /tick-label-scale=1.1 \n") myfile.write("ylabel magnitude\n") myfile.write("xlabel phase\n") myfile.write("color-set blue\n") myfile.write("axis-style right /tick-label-scale=1.1 \n") myfile.write("fill none\n") myfile.write("color-set red\n") myfile.write("plot ../kirka3.txt@1:2 /line-width=3\n") myfile.write("draw-image "+kuvapolku+" 0.1,-1 369,8 /transparency=0.0\n") myfile.write("\n") myfile.write("xy-plot\n") myfile.write("yrange 8:0\n") myfile.write("fill none\n") myfile.write("color-set yellow\n") myfile.write("plot ../kirka3.txt@1:2 /line-width=3\n") myfile.write("draw-marker "+str(phase)+","+str(mag)+" Circle /color white\n")

myfile.close() return

def read_light_curve(kayranimi): naku=0 with open(kayranimi) as csvfile: readCSV = csv.reader(csvfile, delimiter=' ')

for row in readCSV: phase = row[0] mag = row[1] if (naku>-1): phases.append(phase) mags.append(mag) naku=naku+1

#print(phases) #print(mags) return

def generate_taco_bases(kuvahake, animhake, kuvakanta, kuvaliite): global phases global mags

myfile = open(animhake+"makepdf.bash", 'w')

maara=len(phases) print (maara) maara=maara-1; for n in range(1, maara): #print (n) nimmi=kuvakanta+str(("%02d"%n))+kuvaliite #print (nimmi) polkunimmi=kuvahake+nimmi; #print (polkunimmi) aninimmi=animhake+"g"+str(("%04d"%n))+".ct" #print (aninimmi) phase=phases[n] mag=mags[n] #print(phase, mag) write_taco_faili(polkunimmi, aninimmi, phase, mag) print (".") myfile.write("ctioga2 -f g"+str(("%04d"%n))+".ct"+"\n")

myfile.write("mogrify -verbose -density 500 -resize 800 -format png ./*.pdf\n") myfile.write("convert -delay 10 -loop 0 *.png algol_type_binary_animation_1.gif\n")


myfile.close() return

  1. entry point

read_light_curve("kirka3.txt") generate_taco_bases("../anim_sources/","./animator/", "n6",".png")


Brightness orig src file

00 4 30 4 60 4 95 4 125 6 160 4 180 4 220 4 250 5 280 4 300 4 330 4 360 4

Brightness file, that is used in anim, kirka2,txt

phase magnitude 0 4 5 3.98062 10 3.96899 15 3.96511 20 3.96899 25 3.98062 30 4 35 4.02585 40 4.05169 45 4.06978 50 4.07237 55 4.05169 60 4 65 3.91503 70 3.81644 75 3.72941 80 3.67909 85 3.69064 90 3.78922 95 4 100 4.3341 105 4.74656 110 5.17837 115 5.57055 120 5.86409 125 6 130 5.93799 135 5.71263 140 5.37718 145 4.98492 150 4.58912 155 4.24306 160 4 165 3.89567 170 3.89558 175 3.9477 180 4 185 4.0118 190 3.9879 195 3.94447 200 3.89767 205 3.86366 210 3.8586 215 3.89866 220 4 225 4.17045 230 4.3845 235 4.60832 240 4.80807 245 4.94991 250 5 255 4.93617 260 4.78295 265 4.57653 270 4.3531 275 4.14886 280 4 285 3.93205 290 3.92791 295 3.95982 300 4 305 4.02598 310 4.03637 315 4.03507 320 4.02598 325 4.01299 330 4 335 3.99026 340 3.98441 345 3.98246 350 3.98441 355 3.99026 360 4

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current08:58, 28 September 2023Thumbnail for version as of 08:58, 28 September 2023640 × 480 (1.98 MB)Merikanto (talk | contribs)Update
12:17, 18 May 2019Thumbnail for version as of 12:17, 18 May 2019800 × 600 (4.63 MB)Merikanto (talk | contribs)User created page with UploadWizard

There are no pages that use this file.