teareduce 0.4.8__py3-none-any.whl → 0.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,6 +12,8 @@
12
12
  import argparse
13
13
  import tkinter as tk
14
14
  import os
15
+ from rich import print
16
+ from rich_argparse import RichHelpFormatter
15
17
 
16
18
  from .cosmicraycleanerapp import CosmicRayCleanerApp
17
19
 
@@ -20,26 +22,36 @@ matplotlib.use("TkAgg")
20
22
 
21
23
 
22
24
  def main():
23
- parser = argparse.ArgumentParser(description="Interactive cosmic ray cleaner for FITS images.")
25
+ parser = argparse.ArgumentParser(
26
+ description="Interactive cosmic ray cleaner for FITS images.",
27
+ formatter_class=RichHelpFormatter)
24
28
  parser.add_argument("input_fits", help="Path to the FITS file to be cleaned.")
25
29
  parser.add_argument("--extension", type=int, default=0,
26
30
  help="FITS extension to use (default: 0).")
27
- parser.add_argument("--output_fits", type=str, default=None,
28
- help="Path to save the cleaned FITS file")
31
+ parser.add_argument("--auxfile", type=str, default=None,
32
+ help="Auxiliary FITS file")
33
+ parser.add_argument("--extension_auxfile", type=int, default=0,
34
+ help="FITS extension for auxiliary file (default: 0).")
29
35
  args = parser.parse_args()
30
36
 
31
37
  if not os.path.isfile(args.input_fits):
32
38
  print(f"Error: File '{args.input_fits}' does not exist.")
33
39
  return
34
- if args.output_fits is not None and os.path.isfile(args.output_fits):
35
- print(f"Error: Output file '{args.output_fits}' already exists.")
40
+ if args.auxfile is not None and not os.path.isfile(args.auxfile):
41
+ print(f"Error: Auxiliary file '{args.auxfile}' does not exist.")
36
42
  return
37
43
 
38
44
  # Initialize Tkinter root
39
45
  root = tk.Tk()
40
46
 
41
47
  # Create and run the application
42
- CosmicRayCleanerApp(root, args.input_fits, args.extension, args.output_fits)
48
+ CosmicRayCleanerApp(
49
+ root=root,
50
+ input_fits=args.input_fits,
51
+ extension=args.extension,
52
+ auxfile=args.auxfile,
53
+ extension_auxfile=args.extension_auxfile
54
+ )
43
55
 
44
56
  # Execute
45
57
  root.mainloop()