rogerblandford / Music

Speculative project to map the entire universe over time with low spatial resolution using CMB, 21 cm and local surveys
MIT License
0 stars 5 forks source link

Potential f_n to Temperature a_lm "R Test" #8

Closed drphilmarshall closed 8 years ago

drphilmarshall commented 9 years ago

@rogerblandford: Here's what we agreed to do:

drphilmarshall commented 9 years ago

PS. Notebook with my ongoing attempts to make a_lm's out of Fourier f_n's is here. 3D visualiization is on hold for now.

rogerblandford commented 9 years ago

Sorry for not doing homework. Was sub-par last night but now fine. Have Mollweide working. Now generating new models and simulations. Roger On Aug 24, 2015, at 9:30 PM, Phil Marshall notifications@github.com<mailto:notifications@github.com> wrote:

PS. Notebook with my ongoing attempts to make a_lm's out of Fourier f_n's is herehttps://github.com/drphilmarshall/Music/blob/master/Potential_Demo.ipynb. 3D visualiization is on hold for now.

— Reply to this email directly or view it on GitHubhttps://github.com/rogerblandford/Music/issues/8#issuecomment-134470709.

drphilmarshall commented 9 years ago

Excellent! That'll help us compare T maps no end. I put a small ad out for yt help and will get back to coding up the R matrix after tea.

On Tue, Aug 25, 2015 at 9:14 AM, Roger Blandford notifications@github.com wrote:

Sorry for not doing homework. Was sub-par last night but now fine. Have Mollweide working. Now generating new models and simulations. Roger On Aug 24, 2015, at 9:30 PM, Phil Marshall <notifications@github.com mailto:notifications@github.com> wrote:

PS. Notebook with my ongoing attempts to make a_lm's out of Fourier f_n's is here< https://github.com/drphilmarshall/Music/blob/master/Potential_Demo.ipynb>. 3D visualiization is on hold for now.

— Reply to this email directly or view it on GitHub< https://github.com/rogerblandford/Music/issues/8#issuecomment-134470709>.

— Reply to this email directly or view it on GitHub https://github.com/rogerblandford/Music/issues/8#issuecomment-134656132.

drphilmarshall commented 8 years ago

Hey @LaurencePeanuts I updated the Potential_Demo notebook to display your potential field, drawn from a plausible inflation model prior :-) The visualization is still a bit yellow but hopefully the yt crew can help us improve that.

The next step is to complete this notebook by making a mock CMB T map from this potential, which means working on the transform_3D_potential_fourier_series_into_T_spherical_harmonics method. We'll need to follow @rogerblandford's book-keeping conventions, and then populate the R matrix in the same way he does. Roger, if you have settled on an indexing scheme, can you paste the relevant mathematica snippets in a reply for us, please? We need to know a) how you organize the components of the complex a_lm's and b) how you populate the R matrix. Thanks!

drphilmarshall commented 8 years ago

Hi @rogerblandford - now that you have made a first 3D potential map from the Planck T data (pasted below and used in Fig 3 of our NSF Proposal :-) ), can you please send @LaurencePeanuts and me (or git push) a single-column plain text file containing the $fn$ coefficient vector of the 3D potential map? We can then try and code up the R matrix in python, and use it to make the corresponding temperature %a{lm}$ coefficients, which we can then package up in healpy format to make a Mollweide projection to compare with yours. Thanks!

image

rogerblandford commented 8 years ago

Hope I did not screw up! {-2.55866, -6.49783, 0.188568, -2.00205, 0.925219, 3.62971, 0.537895, \ -0.986828, 1.7225, -3.3974, -0.536927, 0.316676, 3.32154, -1.99776, \ -0.338588, 0.457334, -1.19317, -1.26149, 2.40275, 1.8544, 2.18233, \ -1.93067, 1.56869, -0.344354, 2.08878, -0.457189, -0.35542, \ -0.838631, 0.3746, 0.4982, -0.159589, 1.96465, -1.80473, -0.280496, \ 0.142527, 0.0174309, -2.59685, 4.90796, -0.591828, -0.183679, \ 0.467487, -3.00585, 0.136161, -2.37692, 0.627632, 0.513176, 3.24917, \ 1.46546, -4.28281, -1.75464, 0.237701, -1.39762, 0.820925, 3.92672, \ 0.210973, -0.0913328, -0.68342, -1.93775, 1.70846, -0.188018, \ -0.250727, -0.129875, -0.345576, -1.75872, 6.61303, 0.341211, \ -0.170187, -0.799375, -5.88089, -5.80735, -5.10238, -0.68299, \ 0.808122, -0.803421, -0.402086, -5.56499, 2.35546, -0.0155268, \ -0.682604, -5.91078, 1.57087, 0.516064, -0.174801, 0.0694442, \ -2.53754, -3.23231, 0.112496, 0.02224, 0.966374, 8.85527, -1.91622, \ 0.675115, 0.339426, 0.971692, 3.59097, -0.0548719, 5.38719, 1.35093, \ -1.04295, -3.32028, 4.28518, -1.62995, 2.46706, 1.27733, -2.43357, \ -2.72446, 1.45681, 5.32446, 4.06235, 1.6648, -0.148942, -3.64012, \ -4.49613, -0.300155, -3.15109, -0.96929, 2.43679, -1.46607, 4.48551, \ -4.91778, 3.69505, 7.29441} You will need the ks {{-4.71239, 0., 0.}, {-3.14159, -3.14159, -1.5708}, {-3.14159, -3.14159, 0.}, {-3.14159, -3.14159, 1.5708}, {-3.14159, -1.5708, -3.14159}, {-3.14159, -1.5708, \ -1.5708}, {-3.14159, -1.5708, 0.}, {-3.14159, -1.5708, 1.5708}, {-3.14159, -1.5708, 3.14159}, {-3.14159, 0., -3.14159}, {-3.14159, 0., -1.5708}, {-3.14159, 0., 0.}, {-3.14159, 0., 1.5708}, {-3.14159, 0., 3.14159}, {-3.14159, 1.5708, -3.14159}, {-3.14159, 1.5708, -1.5708}, {-3.14159, 1.5708, 0.}, {-3.14159, 1.5708, 1.5708}, {-3.14159, 1.5708, 3.14159}, {-3.14159, 3.14159, -1.5708}, {-3.14159, 3.14159, 0.}, {-3.14159, 3.14159, 1.5708}, {-1.5708, -3.14159, -3.14159}, {-1.5708, -3.14159, \ -1.5708}, {-1.5708, -3.14159, 0.}, {-1.5708, -3.14159, 1.5708}, {-1.5708, -3.14159, 3.14159}, {-1.5708, -1.5708, -3.14159}, {-1.5708, -1.5708, \ -1.5708}, {-1.5708, -1.5708, 0.}, {-1.5708, -1.5708, 1.5708}, {-1.5708, -1.5708, 3.14159}, {-1.5708, 0., -3.14159}, {-1.5708, 0., -1.5708}, {-1.5708, 0., 0.}, {-1.5708, 0., 1.5708}, {-1.5708, 0., 3.14159}, {-1.5708, 1.5708, -3.14159}, {-1.5708, 1.5708, -1.5708}, {-1.5708, 1.5708, 0.}, {-1.5708, 1.5708, 1.5708}, {-1.5708, 1.5708, 3.14159}, {-1.5708, 3.14159, -3.14159}, {-1.5708, 3.14159, -1.5708}, {-1.5708, 3.14159, 0.}, {-1.5708, 3.14159, 1.5708}, {-1.5708, 3.14159, 3.14159}, {0., -4.71239, 0.}, {0., -3.14159, -3.14159}, {0., -3.14159, -1.5708}, {0., \ -3.14159, 0.}, {0., -3.14159, 1.5708}, {0., -3.14159, 3.14159}, {0., -1.5708, -3.14159}, {0., -1.5708, -1.5708}, {0., \ -1.5708, 0.}, {0., -1.5708, 1.5708}, {0., -1.5708, 3.14159}, {0., 0., -4.71239}, {0., 0., -3.14159}, {0., 0., -1.5708}, {0., 0., 1.5708}, {0., 0., 3.14159}, {0., 0., 4.71239}, {0., 1.5708, -3.14159}, {0., 1.5708, -1.5708}, {0., 1.5708, 0.}, {0., 1.5708, 1.5708}, {0., 1.5708, 3.14159}, {0., 3.14159, -3.14159}, {0., 3.14159, -1.5708}, {0., 3.14159, 0.}, {0., 3.14159, 1.5708}, {0., 3.14159, 3.14159}, {0., 4.71239, 0.}, {1.5708, -3.14159, -3.14159}, {1.5708, -3.14159, -1.5708}, \ {1.5708, -3.14159, 0.}, {1.5708, -3.14159, 1.5708}, {1.5708, -3.14159, 3.14159}, {1.5708, -1.5708, -3.14159}, {1.5708, -1.5708, -1.5708}, \ {1.5708, -1.5708, 0.}, {1.5708, -1.5708, 1.5708}, {1.5708, -1.5708, 3.14159}, {1.5708, 0., -3.14159}, {1.5708, 0., -1.5708}, {1.5708, 0., 0.}, {1.5708, 0., 1.5708}, {1.5708, 0., 3.14159}, {1.5708, 1.5708, -3.14159}, {1.5708, 1.5708, -1.5708}, {1.5708, 1.5708, 0.}, {1.5708, 1.5708, 1.5708}, {1.5708, 1.5708, 3.14159}, {1.5708, 3.14159, -3.14159}, {1.5708, 3.14159, -1.5708}, {1.5708, 3.14159, 0.}, {1.5708, 3.14159, 1.5708}, {1.5708, 3.14159, 3.14159}, {3.14159, -3.14159, -1.5708}, {3.14159, -3.14159, 0.}, {3.14159, -3.14159, 1.5708}, {3.14159, -1.5708, -3.14159}, {3.14159, -1.5708, -1.5708}, \ {3.14159, -1.5708, 0.}, {3.14159, -1.5708, 1.5708}, {3.14159, -1.5708, 3.14159}, {3.14159, 0., -3.14159}, {3.14159, 0., -1.5708}, {3.14159, 0., 0.}, {3.14159, 0., 1.5708}, {3.14159, 0., 3.14159}, {3.14159, 1.5708, -3.14159}, {3.14159, 1.5708, -1.5708}, {3.14159, 1.5708, 0.}, {3.14159, 1.5708, 1.5708}, {3.14159, 1.5708, 3.14159}, {3.14159, 3.14159, -1.5708}, {3.14159, 3.14159, 0.}, {3.14159, 3.14159, 1.5708}, {4.71239, 0., 0.}, {-4.71239, 0., 0.}, {-3.14159, -3.14159, -1.5708}, {-3.14159, -3.14159, 0.}, {-3.14159, -3.14159, 1.5708}, {-3.14159, -1.5708, -3.14159}, {-3.14159, -1.5708, \ -1.5708}, {-3.14159, -1.5708, 0.}, {-3.14159, -1.5708, 1.5708}, {-3.14159, -1.5708, 3.14159}, {-3.14159, 0., -3.14159}, {-3.14159, 0., -1.5708}, {-3.14159, 0., 0.}, {-3.14159, 0., 1.5708}, {-3.14159, 0., 3.14159}, {-3.14159, 1.5708, -3.14159}, {-3.14159, 1.5708, -1.5708}, {-3.14159, 1.5708, 0.}, {-3.14159, 1.5708, 1.5708}, {-3.14159, 1.5708, 3.14159}, {-3.14159, 3.14159, -1.5708}, {-3.14159, 3.14159, 0.}, {-3.14159, 3.14159, 1.5708}, {-1.5708, -3.14159, -3.14159}, {-1.5708, -3.14159, \ -1.5708}, {-1.5708, -3.14159, 0.}, {-1.5708, -3.14159, 1.5708}, {-1.5708, -3.14159, 3.14159}, {-1.5708, -1.5708, -3.14159}, {-1.5708, -1.5708, \ -1.5708}, {-1.5708, -1.5708, 0.}, {-1.5708, -1.5708, 1.5708}, {-1.5708, -1.5708, 3.14159}, {-1.5708, 0., -3.14159}, {-1.5708, 0., -1.5708}, {-1.5708, 0., 0.}, {-1.5708, 0., 1.5708}, {-1.5708, 0., 3.14159}, {-1.5708, 1.5708, -3.14159}, {-1.5708, 1.5708, -1.5708}, {-1.5708, 1.5708, 0.}, {-1.5708, 1.5708, 1.5708}, {-1.5708, 1.5708, 3.14159}, {-1.5708, 3.14159, -3.14159}, {-1.5708, 3.14159, -1.5708}, {-1.5708, 3.14159, 0.}, {-1.5708, 3.14159, 1.5708}, {-1.5708, 3.14159, 3.14159}, {0., -4.71239, 0.}, {0., -3.14159, -3.14159}, {0., -3.14159, -1.5708}, {0., \ -3.14159, 0.}, {0., -3.14159, 1.5708}, {0., -3.14159, 3.14159}, {0., -1.5708, -3.14159}, {0., -1.5708, -1.5708}, {0., \ -1.5708, 0.}, {0., -1.5708, 1.5708}, {0., -1.5708, 3.14159}, {0., 0., -4.71239}, {0., 0., -3.14159}, {0., 0., -1.5708}, {0., 0., 1.5708}, {0., 0., 3.14159}, {0., 0., 4.71239}, {0., 1.5708, -3.14159}, {0., 1.5708, -1.5708}, {0., 1.5708, 0.}, {0., 1.5708, 1.5708}, {0., 1.5708, 3.14159}, {0., 3.14159, -3.14159}, {0., 3.14159, -1.5708}, {0., 3.14159, 0.}, {0., 3.14159, 1.5708}, {0., 3.14159, 3.14159}, {0., 4.71239, 0.}, {1.5708, -3.14159, -3.14159}, {1.5708, -3.14159, -1.5708}, \ {1.5708, -3.14159, 0.}, {1.5708, -3.14159, 1.5708}, {1.5708, -3.14159, 3.14159}, {1.5708, -1.5708, -3.14159}, {1.5708, -1.5708, -1.5708}, \ {1.5708, -1.5708, 0.}, {1.5708, -1.5708, 1.5708}, {1.5708, -1.5708, 3.14159}, {1.5708, 0., -3.14159}, {1.5708, 0., -1.5708}, {1.5708, 0., 0.}, {1.5708, 0., 1.5708}, {1.5708, 0., 3.14159}, {1.5708, 1.5708, -3.14159}, {1.5708, 1.5708, -1.5708}, {1.5708, 1.5708, 0.}, {1.5708, 1.5708, 1.5708}, {1.5708, 1.5708, 3.14159}, {1.5708, 3.14159, -3.14159}, {1.5708, 3.14159, -1.5708}, {1.5708, 3.14159, 0.}, {1.5708, 3.14159, 1.5708}, {1.5708, 3.14159, 3.14159}, {3.14159, -3.14159, -1.5708}, {3.14159, -3.14159, 0.}, {3.14159, -3.14159, 1.5708}, {3.14159, -1.5708, -3.14159}, {3.14159, -1.5708, -1.5708}, \ {3.14159, -1.5708, 0.}, {3.14159, -1.5708, 1.5708}, {3.14159, -1.5708, 3.14159}, {3.14159, 0., -3.14159}, {3.14159, 0., -1.5708}, {3.14159, 0., 0.}, {3.14159, 0., 1.5708}, {3.14159, 0., 3.14159}, {3.14159, 1.5708, -3.14159}, {3.14159, 1.5708, -1.5708}, {3.14159, 1.5708, 0.}, {3.14159, 1.5708, 1.5708}, {3.14159, 1.5708, 3.14159}, {3.14159, 3.14159, -1.5708}, {3.14159, 3.14159, 0.}, {3.14159, 3.14159, 1.5708}, {4.71239, 0., 0.}}

On Nov 12, 2015, at 9:04 AM, Phil Marshall notifications@github.com<mailto:notifications@github.com> wrote:

Hi @rogerblandfordhttps://github.com/rogerblandford - now that you have made a first 3D potential map from the Planck T data (pasted below and used in Fig 3 of our NSF Proposalhttps://github.com/rogerblandford/Music/blob/master/doc/proposals/2015NSF/prodes.pdf :-) ), can you please send @LaurencePeanutshttps://github.com/LaurencePeanuts and me (or git push) a single-column plain text file containing the $fn$ coefficient vector of the 3D potential map? We can then try and code up the R matrix in python, and use it to make the corresponding temperature %a{lm}$ coefficients, which we can then package up in healpy format to make a Mollweide projection to compare with yours. Thanks!

[image]https://cloud.githubusercontent.com/assets/710903/11124956/497fd8a4-891c-11e5-9044-65d352aea861.png

— Reply to this email directly or view it on GitHubhttps://github.com/rogerblandford/Music/issues/8#issuecomment-156167391.

LaurencePeanuts commented 8 years ago

Hi @rogerblandford and @drphilmarshall ,

I've coded this up, but I don't quite understand the format of the data. There seems to be 122 f_ns coefficients but 244 coordinate tuples in k space. For real f_ns I was expecting twice as many f_n coefficient as coordinate tuples, not the opposite... I've realized that the k coordinates repeat twice, and that the unique k coordinates map the whole sphere, so to get only a hemisphere one must use half of them. To recover graph 3 from the proposal I think I need to know half was used. The first half of the coordinates here do give a hemisphere, but if it's not the same as the one used to make graph 3 my reconstruction won't match. Also, I'm not sure it'll be trivial to find matching Mollweide projections... it really depends how the healpy package decides to cut the sphere open. For example, the maps I'm attaching are both projections of the same data Roger sent, but with x,y,z labels mixed (meaning that the projection gets done along different axis)

recovered_phi unknown-2

Best, Laurence

rogerblandford commented 8 years ago

Clearly this will be easier to go through in person. Roger

On Dec 14, 2015, at 5:13 PM, Laurence Perreault Levasseur notifications@github.com<mailto:notifications@github.com> wrote:

Hi @rogerblandfordhttps://github.com/rogerblandford and @drphilmarshallhttps://github.com/drphilmarshall ,

I've coded this up, but I don't quite understand the format of the data. There seems to be 122 f_ns coefficients but 244 coordinate tuples in k space. For real f_ns I was expecting twice as many f_n coefficient as coordinate tuples, not the opposite... I've realized that the k coordinates repeat twice, and that the unique k coordinates map the whole sphere, so to get only a hemisphere one must use half of them. To recover graph 3 from the proposal I think I need to know half was used. The first half of the coordinates here do give a hemisphere, but if it's not the same as the one used to make graph 3 my reconstruction won't match. Also, I'm not sure it'll be trivial to find matching Mollweide projections... it really depends how the healpy package decides to cut the sphere open. For example, the maps I'm attaching are both projections of the same data Roger sent, but with x,y,z labels mixed (meaning that the projection gets done along different axis)

[recovered_phi]https://cloud.githubusercontent.com/assets/13594101/11799002/f2b256dc-a284-11e5-967c-353b3eb5b174.jpeg [unknown-2]https://cloud.githubusercontent.com/assets/13594101/11799007/00337e6c-a285-11e5-86ec-50fa172c69e0.jpeg

Best, Laurence

— Reply to this email directly or view it on GitHubhttps://github.com/rogerblandford/Music/issues/8#issuecomment-164610445.

LaurencePeanuts commented 8 years ago

Hi @rogerblandford and @drphilmarshall ,

Good news! This is finally done! In the end I realized the Mollweide projection from the healpy package has a -90 degrees shift in longitude compared to the Mathematica projection, but once this is corrected for, the plots agree perfectly with figure 3 from the proposal.

Best, Laurence

recoveredfig3b phi_slice_z_density_w_x 1_circle

rogerblandford commented 8 years ago

Great. Not sure about the rhs ordinate label. Best, Roger On Dec 17, 2015, at 9:55 PM, Laurence Perreault Levasseur notifications@github.com<mailto:notifications@github.com> wrote:

Hi @rogerblandfordhttps://github.com/rogerblandford and @drphilmarshallhttps://github.com/drphilmarshall ,

Good news! This is finally done! In the end I realized the Mollweide projection from the healpy package has a -90 degrees shift in longitude compared to the Mathematica projection, but once this is corrected for, the plots agree perfectly with figure 3 from the proposal.

Best, Laurence

[recoveredfig3b]https://cloud.githubusercontent.com/assets/13594101/11890371/8fd68156-a508-11e5-9833-5cd286dda28a.png [phi_slice_z_density_w_x 1_circle]https://cloud.githubusercontent.com/assets/13594101/11890394/c52f8e9c-a508-11e5-9d19-b2cefbfef81c.png

— Reply to this email directly or view it on GitHubhttps://github.com/rogerblandford/Music/issues/8#issuecomment-165680354.