Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 2.12 KB | None | 0 0
  1. #!/usr/bin/perl
  2. $tfnn = $ARGV[0];
  3. my $grbc='';
  4. open FILE3, "<$tfnn" or die $!;
  5.  
  6. $t = 1;
  7. system("mkdir -p ./gpl");
  8. $viewc = "perl /master/sbin/viewcirc.pl ";
  9. while (<FILE3>) {
  10.     $files = $_;
  11.     if ( $files =~ /([+-]?\d+\.?\d*)\s*([+-]?\d+\.?\d*)\s*(\d+\.?\d*)/ ) {
  12.         if ($3 == 0) {
  13.         $label="w p ps 2  lc 'blue'  pt 3  title  'optical counterparts'";
  14.         }
  15.         elsif ( ($3 < 0.15) and ($3>0) ) {
  16.         $label="w point ps 1 lc 'red' pt 13 notitle";
  17.         }
  18.         else{
  19.         $label="w dot notitle";
  20.         }
  21.         $comm = "$viewc $1 $2 $3 $1 $2 2  > ./gpl/grb_c$t";
  22.         printf stderr "$comm \n";
  23.         system($comm);
  24.         $grbc = "$grbc ,  './gpl/grb_c$t' u ((\$1)>180?(\$1)-360:(\$1))*sqrt(cos((\$2)/180*3.1415)):2 $label";
  25.         $t++;
  26.     }
  27.  
  28. }
  29.  
  30. open FILEX2, ">./gpl/grb_multi.gpl" or die $!;
  31.  
  32. print FILEX2 "set term pngcairo size 1920,1080;\n\
  33. set title \"GRB localisations and optical counterparts\" font \"roboto,20\"\n\;\n\
  34. set xrange [180:-180] ; \n\
  35. set yrange [-90:90] ; \n\
  36. set cbtics font \",10\"  \n\
  37. set format cb \"\%.1tx10^{\%T}\"\n\
  38. set key font \",8\" left ;  \n\
  39. set key at 0,-155  center  center   maxrow 1  Right\n\
  40. set view map \n\
  41. set xtics  font \",15\"\n\
  42. set ytics  font \",15\"\n\
  43. set colorbox horizontal \n\
  44. set colorbox user origin 0.1,0.1 size 0.8,0.05 \n\
  45. set palette defined ( 0 \"#ffeee0\", 0.1 \"#ff995c\", 0.2 \"#ff5734\" , 0.3 \"#ff083e\" , 0.4 \"#e3004b\", 0.5 \"#b80044\", 0.6 \"#7c001c\", 0.8 \"#3a080b\", 1.0 \"#000000\") \n\
  46. set xtics ('12' -180,'14' -150,'16' -120, '18' -90,'20' -60, '22' -30, '0' 0, '2' 30, '4' 60, '6' 90,  '8' 120, '10' 150,'12' 180); \n\
  47. set ytics (-90 , -60 , -30 ,  0 , 30 , 60 ,  90 ) \n\
  48. set style fill transparent solid 1 \n\
  49. set output 'grb_multi.png' \n\
  50.  
  51.  
  52.  
  53. plot  '/master/etc/net.dat' u  ((\$1)>180?(\$1)-360:(\$1))*sqrt(cos((\$2)/180*3.1415)):2 w line   lc rgb 'gray' notitle ,  '/master/etc/net3.dat' u  ((\$1)>180?(\$1)-360:(\$1))*sqrt(cos((\$2)/180*3.1415)):2 w dot   lc rgb 'gray' notitle $grbc;
  54. ";
  55.  
  56. close FILEX2;
  57.  
  58. $com = "gnuplot ./gpl/grb_multi.gpl";
  59. print stderr "$com\n";
  60. system($com);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement