pro make_all_months_all,stdte,endte
;
;+
; NAME:
;	MAKE_ALL_MONTHS
;
; PURPOSE:
;	Pipeline wrapper for make_all_months.pro which is an easy interface to the MK_MONTHLY_MIN procedure
;   	Does C2 and C3, ROlled and Unrolled, current and ANY_YEAR
;
; CATEGORY:
;	LASCO SYNOPTIC pipeline
;
; CALLING SEQUENCE:
;	MAKE_ALL_MONTHS_all,Stdte,Endte
;
; INPUTS:
;	Stdte:	The starting date specified as a string: YYMMDD, eg. 960601
;	Endte:	The ending date specified as a string: YYMMDD, eg, 960630
;
; OUTPUTS:
;	"Monthly" minimum FITS files in $MONTHLY_IMAGES; filenames have dates 
;	corresponding to 3m_clcl_xx'*'.fts
;	Logs written in $MONTHLY_IMAGES/logs
;
; KEYWORDS:
;
; RESTRICTIONS:
;	
;	
; PROCEDURE:
;
; MODIFICATION HISTORY:
;
;      %W% %H%   LASCO IDL LIBRARY
;
;-
;
yy =  FIX(STRMID(stdte,0,2))
IF (yy EQ 19) or yy EQ 20 THEN BEGIN
   st = str2utc(stdte)
   en = str2utc(endte)
ENDIF ELSE BEGIN
   st = yymmdd2utc(stdte)
   en = yymmdd2utc(endte)
ENDELSE
;
;  Convert the date strings to modified julian dates
;
jd = st
;jdstart = nbetween*((jd.mjd+nbetween)/nbetween)
jdstart = st.mjd
jdend = en.mjd

; dates from 3m_clcl_xx*.fts

xxlist=['0107', '0114', '0121', '0128', '0204', '0211', $
'0218', '0225', '0304', '0311', '0318', '0325', $
'0401', '0408', '0415', '0422', '0429', '0506', $
'0513', '0520', '0527', '0603', '0610', '0617', $
'0624', '0702', '0709', '0716', '0723', '0730', $
'0806', '0813', '0820', '0827', '0903', '0910', $
'0917', '0924', '1001', '1008', '1015', '1022', $
'1029', '1105', '1112', '1119', '1126', '1203', $
'1210', '1217', '1224', '1231']

FOR i=jdstart,jdend,nbetween DO BEGIN
    jd.mjd = i
    yymmdd = utc2yymmdd(jd)
    mmdd = STRMID(yymmdd,2,4)
    IF NOT (keyword_set(INTERVAL) OR keyword_set(MANUAL)) THEN duh = WHERE(xxlist EQ mmdd,inlist) ELSE inlist=1
    print,i,'  ',yymmdd,inlist
    IF inlist THEN $
    MK_MONTHLY_MIN,tel,yymmdd, filpol, ALL_YEARS=all_years, NDAYS=ndays, NOREBIN=norebin, ROLLED=rolled, TEST=test
ENDFOR
RETURN
END
