Skip to content
Snippets Groups Projects
Select Git revision
  • f5f1ebfa9ae48e378360924817c24f9478a1b973
  • master default
  • mingw_gcc44
  • release_ABP1_012
  • release_ABP1_008
  • release_ABP1_006
  • release_ABP1_007
  • release_ABP1_005
  • release_ABP1_004
  • release_ABP1_003
  • pre_release_0.15
  • release_ABP1_001
  • release_ABP1_002
  • pre_release_0.13
  • pre_release_0.14
  • pre_release_0.11
  • pre_release_0.12
  • pre_release_0.10
  • pre_release_0.09
  • pre_release_0.08
20 results

Resource.h

Blame
  • Forked from einsteinathome / graphicsframework
    Source project has a limited visibility.
    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)