;pro Generate_Single_Read_Jpeg
;
;PURPOSE:
;	To produce a 768x768 jpeg of a single read frame for whatever purpose
;
pro Generate_Single_Read_Jpeg, FileName, ReadNum = ReadNum, $
	RootDir=RootDir, Date=Date, $
        ReducedDir = ReducedDir, BlockLength = BlockLength, $
        ObjectName=ObjectName, NReads = NReads, ThisFilter = ThisFilter,$
        OverRide = OverRide, Rem60Hz = Rem60Hz, TvFlag = TvFlag, $
        BiasSub = BiasSub, SubtractDark = SubtractDark, $
        ThisNDrops = ThisNDrops


;Make the Common Block
Common KeyParams, KeyStr

;Include all the keywords from the KeywordStruct.pro file
@KeywordStruct.pro
@PlotSettings.pro

KeyStr.RawName = FileName
Fits_Read, KeyStr.RawName, NoData, FitsHeader, /header_only
FileParams = Return_File_Params(FitsHeader)

Fits_Read_DataCube, KeyStr.RawName, Im, FitsHeader, ZStart = ReadNum, ZStop = ReadNum

;Write a .jpeg file with this read
Write_Jpeg, KeyStr.ObjectDir+KeyStr.RawKey+'ReadNumber'+Strtrim(ReadNum,2)+$
	'.jpeg', Congrid(bytscl(Im), 768, 768), Quality = 100

stop
end
