-
Notifications
You must be signed in to change notification settings - Fork 4
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
ValueError: The header keyword 'SIM SRC0 amplitudes' with its value is too long #70
Comments
Thanks. You can workaround this problem by disabling the source fits keywords: micado["source_fits_keywords"].include = False Nevertheless we should fix this. Unfortunately, I cannot reproduce your exact error. The file produced by your script for small n does not contain the Could you please share the output of However, increasing n from 5 to 6 will lead to a related error:
The error above is caused by the key
for that key. That line will convert the card from a HIERARCH card to a normal one, which supports the CONTINUE keyword. And indeed for n=5 this key indeed does not appear in the headers. But this code is not reached for n=6 because the error occurs earlier. We would need to fix that 'hack', but once fixed, we could perhaps employ something similar for the other keywords that can reach an arbitrary length like For completeness, this is the output of
|
MORFEO_debugSRC0.py.txt (scope_test) [carmelo@dyno simcado]$ python MORFEO_debug.py Installed Python packages: Installed IRDB packages: Operating System info: Traceback (most recent call last): |
The SourceDescriptionFitsKeywords still cause problems, see AstarVienna/ScopeSim_Templates#70 AstarVienna/ScopeSim_Templates#69
Thanks for sharing the output of The latest ScopeSim_Templates is 0.5.0, in which this particular problem does not occur. However, that is a coincidence, because 0.5.0 does not store the default source parameters. It would probably still fail with ScopeSim_Templates 0.5.0 if you would have explicitly listed the desired amplitudes in the script. The short term fix would be to default to not storing these source description fits keywords, since they don't work properly, and they are probably not actively used, so they cause more problems then they solve, see AstarVienna/irdb#150 . |
It is not possible to complete a simulation of a star cluser using SCOPESIM since python wants to save a string that is too long to be handled in a fits header keyword. It is not possible to save the fits image file.
In the example, we used 5 randomly placed stars using the scopesim_templates.stars tool. Specifically MICADO and MORFEO irdb were considered.
Attached the python script to reproduce the error
MORFEO_debug2.py.txt
Traceback (most recent call last):
File "/python/simcado/MORFEO_debug2.py", line 100, in
hdus_J_small_test_3DM = micado.readout(filename= "scopesim_debug.fits")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/carmelo/.conda/envs/scope_test/lib/python3.11/site-packages/scopesim/utils.py", line 1053, in wrapper
output = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/carmelo/.conda/envs/scope_test/lib/python3.11/site-packages/scopesim/optics/optical_train.py", line 328, in readout
hdul.writeto(fname, overwrite=True)
File "/home/carmelo/.conda/envs/scope_test/lib/python3.11/site-packages/astropy/io/fits/hdu/hdulist.py", line 1006, in writeto
self.verify(option=output_verify)
File "/home/carmelo/.conda/envs/scope_test/lib/python3.11/site-packages/astropy/io/fits/verify.py", line 82, in verify
errs = self._verify(opt)
^^^^^^^^^^^^^^^^^
File "/home/carmelo/.conda/envs/scope_test/lib/python3.11/site-packages/astropy/io/fits/hdu/hdulist.py", line 1401, in _verify
result = hdu._verify(option)
^^^^^^^^^^^^^^^^^^^
File "/home/carmelo/.conda/envs/scope_test/lib/python3.11/site-packages/astropy/io/fits/hdu/image.py", line 1162, in _verify
errs = super()._verify(option=option)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/carmelo/.conda/envs/scope_test/lib/python3.11/site-packages/astropy/io/fits/hdu/image.py", line 599, in _verify
return super()._verify(option)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/carmelo/.conda/envs/scope_test/lib/python3.11/site-packages/astropy/io/fits/hdu/base.py", line 1099, in _verify
errs.append(card._verify(option))
^^^^^^^^^^^^^^^^^^^^
File "/home/carmelo/.conda/envs/scope_test/lib/python3.11/site-packages/astropy/io/fits/card.py", line 1166, in _verify
keyword, valuecomment = self._split()
^^^^^^^^^^^^^
File "/home/carmelo/.conda/envs/scope_test/lib/python3.11/site-packages/astropy/io/fits/card.py", line 838, in _split
image = self.image
^^^^^^^^^^
File "/home/carmelo/.conda/envs/scope_test/lib/python3.11/site-packages/astropy/io/fits/card.py", line 530, in image
self._image = self._format_image()
^^^^^^^^^^^^^^^^^^^^
File "/home/carmelo/.conda/envs/scope_test/lib/python3.11/site-packages/astropy/io/fits/card.py", line 1025, in _format_image
raise ValueError(
ValueError: The header keyword 'SIM SRC0 amplitudes' with its value is too long
The text was updated successfully, but these errors were encountered: