Menu

Is there NAN, or BAD_VALUE in libsharp/libpsht

Gouedard
2013-10-08
2013-10-10
  • Gouedard

    Gouedard - 2013-10-08

    Hi sharp users,
    I would like to know if there is NAN or BAD_VALUE defined for ignored pixels in libsharp/libpsht like in HEALPIX (BAD_DATA= -1.637500000000E+30 / Sentinel value given to bad pixels).
    If YES, is it possible to change this value without consequenses.
    If No, is it easy to set up one? ( a value in maps the code will ignore?)
    ( I am using VTK which has a different NAN).

    Best regards

    Claude Gouedard

     
    • Martin Reinecke

      Martin Reinecke - 2013-10-08

      Hi Claude!

      I would like to know if there is NAN or BAD_VALUE defined for ignored pixels
      in libsharp/libpsht like in HEALPIX (BAD_DATA= -1.637500000000E+30 / Sentinel
      value given to bad pixels). If YES, is it possible to change this value
      without consequenses. If No, is it easy to set up one? ( a value in maps the
      code will ignore?) ( I am using VTK which has a different NAN).

      There is no support for special NaN-indicating pixel values in the libraries,
      because they do not have a useful meaning in an SHT context. If you have a map
      that has some pixels with unknown/undefined value, this corresponds to
      harmonic coefficients which are all unknown/undefined. Of course the user
      can decide that undefined pixels should be treated as having the value 0; but
      this decision has to be made deliberately, and on a case-to-case basis.
      The best way of doing this is to change the map values accordingly before
      calling the SHT.
      In principle I expect that this is in close analogy to FFT algorithms; there
      is no FFT out there which will give meaningful results if there are NaNs in
      the input.

      Cheers,
      Martin

       
  • Gouedard

    Gouedard - 2013-10-08

    Martin,
    Thanks for quick answer.
    Of course there is no meaning for Nan in a chart, unless 0.
    It was just for using the trick, in case ...
    Yes, I have to deliberatly put zeros, padding with zeros has a sens in FFT.
    Many thanks.

    Claude G.

     
    • Martin Reinecke

      Martin Reinecke - 2013-10-08

      Hi Claude!

      Of course there is no meaning for Nan in a chart, unless 0.

      The missing data need not necessarily be 0, and that is exactly the
      problem. Imagine you have a map of the CMB emission, with a few pixels
      that are unobserved. The values of the observed pixels will be around
      2.725K. If you want to do a meaningful spherical harmonic analysis of
      such a map, your best bet is to fill the missing pixels with 2.725, and
      not with 0. This is why the process cannot be automated by the library.

      Cheers,
      Martin

       
  • Gouedard

    Gouedard - 2013-10-10

    You are right, of course.
    We can also imagin some inpainting to replace missing zones with data all arround.
    I agree.
    Claude G.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.