Tried using a daytime image of the sun for a rough color calibration. 

server:calib christopherstubbs$ gphoto2 --set-config=/main/capturesettings/shutterspeed=1/8000

server:calib christopherstubbs$ gphoto2 --capture-image-and-download --filename suntest

New file is in location /capt0000.cr2 on the camera                            

Saving file as suntest

Deleting file /capt0000.cr2 on the camera

Deleting 'capt0000.cr2' from folder '/'...

server:calib christopherstubbs$ ls

suntest

server:calib christopherstubbs$ mv suntest suntest.cr2

cp65239:calib cstubbs$ gethead *.fits BIAS

suntest.B.fits 2047.603

suntest.G.fits 2047.581

suntest.M.fits 2047.527

suntest.R.fits 2048.317

vocl> imarith suntest.B.fits - 2047.603 suntest.B.debias.fits
vocl> imarith suntest.G.fits - 2047.581 suntest.G.debias.fits
vocl> imarith suntest.M.fits - 2047.527 suntest.M.debias.fits
vocl> imarith suntest.R.fits - 2048.317 suntest.R.debias.fits

DAYMULT:

ut011314.0999.short.M.fits 2.391381 0.929156 1.289254

CAMMULT:

ut011314.0999.short.M.fits 1945.0 1024.0 1664.0 1024.0

here is a link to a description of how dcraw handles white balance: http://www.guillermoluijk.com/tutorial/dcraw/index_en.htm

according to that description, the CAMMULT figures correspond to RGBG respectively. Normalizing each of these to G=1 gives RGB values of 

DAYMULT    2.5737 1 1.3876

CAMMULT   1.8994 1 1.625

take a look at an image:

mdcraw  -v suntest.cr2

Loading Canon EOS 5D Mark III image from suntest.cr2 ...

Scaling with darkness 0, saturation 15600, and

multipliers 2.573713 1.000000 1.387554 1.000000

so it seems to be using the DAYMULT numbers for scaling. But then if we do 

 

mdcraw  -v -D suntest.cr2

Loading Canon EOS 5D Mark III image from suntest.cr2 ...

Building histograms...

Writing data to suntest.pgm ...

which looks like it just takes the raw unscaled values, as expected. So I think the resolution here is that the dcraw process is doing the right thing, but when a .cr2 image is displayed with some tool on the MAC, the white balance is adjusted according to some metadata in the image header. 

note added later:

Duh, should have stopped down the aperture on the lens! That would have allowed a picture of the sun that was not saturated. Good thing to do tomorrow. 

command to set aperture is 

gphoto2 --set-config aperture=2.8

Abs mag of the sun, from http://mips.as.arizona.edu/~cnaw/sun.html

B=5.45

V=4.80

R=4.46

I=4.11

so solar colors are

B-V=5.45 - 4.80=0.65

V-R=4.80 - 4.46=0.34

B-R=5.45 - 4.46=0.99

 


Stellar locus calibration!

Did SIMBAD query for all objects with dec < 30 and Rmag < 10. This finds stars with BVR magnitudes. Got about 15,000 sources, listed here

BVR.dat

with the following format:

christophers-MacBook-Pro-2:analysisrefs cstubbs$ more BVR.dat

C.D.S.  -  SIMBAD4 rel 1.211  -  2014.01.14EST13:33:01

 

dec < 30 & Rmag < 10

--------------------

 

Number of objects : 15068

 

  #  |           identifier            |typ| coord1 (ICRS,J2000/2000)  |Mag B |Mag V |Mag R |Mag I |Mag u |Mag g |Mag r |Mag i |Mag z 

-----|---------------------------------|---|---------------------------|------|------|------|------|------|------|------|------|------

1    |LTT 10989                        |PM*|045.60844298 +26.60923785  | 7.328| 6.624| 6.2  | 5.8  |     ~|     ~|     ~|     ~|     ~

2    |HD 19445                         |V* |047.10662340 +26.33094325  | 8.51 | 8.05 | 7.8  | 7.6  |     ~|     ~|     ~|     ~|     ~

3    |TYC 1782-1071-1                  |*  |045.254337 +23.292858      |12.39 |10.38 | 9.858|     ~|     ~|     ~|     ~|     ~|     ~

4    |BD+21 418                        |TT?|047.80767098 +22.41586260  | 9.14 | 8.51 | 8.61 |     ~|     ~|     ~|     ~|     ~|     ~

5    |BD+17 499                        |PM*|047.007371 +18.296564      | 9.96 | 8.992| 8.4  | 8.0  |     ~|     ~|     ~|     ~|     ~

6    |HD 19617                         |PM*|047.54126726 +18.34556259  | 9.38 | 8.718| 8.3  | 8.0  |     ~|     ~|     ~|     ~|     ~

7    |BD+17 483                        |PM*|046.176113 +17.902456      |10.40 | 9.77 | 9.4  | 9.1  |     ~|     ~|     ~|     ~|     ~

8    |HD 18783                         |PM*|045.46079809 +16.51803451  | 8.726| 8.25 | 8.0  | 7.7  |     ~|     ~|     ~|     ~|     ~

9    |LTT 11022                        |PM*|047.18460936 +15.33482953  | 8.460| 7.840| 7.4  | 7.1  |     ~|     ~|     ~|     ~|     ~

10   |G 79-4                           |PM*|047.49862758 +15.37323859  | 9.89 | 9.05 | 8.6  | 8.2  |     ~|     ~|     ~|     ~|     ~

11   |BD+12 444                        |PM*|047.088179 +13.293681      |10.16 | 9.426| 9.0  | 8.6  |     ~|     ~|     ~|     ~|     ~

pulled out BVR photometry using

awk 'FS="|" {print $4,$5,$6,$7}' BVR.dat | grep -v '~' > BVRphot.dat

Made a plot of V-R vs. B-V to find stellar locus. Worked best if limited to stars brighter than V=8, and after excising outliers:

so we expect the brighter stars to lie on line with the bluest object having B-V=V-R~0 and satisfying (V-R)=0.58*(B-V)+0.03

Making the following association: B is B_camera, V is G_camera, R is R_camera

night of ut011314 was photometric, and images around sequence number 806 have no moon. So let's do forced photometry on image ut011314.0806, long exposure.

 

cp65239:calib cstubbs$ cr2fits -bw ut011314.0806.long.cr2 

RawSize= 5920 x 3950 Bias=  2047.33 Noise=     6.91

ut011314.0806.long.cr2 -> ./ut011314.0806.long.fits

cp65239:calib cstubbs$ mv ut011314.0806.long.fits ut011314.0806.long.M.fits

cp65239:calib cstubbs$ tphot ut011314.0806.long.M.fits -bias 2047.33 -chin 3 > 806.M.phot

cp65239:calib cstubbs$ wc *.phot

    3999   55987  451887 806.M.phot

now take the 500 brightest objects and make a list of centroids

cp65239:calib cstubbs$ sort -k 8 -n -r 806.M.phot | head -500 | awk '{print $1, $2}' > 806.centroids

make G band image:

cp65239:calib cstubbs$ cr2fits -g ut011314.0806.long.cr2 

RawSize= 5920 x 3950 Bias=  2047.65 Noise=     9.73

ut011314.0806.long.cr2 -> ./ut011314.0806.long.fits

cp65239:calib cstubbs$ mv ut011314.0806.long.fits ut011314.0806.long.G.fits

cp65239:calib cstubbs$ cr2fits -b ut011314.0806.long.cr2 

RawSize= 5920 x 3950 Bias=  2047.15 Noise=    13.55

ut011314.0806.long.cr2 -> ./ut011314.0806.long.fits

cp65239:calib cstubbs$ mv ut011314.0806.long.fits ut011314.0806.long.B.fits

this seems to give better photometry results:

cp65239:calib cstubbs$ tphot ut011314.0806.long.M.fits -bias 2047.33 -chin 1000 -snr 1 -fwmin 1.0 -fwmax 4.0 -min 20 > 806.M.phot

Well... decided to use source extractor instead, and ran colmerge on the results. Got the following color-color diagram, which is clearly wrong:

Since we suspect an error in the generation of the BVR fits files, take a crack at color validation with polychromatic kleenex box.

  1. stop down the aperture.

     

    2. take test image at 1/8000

    server:~ christopherstubbs$ gphoto2 --set-config aperture=5.6

    server:~ christopherstubbs$ gphoto2 --set-config=/main/capturesettings/shutterspeed=1/8000

    server:~ christopherstubbs$ gphoto2 --capture-image-and-download --filename ut011414.colortest.cr2

    worked!

    did 5 pixel boxcar smoothing, pixel values at center of color panels

panelB frame(Panel_B-Black)/(white-black)G frame(panel_G-black)/(white-black)R frame(panel_R-black)/(white-black)
top, white4750(4750-2519)/(4750-2519)=13580147261
2, yellow41000.70730000.53841340.733
3, light blue34900.43528900.45134870.441
4, green30640.24424500.10030900.262
5, pink28080.12927800.36328020.132
6, red27700.11226400.35527600.113
7, dark blue26400.05424800.25226500.063
8, black251902324025100

 

Ok, so the B and R frames have essentially identical spectral sensitivity, which isn't right. This explains why the sky brightness is the same in both bands! Clearly the generation of the multi band fits files is screwed up somehow. 

Ran cr2fits with rggb option, which makes a multi-extension fits file with 4 planes. I think the designations for the options are wrong, and that -b and r options actually pull out the two green bands, which is why we see things that are really really similar but not identical. From a quick inspection it looks like planes 1 and 4 are the same, so they are presumably the green channels. 

It looks like plane 3 is the red channel, so that means number 2 should be the blue channel. The canon2fits.c code assumes 

channel    color

1             R

2             G1

3             G2

4             B

whereas I think it's

1            G1

2            B

3            R

4            G2

Will email JT and tell him. In the meantime let's do a workaround. If you request r you get g1. If you request b you get g2. If you request g1 you get b. if you request g2 you get r. Changed the makefits.sh script to circumvent this issue, and to create the appropriate files in the appropriate directories. 

Note the monochrome image does not have quite the correct weighting for rggb planes, but we'll go with that for now. 

Jan 15, 2014

Have run data from ut011414 through revised FITS file generation. Seems more sensible now. Used colmerge to obtain joint photometry for stars in frame ut011414.0200. Resulting data file is BVR.cleaned.phot. The BVR photometry from Simbad data are in SimbadBVR.dat

Here is plot of B-R vs. B-V for Canon

and similar for Simbad:
Canon fit gives B-R=0.83*B-V-1.6
Simbad fit gives B-R=1.5*B-V + 0

  


Jan 15 2014.

Took some test images of the sun with stopped down f=22 and 1/8000 shutter speed. It seems the sun does not saturate in this configuration. Set up a new script, daycals.sh, that takes sun images with 10 minute separation using these settings. Nope, core of sun is saturated. Need to bring mylar film next time. 

photometric calibration using frame ut011314.0360.long, for which we have a WCS solution. Sticking to stars near the center, found two objects by hand that seem to correspond to SIMBAD catalog. 

RADECxyBVRimexam flux Bimexam flux V=Gimexam flux R

096.1828

-28.780

14579236.996.376.2433822=-11.3228894=-11.1513108=-10.3

110.3118

-29.29997

1159947

6.75

11.2

9.50

35362=-11.3734134=-11.3321982=-10.8

 

The second star's colors are totally nuts. I'm going to base the initial calibration on the the first object only, which (ignoring color terms) implies

Bmag(Vega)=-2.5*log_10(Bflux)+18.3

Vmag(Vega)=-2.5*log_10(Gflux)+17.5

Rmag(Vega)=-2.5*log_10(Rflux)+16.5

(Note I also fixed an error in using log() in Matlab instead of log10()) 

Now a plot of B-R vs. B-V for our photometry looks like this:

 


May 17 2014. 

have obtained 2 inch square SDSS band filters from Astrodon, we can use these to establish color terms and sensitivity for Canon bands. These are what Astrodon calls SDSS gen 1 filters. I'm guessing the two coating run numbers pertain to front side and back side. 

bandnamecoating run
g'Sloan 49.7 mm SQ g'2102-17024/17026
r'Sloan 49.7 mm SQ r'2104-05534/2104-05541
i'Sloan 49.7 mm SQ i'2104-04092/2104-04097
z'Sloan 49.7 mm SQ z'2103-03565 2103-03869

We have the ones listed in "Astrodon" column below, not the last column. These are the 50% transmission points:

specs:

 

 

These mount nicely into Edmund Optics 2 inch square mounting rings for use on camera lenses: Edmund part number 59-445 which has 52mm threads. 

Found a useful article in PASP that converts from Tycho magnitudes (from the Hipparcos satellite) into g'r'i'z' magnitudes. Ofek PASP 120, 1128 (2008). Pulled down his photometric catalog, that uses template SED's in conjunction with 2MASS magnitudes, but ignores Galactic extinction. So this is best used at high Galactic latitudes. Pulled down catalog from Vizier, selected out VT<8 sources. It turns out to be easier to use bar-separated file since some entries are missing for some sources. 

#

#   VizieR Astronomical Server vizier.cfa.harvard.edu

#    Date: 2014-05-18T15:03:28 [V1.99+ (14-Oct-2013)]

#   In case of problem, please report to:	cds-question@unistra.fr

#

#

#Coosys	J2000:	eq_FK5 J2000

#INFO	votable-version=1.99+ (14-Oct-2013)	

#INFO	-ref=VIZ5378c968086b	

#INFO	-out.max=unlimited	

#INFO	queryParameters=38	

#-oc.form=dec

#-nav=cat:J/PASP/120/1128&tab:{J/PASP/120/1128/catalog}&key:source=J/PASP/120/1128&HTTPPRM:&&-ref=VIZ5378c968086b&-out.all=1&-oc.form=dec&-c.r=  2&-c.geom=r&-order=I&-out=recno&-out=ok&-out=BTmag&-out=e_BTmag&-out=VTmag&-out=e_VTmag&-out=Jmag&-out=e_Jmag&-out=Hmag&-out=e_Hmag&-out=Kmag&-out.all=1&-out=e_Kmag&-out=T2M&-ignore=T2M=*&T2M=T2M&-out=rmsTem&-out=minRMS&-out=gmag&-out=rmag&-out=imag&-out=zmag&-out=chiTem&-out=minChi&-out=2gmag&-out=2rmag&-out=2imag&-out=2zmag&-out=RAJ2000&-out=DEJ2000&-out.all=1&-file=-sort&-meta.ucd=2&-meta=1&-meta.foot=1&-usenav=1&-bmark=POST&-out.max=unlimited&-out.form=| -Separated-Values&-c.eq=J2000&-c.u=arcmin&

#-c.r=  2

#-c.geom=r

#-source=J/PASP/120/1128/catalog

#-order=I

#-out=recno

#-out=ok

#-out=BTmag

#-out=e_BTmag

#-out=VTmag

#VTmag=<8

#-out=e_VTmag

#-out=Jmag

#-out=e_Jmag

#-out=Hmag

#-out=e_Hmag

#-out=Kmag

#-out=e_Kmag

#-out=T2M

#T2M=T2M

#-out=rmsTem

#-out=minRMS

#-out=gmag

#-out=rmag

#-out=imag

#-out=zmag

#-out=chiTem

#-out=minChi

#-out=2gmag

#-out=2rmag

#-out=2imag

#-out=2zmag

#-out=RAJ2000

#-out=DEJ2000

#-out.max=unlimited

#-c.eq=J2000

#-c.u=arcmin

#




#RESOURCE=yCat_61201128

#Name: J/PASP/120/1128

#Title: Calibrated griz magnitudes of Tycho star (Ofek, 2008)

#Table	J_PASP_120_1128_catalog:

#Name: J/PASP/120/1128/catalog

#Title: Catalog

#Column	recno	(I8)	Record number assigned by the VizieR team. Should Not be used for identification.	[ucd=meta.record]

#Column	ok	(I1)	[0,1] Flag indicating a good standard (1)	[ucd=meta.code]

#Column	BTmag	(F5.2)	BT magnitude	[ucd=phot.mag;em.opt.B]

#Column	e_BTmag	(F5.2)	BT magnitude error	[ucd=stat.error;phot.mag;em.opt.B]

#Column	VTmag	(F5.2)	VT magnitude	[ucd=phot.mag;em.opt.V]

#Column	e_VTmag	(F5.2)	VT magnitude error	[ucd=stat.error;phot.mag;em.opt.V]

#Column	Jmag	(F5.2)	? J magnitude	[ucd=phot.mag;em.IR.J]

#Column	e_Jmag	(F5.2)	? J magnitude error (2)	[ucd=stat.error;phot.mag;em.IR.J]

#Column	Hmag	(F5.2)	? H magnitude	[ucd=phot.mag;em.IR.H]

#Column	e_Hmag	(F5.2)	? H magnitude error (2)	[ucd=stat.error;phot.mag;em.IR.H]

#Column	Kmag	(F5.2)	? K magnitude	[ucd=phot.mag;em.IR.K]

#Column	e_Kmag	(F5.2)	? K magnitude error (2)	[ucd=stat.error;phot.mag;em.IR.K]

#Column	T2M	(A3)	Tycho (Cat. I/259) and 2MASS (Cat. II/246) data	[ucd=meta.ref.url]

#Column	rmsTem	(a8)	Best rms-fit spectral template \linkRole{corresponding synthetic spectrum from Pickes 1998, Cat. J/PASP/110/863} (3)	[ucd=meta.id;stat.fit]

#Column	minRMS	(F5.2)	? the rms for the best rms-fit template	[ucd=stat.stdev;phot.mag;meta.modelled]

#Column	gmag	(F5.2)	? rms-fit g-band magnitude (0.06 magnitude already added)	[ucd=phot.mag;em.opt.B]

#Column	rmag	(F5.2)	? rms-fit r-band magnitude (0.04 magnitude already added)	[ucd=phot.mag;em.opt.R]

#Column	imag	(F5.2)	? rms-fit i-band magnitude (0.03 magnitude already added)	[ucd=phot.mag;em.opt.I]

#Column	zmag	(F5.2)	? rms-fit z-band magnitude (0.03 magnitude already added)	[ucd=phot.mag;em.opt.I]

#Column	chiTem	(a8)	Best {chi}^2^-fit spectral template \linkRole{corresponding synthetic spectrum from Pickes 1998, Cat. J/PASP/110/863} (3)	[ucd=meta.id;stat.fit]

#Column	minChi	(F8.2)	? the {chi}^2^ for the best {chi}^2^-fit template (dof=4)	[ucd=stat.fit.chi2]

#Column	2gmag	(F5.2)	? {chi}^2^-fit g-band magnitude (0.07 magnitude already added)	[ucd=stat.fit.chi2]

#Column	2rmag	(F5.2)	? {chi}^2^-fit r-band magnitude (0.04 magnitude already added)	[ucd=stat.fit.chi2]

#Column	2imag	(F5.2)	? {chi}^2^-fit i-band magnitude (0.04 magnitude already added)	[ucd=stat.fit.chi2]

#Column	2zmag	(F5.2)	? {chi}^2^-fit z-band magnitude (0.03 magnitude already added)	[ucd=stat.fit.chi2]

#Column	RAJ2000	(F9.5)	Right Ascension J2000.0	[ucd=pos.eq.ra;meta.main]

#Column	DEJ2000	(F9.5)	Declination J2000.0	[ucd=pos.eq.dec;meta.main]

recno|ok|BTmag|e_BTmag|VTmag|e_VTmag|Jmag|e_Jmag|Hmag|e_Hmag|Kmag|e_Kmag|T2M|rmsTem|minRMS|gmag|rmag|imag|zmag|chiTem|minChi|2gmag|2rmag|2imag|2zmag|RAJ2000|DEJ2000

 | |mag|mag|mag|mag|mag|mag|mag|mag|mag|mag| | |mag|mag|mag|mag|mag| | |mag|mag|mag|mag|deg|deg

--------|-|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|---|--------|-----|-----|-----|-----|-----|--------|--------|-----|-----|-----|-----|---------|---------

       3|1| 7.96| 0.02| 7.83| 0.01| 7.58| 0.03| 7.60| 0.04| 7.55| 0.02|T2M|uka2i   | 0.06| 7.89| 7.97| 8.11| 8.22|uka2i   |   20.92| 7.90| 7.97| 8.12| 8.22|149.15626|-89.78243

       4|0| 9.08| 0.02| 7.06| 0.01| 2.65| 0.28| 1.80| 0.25| 1.49| 0.31|T2M|ukm4v   | 0.12| 7.92| 6.49| 5.37| 4.79|ukm3ii  |   15.76| 7.81| 6.36| 5.26| 4.66|218.87308|-89.77172

      22|0| 9.40| 0.02| 7.39| 0.01| 4.04| 0.29| 3.04| 0.26| 2.80| 0.24|T2M|ukm2i   | 0.12| 8.14| 6.63| 5.58| 5.04|ukm2i   |    9.95| 8.15| 6.63| 5.59| 5.04|130.52314|-89.46054

      31|1| 8.30| 0.02| 7.87| 0.01| 7.09| 0.03| 6.98| 0.06| 6.89| 0.02|T2M|ukf2iii | 0.04| 8.02| 7.78| 7.77| 7.79|ukf2iii |   19.16| 8.03| 7.78| 7.78| 7.79|241.47612|-89.30855

      40|1| 7.94| 0.02| 7.58| 0.01| 6.81| 0.03| 6.71| 0.03| 6.62| 0.02|T2M|ukf2iii | 0.05| 7.73| 7.49| 7.48| 7.50|ukf2iii |   35.51| 7.74| 7.49| 7.49| 7.50|165.94157|-89.23914

      78|0| 5.77| 0.01| 5.47| 0.01| 4.73| 0.18| 4.76| 0.01| 4.67| 0.01|T2M|ukf5i   | 0.05| 5.67| 5.55| 5.55| 5.64|ukf0v   |   23.96| 5.61| 5.48| 5.49| 5.57|317.19522|-88.95650

     111|0| 6.90| 0.01| 6.58| 0.01| 5.96| 0.02| 5.89| 0.03| 5.82| 0.03|T2M|ukf0v   | 0.03| 6.70| 6.58| 6.58| 6.67|ukf0v   |    6.82| 6.71| 6.58| 6.59| 6.67|341.37590|-88.81829

     128|1| 7.33| 0.01| 7.35| 0.01| 7.38| 0.02| 7.44| 0.04| 7.41| 0.02|T2M|ukb8i   | 0.02| 7.34| 7.57| 7.73| 7.84|ukb8i   |    5.32| 7.35| 7.57| 7.74| 7.84|096.69657|-88.74369

     153|0| 9.58| 0.02| 7.73| 0.01| 5.05| 0.29| 4.12| 0.23| 3.96| 0.27|T2M|ukk5iii | 0.09| 8.45| 7.15| 6.59| 6.28|ukrk5iii|    8.96| 8.42| 7.11| 6.56| 6.24|235.02245|-88.65463

     225|1| 6.54| 0.01| 6.61| 0.01| 6.64| 0.01| 6.74| 0.03| 6.70| 0.02|T2M|ukb9v   | 0.04| 6.54| 6.77| 6.93| 7.05|ukb8i   |   29.45| 6.60| 6.82| 6.99| 7.10|184.69194|-88.41492

     242|1| 7.28| 0.01| 7.21| 0.01| 6.94| 0.01| 6.94| 0.04| 6.92| 0.03|T2M|uka2i   | 0.06| 7.23| 7.31| 7.44| 7.56|uka2i   |   35.98| 7.24| 7.31| 7.45| 7.56|003.14142|-88.36287

     270|0| 9.37| 0.02| 7.38| 0.01| 3.45| 0.24| 2.50| 0.20| 2.17| 0.23|T2M|ukm3ii  | 0.03| 8.11| 6.68| 5.56| 4.98|ukm3ii  |    3.10| 8.12| 6.68| 5.57| 4.98|072.26067|-88.27116

     317|0| 6.83| 0.01| 6.52| 0.01| 5.95| 0.02| 5.86| 0.03| 5.77| 0.02|T2M|ukf0v   | 0.04| 6.64| 6.52| 6.53| 6.61|ukf0v   |   10.13| 6.65| 6.52| 6.54| 6.61|232.07939|-88.13301


 

To access columns from this photometry data file, do

awk -F "|" '{print $26, $27}' Tycho_SDSS_bright.barsep.dat > brightcoords.dat