AstarVienna / ScopeSim

A telescope observation simulator for Python.
GNU General Public License v3.0
16 stars 10 forks source link

SourceDescriptionFitsKeywords, EffectsMetaKeywords, and SimulationConfigFitsKeywords create too long header keyword cards. #136

Open hugobuddel opened 2 years ago

hugobuddel commented 2 years ago

The new FITS keyword effects SourceDescriptionFitsKeywords, EffectsMetaKeywords, and SimulationConfigFitsKeywords create too long header keyword cards.

import scopesim as sim
import scopesim_templates as sim_tp

gal = sim_tp.micado.cluster()

cmd = sim.UserCommands(use_instrument="MICADO", set_modes=["SCAO", "IMG_4mas"])
cmd.update(properties={
    "!OBS.filter_name_fw1": "open",
    "!OBS.filter_name_fw2": "H",
    "!OBS.ndit": 1,
    "!OBS.dit": 3600,
})

cmd["!DET.width"] = 512     # pixel
cmd["!DET.height"] = 512

micado = sim.OpticalTrain(cmd)
micado.observe(gal)
hdulistss = micado.readout()

SourceDescriptionFitsKeywords gives:

ValueError: The header keyword 'SIM SRC0 function_call' with its value is too long
"'scopesim_templates.stellar.clusters.cluster(mass=10000, distance=2000, core_radius=0.1, tidal_radius=None, multiplicity_object=None, seed=9001)'"

EffectsMetaKeywords gives:

ValueError: The header keyword 'SIM EFF0 description' with its value is too long
"'atmospheric spectra pulled from the skycalc server'"

SimulationConfigFitsKeywords gives:

ValueError: The header keyword 'SIM CONFIG SIM file server_base_url' with its value is too long
"'https://www.univie.ac.at/simcado/InstPkgSvr/'"

Apparently it is not possible to create HIERARCH CONTINUE keywords in astropy: https://github.com/astropy/astropy/issues/3746

hugobuddel commented 2 years ago

Using dev_micado branch of the IRDB.