Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecThomson committed Jul 31, 2024
1 parent d1bad94 commit e874314
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion racs_tools/beamcon_2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def smooth_fits_files(
if listfile:
assert len(infile_list) == 1, "Only one list file can be provided!"
with open(infile_list[0]) as f:
infile_list = [Path(l) for l in f.read().splitlines()]
infile_list = [Path(line) for line in f.read().splitlines()]
files = sorted(infile_list)
if len(files) == 0:
raise FileNotFoundError("No files found!")
Expand Down
10 changes: 5 additions & 5 deletions racs_tools/getnoise_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from spectral_cube import SpectralCube
from spectral_cube.utils import SpectralCubeWarning

from racs_tools.logging import logger, setup_logger
from racs_tools.logging import logger, set_verbosity

warnings.filterwarnings(action="ignore", category=SpectralCubeWarning, append=True)

Expand All @@ -30,7 +30,7 @@ def getcube(filename: str) -> SpectralCube:
SpectralCube: Data cube
"""
cube = SpectralCube.read(filename)
mask = ~(cube == 0 * u.jansky / u.beam)
mask = ~(cube == 0 * cube.unit)
cube = cube.with_mask(mask)
return cube

Expand Down Expand Up @@ -189,7 +189,7 @@ def main(

if outfile:
logger.info(f"Saving bad files to {outfile}")
np.savetxt(outfile, totalbad)
np.savetxt(outfile, totalbad.astype(int), fmt="%d")


def cli() -> None:
Expand Down Expand Up @@ -256,9 +256,9 @@ def cli() -> None:
args = parser.parse_args()

# Set up logging
logger = setup_logger(
set_verbosity(
logger=logger,
verbosity=args.verbosity,
filename=args.logfile,
)

main(
Expand Down

0 comments on commit e874314

Please sign in to comment.