45 #include "healpix_data_io.h" 47 #include "healpix_map.h" 48 #include "healpix_map_fitsio.h" 49 #include "alm_healpix_tools.h" 50 #include "alm_powspec_tools.h" 51 #include "fitshandle.h" 53 #include "lsconstants.h" 60 #define EPOCH_J2000_0_GPS 630763213 78 skymap(
double,
double=0.,
double=180.,
double=0.,
double=360.);
117 double get(
size_t i);
122 inline void set(
size_t i,
double a) {
123 if(
int(i) !=
mIndex) this->
get(i);
130 inline void add(
size_t i ,
double a) {
131 if(
int(i) !=
mIndex) this->
get(
i);
139 for(
size_t i=0; i<
n; i++) m +=
value[i].
size();
145 if(!k)
return value.size();
158 inline double get(
double th,
double ph) {
167 pointing P =
healpix->pix2ang(i);
173 if(
int(i) !=
mIndex) this->
get(
i);
183 if(
int(i) !=
mIndex) this->
get(
i);
197 static inline double phiRA(
double ph,
double gps,
bool inverse=
false) {
198 double sidereal_time;
201 sidereal_time = (-6.2e-6 * t + 0.093104) * t * t + 67310.54841;
202 sidereal_time += 8640184.812866*t + 3155760000.*
t;
204 double gmst = 360.*sidereal_time/86400.;
205 if(inverse) gmst=-gmst;
207 double ra = fmod( ph + gmst, 360. );
208 return ra<0. ? ra+360 :
ra;
216 if(this->
gps<=0.)
return 0.;
227 pointing P =
healpix->pix2ang(i);
233 size_t n = this->
value.size()-1;
234 if(
int(i) !=
mIndex) this->
get(
i);
243 size_t n = this->
value.size()-1;
244 if(
int(i) !=
mIndex) this->
get(
i);
268 double norm(
double=0.);
288 void Dump2fits(
const char* file,
double gps_obs=0,
const char configur[]=
"",
289 const char TTYPE1[]=
"",
const char TUNIT1[]=
"",
char coordsys=
'x');
301 void median(
double radius);
302 void smoothing(
double fwhm,
int nlmax=256,
int num_iter=0);
303 void rotate(
double psi,
double theta,
double phi,
int nlmax=256,
int num_iter=0);
305 wat::Alm getAlm(
int nlmax,
int num_iter=0);
306 void resample(
int order);
308 int getRingPixels(
int ring);
309 int getStartRingPixel(
int ring);
310 int getEulerCharacteristic(
double threshold);
351 template<
typename Iterator>
typename iterator_traits<Iterator>::value_type
352 median(Iterator first, Iterator last)
354 Iterator mid = first+(last-first-1)/2;
355 nth_element(first,mid,last);
356 if ((last-first)&1)
return *mid;
357 return typename iterator_traits<Iterator>::value_type
358 (0.5*((*mid)+(*min_element(mid+1,last))));
wavearray< double > t(hp.size())
#define EPOCH_J2000_0_GPS
wavearray< double > a(hp.size())
skymap & operator-=(const skymap &)
double median(std::vector< double > &vec)
skymap & operator*=(const skymap &)
double getTheta(size_t i)
double getThetaStep(size_t i)
double getPhiStep(size_t i)
void downsample(wavearray< short > &, size_t=4)
size_t getSkyIndex(double th, double ph)
param: theta param: phi
std::vector< vectorD > value
skymap & operator+=(const skymap &)
Class for storing spherical harmonic coefficients.
char * operator>>(char *fname)
double RA2phi(double ph, double gps)
std::vector< double > vectorD
void DumpBinary(char *, int)
double phi2RA(double ph, double gps)
skymap & operator=(const skymap &)
void add(size_t i, double a)
param: sky index param: value to add
skymap & operator/=(const skymap &)
static double phiRA(double ph, double gps, bool inverse=false)