Skip to content
Snippets Groups Projects
Select Git revision
  • 8a6142ca1e0a9c1afa3021569bb91c5ed93b2aad
  • master default protected
  • fix_Makefile.mingw#2
  • update_Makefile.mingw
  • fix_Makefile.mingw
  • fix_API_for_C_apps
  • fix_procinfo_mac
  • boinccmd_gpu_mode_always_until_sigterm
  • fgrp_osx_hotfix
  • fix_boinc_master@f8250782
  • eah_wrapper_improvements
  • diagnostics_win-hotfix
  • diagnostics_win-hotfix-old
  • current_fgrp_apps
  • testing_gw_apps
  • gw_app_darwin_15
  • current_brp_apps
  • current_brp_apps_android10
  • current_gfx_apps
  • current_server
  • current_gw_apps
  • previous_fgrp_apps
  • previous_gw_apps
  • testing_brp_apps
  • apps_FGRP3_1.07
  • apps_FGRP3_1.08
26 results

bmplib.cpp

Blame
  • antenna_main.cpp 2.28 KiB
    // Copyright Bruce Allen 2017
    // Compile with gcc -o antenna antenna.c -lm
    
    // REMAINING THINGS TO CHECK:
    
    // (a) sign conventions for h, which arm is positive CONFIRMED.  VIRGO
    //  AND LIGO DEFINE THE POSITIVE ARM AS "X" where X defined by right
    //  hand rule with two arms and Z away from center of earth.
    
    // (b) direction and origin conventions for the polarization axis The
    // convention for LAL is that psi is the angle that the source plane
    // is rotated CCW as viewed from the Earth.  The convention in my
    // calculation is the opposite.  So in my code I have changed the sign
    // inside get_antenna() so that the arguments now correspond to LAL
    // ones.  Thus in this code, the conventions correspond to LAL.
    
    // IOTA is zero when orbital angular momentum points to earth
    // PSI is orbital plane rotation CCW as viewed from Earth
    
    #include <math.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <strings.h>
    #include "antenna_lib.h"
    
    // This function requires two floating point arguments on the command
    // line, iota and psi, angles in degrees.
    int main(int argc, char *argv[]) {
       // to loop over detectors
       int i;
    
       // to pass data in and out
       struct InputStruct myinput;
       struct OutputStruct myoutput;
    
       // check syntax crudely, issue usage message
       if (argc != 3) {
          fprintf(stderr,
    	      "Wrong argument count! Correct usage:\n"
    	      "%s float_iota_in_degrees float_psi_in_degrees\n",
    	      argv[0]);
          exit(1);
       }
       myinput.iota = atof(argv[1]);
       myinput.psi = atof(argv[2]);
    
       // pass inclination angle, polarization axis, orientation offsets
       for (i=0;i<3;i++) myinput.orientation[i]=0.0;
       
       printf("Iota = %f degrees\nPsi = %f degrees\n", myinput.iota, myinput.psi);
    
       // now compute responses
       get_antenna(&myoutput, &myinput);
    
       for (i=0; i<5; i++) print_detector(i);
       print_source();
    
       // degree character in UTF-8 character set (most likely terminal type!)
       int deg1=0xC2, deg2=0xB0;
       
       // Now display waveforms
       for (i=0; i<5; i++)
          printf("For detector %s the waveform is %.3f w^2 sin(2w[t%+.1f ms]%+.1f%c%c)\n",
    	     myoutput.name[i], myoutput.amp[i], myoutput.dt[i], myoutput.phase[i], deg1, deg2);
    
       // prints angles between line in between detector i arms and direction to source
       // for (i=0; i<5; i++) print_angles(i);
    
       return 0;
    }