11 #ifndef __Pulsar_setup_profiles_h
12 #define __Pulsar_setup_profiles_h
15 template<
typename I,
typename P>
16 void setup_profiles_dat (I subint, P& profiles)
18 const unsigned npol = subint->get_npol ();
19 const unsigned nchan = subint->get_nchan ();
21 profiles.resize (npol * nchan);
23 for (
unsigned ipol=0; ipol<npol; ipol++)
24 for (
unsigned ichan=0; ichan<nchan; ichan++)
25 profiles[ipol*nchan + ichan] = subint->get_Profile (ipol, ichan);
29 template<
class E,
typename I,
typename P>
30 void setup_profiles (I subint, P& profiles)
32 E* ext = subint->get_Profile(0,0)->template get<E>();
34 throw Error (InvalidState,
"setup_profiles<Extension>",
35 "first profile is missing required Extension");
37 const unsigned naux = ext->get_size();
38 const unsigned nchan = subint->get_nchan ();
40 profiles.resize (naux * nchan);
42 for (
unsigned ichan=0; ichan<nchan; ichan++)
44 ext = subint->get_Profile(0,ichan)->template get<E>();
46 throw Error (InvalidState,
"setup_profiles<Extension>",
47 "profile[%u] is missing required Extension", ichan);
49 for (
unsigned iaux=0; iaux<naux; iaux++)
50 profiles[iaux*nchan + ichan] = ext->get_Profile (iaux);