Skip to content
Snippets Groups Projects
Select Git revision
  • d25450cf974063500c3fae2dfebb73dfae977886
  • master default protected
  • antenna-patterns
  • qt5-qopenglwidget
  • license-demo
  • isolated
  • isolated-fixedprofile
  • release_1.1
  • press-conference
  • rim-only
  • release_1.0
11 results

pulsatingsciencehelp.cpp

Blame
  • antenna.cpp 12.96 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
    // (b) direction and origin conventions for the polarization axis
    // (c) double check the hand calculations
    
    #include <math.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <strings.h>
    
    
    // Structure for passing information about the GW source and detectors
    struct InputStruct {
       // orbital orientation in degrees, 0 to 180. Zero degrees has
       // orbital angular momentum pointing to the earth
       double iota;
       // orientation of long axis of ellipse, 0 to 360, in degrees CCW
       // from North
       double psi;
       // orientation of detector arms away from actual, 0 to 360, in
       // degrees CCW when viewed from directly overhead
       // Ordering is LLO, LHO, VIRGO
       double orientation[3];
    };
    
    // Structure for returning information about the response.  The array
    // elements are in the order LLO, LHO, VIRGO
    struct OutputStruct {
       // amplitude of sin function, dimensionless
       double amp[3];
       // phase of sin function, in degrees from 0 to 360
       double phase[3];
       // time delays, in milliseconds
       double dt[3];
    };
    
    // Global variables for passing information. Ugly style but doesn't
    // matter for this!
    struct InputStruct inputdata;
    
    // For converting degrees to radians
    const double deg_to_rad = M_PI/180.0;
    
    // For computing arrival time delays, need mean radius of the earth in
    // milliseconds. Get this by dividing radius in km by speed of light in
    // km/s.
    const double radius_earth = 6371.0*1000.0/299792.458;
    
    // Event time
    // GPS 1187008882
    // UTC:	Thu 2017 Aug 17	12:41:04
    // Julian Day 2457983.02852
    // Modified Julian Day 57982.52852
    
    // The convention in this code is that Lattitude is measured north of
    // the equator.  So Lattitude -10 means 10 degrees SOUTH of the
    // equator.  Longitude is measured East of Greenwich.  So longitude
    // -90 means 90 degrees West of Greenwich (somewhere in the USA).
    
    // Galaxy NGC 4993 (from Wikipedia):
    //    Right ascension: 13h 09m 47.2s
    //    Declination: −23° 23′ 4″
    // We will need to convert this to location over the Earth at the
    // event time.  It will turn out to be:
    //    Lattitude −23.3844 degrees (south of equator)
    //    Longitude 41.092981 degrees (east of Greenwich)