From 7b51a22eaa44adcdbcb676e55db57aee4ec40b8c Mon Sep 17 00:00:00 2001 From: Sean-Morrison Date: Fri, 14 Jan 2022 16:33:42 -0700 Subject: [PATCH] FPS Updates --- bin/plot_sdss_sky | 36 ++++++--- bin/run_PyXCSAO.py | 25 +++--- pro/fpsconfig/field_to_string.pro | 10 +-- pro/rm/rm_combine_script.pro | 2 +- pro/rm/rm_spcoadd_v5.pro | 5 +- pro/rm/rm_spcombine_v5.pro | 4 +- pro/rm/spreduce1d_empca.pro | 7 +- pro/spec1d/conflist.pro | 25 +++++- pro/spec1d/fieldmerge.pro | 18 +++-- pro/spec1d/plate_spec_image.pro | 19 +++-- pro/spec1d/readspec.pro | 3 +- pro/spec1d/reformat_spec.pro | 36 +++++---- pro/spec2d/chunkinfo.pro | 6 +- pro/spec2d/sdsshead.pro | 4 +- pro/spec2d/sdssproc.pro | 4 +- pro/spec2d/spadd_guiderinfo.pro | 128 +++++++++++++++++++----------- pro/spec2d/sphdrfix.pro | 8 +- pro/spec2d/spplan1d.pro | 37 +++++++-- pro/spec2d/spplan2d.pro | 27 ++++--- pro/spec2d/spplan_findrawdata.pro | 3 +- pro/spec2d/spreduce.pro | 5 +- pro/spec2d/spreduce2d.pro | 2 +- pro/spec2d/trace320crude.pro | 1 - pro/spec2d/uubatchpbs.pro | 2 + 24 files changed, 274 insertions(+), 143 deletions(-) diff --git a/bin/plot_sdss_sky b/bin/plot_sdss_sky index c2b1f3f62..2f4c22b4e 100755 --- a/bin/plot_sdss_sky +++ b/bin/plot_sdss_sky @@ -7,6 +7,7 @@ from matplotlib import pyplot as plt from astropy.visualization import hist from astropy.io import fits as pyf import os +from astropy.table import Table matplotlib.style.use('default') import warnings warnings.filterwarnings("ignore") @@ -17,13 +18,14 @@ run2d = os.getenv('RUN2D') redux = os.getenv('BOSS_SPECTRO_REDUX') file_c=redux+'/'+run2d+'/fieldlist-'+run2d+'.fits' -hdu_list = pyf.open(file_c) -table_hdu = hdu_list[1] -table_data = table_hdu.data +if os.path.exists(file_c): + hdu_list = pyf.open(file_c) + table_hdu = hdu_list[1] + table_data = table_hdu.data +else: table_data=Table(names=('RACEN','DECCEN', 'PROGRAMNAME')) RA=table_data.field('RACEN') DEC=table_data.field('DECCEN') prog=table_data.field('PROGRAMNAME') - PROG_N=np.zeros(len(prog)) PROG_C=[] for i in range(0, len(prog)): @@ -48,7 +50,9 @@ for i in range(0, len(prog)): elif 'OFFSET' in prog[i]: PROG_N[i]=7.0 PROG_C.extend(['black']) - + else: + PROG_N[i]=0.0 + PROG_C.extend(['saddlebrown']) PROG_C=np.array(PROG_C) @@ -58,6 +62,8 @@ c3=0 c4=0 c5=0 c6=0 +c7=0 +c0=0 # convert coordinates to degrees RA *= np.pi / 180 @@ -92,6 +98,8 @@ for i in range(0, len(RA)): elif PROG_C[i] == 'green' and c6== 0: ax.plot(x, y, color=PROG_C[i],label='eFEDS') c6=1 + elif PROG_C[i] == 'black' and c7==0: + ax.plot(x, y, color=PROG_C[i],label='Offset') else: ax.plot(x, y, color=PROG_C[i]) plt.legend(loc=1,fontsize=10) @@ -106,6 +114,9 @@ c2=0 c3=0 c4=0 c5=0 +c6=0 +c7=0 +c0=0 fig, ax = plt.subplots(figsize=(9.5*1.0,5.5*1.0)) ax = plt.axes(projection='mollweide') @@ -131,12 +142,15 @@ for i in range(0, len(RA)): elif PROG_C[i] == 'orange' and c4== 0: ax.plot(x, y, color=PROG_C[i],label='AQMES-Wide') c4=1 - elif PROG_C[i] == 'magenta' and c4== 0: + elif PROG_C[i] == 'magenta' and c5== 0: ax.plot(x, y, color=PROG_C[i],label='AQMES-Bonus') c5=1 - elif PROG_C[i] == 'green' and c5== 0: + elif PROG_C[i] == 'green' and c6== 0: ax.plot(x, y, color=PROG_C[i],label='eFEDS') c6=1 + elif PROG_C[i] == 'black' and c7== 0: + ax.plot(x, y, color=PROG_C[i],label='eFEDS') + c7=1 else: ax.plot(x, y, color=PROG_C[i]) plt.legend(loc=1,fontsize=10) @@ -147,9 +161,11 @@ plt.savefig(redux+'/'+run2d+'/SDSSV.png',dpi=500) plt.close() file_c=redux+'/'+run2d+'/spAll-'+run2d.replace('/','-')+'.fits' -hdu_list = pyf.open(file_c) -table_hdu = hdu_list[1] -table_data = table_hdu.data +if os.path.exists(file_c): + hdu_list = pyf.open(file_c) + table_hdu = hdu_list[1] + table_data = table_hdu.data +else: table_data=Table(names=('PLUG_RA','PLUG_DEC', 'PROGRAMNAME','NSPECOBS')) RA1=table_data.field('PLUG_RA') DEC1=table_data.field('PLUG_DEC') prog1=table_data.field('PROGRAMNAME') diff --git a/bin/run_PyXCSAO.py b/bin/run_PyXCSAO.py index c6bb93266..a46a5b167 100755 --- a/bin/run_PyXCSAO.py +++ b/bin/run_PyXCSAO.py @@ -53,8 +53,10 @@ def get_fiber(flux, PlugMap, hdr, i): #meta['objid']=PlugMap['OBJID'][i] meta['program']=PlugMap['PROGRAM'][i] meta['objtype']=PlugMap['OBJTYPE'][i] - meta['SOURCETYPE']=PlugMap['SOURCETYPE'][i] - + if 'SOURCETYPE' in hdr:meta['SOURCETYPE']=PlugMap['SOURCETYPE'][i] + elif 'CATEGORY' in hdr:meta['SOURCETYPE']=PlugMap['CATEGORY'][i] + else:meta['SOURCETYPE']=PlugMap['OBJTYPE'][i] + if 'PLATEID' in hdr: meta['FIELDID']=hdr['PLATEID'] elif 'FIELDID' in hdr: meta['FIELDID']=hdr['FIELDID'] else: meta['FIELDID']=np.nan @@ -77,9 +79,15 @@ def get_fiber(flux, PlugMap, hdr, i): meta['sdss_r']=PlugMap['MAG'][i][2] meta['sdss_i']=PlugMap['MAG'][i][3] meta['sdss_z']=PlugMap['MAG'][i][4] - meta['gaia_G']=PlugMap['GAIA_G'][i] - meta['BP']=PlugMap['GAIA_BP'][i] - meta['RP']=PlugMap['GAIA_RP'][i] + if 'GAIA_G' in hdr:meta['gaia_G']=PlugMap['GAIA_G'][i] + elif 'GAIA_G_MAG' in hdr:meta['gaia_G']=PlugMap['GAIA_G_MAG'][i] + else: meta['gaia_G']=np.NaN + if 'GAIA_BP' in hdr:meta['BP']=PlugMap['GAIA_BP'][i] + elif 'BP_MAG' in hdr:meta['BP']=PlugMap['BP_MAG'][i] + else: meta['BP']=np.NaN + if 'GAIA_RP' in hdr:meta['RP']=PlugMap['GAIA_RP'][i] + elif 'RP_MAG' in hdr:meta['RP']=PlugMap['RP_MAG'][i] + else: meta['RP']=np.NaN meta['J']=PlugMap['TWOMASS_MAG'][i][0] meta['H']=PlugMap['TWOMASS_MAG'][i][1] meta['K']=PlugMap['TWOMASS_MAG'][i][2] @@ -97,8 +105,7 @@ def get_fiber(flux, PlugMap, hdr, i): default=os.getenv('RUN1D')) args = parser.parse_args() - platemjd=os.path.basename(args.fitsfile)[8:19] - + platemjd='-'.join(os.path.basename(args.fitsfile).split('-')[1:]).split('.')[0] # Open a file with access mode 'a' logfile = args.run1d+'/spXCSAO-' + platemjd + '.log' @@ -112,7 +119,7 @@ def get_fiber(flux, PlugMap, hdr, i): splog.write('idlutils version ' + os.popen('idlutils_version').read()) splog.write('Python version ' + python_version()) try: - #splog.write('pyxcsao version ' + pyxcsao.__path__[0].split('/')[-2][:-4]) + #splog.write('pyxcsao version ' + pyxcsao.__path__[0].split('/')[-2][:-4]) splog.write('pyxcsao version ' +os.getenv('PYXCSAO_VER')) c=PyXCSAO(st_lambda=5000,end_lambda=10000) templates=os.getenv('PYXCSAO_DIR')+'/../grids/phoenix_full1.p' @@ -137,5 +144,5 @@ def get_fiber(flux, PlugMap, hdr, i): test.write(args.run1d+'/spXCSAO-' + platemjd + '.fits',overwrite=True) splog.write('CPU time to compute RVs = '+ str(datetime.now()-t0)) - except: splog.write('WARNING: Python package pyxcsao not installed\n') + except: splog.write('WARNING: Failed run of pyXCSAO\n') splog.close() diff --git a/pro/fpsconfig/field_to_string.pro b/pro/fpsconfig/field_to_string.pro index 7908c00d9..342dff088 100644 --- a/pro/fpsconfig/field_to_string.pro +++ b/pro/fpsconfig/field_to_string.pro @@ -5,10 +5,10 @@ function field_to_string, field for i=0, n_elements(field)-1 do sfield[i] = field_to_string(field[i]) return, sfield endif - - if field lt 10000 then $ - return, strtrim(string(field,f='(i5.5)'),2) $ - else $ - return, strtrim(field,2) + return, strtrim(string(field,f='(i6.6)'),2) + ;if field lt 10000 then $ + ; return, strtrim(string(field,f='(i6.6)'),2) $ + ;else $ + ; return, strtrim(field,2) end diff --git a/pro/rm/rm_combine_script.pro b/pro/rm/rm_combine_script.pro index f752f1966..a5469482d 100644 --- a/pro/rm/rm_combine_script.pro +++ b/pro/rm/rm_combine_script.pro @@ -14,7 +14,7 @@ if keyword_set(legacy) then begin ;fieldstr = strmid(planfile,11,4) fieldstr = strsplit(repstr(repstr(planfile,'spPlancomb',''),'.par', ''),'-',/extract) endif else begin - fieldstr = strmid(planfile,11,5) + fieldstr = (strsplit(repstr(repstr(planfile,'spPlancomb',''),'.par', ''),'-',/extract))[0] endelse if not keyword_set(finaldir) then finaldir = '';'recalib/' ; 'recalib/test20/' diff --git a/pro/rm/rm_spcoadd_v5.pro b/pro/rm/rm_spcoadd_v5.pro index f838df74d..c73c7b031 100644 --- a/pro/rm/rm_spcoadd_v5.pro +++ b/pro/rm/rm_spcoadd_v5.pro @@ -1139,7 +1139,8 @@ pro rm_spcoadd_v5, spframes, outputname, $ ;---------- ; Remove header cards that were specific to this first exposure ; (where we got the header). - sxaddpar, bighdr, 'FIELDID', strmid(outputname,8,5) + sxaddpar, bighdr, 'FIELDID', (strsplit(outputname,'-',/EXTRACT))[1] + ;sxaddpar, bighdr, 'FIELDID', strmid(outputname,8,5) ncoeff = sxpar(bighdr, 'NWORDER') for i=2, ncoeff-1 do sxdelpar, bighdr, 'COEFF'+strtrim(string(i),2) @@ -1474,7 +1475,7 @@ pro rm_spcoadd_v5, spframes, outputname, $ ;coaddname = repstr(repstr(outputname,'spField','spSpec'),'.fits', $ ; '-'+string(itarget,format='(i3.3)')+'.fits') coaddname = repstr(repstr(outputname,'spField','spSpec'),'.fits', $ - '-'+targid_tar+'.fits') + '-'+strtrim(targid_tar,2)+'.fits') fulloutname_coadd = djs_filepath(coaddname, root_dir=coadddir) ; HDU # 0 header mwrfits, junk_d, fulloutname_coadd, bighdr, /create diff --git a/pro/rm/rm_spcombine_v5.pro b/pro/rm/rm_spcombine_v5.pro index 04cd4ecf9..be5dacc88 100644 --- a/pro/rm/rm_spcombine_v5.pro +++ b/pro/rm/rm_spcombine_v5.pro @@ -151,10 +151,10 @@ pro rm_spcombine_v5, planfile, docams=docams, adderr=adderr, xdisplay=xdisplay, if (NOT keyword_set(thismjd)) then $ thismjd = max(allseq.mjd) if keyword_set(legacy) or keyword_set(plates) then begin - fieldmjd = string(yanny_par(hdr,'plateid'),format='(i5.5)') $ + fieldmjd = field_to_string(yanny_par(hdr,'plateid')) $ + '-' + string(thismjd,format='(i5.5)') endif else begin - fieldmjd = string(yanny_par(hdr,'fieldid'),format='(i5.5)') $ + fieldmjd = field_to_string(yanny_par(hdr,'fieldid')) $ + '-' + string(thismjd,format='(i5.5)') endelse for i=0, n_elements(allseq.mjd)-1 do begin diff --git a/pro/rm/spreduce1d_empca.pro b/pro/rm/spreduce1d_empca.pro index d395f433c..388fc626f 100644 --- a/pro/rm/spreduce1d_empca.pro +++ b/pro/rm/spreduce1d_empca.pro @@ -120,8 +120,9 @@ CPU, TPOOL_NTHREADS = 1 ;---------- ; Determine names of output files - - platemjd = strmid(fileandpath(platefile), 8, 11) + platemjd=(strsplit(repstr(platefile,".fits",""), '-',/extract))[1:2] + platemjd=strjoin(platemjd, '-') + ;platemjd = strmid(fileandpath(platefile), 8, 11) if platemjd eq '15013-59165' or platemjd eq '15014-59165' then begin chop_data = [3600., 9000.] splog, 'Setting wavelength coverage as:'+string(chop_data[0])+' to '+string(chop_data[1])+' for plate-mjd '+platemjd @@ -946,7 +947,7 @@ endif endif plottitle = string(zans[0].field, zans[0].mjd, $ - format='("Flux-Calibration Errors Field=", i4, " MJD=", i5)') + format='("Flux-Calibration Errors Field=", i4 ," MJD=", i5)') qaplot_fcalibvec, objloglam, objflux, objivar, synflux, plugmap, zans, $ plottitle=plottitle diff --git a/pro/spec1d/conflist.pro b/pro/spec1d/conflist.pro index 94098fe99..4a269a410 100644 --- a/pro/spec1d/conflist.pro +++ b/pro/spec1d/conflist.pro @@ -635,7 +635,7 @@ pro conflist, plist=plist, create=create, $ 'data' , ' ', $ 'plots' , ' ', $ 'fieldquality' , ' ', $ - 'platesn2' , 0.0, $ + 'fieldsn2' , 0.0, $ 'deredsn2' , 0.0, $ 'qsurvey' , 0L, $ 'mjdlist' , ' ', $ @@ -998,8 +998,13 @@ pro conflist, plist=plist, create=create, $ hdr=hdrcomb,/anonymous))[0].mjd ;if jdtemp ge 59309 and run2d ne 'master' then begin ;if jdtemp ge 59309 then begin - plate_temp = (yanny_readone(combparfile[ifile], 'SPEXP', $ - hdr=hdrcomb,/anonymous))[0].plateid + if keyword_set(plates) then begin + plate_temp = (yanny_readone(combparfile[ifile], 'SPEXP', $ + hdr=hdrcomb,/anonymous))[0].plateid + endif else begin + plate_temp = (yanny_readone(combparfile[ifile], 'SPEXP', $ + hdr=hdrcomb,/anonymous))[0].fieldid + endelse epoch_temp = (yanny_readone(combparfile[ifile], 'SPEXP', $ hdr=hdrcomb,/anonymous))[0].epoch_combine plist[ifile].mapname=strtrim(string(plate_temp),2)+'-'+strtrim(string(epoch_temp),2) @@ -1224,7 +1229,19 @@ pro conflist, plist=plist, create=create, $ plist[ifile].epoch = cinfo.epoch plist[ifile].chunkhtml=''+cinfo.chunk+'' endif else begin - splog, 'Empty or missing platePlans.par file' + if keyword_set(plates) or keyword_set(legacy) then begin + splog, 'Empty or missing platePlans.par file' + endif else begin + splog, 'Empty or missing configPlans.par file' + fibermap='fibermap-'+strtrim(yanny_par(hdrp,'fieldid'),2)+'.fits' + fibermap=djs_filepath(fibermap, root_dir=topdir + '/' + run2d, subdir=field_to_string(yanny_par(hdrp,'fieldid'))) + if FILE_TEST(fibermap) then begin + plughead=headfits(fibermap,EXTEN=1) + plist[ifile].racen = sxpar(plughead,'RACEN') + plist[ifile].deccen = sxpar(plughead,'DECCEN') + ;if strtrim(sxpar(plughead,'OBS'),2) EQ 'APO' + endif else splog, 'Empty or missing fibermap: '+fibermap + endelse endelse ;---------- diff --git a/pro/spec1d/fieldmerge.pro b/pro/spec1d/fieldmerge.pro index e4fb43c66..5b76e406f 100644 --- a/pro/spec1d/fieldmerge.pro +++ b/pro/spec1d/fieldmerge.pro @@ -106,7 +106,7 @@ pro fieldmerge1, field=field, mjd=mjd, except_tags1=except_tags1, $ endif else begin outroot = ['spAll','spAllLine'] if (keyword_set(field) and keyword_set(mjd)) then begin - outroot='spectra/full/'+strtrim(string(field),2)+'/'+strtrim(string(mjd),2)+'/'+outroot+'-'+strtrim(string(field),2)+'-'+strtrim(string(mjd),2) + outroot='spectra/full/'+field_to_string(field)+'/'+strtrim(string(mjd),2)+'/'+outroot+'-'+field_to_string(field)+'-'+strtrim(string(mjd),2) endif else begin if (keyword_set(run2d)) then outroot = outroot + '-' + repstr(run2d,'/','-') endelse @@ -315,10 +315,11 @@ pro fieldmerge1, field=field, mjd=mjd, except_tags1=except_tags1, $ for ifile=0L, nfile-1 do begin print, 'Reading ZANS file ',ifile+1, ' of ', nfile if keyword_set(legacy) or keyword_set(plates) then begin - field_plate=plist[ifile].field + field_plate=field_to_string(plist[ifile].field) endif else begin - field_plate=plist[ifile].field + field_plate=field_to_string(plist[ifile].field) endelse + readspec, field_plate, mjd=plist[ifile].mjd, $ run2d=strtrim(plist[ifile].run2d), run1d=strtrim(plist[ifile].run1d), $ zans=zans, objhdr=objhdr, $ ;; zmanual=zmanual, @@ -475,9 +476,12 @@ pro fieldmerge1, field=field, mjd=mjd, except_tags1=except_tags1, $ ; Get PRIMTARGET+SECTARGET with those values from ; the plug-map structure in spfield file. ; HJIM decoment the next three lines for the final version - outdat[indx].primtarget = plugmap.primtarget - outdat[indx].sectarget = plugmap.sectarget - outdat[indx].lambda_eff = plugmap.lambda_eff + if (tag_exist(plugmap,'primtarget')) then $ + outdat[indx].primtarget = plugmap.primtarget + if (tag_exist(plugmap,'sectarget')) then $ + outdat[indx].sectarget = plugmap.sectarget + if (tag_exist(plugmap,'lambda_eff')) then $ + outdat[indx].lambda_eff = plugmap.lambda_eff if (tag_exist(plugmap,'zoffset')) then $ outdat[indx].zoffset = plugmap.zoffset if (tag_exist(plugmap,'xfocal')) then $ @@ -636,7 +640,7 @@ pro fieldmerge1, field=field, mjd=mjd, except_tags1=except_tags1, $ '-' + string(plugmap[fid].catalogid,format='(i11.11)')+'.fits' endfor endif else begin - if not keyword_keyword_set(legacy) then begin + if not keyword_set(legacy) then begin for fid = 0L, n_elements(zans)-1 do begin healpix_dir_t[fid]=mwm_root + $ strtrim(string(healp[fid].healpixgrp),2) + '/' + $ diff --git a/pro/spec1d/plate_spec_image.pro b/pro/spec1d/plate_spec_image.pro index d500732b4..7277308e8 100644 --- a/pro/spec1d/plate_spec_image.pro +++ b/pro/spec1d/plate_spec_image.pro @@ -78,15 +78,20 @@ for i=0L, n_elements(zans)-1L do begin if keyword_set(legacy) then begin pmjdf= pmjd+'-'+string(f='(i4.4)', fiber) endif else begin - catalogid=plug[i].catalogid - if catalogid eq 0 then begin - pmjdf= pmjd+'-'+string(f='(i11.11)', fiber) - endif else begin - if plug[i].program.contains('offset', /FOLD_CASE ) then begin - pmjdf= pmjd+'-'+strtrim(string(catalogid),1) + if keyword_set(plates) then begin + catalogid=plug[i].catalogid + if catalogid eq 0 then begin + pmjdf= pmjd+'-'+string(f='(i11.11)', fiber) endif else begin - pmjdf= pmjd+'-'+string(f='(i11.11)', catalogid) + if plug[i].program.contains('offset', /FOLD_CASE ) then begin + pmjdf= pmjd+'-'+strtrim(string(catalogid),1) + endif else begin + pmjdf= pmjd+'-'+string(f='(i11.11)', catalogid) + endelse endelse + endif else begin + catalogid=plug[i].catalogid + pmjdf=pmjd+'-'+strtrim(string(catalogid),2) endelse endelse stamp='http://skyserver.sdss.org/dr16/SkyServerWS/ImgCutout/getjpeg?TaskName=Skyserver.Chart.Image&ra='+strtrim(string(f='(f40.5)', ra),2)+'&dec='+strtrim(string(f='(f40.5)', dec),2)+'&scale=0.1&width=512&height=512&opt=G&query=&Grid=on' diff --git a/pro/spec1d/readspec.pro b/pro/spec1d/readspec.pro index 92df2231b..38e6f35b9 100644 --- a/pro/spec1d/readspec.pro +++ b/pro/spec1d/readspec.pro @@ -166,8 +166,9 @@ pro readspec1, plate, rownums, mjd=mjd, flux=flux, flerr=flerr, invvar=invvar, $ align=align, silent=silent, qread=qread, sdss=sdss, unsigned=unsigned, $ legacy=legacy, plates=plates + platestr = field_to_string(plate) ;platestr = plate_to_string(plate) - platestr = string(plate, format='(i5.5)') +; platestr = string(plate, format='(i5.5)') if (NOT keyword_set(mjd)) then mjdstr = '*' $ else mjdstr = string(mjd,format='(i5.5)') if (keyword_set(path)) then begin diff --git a/pro/spec1d/reformat_spec.pro b/pro/spec1d/reformat_spec.pro index 776694528..3350463b5 100644 --- a/pro/spec1d/reformat_spec.pro +++ b/pro/spec1d/reformat_spec.pro @@ -326,7 +326,11 @@ CPU, TPOOL_NTHREADS = 1 return endelse - platemjd = strmid(fileandpath(platefile), 8, 11) + platemjd=(strsplit(repstr(platefile,".fits",""), '-',/extract))[1:2] + fieldid=platemjd[0] + thismjd=platemjd[1] + platemjd=strjoin(platemjd, '-') + ;platemjd = strmid(fileandpath(platefile), 8, 11) zallfile = djs_filepath('spZall-' + platemjd + '.fits', root_dir=run1d) zbestfile = djs_filepath('spZbest-' + platemjd + '.fits', root_dir=run1d) zlinefile = djs_filepath('spZline-' + platemjd + '.fits', root_dir=run1d) @@ -341,15 +345,15 @@ CPU, TPOOL_NTHREADS = 1 endif splog,'Writing the final output files' - - plugmap = mrdfits(platefile,5) - zall = mrdfits(zallfile,1) - zbest = mrdfits(zbestfile,1) - zline = mrdfits(zlinefile,1) - zmodel = mrdfits(zbestfile,2) - if keyword_set(XCSAO) then XCSAO = mrdfits(XCSAOFILE,1) - fieldid=strmid(platemjd,0,5) - thismjd=strmid(platemjd,6,5) + print, zallfile + plugmap = mrdfits(platefile,5,/silent) + zall = mrdfits(zallfile,1,/silent) + zbest = mrdfits(zbestfile,1,/silent) + zline = mrdfits(zlinefile,1,/silent) + zmodel = mrdfits(zbestfile,2,/silent) + if keyword_set(XCSAO) then XCSAO = mrdfits(XCSAOFILE,1,/silent) + ;fieldid=strmid(platemjd,0,5) + ;thismjd=strmid(platemjd,6,5) if keyword_set(XCSAO) then XCSAO_str={XCSAO_rv:0.D,XCSAO_erv:0.D,$ XCSAO_Rxc:0.D, $ XCSAO_Teff:0.D,XCSAO_eteff:0.D,$ @@ -445,11 +449,11 @@ CPU, TPOOL_NTHREADS = 1 endelse endif else begin ; single_file=single_basefile+plug_target.targetid+'.fits' - single_file=single_basefile+plug_target.catalogid+'.fits' + single_file=single_basefile+strtrim(plug_target.catalogid,2)+'.fits' endelse - ;print,single_file - junk = mrdfits(single_file,0,hdr0) - coadd = mrdfits(single_file,1) + ;print,single_file + junk = mrdfits(single_file,0,hdr0,/silent) + coadd = mrdfits(single_file,1,/silent) values_t=replicate(create_struct('model',0.0),n_elements(coadd.flux)) coadd=struct_addtags(coadd,values_t) coadd.model=zmodel[*,itarget] @@ -478,7 +482,7 @@ CPU, TPOOL_NTHREADS = 1 endelse endelse endif else begin - file_name=single_out_basefile+plug_target.catalogid+'.fits' + file_name=single_out_basefile+strtrim(plug_target.catalogid,2)+'.fits' ; file_name=single_out_basefile+plug_target.targetid+'.fits' endelse fulloutname_spec = djs_filepath(file_name, root_dir=dir_finalsp) @@ -509,7 +513,7 @@ CPU, TPOOL_NTHREADS = 1 ;print,single_file if not keyword_set(lite) then begin for i=0, nexp-1 do begin - single = mrdfits(single_file,3+i,hdri) + single = mrdfits(single_file,3+i,hdri, /silent) sxdelpar, hdri, 'COMMENT' mwrfits, single, fulloutname_spec, hdri, /silent endfor diff --git a/pro/spec2d/chunkinfo.pro b/pro/spec2d/chunkinfo.pro index 73131ce68..376ef9cad 100644 --- a/pro/spec2d/chunkinfo.pro +++ b/pro/spec2d/chunkinfo.pro @@ -51,7 +51,11 @@ function chunkinfo, plateid,legacy=legacy,plates=plates chunkdata = yanny_readone(chunkfile) endif if (NOT keyword_set(chunkdata)) then begin - splog, 'Empty or missing platePlans.par file' + if keyword_set(plates) or keyword_set(legacy) then begin + splog, 'Empty or missing platePlans.par file' + endif else begin + splog, 'Empty or missing configPlans.par file' + endelse return, 0 endif diff --git a/pro/spec2d/sdsshead.pro b/pro/spec2d/sdsshead.pro index 43a436a95..130f3adad 100644 --- a/pro/spec2d/sdsshead.pro +++ b/pro/spec2d/sdsshead.pro @@ -30,9 +30,9 @@ ;- ;------------------------------------------------------------------------------ -function sdsshead, infile, indir=indir, do_lock=do_lock +function sdsshead, infile, indir=indir, do_lock=do_lock, silentwarn=silentwarn - sdssproc, infile, indir=indir, hdr=hdr, do_lock=do_lock, /nopixflat, /nopixmask + sdssproc, infile, indir=indir, hdr=hdr, do_lock=do_lock, /nopixflat, /nopixmask, nowarn=silentwarn return, hdr end diff --git a/pro/spec2d/sdssproc.pro b/pro/spec2d/sdssproc.pro index 37daa54a2..31b78b4ba 100644 --- a/pro/spec2d/sdssproc.pro +++ b/pro/spec2d/sdssproc.pro @@ -295,7 +295,7 @@ pro sdssproc, infile1, image, invvar, indir=indir, $ applybias=applybias, nopixflat=nopixflat, nopixmask=nopixmask, silent=silent, $ do_lock=do_lock, minflat=minflat, maxflat=maxflat, $ spectrographid=spectrographid, color=color, camname=camname, $ - applycrosstalk=applycrosstalk, ccdmask=ccdmask + applycrosstalk=applycrosstalk, ccdmask=ccdmask, nowarn=nowarn ;outfile1=1 @@ -369,7 +369,7 @@ pro sdssproc, infile1, image, invvar, indir=indir, $ if (expnum GE 100706 AND expnum LE 100745) then sxaddpar, hdr, 'MJD', 55072 if (expnum GE 100746 AND expnum LE 100781) then sxaddpar, hdr, 'MJD', 55073 - sphdrfix, infile, hdr, silent=silent, do_lock=do_lock + sphdrfix, infile, hdr, silent=silent, do_lock=do_lock, nowarn=nowarn ;----------- ; Replace exposure number with that found in the file name. diff --git a/pro/spec2d/spadd_guiderinfo.pro b/pro/spec2d/spadd_guiderinfo.pro index 71841e7ba..301184f20 100644 --- a/pro/spec2d/spadd_guiderinfo.pro +++ b/pro/spec2d/spadd_guiderinfo.pro @@ -62,33 +62,52 @@ pro spadd_guiderinfo, hdr return endif - speclog_dir = getenv('SPECLOG_DIR') - if (NOT keyword_set(speclog_dir)) then $ - message, 'Must set environment variable SPECLOG_DIR' mjd = sxpar(hdr, 'MJD') mjdstr = string(mjd, format='(i05.5)') - plugdir = concat_dir(speclog_dir, mjdstr) - guidermonfile = filepath('guiderMon-'+mjdstr+'.par', root_dir=plugdir) - guidermon = yanny_readone(guidermonfile, 'GUIDEOBJ', $ - stnames=stnames, /anonymous) - - if (keyword_set(guidermon)) then begin - ; Ensure that this guiderMon file has all of the following tag - ; names, which wasn't the case for the early data. - if (tag_exist(guidermon, 'timestamp') $ - AND tag_exist(guidermon, 'fwhm') $ - AND tag_exist(guidermon, 'dra') $ - AND tag_exist(guidermon, 'ddec')) then begin - guidermon = guidermon - endif else begin - guidermon = 0 - splog, 'WARNING: Invalid format for guiderMon file ' + guidermonfile - endelse + cart = strtrim(string(sxpar(hdr, 'CARTID')),2) + if (strmatch(cart, '*FPS-N*', /FOLD_CASE) or strmatch(cart, '*FPS-S*', /FOLD_CASE)) then begin + fps=1 + gcam_dir = getenv('GCAM_DATA') + if (NOT keyword_set(gcam_dir)) then $ + message, 'Must set environment variable GCAM_DATA' + night_gcam_dir = concat_dir(gcam_dir, mjdstr) + guidermonfile = filepath('gcam-'+mjdstr+'.fits', root_dir=night_gcam_dir) + if file_test(guidermonfile) then guidermon = mrdfits(guidermonfile, 1) + if (keyword_set(guidermon)) then begin + ;Ensure that this gcam file has all of the following columns + if(tag_exist(guidermon, 'MJD') AND tag_exist(guidermon,'fwhm') AND $ + tag_exist(guidermon, 'dRA') AND tag_exist(guidermon, 'dDec')) then begin + guidermon = guidermon + endif else begin + guidermon = 0 + splog, 'WARNING: Invalid format for gcam Summary file '+ guidermonfile + endelse + endif else splog, 'WARNING: Empty gcam Summary file ' + guidermonfile endif else begin - splog, 'WARNING: Empty guiderMon file ' + guidermonfile + speclog_dir = getenv('SPECLOG_DIR') + if (NOT keyword_set(speclog_dir)) then $ + message, 'Must set environment variable SPECLOG_DIR' + plugdir = concat_dir(speclog_dir, mjdstr) + guidermonfile = filepath('guiderMon-'+mjdstr+'.par', root_dir=plugdir) + guidermon = yanny_readone(guidermonfile, 'GUIDEOBJ', $ + stnames=stnames, /anonymous) + if (keyword_set(guidermon)) then begin + ; Ensure that this guiderMon file has all of the following tag + ; names, which wasn't the case for the early data. + if (tag_exist(guidermon, 'timestamp') $ + AND tag_exist(guidermon, 'fwhm') $ + AND tag_exist(guidermon, 'dra') $ + AND tag_exist(guidermon, 'ddec')) then begin + guidermon = guidermon + endif else begin + guidermon = 0 + splog, 'WARNING: Invalid format for guiderMon file ' + guidermonfile + endelse + endif else begin + splog, 'WARNING: Empty guiderMon file ' + guidermonfile + endelse endelse - see20 = 0.0 see50 = 0.0 see80 = 0.0 @@ -107,44 +126,61 @@ pro spadd_guiderinfo, hdr get_tai, hdr, tai_beg, tai_mid, tai_end ; If this is an old SDSS-I file, then the timstamps are all offset ; and need correcting; if BOSS, then no corrections - taiplate = guidermon.timestamp - if (tag_exist(guidermon, 'focusoffset') EQ 0) then $ - taiplate += 3506716800.0d + if (strmatch(cart, '*FPS-N*', /FOLD_CASE) or strmatch(cart, '*FPS-S*', /FOLD_CASE)) then begin + taiplate = guidermon.mjd * (24.0 *3600.0) + endif else begin + taiplate = guidermon.timestamp + if (tag_exist(guidermon, 'focusoffset') EQ 0) then $ + taiplate += 3506716800.0d + endelse ifound = where(taiplate GE tai_beg AND taiplate LE tai_end, nfound) - if (nfound GT 8) then begin ; at least 8 fibers in the time interval? + if ((nfound GT 8) or keyword_set(fps)) then begin ; at least 8 fibers in the time interval? guidermon = guidermon[ifound] ; Count the number of guider frames based upon the unique number ; of time stamps. - alltimes = guidermon.timestamp + alltimes = taiplate alltimes = alltimes[uniq(alltimes, sort(alltimes))] nguide = n_elements(alltimes) splog, 'Number of guider frames = ', nguide seeing = 0.0 qgood = (guidermon.fwhm GT 0) AND finite(guidermon.fwhm) - if (tag_exist(guidermon, 'focusoffset')) then $ - qgood *= (abs(guidermon.focusoffset) LT 100) ; in-focus fibers only - if (tag_exist(guidermon, 'exists')) then $ - qgood *= (guidermon.exists EQ 'T') - if (tag_exist(guidermon, 'enabled')) then $ - qgood *= (guidermon.enabled EQ 'T') - igood = where(qgood, ngood) - if (ngood GT 0) then begin - seeing = guidermon[igood].fwhm - seeing = seeing[sort(seeing)] - see20 = seeing[(long(ngood*0.20) - 1) > 0] - see50 = seeing[(long(ngood*0.50) - 1) > 0] - see80 = seeing[(long(ngood*0.80) - 1) > 0] - endif else splog, 'Warning: No non-zero FWHM entries' - + if not keyword_set(fps) then begin + if (tag_exist(guidermon, 'focusoffset')) then $ + qgood *= (abs(guidermon.focusoffset) LT 100) ; in-focus fibers only + if (tag_exist(guidermon, 'exists')) then $ + qgood *= (guidermon.exists EQ 'T') + if (tag_exist(guidermon, 'enabled')) then $ + qgood *= (guidermon.enabled EQ 'T') + igood = where(qgood, ngood) + if (ngood GT 0) then begin + seeing = guidermon[igood].fwhm + seeing = seeing[sort(seeing)] + see20 = seeing[(long(ngood*0.20) - 1) > 0] + see50 = seeing[(long(ngood*0.50) - 1) > 0] + see80 = seeing[(long(ngood*0.80) - 1) > 0] + endif else splog, 'Warning: No non-zero FWHM entries' + endif else begin + igood = where(qgood, ngood) + if (ngood GT 0) then begin + seeing = guidermon.fwhm[igood] + seeing = reform(seeing, n_elements(seeing)) + seeing = seeing[sort(seeing)] + see20 = seeing[(long(ngood*0.20) - 1) > 0] + see50 = seeing[(long(ngood*0.50) - 1) > 0] + see80 = seeing[(long(ngood*0.80) - 1) > 0] + endif else splog, 'Warning: No non-zero FWHM entries' + endelse rmsoff = 0.0 qgood = guidermon.dra NE 0.0 OR guidermon.ddec NE 0.0 - if (tag_exist(guidermon, 'exists')) then $ - qgood *= (guidermon.exists EQ 'T') - if (tag_exist(guidermon, 'enabled')) then $ - qgood *= (guidermon.enabled EQ 'T') + if not keyword_set(fps) then begin + if (tag_exist(guidermon, 'exists')) then $ + qgood *= (guidermon.exists EQ 'T') + if (tag_exist(guidermon, 'enabled')) then $ + qgood *= (guidermon.enabled EQ 'T') + endif ;- Ensure offsets aren't NaN or Inf qgood *= finite(guidermon.dra) * finite(guidermon.ddec) diff --git a/pro/spec2d/sphdrfix.pro b/pro/spec2d/sphdrfix.pro index c46be783d..3284cee36 100644 --- a/pro/spec2d/sphdrfix.pro +++ b/pro/spec2d/sphdrfix.pro @@ -115,7 +115,7 @@ pro sphdrfix1, filename, hdr, hfixpar, silent=silent end ;------------------------------------------------------------------------------ -pro sphdrfix, filename, hdr, silent=silent, do_lock=do_lock +pro sphdrfix, filename, hdr, silent=silent, do_lock=do_lock, nowarn=nowarn common spec2d_hfixpar, hfix1 @@ -159,8 +159,10 @@ pro sphdrfix, filename, hdr, silent=silent, do_lock=do_lock reportfile = filepath('sdHdrFix-'+mjdstr+'.par', root_dir=plugdir) endif else begin - splog, 'No location set for sdHdrFix files' - splog, 'if needed contact BOSS pipeline team with location' + if not keyword_set(nowarn) then begin + splog, 'No location set for sdHdrFix files' + splog, 'if needed contact BOSS pipeline team with location' + endif return endelse diff --git a/pro/spec2d/spplan1d.pro b/pro/spec2d/spplan1d.pro index b1429f6fc..79f7701d9 100644 --- a/pro/spec2d/spplan1d.pro +++ b/pro/spec2d/spplan1d.pro @@ -399,7 +399,21 @@ pro spplan1d, topdir=topdir1, run2d=run2d1, $ endif ;print, allmaps[imap], qmjd, keyword_set(spexp) if (keyword_set(spexp) AND qmjd) then begin - ;spexp=spexp[qmjd] +RM_fields=[] + fld=spexp[0].fieldid + junk = where(RM_fields eq fld ,ct) + epc=1000;this number force to coadd during all the pluggin mapname + if ct gt 0 then epc=3 + spexp_org=spexp + stop_loop=0 + while stop_loop eq 0 do begin + indx_ep = where(spexp.mjd lt min(spexp.mjd)+epc) + spexp=spexp[indx_ep] + epoch_tag = replicate( $ + {epoch_combine: min(spexp.mjd)}, n_elements(spexp)) + spexp = struct_addtags(spexp, epoch_tag) + + ;spexp=spexp[qmjd] ;---------- ; Determine the 2D plan files that are relevant planlist1 = planlist[indx] @@ -409,9 +423,13 @@ pro spplan1d, topdir=topdir1, run2d=run2d1, $ ; Replace the prefix 'sdR' with 'spFrame' in the science frames ; and the suffix '.fit' with '.fits' if keyword_set(mjd) then begin - nind=where(spexp.mjd EQ mjd) - spexp=spexp[nind] - planlist1f=planlist1[nind] + runspexp=[] + planlist1f=[] + foreach runmjd, mjd do begin + nind=where(spexp.mjd EQ mjd) + runspexp=[runspexp,spexp[nind]] + planlist1f=[planlist1f,planlist1[nind]] + endforeach planlist1=planlist1f[0] endif if (keyword_set(mjstart) AND keyword_set(mjend) AND qmjd) then begin @@ -481,8 +499,17 @@ pro spplan1d, topdir=topdir1, run2d=run2d1, $ endif if ((NOT qexist) OR keyword_set(clobber)) then begin splog, 'Writing plan file ', fullplanfile - yanny_write, fullplanfile, ptr_new(spexp), hdr=hdr + yanny_write, fullplanfile, ptr_new(spexp), hdr=hdr, stnames='SPEXP' endif + if max(spexp_org.mjd) eq max(spexp.mjd) then begin + stop_loop=1 + endif else begin + stop_loop=0 + endelse + indx_ep = where(spexp_org.mjd gt max(spexp.mjd)) + if (indx_ep[0] NE -1) then spexp = spexp_org[indx_ep] + endwhile + endif ;endfor ; End loop through fps configuration names endif diff --git a/pro/spec2d/spplan2d.pro b/pro/spec2d/spplan2d.pro index ce1b23c8a..a579c3356 100644 --- a/pro/spec2d/spplan2d.pro +++ b/pro/spec2d/spplan2d.pro @@ -78,9 +78,11 @@ pro spplan2d, topdir=topdir1, run2d=run2d1, mjd=mjd, lco=lco, $ if (NOT keyword_set(minexp)) then minexp = 1 if keyword_set(lco) then begin obsdir='LCO' + sdsscore_obs='lco' BOSS_SPECTRO_DATA='BOSS_SPECTRO_DATA_S' endif else begin obsdir='APO' + sdsscore_obs='apo' BOSS_SPECTRO_DATA='BOSS_SPECTRO_DATA_N' endelse obsdir='';coment this line for the final version HJIM @@ -112,7 +114,7 @@ pro spplan2d, topdir=topdir1, run2d=run2d1, mjd=mjd, lco=lco, $ sdsscore_dir = getenv('SDSSCORE_DIR') if (NOT keyword_set(sdsscore_dir)) then $ message, 'Must set environment variable SDSSCORE_DIR' - sdsscore_dir = concat_dir(sdsscore_dir, obsdir) + sdsscore_dir = concat_dir(sdsscore_dir, sdsscore_obs) sdsscore_dir = concat_dir(sdsscore_dir, 'summary_files') splog, 'Setting SDSSCORE_DIR=', sdsscore_dir endelse @@ -186,8 +188,11 @@ pro spplan2d, topdir=topdir1, run2d=run2d1, mjd=mjd, lco=lco, $ for i=0, nfile-1 do begin - hdr = sdsshead(fullname[i]) - + if (i eq 0) then begin + hdr = sdsshead(fullname[i]) + endif else begin + hdr = sdsshead(fullname[i],/silentwarn) + endelse if (size(hdr,/tname) EQ 'STRING') then begin EXPTIME[i] = sxpar(hdr, 'EXPTIME') @@ -300,10 +305,10 @@ pro spplan2d, topdir=topdir1, run2d=run2d1, mjd=mjd, lco=lco, $ if (ct EQ 1) then $ MAPNAME[i] = strmid(fileandpath(confile), 11, 15) confile = 'confSummary-'+MAPNAME[i]+'.par' - thisplan=filepath(confile, root_dir=confdir) + thisplan=(findfile(filepath(confile, root_dir=confdir,subdir='*')))[0] allseq = yanny_readone(thisplan, 'SPEXP', hdr=hdr1, /anon) - thisfield=strtrim(string(yanny_par(hdr1,'field_id')),2) - if strlen(thisfield) eq 0 then thisfield='00000' + thisfield=field_to_string(yanny_par(hdr1,'field_id')) + if strlen(thisfield) eq 0 then thisfield=field_to_string(0) FIELDID[i]=thisfield;field_id endif endelse @@ -474,23 +479,23 @@ pro spplan2d, topdir=topdir1, run2d=run2d1, mjd=mjd, lco=lco, $ ; platestr = string(pltid, format='(i04.4)') if (conid GE 0) then begin if (fieid GE 0) then begin - fieldstr = string(fieid, format='(i05.5)');Modified this to add the number of digits for the FieldID + fieldstr = field_to_string(fieid);Modified this to add the number of digits for the FieldID endif else begin splog, 'WARNING: Field number '+strtrim(string(fieid),2)+' invalid for COFNAME=' + allconfs[imap] - fieldstr = '0000' + fieldstr = field_to_string(0) endelse ;confistr = spexp[0].confid; confistr = config_to_string(conid) ;print, confistr endif else begin if (fieid GE 0) then begin - fieldstr = string(fieid, format='(i05.5)');Modified this to add the number of digits for the FieldID + fieldstr = field_to_string(fieid);Modified this to add the number of digits for the FieldID endif else begin splog, 'WARNING: Field number '+strtrim(string(fieid),2)+' invalid for COFNAME=' + allconfs[imap] - fieldstr = '00000';Modified this to add the number of digits for the FieldID + fieldstr = field_to_string(0);Modified this to add the number of digits for the FieldID endelse splog, 'WARNING: Configuration number '+strtrim(string(conid),2)+' invalid for COFNAME=' + allconfs[imap] - confistr = '000000' + confistr = config_to_string(0) spexp = 0 endelse endif else begin diff --git a/pro/spec2d/spplan_findrawdata.pro b/pro/spec2d/spplan_findrawdata.pro index 636cc074e..37875f07e 100644 --- a/pro/spec2d/spplan_findrawdata.pro +++ b/pro/spec2d/spplan_findrawdata.pro @@ -13,7 +13,8 @@ function spplan_findrawdata, inputdir, nfile if place[i] GT 1 then begin tempname = strmid(gzipnames[i], 0, place[i]) - + junk = where(fullnames EQ tempname,count) + if count GE 1 then continue if fullnames[0] EQ '' then fullnames = tempname $ else fullnames = [fullnames, tempname] endif diff --git a/pro/spec2d/spreduce.pro b/pro/spec2d/spreduce.pro index 425850209..56ae19213 100644 --- a/pro/spec2d/spreduce.pro +++ b/pro/spec2d/spreduce.pro @@ -160,7 +160,6 @@ pro spreduce, flatname, arcname, objname, run2d=run2d, plugfile=plugfile, $ if keyword_set(fps) then begin nt=where(strtrim(hdrcal,2) EQ 'cut') cartid = strtrim(yanny_par(hdrcal[nt[0]+1:nt[0+1]-1], 'cartridgeId'),2) - cartid = '9' ;; SSM REMOVE for final spcalib, flatname, arcname, fibermask=fibermaskcal, cartid=cartid, $ lampfile=lampfile, indir=indir, ecalibfile=ecalibfile, $ plottitle=plottitle, flatinfoname=flatinfoname, arcinfoname=arcinfoname, $ @@ -398,10 +397,10 @@ pro spreduce, flatname, arcname, objname, run2d=run2d, plugfile=plugfile, $ plottitle=plottitle, do_telluric=do_telluric, bbspec=bbspec, $ splitsky=splitsky, ccdmask=ccdmask, nitersky=nitersky,corrline=corrline endif else begin - extract_object, outname, objhdr, image, invvar, rdnoise, $ + extract_object, outname, objhdr, image, invvar, rdnoise, $ objobssum[500*iobj:500*(iobj+1)-1], wset, xpeak, lambda, xsol, $ fflat, fibermaskobj[nt1[iobj]+1:nt1[iobj+1]-1], color=color, $ - proftype=proftype, superflatset=superflatset, $ + proftype=proftype, superflatset=superflatset, reslset=reslset, $ widthset=widthset, dispset=dispset, skylinefile=fullskyfile, $ plottitle=plottitle, do_telluric=do_telluric, bbspec=bbspec, $ splitsky=splitsky, ccdmask=ccdmask, nitersky=nitersky, corrline=corrline diff --git a/pro/spec2d/spreduce2d.pro b/pro/spec2d/spreduce2d.pro index 229dfe02c..f04a18c0b 100644 --- a/pro/spec2d/spreduce2d.pro +++ b/pro/spec2d/spreduce2d.pro @@ -330,7 +330,7 @@ pro spreduce2d, planfile, docams=docams, do_telluric=do_telluric, $ objobssfile=[objobssfile, objobssfile1] endif endfor - ; objobssfile = objobssfile[ uniq(objobssfile) ] + ;objobssfile = objobssfile[ uniq(objobssfile) ] ;----------- ; Select **all** flat exposures at this sequence + camera diff --git a/pro/spec2d/trace320crude.pro b/pro/spec2d/trace320crude.pro index c77f5a59e..265d32152 100644 --- a/pro/spec2d/trace320crude.pro +++ b/pro/spec2d/trace320crude.pro @@ -96,7 +96,6 @@ function trace320crude, image, invvar, ystart=ystart, nmed=nmed, $ root_dir=getenv('IDLSPEC2D_DIR'), subdir='opfiles'), 'FIBERPARAM') if (NOT keyword_set(fiberparam)) then message, opfibersFile+' file not found!' - ; cartid = sxpar(flathdr, 'CARTID') camname = strtrim(sxpar(flathdr, 'CAMERAS'),2) mjd = sxpar(flathdr, 'MJD') diff --git a/pro/spec2d/uubatchpbs.pro b/pro/spec2d/uubatchpbs.pro index 65d3f085a..ff7c2e306 100644 --- a/pro/spec2d/uubatchpbs.pro +++ b/pro/spec2d/uubatchpbs.pro @@ -620,8 +620,10 @@ pro uubatchpbs, platenums1, topdir=topdir1, run2d=run2d1, run1d=run1d1, $ ; Define the observatory data if (keyword_set(lco)) then begin printf, olun, 'export BOSS_SPECTRO_DATA=$BOSS_SPECTRO_DATA_S' + printf, olun, 'export GCAM_DATA=$GCAM_DATA_S' endif else begin printf, olun, 'export BOSS_SPECTRO_DATA=$BOSS_SPECTRO_DATA_N' + printf, olun, 'export GCAM_DATA=$GCAM_DATA_N' endelse ; Override environment variables if requested if (keyword_set(rawdata_dir)) then begin