00001 /* 00002 * This file is part of libsharp. 00003 * 00004 * libsharp 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 * libsharp 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 libsharp; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00017 */ 00018 00019 /* 00020 * libsharp is being developed at the Max-Planck-Institut fuer Astrophysik 00021 * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt 00022 * (DLR). 00023 */ 00024 00025 /*! \file sharp_geomhelpers.h 00026 * SHARP helper function for the creation of grid geometries 00027 * 00028 * Copyright (C) 2006-2013 Max-Planck-Society 00029 * \author Martin Reinecke 00030 */ 00031 00032 #ifndef PLANCK_SHARP_GEOMHELPERS_H 00033 #define PLANCK_SHARP_GEOMHELPERS_H 00034 00035 #include "sharp_lowlevel.h" 00036 00037 #ifdef __cplusplus 00038 extern "C" { 00039 #endif 00040 00041 /*! Creates a geometry information describing a HEALPix map with an 00042 Nside parameter \a nside. \a weight contains the relative ring 00043 weights and must have \a 2*nside entries. 00044 \note if \a weight is a null pointer, all weights are assumed to be 1. 00045 \ingroup geominfogroup */ 00046 void sharp_make_weighted_healpix_geom_info (int nside, int stride, 00047 const double *weight, sharp_geom_info **geom_info); 00048 00049 /*! Creates a geometry information describing a HEALPix map with an 00050 Nside parameter \a nside. 00051 \ingroup geominfogroup */ 00052 static inline void sharp_make_healpix_geom_info (int nside, int stride, 00053 sharp_geom_info **geom_info) 00054 { sharp_make_weighted_healpix_geom_info (nside, stride, NULL, geom_info); } 00055 00056 /*! Creates a geometry information describing a Gaussian map with \a nrings 00057 iso-latitude rings and \a nphi pixels per ring. The azimuth of the first 00058 pixel in each ring is \a phi0 (in radians). The index difference between 00059 two adjacent pixels in an iso-latitude ring is \a stride_lon, the index 00060 difference between the two start pixels in consecutive iso-latitude rings 00061 is \a stride_lat. 00062 \ingroup geominfogroup */ 00063 void sharp_make_gauss_geom_info (int nrings, int nphi, double phi0, 00064 int stride_lon, int stride_lat, sharp_geom_info **geom_info); 00065 00066 /*! Creates a geometry information describing an ECP map with \a nrings 00067 iso-latitude rings and \a nphi pixels per ring. The azimuth of the first 00068 pixel in each ring is \a phi0 (in radians). The index difference between 00069 two adjacent pixels in an iso-latitude ring is \a stride_lon, the index 00070 difference between the two start pixels in consecutive iso-latitude rings 00071 is \a stride_lat. 00072 \note The spacing of pixel centers is equidistant in colatitude and 00073 longitude. 00074 \note The sphere is pixelized in a way that the colatitude of the first ring 00075 is \a 0.5*(pi/nrings) and the colatitude of the last ring is 00076 \a pi-0.5*(pi/nrings). There are no pixel centers at the poles. 00077 \note This grid corresponds to Fejer's first rule. 00078 \ingroup geominfogroup */ 00079 void sharp_make_fejer1_geom_info (int nrings, int nphi, double phi0, 00080 int stride_lon, int stride_lat, sharp_geom_info **geom_info); 00081 00082 /*! Old name for sharp_make_fejer1_geom_info() 00083 \ingroup geominfogroup */ 00084 static inline void sharp_make_ecp_geom_info (int nrings, int nphi, double phi0, 00085 int stride_lon, int stride_lat, sharp_geom_info **geom_info) 00086 { 00087 sharp_make_fejer1_geom_info (nrings, nphi, phi0, stride_lon, stride_lat, 00088 geom_info); 00089 } 00090 00091 /*! Creates a geometry information describing an ECP map with \a nrings 00092 iso-latitude rings and \a nphi pixels per ring. The azimuth of the first 00093 pixel in each ring is \a phi0 (in radians). The index difference between 00094 two adjacent pixels in an iso-latitude ring is \a stride_lon, the index 00095 difference between the two start pixels in consecutive iso-latitude rings 00096 is \a stride_lat. 00097 \note The spacing of pixel centers is equidistant in colatitude and 00098 longitude. 00099 \note The sphere is pixelized in a way that the colatitude of the first ring 00100 is \a 0 and that of the last ring is \a pi. 00101 \note This grid corresponds to Clenshaw-Curtis integration. 00102 \ingroup geominfogroup */ 00103 void sharp_make_cc_geom_info (int nrings, int ppring, double phi0, 00104 int stride_lon, int stride_lat, sharp_geom_info **geom_info); 00105 00106 /*! Creates a geometry information describing an ECP map with \a nrings 00107 iso-latitude rings and \a nphi pixels per ring. The azimuth of the first 00108 pixel in each ring is \a phi0 (in radians). The index difference between 00109 two adjacent pixels in an iso-latitude ring is \a stride_lon, the index 00110 difference between the two start pixels in consecutive iso-latitude rings 00111 is \a stride_lat. 00112 \note The spacing of pixel centers is equidistant in colatitude and 00113 longitude. 00114 \note The sphere is pixelized in a way that the colatitude of the first ring 00115 is \a pi/(nrings+1) and that of the last ring is \a pi-pi/(nrings+1). 00116 \note This grid corresponds to Fejer's second rule. 00117 \ingroup geominfogroup */ 00118 void sharp_make_fejer2_geom_info (int nrings, int ppring, double phi0, 00119 int stride_lon, int stride_lat, sharp_geom_info **geom_info); 00120 00121 /*! Creates a geometry information describing a map with \a nrings 00122 iso-latitude rings and \a nphi pixels per ring. The azimuth of the first 00123 pixel in each ring is \a phi0 (in radians). The index difference between 00124 two adjacent pixels in an iso-latitude ring is \a stride_lon, the index 00125 difference between the two start pixels in consecutive iso-latitude rings 00126 is \a stride_lat. 00127 \note The spacing of pixel centers is equidistant in colatitude and 00128 longitude. 00129 \note The sphere is pixelized in a way that the colatitude of the first ring 00130 is \a pi/(2*nrings-1) and that of the last ring is \a pi. 00131 \note This is the grid introduced by McEwen & Wiaux 2011. 00132 \note This function does \e not define any quadrature weights. 00133 \ingroup geominfogroup */ 00134 void sharp_make_mw_geom_info (int nrings, int ppring, double phi0, 00135 int stride_lon, int stride_lat, sharp_geom_info **geom_info); 00136 00137 #ifdef __cplusplus 00138 } 00139 #endif 00140 00141 #endif