Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map noise type not handled uniformly throughout codebase #152

Open
dncnwtts opened this issue Nov 16, 2022 · 0 comments
Open

Map noise type not handled uniformly throughout codebase #152

dncnwtts opened this issue Nov 16, 2022 · 0 comments

Comments

@dncnwtts
Copy link
Collaborator

There are some places where certain operations are applied if the noise type is rms and then does another operation otherwise, or just doesn't do it at all.

Two examples I found so far are in the subroutine compute_chisq (line 76):

          if (trim(data(i)%N%type) == "rms" .and. data(i)%N%nside_chisq_lowres < res%info%nside .and. present(chisq_fullsky) .and. present(lowres_eval)) then
             if (lowres_eval) then
                lowres = .true.
                info_lowres  => comm_mapinfo(data(i)%info%comm, data(i)%N%nside_chisq_lowres, 0, data(i)%info%nmaps, data(i)%info%nmaps==3)

                res_lowres => comm_map(info_lowres)
                res_lowres_temp => comm_map(info_lowres)

                call res%udgrade(res_lowres)
                res_lowres_temp%map = res_lowres%map ! Save temporarily

                call data(i)%N%invN_lowres(res_lowres) ! invN*res
                res_lowres%map = res_lowres_temp%map*res_lowres%map ! res*(invN*res)

                call res_lowres_temp%dealloc(); deallocate(res_lowres_temp)
             end if
          else
             lowres=.false.
             call data(i)%N%sqrtInvN(res)
             res%map = res%map**2 !(sqrtInvN*res)**2 = res*invN*res
          end if

It's not clear to me if things like lcut and the in-development rms_qucov should be skipped, or if the else construct is meant to only catch the pixel-pixel qucov noise format.

Another example is in comm_signal_mod.f90, line 447. I've recently added a default class that gives a warning, like this:

          select type (N)
          class is (comm_N_rms)
             if (trim(data(i)%tod%init_from_HDF) == 'default' .or. present(init_from_output)) then
                call data(i)%tod%initHDF(file, initsamp, data(i)%map, rms)
             else
                call get_chainfile_and_samp(data(i)%tod%init_from_HDF, &
                     & chainfile, initsamp2)
                call open_hdf_file(chainfile, file2, 'r')
                call data(i)%tod%initHDF(file2, initsamp2, data(i)%map, rms)
                call close_hdf_file(file2)
             end if
          class default
             write(*,*) 'Noise type is not covered'
          end select

just so that people know that the tod parameters aren't being read in.

In any case, this has had the effect of things that shouldn't have had anything to do with the noise format being affected when the noise format is changed. There's probably some other subtle things elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant