Skip to content

Add logging proposals#3

Merged
crawfordsm merged 4 commits into
crawfordsm:ccdprocfrom
mwcraig:logging
Feb 18, 2014
Merged

Add logging proposals#3
crawfordsm merged 4 commits into
crawfordsm:ccdprocfrom
mwcraig:logging

Conversation

@mwcraig

@mwcraig mwcraig commented Feb 11, 2014

Copy link
Copy Markdown

This pull request provides three options for logging in ccdproc.

@crawfordsm

Copy link
Copy Markdown
Owner

Hey Matthew, this looks like a good start. A couple of notes:

  1. In the first assert statement, you missed a .meta after ccddata.
  2. I don't really like the optional flag. That requires you to end up doing some transformations to check on it whereas I much prefer the explicit keywords. Also the keywords could have important information for their values and not just that they were done.
  3. The keywords should be FITS compliant, so that they can be easily written out. That means limited to 8 characters in length.

@crawfordsm

Copy link
Copy Markdown
Owner

I'm also thinking about a third option of including something like:

def subtract_bias(ccddata, masterbias, add_keyword='SUBBIAS')

Users or groups may want to specify a keyword for internal purposes

@mwcraig

mwcraig commented Feb 15, 2014

Copy link
Copy Markdown
Author

I took out the flag option and put in your user-supplied keyword. That seems like the most flexible of the options -- one thought is to modify the Keyword class a bit to allow it to have a string value so that the user can either do

subtract_bias(ccddata, masterbias, add_keyword='SUBBIAS')

or

subtract_bias(ccddata, masterbias, add_keyword=a_keyword_object_with_name_and_value)

@mwcraig

mwcraig commented Feb 15, 2014

Copy link
Copy Markdown
Author

Regarding FITS compliance, I'd lean towards letting astropy.io.fits handle that on writing the file.

If you add a long keyword to a astropy.io.fits.Header you get a warning that it is creating a HIERARCH card, but it still handles the keyword.

One thing nice about your logging suggestion is that if there are users that want to avoid HIERARCH they have the option of choosing to add only keywords that are 8 characters or less

If we are dictating the keyword then I'd lean towards having users opt-in to a strict 8 character system but use a more descriptive one by default...but I lean towards more descriptive if it can be accommodated by astropy.io.fits so that future readers of the fits file have a better chance of understanding what was done to it.

@crawfordsm

Copy link
Copy Markdown
Owner

Ah, I forgot about HIERARCH card. With that, I'm definitely happy to let fits.io do all the heavy lifting and then we can set it up otherwise how you like.

+1 to it can either be a string or a keyword instance. I'd remove the bit about the value--if people want a specific value than they can pass a Keyword instead. Otherwise this then looks good.

@mwcraig

mwcraig commented Feb 18, 2014

Copy link
Copy Markdown
Author

I have:

  • Rebased on the latest version in the ccdproc branch to make sure this will be easy to merge.
  • Updated to the Keyword class to allow for string values

For the moment I've left the other two options in, but we can pull them if you prefer. The third option definitely makes the most sense to me.

@crawfordsm crawfordsm merged commit ac603c5 into crawfordsm:ccdproc Feb 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants