{"action":"opened","issue":{"url":"https://api.github.com/repos/radio-astro-tools/spectral-cube/issues/324","repository_url":"https://api.github.com/repos/radio-astro-tools/spectral-cube","labels_url":"https://api.github.com/repos/radio-astro-tools/spectral-cube/issues/324/labels{/name}","comments_url":"https://api.github.com/repos/radio-astro-tools/spectral-cube/issues/324/comments","events_url":"https://api.github.com/repos/radio-astro-tools/spectral-cube/issues/324/events","html_url":"https://github.com/radio-astro-tools/spectral-cube/issues/324","id":162914596,"number":324,"title":"Reading cubes with improper CTYPE3 axis","user":{"login":"ivvv","id":7148876,"avatar_url":"https://avatars.githubusercontent.com/u/7148876?v=3","gravatar_id":"","url":"https://api.github.com/users/ivvv","html_url":"https://github.com/ivvv","followers_url":"https://api.github.com/users/ivvv/followers","following_url":"https://api.github.com/users/ivvv/following{/other_user}","gists_url":"https://api.github.com/users/ivvv/gists{/gist_id}","starred_url":"https://api.github.com/users/ivvv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivvv/subscriptions","organizations_url":"https://api.github.com/users/ivvv/orgs","repos_url":"https://api.github.com/users/ivvv/repos","events_url":"https://api.github.com/users/ivvv/events{/privacy}","received_events_url":"https://api.github.com/users/ivvv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-06-29T12:38:24Z","updated_at":"2016-06-29T12:38:24Z","closed_at":null,"body":"I have spectral cubes from the Herschel Space Observatory and unfortunately the CTYPE3 FITS header keyword contains a bogus '&' symbol in the name. So, it's 'Frequency&' instead of 'Frequency'.\r\n\r\nI tried to use the meta parameter in the SpectralCube.read(), like this:\r\n\r\n`xx = SpectralCube.read(file,hdu=1,meta={'CTYPE3': 'FREQ'})\r\n`\r\nbut this does not seem to work. Actually, the documentation on the meta input parameter is inexistent and I was just shooting in the dark with this experiment, as I am not quite sure if this will only change this metadatum. Well, I can look at the code...\r\n\r\nThe workaround I found was to read the cube, change the CTYPE3 and then create the SpectralCube object:\r\n\r\n```\r\nxx = fits.open(file)\r\ncube = xx['image'].data\r\nheader = xx['image'].header\r\nheader[\"CTYPE3\"] = \"FREQ\"\r\nyy = SpectralCube(data=cube,wcs=WCS(header))\r\nyy[10,:,:].quicklook()\r\n```\r\n\r\nThis works but it's a bit ugly. So, maybe for such non-standard headers the user could still have some control on setting some keywords to their standard names. I expected the meta parameter to be used for this.\r\n\r\nI can provide an example spectral cube from the Herschel SPIRE Fourier-Transform Spectrometer. \r\nThanks,\r\nIvan"}}
{"actor":{"display_login":"ivvv"}}