sdss / lvmdrp

Local Volume Mapper (LVM) Data Reduction Pipeline
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

lvmdrp failing #78

Closed kslong closed 2 months ago

kslong commented 3 months ago

For me, the current main branch of lvmdrp is failing, with the following error:

WARNING: FITSFixedWarning: The WCS transformation has more axes (2) than the image it is associated with (0) [astropy.wcs.wcs]
[ERROR]: Traceback (most recent call last):
  File "/Users/long/anaconda3/envs/lvmdrp/bin/drp", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/Users/long/SDSS/lvmdrp/bin/drp", line 276, in <module>
    cli()
  File "/Users/long/anaconda3/envs/lvmdrp/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/Users/long/anaconda3/envs/lvmdrp/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/Users/long/anaconda3/envs/lvmdrp/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/long/anaconda3/envs/lvmdrp/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/long/anaconda3/envs/lvmdrp/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Users/long/SDSS/lvmdrp/bin/drp", line 174, in quick_reduction
    quick_science_reduction(expnum, use_fiducial_master, skip_sky_subtraction,
  File "/Users/long/SDSS/lvmdrp/python/lvmdrp/functions/run_quickdrp.py", line 189, in quick_science_reduction
    image_tasks.add_astrometry(in_image=dsci_path, out_image=dsci_path, in_agcsci_image=agcsci_path, in_agcskye_image=agcskye_path, in_agcskyw_image=agcskyw_path)
  File "/Users/long/SDSS/lvmdrp/python/lvmdrp/functions/imageMethod.py", line 4072, in add_astrometry
    RAobs_sci, DECobs_sci, PAobs_sci = getobsparam('sci')
  File "/Users/long/SDSS/lvmdrp/python/lvmdrp/functions/imageMethod.py", line 4034, in getobsparam
    copy_guider_keyword(mfheader, 'FRAME0  ', org_img._header)
  File "/Users/long/SDSS/lvmdrp/python/lvmdrp/functions/imageMethod.py", line 4018, in copy_guider_keyword
    imghdr.setHdrValue(f'HIERARCH GDRCOADD {keyword}', gdrhdr[keyword], gdrhdr.comments[keyword])
AttributeError: 'Header' object has no attribute 'setHdrValue'

The guider image does exist, and the keyword it is tryint to obtain also exists.

kslong commented 3 months ago

Note that I have tried this on exposure 4416 and 5372

kslong commented 3 months ago

The line where the error is occurring is one that we added in Ensenada:

0453f34c python/lvmdrp/functions/imageMethod.py (Niv Drory             2024-04-19 10:52:16 -0700 4018)         imghdr.setHdrValue(f'HIERARCH GDRCOADD {keyword}', gdrhdr[keyword], gdrhdr.comments[keyword])
ndrory commented 3 months ago

I've committed a fix to master.

N.

On Apr 24, 2024, at 9:15 AM, Knox S. Long @.***> wrote:

For me, the current main branch of lvmdrp is failing, with the following error:

WARNING: FITSFixedWarning: The WCS transformation has more axes (2) than the image it is associated with (0) [astropy.wcs.wcs] [ERROR]: Traceback (most recent call last): File "/Users/long/anaconda3/envs/lvmdrp/bin/drp", line 7, in exec(compile(f.read(), file, 'exec')) File "/Users/long/SDSS/lvmdrp/bin/drp", line 276, in cli() File "/Users/long/anaconda3/envs/lvmdrp/lib/python3.10/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) File "/Users/long/anaconda3/envs/lvmdrp/lib/python3.10/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/Users/long/anaconda3/envs/lvmdrp/lib/python3.10/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Users/long/anaconda3/envs/lvmdrp/lib/python3.10/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "/Users/long/anaconda3/envs/lvmdrp/lib/python3.10/site-packages/click/core.py", line 783, in invoke return __callback(args, **kwargs) File "/Users/long/SDSS/lvmdrp/bin/drp", line 174, in quick_reduction quick_science_reduction(expnum, use_fiducial_master, skip_sky_subtraction, File "/Users/long/SDSS/lvmdrp/python/lvmdrp/functions/run_quickdrp.py", line 189, in quick_science_reduction image_tasks.add_astrometry(in_image=dsci_path, out_image=dsci_path, in_agcsci_image=agcsci_path, in_agcskye_image=agcskye_path, in_agcskyw_image=agcskyw_path) File "/Users/long/SDSS/lvmdrp/python/lvmdrp/functions/imageMethod.py", line 4072, in add_astrometry RAobs_sci, DECobs_sci, PAobs_sci = getobsparam('sci') File "/Users/long/SDSS/lvmdrp/python/lvmdrp/functions/imageMethod.py", line 4034, in getobsparam copy_guider_keyword(mfheader, 'FRAME0 ', org_img._header) File "/Users/long/SDSS/lvmdrp/python/lvmdrp/functions/imageMethod.py", line 4018, in copy_guider_keyword imghdr.setHdrValue(f'HIERARCH GDRCOADD {keyword}', gdrhdr[keyword], gdrhdr.comments[keyword]) AttributeError: 'Header' object has no attribute 'setHdrValue'

The guider image does exist, and the keyword it is tryint to obtain also exists.

— Reply to this email directly, view it on GitHubhttps://github.com/sdss/lvmdrp/issues/78, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJXJJ7MPKFIVE62H4T6X4ELY665A5AVCNFSM6AAAAABGXAMNW6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3DCNBQHEYDEMY. You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Niv Drory -- McDonald Observatory / Dept. of Astronomy The University of Texas at Austin Tel: +1 512 471 6197 http://www.as.utexas.edu/~drory

kslong commented 3 months ago

@ndrory I was able to process the latest version of the lvmdrp on the bug_guider branch on both of the files that gave the error. From my perspective, this can be merged into main, and this issue closed.

ajmejia commented 2 months ago

PR #79 was merged with a fix to this bug.