Skip to content

Commit

Permalink
Adding file extension to hipsgen file to go around antivirus restrict…
Browse files Browse the repository at this point in the history
…ions.
  • Loading branch information
imbasimba committed Dec 10, 2021
1 parent fbd0dc3 commit f84f5ab
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion toasty/fits_tiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"""

import os.path
from shutil import copyfile
from subprocess import Popen, PIPE, STDOUT, run
import tempfile

Expand Down Expand Up @@ -198,7 +199,7 @@ def _tile_tan(self, cli_progress, **kwargs):
self.builder.cascade(cli_progress=cli_progress, **kwargs)

def _tile_hips(self, cli_progress):
hipsgen_path = download_file(
cached_hipsgen_path = download_file(
"https://aladin.unistra.fr/java/Hipsgen.jar",
show_progress=cli_progress,
cache=True,
Expand Down Expand Up @@ -228,6 +229,12 @@ def _tile_hips(self, cli_progress):
out_base = os.path.basename(self.out_dir)

with self._create_hipsgen_input_dir(fits_paths) as in_dir_path:
# Some antivirus programs (at least Avast) disallow "java -jar"
# invocation of files lacking ".jar" file extensions. Since we
# cannot set the file extension of the file in the astropy cache,
# we have to create a temporary copy with a ".jar" extension.
hipsgen_path = os.path.join(in_dir_path, "hipsgen.jar")
copyfile(cached_hipsgen_path, hipsgen_path)
argv = [
"java",
"-jar",
Expand Down

0 comments on commit f84f5ab

Please sign in to comment.