Skip to content

ValueError: The header keyword 'SIM SRC0 amplitudes' with its value is too long #70

@carmeloarci

Description

@carmeloarci

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions