From 115b12d6465ae10c613d1420d669beaed093d9be Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Sun, 24 May 2015 00:42:29 +0200 Subject: [PATCH] Add LMC survey --- examples/make_pointings.py | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 63 insertions(+), 4 deletions(-) diff --git a/examples/make_pointings.py b/examples/make_pointings.py index 3f8a672..02a0d7b 100755 --- a/examples/make_pointings.py +++ b/examples/make_pointings.py @@ -240,6 +240,59 @@ def set_gc(lst=True): return obsdef +# ============= # +# Setup LMC KSP # +# ============= # +def set_lmc(hours=250.0, lst=True): + """ + Setup LMC KSP. + """ + # Initialise observation definition + obsdef = [] + + # Set LMC centre + centre = gammalib.GSkyDir() + centre.radec_deg(80.0, -69.0) + + # Set offset angle and number of pointings + offset = 1.0 # degrees + n_pnt = 12 + + # Prepare computations + dphi = 360.0/n_pnt + duration = hours*3600.0/float(n_pnt) + + # Loop over pointings + for ipnt in range(n_pnt): + + # Compute pointing direction + pnt = centre.copy() + pnt.rotate_deg(ipnt*dphi, offset) + lon = pnt.l_deg() + lat = pnt.b_deg() + + # Set positions and duration + obs = {'lon': lon, 'lat': lat, 'duration': duration} + + # Add IRF + caldb = "aar" + if lst: + irf = "DESY20140105_50h" + else: + irf = "DESY20140105_50h_noLST" + obs['caldb'] = caldb + obs['irf'] = irf + + # Append observation + obsdef.append(obs) + + # Dump statistics + print("Number of pointings: %d (%.2f sec)" % (n_pnt,duration)) + + # Return observation definition + return obsdef + + # ======================================= # # Write observation definition dictionary # # ======================================= # @@ -302,13 +355,14 @@ if __name__ == '__main__': if need_help: print("Usage: make_pointing.py [OPTIONS]") print(" -h Display this usage message") - print(" gps Galactic plane scan (2 row scheme)") - print(" gps3 Galactic plane scan (3 row scheme)") + print(" gps Galactic plane survey (2 row scheme)") + print(" gps3 Galactic plane survey (3 row scheme)") print(" extgal Extragalactic survey") - print(" gc Galactic centre") + print(" gc Galactic centre survey") + print(" lmc LMC survey") sys.exit() - # Galactic plane scan + # Galactic plane survey if obsname == "gps": obsdef = set_gps(lst=True) write_obsdef("gps.dat", obsdef) @@ -326,6 +380,11 @@ if __name__ == '__main__': obsdef = set_gc(lst=True) write_obsdef("gc.dat", obsdef) + # LMC + elif obsname == "lmc": + obsdef = set_lmc(lst=True) + write_obsdef("lmc.dat", obsdef) + # Invalid pattern else: print("Unknown option \""+obsname+"\"") -- libgit2 0.21.4