Skip to content

Commit

Permalink
Optional dependency for older healpy fits files.
Browse files Browse the repository at this point in the history
  • Loading branch information
delucchi-cmu committed Nov 18, 2024
1 parent 9279af3 commit 9195886
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ full = [
"fsspec[full]", # complete file system specs.
"ipykernel", # Support for Jupyter notebooks
"ipywidgets", # useful for tqdm in notebooks.
"healpy", # used only in hipscat conversion
]

[build-system]
Expand Down
10 changes: 2 additions & 8 deletions src/hats_import/hipscat_conversion/run_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import tempfile
from typing import no_type_check

import hats.pixel_math.healpix_shim as hp
import healpy as hp
import numpy as np
import pyarrow.parquet as pq
from dask.distributed import as_completed, get_worker
Expand Down Expand Up @@ -170,10 +170,4 @@ def _write_nested_fits_map(input_dir, output_dir):
else:
map_fits_image = map_fits_image[0]

output_file = output_dir / "point_map.fits"
with tempfile.NamedTemporaryFile() as _tmp_file:
with output_file.open("wb") as _map_file:
hp.write_map(
_tmp_file.name, map_fits_image, overwrite=True, dtype=np.int32, nest=True, coord="CEL"
)
_map_file.write(_tmp_file.read())
file_io.write_fits_image(map_fits_image, output_dir / "point_map.fits")
3 changes: 1 addition & 2 deletions src/hats_import/soap/resume_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
from typing import List, Optional, Tuple

import hats.pixel_math.healpix_shim as hp
from hats import pixel_math
import numpy as np
from hats import read_hats
from hats import pixel_math, read_hats
from hats.catalog import Catalog
from hats.io import file_io
from hats.pixel_math.healpix_pixel import HealpixPixel
Expand Down

0 comments on commit 9195886

Please sign in to comment.