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

OSError: No SIMPLE card found, this file does not appear to be a valid FITS file #271

Open
MeArpanGhosh opened this issue Mar 28, 2024 · 0 comments

Comments

@MeArpanGhosh
Copy link

Hi,
I am facing this problem while I am trying to replicate the quickstart eleanor tutuorial ( https://eleanor.readthedocs.io/en/latest/getting_started/tutorial.html )

In [28]: data = eleanor.TargetData(star, height=15, width=15, bkg_size=31, do_psf=False, do_pca=False)

OSError Traceback (most recent call last)
in
----> 1 data = eleanor.TargetData(star, height=15, width=15, bkg_size=31, do_psf=False, do_pca=False)

~/eleanor/eleanor/targetdata.py in init(self, source, height, width, save_postcard, do_pca, do_psf, bkg_size, aperture_mode, cal_cadences, try_load, regressors, language)
187 if source.tc == False:
188 self.post_obj = Postcard(source.postcard, source.postcard_bkg,
--> 189 source.postcard_path)
190 else:
191 self.post_obj = Postcard_tesscut(source.cutout)

~/eleanor/eleanor/postcard.py in init(self, filename, background, filepath)
56 self.filename = os.path.join(filepath, filename)
57 self.local_path = copy.copy(self.filename)
---> 58 self.hdu = fits.open(self.local_path)
59 self.background2d = fits.open(os.path.join(filepath, background))[1].data
60

~/anaconda3/envs/tess/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py in fitsopen(name, mode, memmap, save_backup, cache, lazy_load_hdus, ignore_missing_simple, **kwargs)
172
173 return HDUList.fromfile(name, mode, memmap, save_backup, cache,
--> 174 lazy_load_hdus, ignore_missing_simple, **kwargs)
175
176

~/anaconda3/envs/tess/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py in fromfile(cls, fileobj, mode, memmap, save_backup, cache, lazy_load_hdus, ignore_missing_simple, **kwargs)
409 save_backup=save_backup, cache=cache,
410 ignore_missing_simple=ignore_missing_simple,
--> 411 lazy_load_hdus=lazy_load_hdus, **kwargs)
412
413 @classmethod

~/anaconda3/envs/tess/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py in _readfrom(cls, fileobj, data, mode, memmap, cache, lazy_load_hdus, ignore_missing_simple, **kwargs)
1088 if hdulist._file.close_on_error:
1089 hdulist._file.close()
-> 1090 raise OSError('No SIMPLE card found, this file does not '
1091 'appear to be a valid FITS file')
1092

OSError: No SIMPLE card found, this file does not appear to be a valid FITS file

In [29]: data = eleanor.TargetData(star)

OSError Traceback (most recent call last)
in
----> 1 data = eleanor.TargetData(star)

~/eleanor/eleanor/targetdata.py in init(self, source, height, width, save_postcard, do_pca, do_psf, bkg_size, aperture_mode, cal_cadences, try_load, regressors, language)
187 if source.tc == False:
188 self.post_obj = Postcard(source.postcard, source.postcard_bkg,
--> 189 source.postcard_path)
190 else:
191 self.post_obj = Postcard_tesscut(source.cutout)

~/eleanor/eleanor/postcard.py in init(self, filename, background, filepath)
56 self.filename = os.path.join(filepath, filename)
57 self.local_path = copy.copy(self.filename)
---> 58 self.hdu = fits.open(self.local_path)
59 self.background2d = fits.open(os.path.join(filepath, background))[1].data
60

~/anaconda3/envs/tess/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py in fitsopen(name, mode, memmap, save_backup, cache, lazy_load_hdus, ignore_missing_simple, **kwargs)
172
173 return HDUList.fromfile(name, mode, memmap, save_backup, cache,
--> 174 lazy_load_hdus, ignore_missing_simple, **kwargs)
175
176

~/anaconda3/envs/tess/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py in fromfile(cls, fileobj, mode, memmap, save_backup, cache, lazy_load_hdus, ignore_missing_simple, **kwargs)
409 save_backup=save_backup, cache=cache,
410 ignore_missing_simple=ignore_missing_simple,
--> 411 lazy_load_hdus=lazy_load_hdus, **kwargs)
412
413 @classmethod

~/anaconda3/envs/tess/lib/python3.7/site-packages/astropy/io/fits/hdu/hdulist.py in _readfrom(cls, fileobj, data, mode, memmap, cache, lazy_load_hdus, ignore_missing_simple, **kwargs)
1088 if hdulist._file.close_on_error:
1089 hdulist._file.close()
-> 1090 raise OSError('No SIMPLE card found, this file does not '
1091 'appear to be a valid FITS file')
1092

OSError: No SIMPLE card found, this file does not appear to be a valid FITS file

Please help me

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