Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for correctly configured config, local archive, return functionality of default backup. #104

Open
emirkmo opened this issue Jul 6, 2022 · 0 comments

Comments

@emirkmo
Copy link
Member

emirkmo commented Jul 6, 2022

This just needs to be implemented in fileio. Give a warning if config is not as expected and a warning listing the backup path being used. Also a check to make sure we don't use None as a path.

See issue ran into by @rhandberg:

$ python run_photometry.py --fileid=16384
[2022-07-06 14:20:32,173| INFO| 16384 | run_photometry] ========================================================================
[2022-07-06 14:20:32,173| INFO| 16384 | run_photometry] 16384
[2022-07-06 14:20:32,173| INFO| 16384 | run_photometry] ========================================================================
[2022-07-06 14:20:32,208| INFO| 16384 | fileio] Using data from: None.
[2022-07-06 14:20:32,209| INFO| 16384 | fileio] Placing output in '/flows/photometry_workdir/2022hrs/16384'
[2022-07-06 14:21:10,758| ERROR| 16384 | run_photometry] Photometry failed:expected str, bytes or os.PathLike object, not NoneType
Traceback (most recent call last):
  File "/usr/users/kasoc/flows/flows/run_photometry.py", line 27, in process_fileid
    table = photometry(fileid=fid, cm_timeout=cm_timeout, make_plots=not no_plots,
  File "/usr/users/kasoc/flows/flows/flows/photometry.py", line 451, in timed_photometry
    results_table = do_phot(fileid, cm_timeout, make_plots, directories, datafile, rescale_dynamic)
  File "/usr/users/kasoc/flows/flows/flows/photometry.py", line 420, in do_phot
    pm = PhotometryManager.create_from_fid(fileid, directories=directories, datafile=datafile, create_directories=True)
  File "/usr/users/kasoc/flows/flows/flows/photometry.py", line 411, in create_from_fid
    return PhotometryManager(target=io.target, image=io.load_science_image(), bkg=FlowsBackground(),
  File "/usr/users/kasoc/flows/flows/flows/fileio.py", line 182, in load_science_image
    image = self._load_image(image_path)
  File "/usr/users/kasoc/flows/flows/flows/fileio.py", line 177, in _load_image
    image = load_image(self.directories.image_path(image_path), target_coord=self.target.coords)
  File "/usr/users/kasoc/flows/flows/flows/fileio.py", line 96, in image_path
    return os.path.join(self.archive_local, image_path)
  File "/usr/lib/python3.10/posixpath.py", line 76, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
[2022-07-06 14:21:10,846| INFO| 16384 | util] process shutting down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant