make_gridding.h

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 David Chin
00003 *
00004 *  This program is free software; you can redistribute it and/or modify
00005 *  it under the terms of the GNU General Public License as published by
00006 *  the Free Software Foundation; either version 2 of the License, or
00007 *  (at your option) any later version.
00008 *
00009 *  This program is distributed in the hope that it will be useful,
00010 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 *  GNU General Public License for more details.
00013 *
00014 *  You should have received a copy of the GNU General Public License
00015 *  along with with program; see the file COPYING. If not, write to the
00016 *  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00017 *  MA  02111-1307  USA
00018 */
00019 
00020 /*
00021  * Author: David Chin <dwchin@umich.edu> +1-734-709-9119
00022  * $Id: make_gridding.h,v 1.7 2007/06/08 15:29:43 bema Exp $
00023  */
00024 #ifndef _DETRESPONSE_MAKE_GRIDDING_H
00025 #define _DETRESPONSE_MAKE_GRIDDING_H
00026 #include <stdio.h>
00027 #include <stdlib.h>
00028 #include <string.h>
00029 #include <math.h>
00030 #include <errno.h>
00031 #include <lal/LALConfig.h>
00032 #include <lal/LALStdio.h>
00033 #include <lal/LALStdlib.h>
00034 #include <lal/LALConstants.h>
00035 #include <lal/LALDatatypes.h>
00036 #include <lal/Units.h>
00037 
00038 #include <lal/AVFactories.h>
00039 #include <lal/DetectorSite.h>
00040 #include <lal/TimeDelay.h>
00041 #include <lal/DetResponse.h>
00042 #include <lal/Velocity.h>
00043 #include <lal/Units.h>
00044 #include <lal/VectorOps.h>
00045 #include <lal/SkyCoordinates.h>
00046 
00047 #include <lal/PrintFTSeries.h>
00048 #include <lal/StreamOutput.h>
00049 
00050 #include "util.h"
00051 
00052 /*
00053  * Per axis/coord. grid geometry
00054  *
00055  * Regular grid:   regular division of the coordinate; total
00056  *                 grid cells == num_ra or num_dec
00057  * Irregular grid: irregular division of the coordinate;
00058  *                 total grid points == num_ra or num_dec
00059  * Variable grid:  variable grid; number of grid points varies
00060  *                 as a function of the other coordinate;
00061  *                 we only support RA grid vary as cos(dec)
00062  * Mollweide: Mollweide projection 
00063  *            (see http://mathworld.wolfram.com/MollweideProjection.html
00064  *
00065  * NB: only the RA grid supports variable gridding
00066  */
00067 typedef enum 
00068 {
00069   DETRESP_REGGRID, 
00070   DETRESP_IRRGRID, 
00071   DETRESP_VARGRID,
00072   DETRESP_MOLLWEIDEGRID,
00073 } 
00074 gridding_geom_t;
00075 
00076 typedef enum
00077 {
00078   DETRESP_HUMANREAD,
00079   DETRESP_XYPAIRS_ASCII,
00080   DETRESP_XYPAIRS_BIN,
00081 }
00082 gridding_printmode_t;
00083 
00084 /*
00085  * Struct that will contain the coordinates of every 
00086  * grid cell center
00087  */
00088 typedef 
00089 struct tag_gridding_t
00090 {
00091   LIGOTimeGPS        gps;
00092   LALLeapSecAccuracy leapsec_accuracy;
00093   gridding_geom_t ra_geom;
00094   gridding_geom_t dec_geom;
00095   REAL8Vector *ra;
00096   REAL8Vector **ra_irr;  /* irregular grid, Dec dependent */
00097   REAL8Vector *dec;   
00098 }
00099 gridding_t;
00100 
00101 
00102 void init_gridding(gridding_t *p_gridding);
00103 
00104 void make_gridding(LALStatus *status, gridding_t *p_gridding, 
00105                    UINT4 num_ra, gridding_geom_t ra_geom, 
00106                    UINT4 num_dec, gridding_geom_t dec_geom,
00107                    EphemerisData *p_ephem, LIGOTimeGPS *p_gps,
00108                    LALLeapSecAccuracy accuracy);
00109 
00110 void cleanup_gridding(LALStatus *status, gridding_t *p_gridding);
00111 
00112 void zero_gridding(LALStatus *status, gridding_t *p_gridding);
00113 
00114 void print_gridding(gridding_t *p_gridding, char *filename,
00115                     gridding_printmode_t mode);
00116 
00117 void print_ra_grid(gridding_t *p_gridding, char *filename);
00118 
00119 void print_dec_grid(gridding_t *p_gridding, char *filename);
00120 
00121 #endif

Generated on Mon Oct 6 02:31:51 2008 for LAL by  doxygen 1.5.2