UWMRO / ScienceCamera

ISC License
4 stars 4 forks source link

Updated header keywords #12

Closed tristan3214 closed 8 years ago

tristan3214 commented 8 years ago

Oliver will comment.

ojf commented 8 years ago

Camera information should end up in the headers. I assume the exposure time, UT, etc. get written in by Here is the relevant code from add_headers.py for updating the image headers. Add_headers had to add all the header keywords relevant to data reduction except for the exposure time. What follows is that code:

# add_headers used to use pyfits, which is why the astropy is imported as pyfits.
import astropy.io.fits as pyfits

# we had to read in the time of the exposure from the headers, and then process it, and then write it out to the correct header keywords. Presumably you know what time it is in your code, so here is the code for writing it out. I'm happy to help w/ these time routines--which can be a bit much.
            # first convert DateObs (a string) to a python struct_time, then write two header keywords
            ObsTime = time.strptime(DateObs+' UTC', "%Y-%m-%dT%H:%M:%S %Z")
            ImageHdr['DATE-OBS'] = (DateObs, "Time at start of exposure")
            ImageHdr['UT'] = (time.strftime("%H:%M:%S",ObsTime), "UT time at start of exposure")

            ImageHdr['OBSERVAT'] = ('mro', "per the IRAF observatory list")

            # there are three options are imtype = 'object', imtype = 'bias', imtype = 'flat'
            ImageHdr['IMAGETYP'] = imtype

# FILTER can be any string, IRAF just looks for matches, so why not write the name of the filter (since Evora knows that)
            ImageHdr['FILTER'] = filter
# Finally, this is an arbitrary string that IRAF displays in ccdlist. It's optional, and I think we probably want to figure out how we'll save files onto the client's machine before worrying about asking the user for this keyword.
            ImageHdr['OBJECT'] = object_name
tristan3214 commented 8 years ago

What exactly are all the arguments that add headers puts in? Is it only the above or is it pretty much everything?

Here is a an example old MRO image header.

SIMPLE = T / Fits standard BITPIX = -64 / Bits per pixel NAXIS = 2 / Number of axes NAXIS1 = 512 / Axis length NAXIS2 = 512 / Axis length EXTEND = F / File may contain extensions ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator DATE = '2015-07-31T07:29:07' / Date FITS file was generated IRAF-TLM= '2015-07-31T07:29:36' / Time of last modification COMMENT FITS (Flexible Image Transport System) format defined in Astronomy and COMMENT Astrophysics Supplement Series v44/p363, v44/p371, v73/p359, v73/p365. COMMENT Contact the NASA Science Office of Standards and Technology for the COMMENT FITS Definition document #100 and other FITS information. HEAD = 'DV434 ' / Head model ACQMODE = 'Single Scan' / Acquisition mode READMODE= 'Image ' / Readout mode IMGRECT = '1, 1024, 1024, 1' / Image format HBIN = 2 / Horizontal binning VBIN = 2 / Vertical binning SUBRECT = '1, 1024, 1024, 1' / Subimage format XTYPE = 'Pixel number' / Calibration type XUNIT = 0 / Type of system TRIGGER = 'Internal' / Trigger mode CALIB = '0,1,0,0 ' / Calibration EXPOSURE= 7.000000E+00 / Total Exposure Time TEMP = -5.500000E+01 / Temperature READTIME= 1.000000E-06 / Pixel readout time OPERATN = 4 / Type of system DATE-OBS= '2015-07-31T07:29:07' / Time at start of exposure UT = '07:29:07' / UT time at start of exposure OBSERVAT= 'mro ' / per the IRAF observatory list RA = '18:51:15.38' / Right Ascension DEC = '43:36:28.1' / Declination EPOCH = '2015.58 ' / Epoch for RA and Dec (years) ST = '19:55:21' / local sidereal time (hours) HA = '01:04:05' / Hour Angle ZD = '11:44:9.9' / Zenith Angle AIRMASS = 1.021359 UTMIDDLE= '2015-07-31T07:29:10.50' JD = 2457234.81192708 HJD = 2457234.81423198 LJD = 2457234. IMAGETYP= 'object ' OBJECT = 'EB787 ' FILTER = 'r '

jwhueh commented 8 years ago

DSEC11 = '[3:2050,1:2048]' / data section of image (binned) BSEC11 = '[2053:2100,1:2048]' / bias section of image (binned)

Change HBIN and VBIN to: BINX = 2 / column bin factor
BINY = 2 / row bin factor

TELAZ = +1.0392749800000E+02 / TCC AxePos azimuth
TELALT = +1.0018332000000E+01 / TCC AxePos altitude
TELFOCUS= +4.3400000000000E+02 / TCC SecFocus
INSTRUME= 'arctic' / Instrument name
LATITUDE= +3.2780361000000E+01 / Latitude of telescope base
LONGITUD= -1.0582041700000E+02 / Longitude of telescope base
TIMESYS = 'TAI' / Time system for DATE-OBS

Joseph Huehnerhoff jwhueh@gmail.com 425.293.4328

On Jun 7, 2016, at 2:46 PM, Tristan J. Hillis notifications@github.com wrote:

What exactly are all the arguments that add headers puts in? Is it only the above or is it pretty much everything?

Here is a an example old MRO image header.

SIMPLE = T / Fits standard BITPIX = -64 / Bits per pixel NAXIS = 2 / Number of axes NAXIS1 = 512 / Axis length NAXIS2 = 512 / Axis length EXTEND = F / File may contain extensions ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator DATE = '2015-07-31T07:29:07' / Date FITS file was generated IRAF-TLM= '2015-07-31T07:29:36' / Time of last modification COMMENT FITS (Flexible Image Transport System) format defined in Astronomy and COMMENT Astrophysics Supplement Series v44/p363, v44/p371, v73/p359, v73/p365. COMMENT Contact the NASA Science Office of Standards and Technology for the COMMENT FITS Definition document #100 and other FITS information. HEAD = 'DV434 ' / Head model ACQMODE = 'Single Scan' / Acquisition mode READMODE= 'Image ' / Readout mode IMGRECT = '1, 1024, 1024, 1' / Image format HBIN = 2 / Horizontal binning VBIN = 2 / Vertical binning SUBRECT = '1, 1024, 1024, 1' / Subimage format XTYPE = 'Pixel number' / Calibration type XUNIT = 0 / Type of system TRIGGER = 'Internal' / Trigger mode CALIB = '0,1,0,0 ' / Calibration EXPOSURE= 7.000000E+00 / Total Exposure Time TEMP = -5.500000E+01 / Temperature READTIME= 1.000000E-06 / Pixel readout time OPERATN = 4 / Type of system DATE-OBS= '2015-07-31T07:29:07' / Time at start of exposure UT = '07:29:07' / UT time at start of exposure OBSERVAT= 'mro ' / per the IRAF observatory list RA = '18:51:15.38' / Right Ascension DEC = '43:36:28.1' / Declination EPOCH = '2015.58 ' / Epoch for RA and Dec (years) ST = '19:55:21' / local sidereal time (hours) HA = '01:04:05' / Hour Angle ZD = '11:44:9.9' / Zenith Angle AIRMASS = 1.021359 UTMIDDLE= '2015-07-31T07:29:10.50' JD = 2457234.81192708 HJD = 2457234.81423198 LJD = 2457234. IMAGETYP= 'object ' OBJECT = 'EB787 ' FILTER = 'r '

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/UWMRO/ScienceCamera/issues/12#issuecomment-224408902, or mute the thread https://github.com/notifications/unsubscribe/AL2u9psMUrsWUc-96kiieEa4PRp38wMNks5qJdi7gaJpZM4IpMOZ.

ojf commented 8 years ago

The entirely of what add_headers put in is what was in the code above, and also RA, DEC, EPOCH, ST, HA, ZD from the GTCC logfile. It then calculateded AIRMASS and JD through iraf setairmass and setjd.

I believe we're using the old GTCC this summer, right? So it would be great if Evora can take care of the keywords that aren't in the GTCC logfile.

tristan3214 commented 8 years ago

It seems to me I could almost merge some of what add_headers does into the server code and cut out the middle man, unless we are to not worry about that for now.

Ideally I would like the images to have all the header information at the server end but if this process takes some time then I will have to toy around with my code.

ojf commented 8 years ago

I agree, and once the new TCC is implemented we'll do that. For this summer though, to mitigate risk, we talked about retaining GTCC and add_headers rather than implementing code that's just going to go away w/ the new TCC. The "camera/image information" headers above would be great to implement though, since that code won't change with a new TCC.

jwhueh commented 8 years ago

Yep, add camera and site specific items and worry about TCC next year.

Although. I think we should at least write the blank cards and add_headers can just fill them in. Unless that would require a major code change to add_headers.

Joseph Huehnerhoff jwhueh@gmail.com 425.293.4328

On Jun 7, 2016, at 3:48 PM, ojf notifications@github.com wrote:

I agree, and once the new TCC is implemented we'll do that. For this summer though, to mitigate risk, we talked about retaining GTCC and add_headers rather than implementing code that's just going to go away w/ the new TCC. The "camera/image information" headers above would be great to implement though, since that code won't change with a new TCC.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/UWMRO/ScienceCamera/issues/12#issuecomment-224425244, or mute the thread https://github.com/notifications/unsubscribe/AL2u9q7N1GqdVnsJjPH94fMRCXEWpdWkks5qJec9gaJpZM4IpMOZ.

tristan3214 commented 8 years ago

To clarify for you Oliver the above headers can easily be written. I just add some of them to the parameters I send to the server (i.e. image type and filter type). For object, however, it would be harder because I only have access to the base name the user puts in which along with the shorthand object name would also have something on the filter used (e.g. for object EB787 might be put in as rEB787 for the r filter which is too variable to control). Unless I explicitly ask the user on this topic we may never be able to implement this keyword once we are full into the new upgrades.

ojf commented 8 years ago

I'm not sure if add_headers will overwrite blank cards--for now can we leave that code commented out? Just to save me debugging time. If you'd rather see Evora write that stuff I'll change add_headers to make it work.

On Tue, Jun 7, 2016 at 2:52 PM, Joseph Huehnerhoff <notifications@github.com

wrote:

Yep, add camera and site specific items and worry about TCC next year.

Although. I think we should at least write the blank cards and add_headers can just fill them in. Unless that would require a major code change to add_headers.

Joseph Huehnerhoff jwhueh@gmail.com 425.293.4328

On Jun 7, 2016, at 3:48 PM, ojf notifications@github.com wrote:

I agree, and once the new TCC is implemented we'll do that. For this summer though, to mitigate risk, we talked about retaining GTCC and add_headers rather than implementing code that's just going to go away w/ the new TCC. The "camera/image information" headers above would be great to implement though, since that code won't change with a new TCC.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/UWMRO/ScienceCamera/issues/12#issuecomment-224425244>, or mute the thread < https://github.com/notifications/unsubscribe/AL2u9q7N1GqdVnsJjPH94fMRCXEWpdWkks5qJec9gaJpZM4IpMOZ .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/UWMRO/ScienceCamera/issues/12#issuecomment-224426179, or mute the thread https://github.com/notifications/unsubscribe/AL41cVoKjapp_gC7vlGIWCbLhZpEJ3iqks5qJeghgaJpZM4IpMOZ .

Oliver Fraser Astronomy Lecturer UW Seattle

jwhueh commented 8 years ago

Can you push add_headers to the science camera repository? We can test it out this weekend.

Joseph Huehnerhoff jwhueh@gmail.com 425.293.4328

On Jun 7, 2016, at 5:21 PM, ojf notifications@github.com wrote:

I'm not sure if add_headers will overwrite blank cards--for now can we leave that code commented out? Just to save me debugging time. If you'd rather see Evora write that stuff I'll change add_headers to make it work.

On Tue, Jun 7, 2016 at 2:52 PM, Joseph Huehnerhoff <notifications@github.com

wrote:

Yep, add camera and site specific items and worry about TCC next year.

Although. I think we should at least write the blank cards and add_headers can just fill them in. Unless that would require a major code change to add_headers.

Joseph Huehnerhoff jwhueh@gmail.com 425.293.4328

On Jun 7, 2016, at 3:48 PM, ojf notifications@github.com wrote:

I agree, and once the new TCC is implemented we'll do that. For this summer though, to mitigate risk, we talked about retaining GTCC and add_headers rather than implementing code that's just going to go away w/ the new TCC. The "camera/image information" headers above would be great to implement though, since that code won't change with a new TCC.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/UWMRO/ScienceCamera/issues/12#issuecomment-224425244>, or mute the thread < https://github.com/notifications/unsubscribe/AL2u9q7N1GqdVnsJjPH94fMRCXEWpdWkks5qJec9gaJpZM4IpMOZ .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/UWMRO/ScienceCamera/issues/12#issuecomment-224426179, or mute the thread https://github.com/notifications/unsubscribe/AL41cVoKjapp_gC7vlGIWCbLhZpEJ3iqks5qJeghgaJpZM4IpMOZ .

Oliver Fraser Astronomy Lecturer UW Seattle — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/UWMRO/ScienceCamera/issues/12#issuecomment-224443519, or mute the thread https://github.com/notifications/unsubscribe/AL2u9vLgbu5TccFkC3Xm0vDBF7uUzbpeks5qJfzwgaJpZM4IpMOZ.

ojf commented 8 years ago

Re: the object header card. Tristan, you're exactly right--this is information that we'd have to ask the user for. It's also not necessary for image reduction. Can I propose we leave it out for now, add_headers can take care of it if we want it for this summer, and reevaluate when we're ready to remove add_headers from the flow?

Oliver

On Tue, Jun 7, 2016 at 3:21 PM, Tristan J. Hillis notifications@github.com wrote:

To clarify for you Oliver the above headers can easily be written. I just add some of them to the parameters I send to the server (i.e. image type and filter type). For object, however, it would be harder because I only have access to the base name the user puts in which along with the shorthand object name would also have something on the filter used (e.g. for object EB787 might be put in as rEB787 for the r filter which is too variable to control). Unless I explicitly ask the user on this topic we may never be able to implement this keyword once we are full into the new upgrades.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/UWMRO/ScienceCamera/issues/12#issuecomment-224432666, or mute the thread https://github.com/notifications/unsubscribe/AL41cS9FNAMZwoBfscbbROB3AtuYLKYDks5qJe8GgaJpZM4IpMOZ .

Oliver Fraser Astronomy Lecturer UW Seattle

ojf commented 8 years ago

It'll likely need modification before it'll work with this camera, but it's already on Geezil if you want to try it.

Would love to learn how to use Git, but it'll have to wait until at least tomorrow. =)

Oliver

On Tue, Jun 7, 2016 at 4:22 PM, Joseph Huehnerhoff <notifications@github.com

wrote:

Can you push add_headers to the science camera repository? We can test it out this weekend.

Joseph Huehnerhoff jwhueh@gmail.com 425.293.4328

On Jun 7, 2016, at 5:21 PM, ojf notifications@github.com wrote:

I'm not sure if add_headers will overwrite blank cards--for now can we leave that code commented out? Just to save me debugging time. If you'd rather see Evora write that stuff I'll change add_headers to make it work.

On Tue, Jun 7, 2016 at 2:52 PM, Joseph Huehnerhoff < notifications@github.com

wrote:

Yep, add camera and site specific items and worry about TCC next year.

Although. I think we should at least write the blank cards and add_headers can just fill them in. Unless that would require a major code change to add_headers.

Joseph Huehnerhoff jwhueh@gmail.com 425.293.4328

On Jun 7, 2016, at 3:48 PM, ojf notifications@github.com wrote:

I agree, and once the new TCC is implemented we'll do that. For this summer though, to mitigate risk, we talked about retaining GTCC and add_headers rather than implementing code that's just going to go away w/ the new TCC. The "camera/image information" headers above would be great to implement though, since that code won't change with a new TCC.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <

https://github.com/UWMRO/ScienceCamera/issues/12#issuecomment-224425244>, or mute the thread <

https://github.com/notifications/unsubscribe/AL2u9q7N1GqdVnsJjPH94fMRCXEWpdWkks5qJec9gaJpZM4IpMOZ

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/UWMRO/ScienceCamera/issues/12#issuecomment-224426179>, or mute the thread < https://github.com/notifications/unsubscribe/AL41cVoKjapp_gC7vlGIWCbLhZpEJ3iqks5qJeghgaJpZM4IpMOZ

.

Oliver Fraser Astronomy Lecturer UW Seattle — You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/UWMRO/ScienceCamera/issues/12#issuecomment-224443519>, or mute the thread < https://github.com/notifications/unsubscribe/AL2u9vLgbu5TccFkC3Xm0vDBF7uUzbpeks5qJfzwgaJpZM4IpMOZ .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/UWMRO/ScienceCamera/issues/12#issuecomment-224443737, or mute the thread https://github.com/notifications/unsubscribe/AL41cZyres6uXzeWXokE6Oovd9yCnIaGks5qJf1QgaJpZM4IpMOZ .

Oliver Fraser Astronomy Lecturer UW Seattle

tristan3214 commented 8 years ago

Headers are writing well. With filter and image type being written by the Evora server all add_headers has to ask for now is object name. However, because this is not a highly necessary keyword we have opted to exclude this bit, meaning once add_headers is started no user input is needed.

Below is an example image header. SIMPLE = T / Fits standard
BITPIX = -32 / Bits per pixel
NAXIS = 2 / Number of axes
NAXIS1 = 512 / Axis length
NAXIS2 = 512 / Axis length
EXTEND = F / File may contain extensions
ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator
DATE = '2016-06-21T07:32:46' / Date FITS file was generated
IRAF-TLM= '2016-06-21T07:32:54' / Time of last modification
DATE-OBS= '2016-06-21T07:32:10' / Time at start of exposure
UT = '07:32:10' / UT time at start of exposure
OBSERVAT= 'mro ' / per the iraf list
IMAGETYP= 'object '
FILTER = 'i '
BINX = 2 / Horizontal Binning
BINY = 2 / Vertical Binning
EXPOSURE= 30.0 / Total exposure time
ACQMODE = 'Single Scan' / Acquisition mode
READMODE= 'Image ' / Readout mode
INSTRUME= 'evora ' / Instrument used for imaging
LATITUDE= 120.744466667 / Decimal degrees of MRO latitude
LONGITUD= 46.9528 / Decimal degress of MRO longitude
TEMP = -58.47900009155273 / Temperature
READTIME= 0.0 / Pixel readout time
RA = '14:17:54.28' / Right Ascension
DEC = '19:13:3.5' / Declination
EPOCH = '2016.47 ' / Epoch for RA and Dec (years)
ST = '17:24:32' / local sidereal time (hours)
HA = '03:06:38' / Hour Angle
ZD = '46:55:36.2' / Zenith Angle
AIRMASS = 1.464222
UTMIDDLE= '2016-06-21T07:32:25.00'
JD = 2457560.81417824
HJD = 2457560.81625692
LJD = 2457560.
END