26 #include "paramfile.h"
27 #include "healpix_data_io.h"
29 #include "healpix_map.h"
30 #include "healpix_map_fitsio.h"
31 #include "alm_healpix_tools.h"
32 #include "alm_powspec_tools.h"
33 #include "fitshandle.h"
34 #include "levels_facilities.h"
35 #include "lsconstants.h"
42 #define EPOCH_J2000_0_GPS 630763213
60 skymap(
double,
double=0.,
double=180.,
double=0.,
double=360.);
104 inline void set(
size_t i,
double a) {
105 if(
int(i) !=
mIndex) this->
get(
i);
112 inline void add(
size_t i ,
double a) {
113 if(
int(i) !=
mIndex) this->
get(
i);
127 if(!k)
return value.size();
140 inline double get(
double th,
double ph) {
155 if(
int(i) !=
mIndex) this->
get(
i);
165 if(
int(i) !=
mIndex) this->
get(
i);
179 static inline double phiRA(
double ph,
double gps,
bool inverse=
false) {
180 double sidereal_time;
183 sidereal_time = (-6.2e-6 * t + 0.093104) * t * t + 67310.54841;
184 sidereal_time += 8640184.812866*t + 3155760000.*
t;
186 double gmst = 360.*sidereal_time/86400.;
187 if(inverse) gmst=-gmst;
189 double ra = fmod( ph + gmst, 360. );
190 return ra<0. ? ra+360 :
ra;
198 if(this->
gps<=0.)
return 0.;
215 size_t n = this->
value.size()-1;
216 if(
int(i) !=
mIndex) this->
get(
i);
225 size_t n = this->
value.size()-1;
226 if(
int(i) !=
mIndex) this->
get(
i);
250 double norm(
double=0.);
270 void Dump2fits(
const char*
file,
double gps_obs=0,
const char configur[]=
"",
271 const char TTYPE1[]=
"",
const char TUNIT1[]=
"",
char coordsys=
'x');
284 void smoothing(
double fwhm,
int nlmax=256,
int num_iter=0);
285 void rotate(
double psi,
double theta,
double phi,
int nlmax=256,
int num_iter=0);
287 wat::Alm getAlm(
int nlmax,
int num_iter=0);
288 void resample(
int order);
290 int getRingPixels(
int ring);
291 int getStartRingPixel(
int ring);
292 int getEulerCharacteristic(
double threshold);
333 template<
typename Iterator>
typename iterator_traits<Iterator>::value_type
334 median(Iterator first, Iterator last)
336 Iterator mid = first+(last-first-1)/2;
337 nth_element(first,mid,last);
338 if ((last-first)&1)
return *mid;
339 return typename iterator_traits<Iterator>::value_type
340 (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 set(size_t i, double a)
param: sky index param: value to set
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)