so-artn / rts2solib

Steward Observatory python interface to RTS2
0 stars 0 forks source link

Annihilate BINNING header keyword -- And general header cleanup #8

Open dsand opened 2 years ago

dsand commented 2 years ago

One thing we are noticing on April 4-7 science run. Some header keywords are clearly wrong. For instance, the BINNING header keyword is always '3x3 '. Even when the actual binning is 4x4 or something else. The correct header keywords are getting propagated to CCDSUM and CCDBIN1 and CCDBIN2. We should just get rid of this binning header keyword, or at the very least fix it.

This should probably be part of a larger clean up of the RTS2 populated headers.

Note that this bad BINNING keyword gets propagated to things like @pndaly 's observing log on AORP. So there are downstream affects that aren't great.

pndaly commented 2 years ago

OK, I took a look at this and I developed some code for a fix. I copied the object sub-directories of 20220406 and run it against that. It seemed to fix all 414 images and it was very quick to run:

\% diff fix_primary_hdu.before.dat fix_primary_hdu.after.dat -y BINNING = '3x3 ' / Binning | BINNING = '4x4 ' / Binning

If you want to see the code, it's on scopenet in /home/pndaly/fix_primary_hdu.py.

I can fix your data (if you wish) but a larger project would be to fix all data on bigartn and scopenet (as I think this has been happening for some time).

However, we don't want to be fixing fits headers after the fact ... it'd be better to get them right first time. So, whilst fixing another issue (the /etc/rts2 files -> repo thing) I noticed the file /etc/rts2/fitstemplate.ini ... I think we should be able to add a line in there like:

BINNING = @C0.binning / ARN-ORP binning

I also spotted a problem: the ObsReq2 table removed the GroupID so that header is blank. It was that information that was going to be used bind images in, for example, a dither (as they'd all have the same GroupID).

dsand commented 2 years ago

Nice. Thanks @pndaly. I don't think we should be fixing old headers, but we should either fix or remove this header keyword. It is redundant with CCDSUM & CCDBIN1, CCDBIN2 which are all reading correctly.

Thanks for finding where the fits template is. I'll try to add an issue to the relevant repo.

Also, what/where is the ObsReq2 table? What piece of code needs to be debugged there?

Thanks.

pndaly commented 2 years ago

Looks like adding 'BINNING = @C0.binning / Binning' to the /etc/rts2/fitstemplate.ini fixes that issue.