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

shutil.rmtree(outdir) failing #7

Open
orifox opened this issue Dec 24, 2023 · 0 comments
Open

shutil.rmtree(outdir) failing #7

orifox opened this issue Dec 24, 2023 · 0 comments

Comments

@orifox
Copy link

orifox commented Dec 24, 2023

I think this needs a force remove. Or something like that. It's failing for both jwst and hst. I just commented it out for now.

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Cell In[11], line 5
      3 jwst_drz_obs = space_phot.observation3('./mydownloads/02666/obsnum04/miri_f2100w_stage3_asn_skysub_i2d.fits')
      4 #psf_drz = pickle.load(open('psf_f555w_05af.pkl','rb')) 
----> 5 psf_drz = space_phot.get_jwst3_psf(jwst_flc_obs,jwst_drz_obs,sn_location)#,num_psfs=4)
      6 plt.imshow(psf_drz.data)
      7 plt.show()

File ~/miniconda3/envs/space_phot4/lib/python3.10/site-packages/space_phot/util.py:464, in get_jwst3_psf(st_obs, st_obs3, sky_location, num_psfs, psf_width)
    453     #level3[mx,my]*=16**2
    454     
    455     #level3_psf = photutils.psf.FittableImageModel(level3[mx,my],normalize=False, 
    456     #                                              oversampling=4)
    461     level3_psf = photutils.psf.FittableImageModel(level3[mx,my],normalize=False, 
    462                                                   oversampling=4)
--> 464     shutil.rmtree(outdir)
    465 except RuntimeError:
    466     print('Failed to create PSF model')

File ~/miniconda3/envs/space_phot4/lib/python3.10/shutil.py:731, in rmtree(path, ignore_errors, onerror)
    729         os.rmdir(path)
    730     except OSError:
--> 731         onerror(os.rmdir, path, sys.exc_info())
    732 else:
    733     try:
    734         # symlinks to directories are forbidden, see bug #1669

File ~/miniconda3/envs/space_phot4/lib/python3.10/shutil.py:729, in rmtree(path, ignore_errors, onerror)
    727     os.close(fd)
    728     fd_closed = True
--> 729     os.rmdir(path)
    730 except OSError:
    731     onerror(os.rmdir, path, sys.exc_info())

OSError: [Errno 39] Directory not empty: '/home/ofox/miniconda3/envs/space_phot4/lib/python3.10/site-packages/space_phot/temp_519'
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