lpsinger / ligo.skymap

Localization of gravitational-wave transients. Mirror of https://git.ligo.org/lscsoft/ligo.skymap
22 stars 18 forks source link

Issue with running the Script for ligo_skymap_contour_moc.py #19

Closed parkma99 closed 1 year ago

parkma99 commented 1 year ago

I used this script to process Multi-Order Sky Maps, and got error message ValueError: Too deep cell depth. Expected: <= 0; Actual: 4.

lpsinger commented 1 year ago

Would you please provide some more detail? What is the exact command you ran? What were the input files? Paste all of the output from the command.

parkma99 commented 1 year ago

command: $ ligo-skymap-contour-moc ./bayestar.multiorder.fits,1 -c 90 output:

Traceback (most recent call last):
  File "/home/mapenghui/.conda3/envs/gwops/bin/ligo-skymap-contour-moc", line 8, in <module>
    sys.exit(main())
  File "/home/mapenghui/.conda3/envs/gwops/lib/python3.8/site-packages/ligo/skymap/tool/ligo_skymap_contour_moc.py", line 72, in main
    moc = MOC.from_valued_healpix_cells(
  File "/home/mapenghui/.conda3/envs/gwops/lib/python3.8/site-packages/mocpy/moc/moc.py", line 751, in from_valued_healpix_cells
    index = mocpy.from_valued_hpx_cells(
ValueError: Too deep cell depth. Expected: <= 0; Actual: 4
parkma99 commented 1 year ago

https://github.com/lpsinger/ligo.skymap/blob/d8976157ad936bf38c71c8128bff112373e746e6/ligo/skymap/tool/ligo_skymap_contour_moc.py#L72 I guess in this line the function from_valued_healpix_cells needs max_depth parameter.

lpsinger commented 1 year ago

This appears to be a bug in mocpy 0.12.0. See cds-astro/mocpy#91.

In the meantime, please try installing mocpy 0.11.0.

parkma99 commented 1 year ago

Thanks,I try this

fxpineau commented 1 year ago

We are going to fix the bug, but I think it would be better (to spare an extra loop) to provide the max_depth parameter (provided in FITs files) to the MOCPy v0.12 MOC.from_valued_healpix_cells method.

parkma99 commented 1 year ago

I fixed this error in #20 !