def createmasterflatname(infiles, flatkeys): """Create the name for the master flat file based on its parameters. The format for hte name is [S/P][YYYYMMDD]Flat[MODE][BINNING][GAINSET][ROSPEED][FILTER].fits where the following abbreviations are used: [S/P]--Scam or RSS [YYYYMMDD]--obsdate of the data or most common obsdate if multiple dates [MODE]--Mode of the observations: Normal: NM Framte Transfer: FT Slot Mode: SL Drift Scanning: DS [BINNING]--CCD binning in XBINxYBIN [GAINSET]--Gain setting Bright: BR Faint: FA [ROSPEED]--Read out speed FAST: FA SLOW: SL [FILTER]--Filter used """ #setup the in the instrument instr = saltstring.makeinstrumentstr(flatkeys[0]) #setup the obsdate--assumes fixed naming scheme obsdate = saltstring.makeobsdatestr(infiles) #if len(obsdate)<4: obsdate='' print obsdate #set the mode string mdstr = saltstring.makedetmodestr(flatkeys[1]) #set binning binstr = saltstring.makebinstr(flatkeys[2]) #set gain gnstr = saltstring.makegainstr(flatkeys[3]) #set readout rostr = saltstring.makereadoutstr(flatkeys[4]) fltstr = flatkeys[5].strip() if flatkeys[6].count('SKY'): skystr = 'Sky' else: skystr = '' flatname = '%s%s%sFlat%s%s%s%s%s.fits' % (instr, obsdate, skystr, mdstr, binstr, gnstr, rostr, fltstr) return flatname
def createmasterflatname(infiles, flatkeys): """Create the name for the master flat file based on its parameters. The format for hte name is [S/P][YYYYMMDD]Flat[MODE][BINNING][GAINSET][ROSPEED][FILTER].fits where the following abbreviations are used: [S/P]--Scam or RSS [YYYYMMDD]--obsdate of the data or most common obsdate if multiple dates [MODE]--Mode of the observations: Normal: NM Framte Transfer: FT Slot Mode: SL Drift Scanning: DS [BINNING]--CCD binning in XBINxYBIN [GAINSET]--Gain setting Bright: BR Faint: FA [ROSPEED]--Read out speed FAST: FA SLOW: SL [FILTER]--Filter used """ #setup the in the instrument instr=saltstring.makeinstrumentstr(flatkeys[0]) #setup the obsdate--assumes fixed naming scheme obsdate=saltstring.makeobsdatestr(infiles) #if len(obsdate)<4: obsdate='' print obsdate #set the mode string mdstr=saltstring.makedetmodestr(flatkeys[1]) #set binning binstr=saltstring.makebinstr(flatkeys[2]) #set gain gnstr=saltstring.makegainstr(flatkeys[3]) #set readout rostr=saltstring.makereadoutstr(flatkeys[4]) fltstr=flatkeys[5].strip() if flatkeys[6].count('SKY'): skystr='Sky' else: skystr='' flatname='%s%s%sFlat%s%s%s%s%s.fits' % (instr, obsdate, skystr, mdstr, binstr, gnstr, rostr, fltstr) return flatname
def createmasterbiasname(infiles, biaskeys, x1=5, x2=13): """Create the name for the master bias file based on its parameters. The format for hte name is [S/P][YYYYMMDD]Bias[DETNAM][BINNING][GAINSET][ROSPEED].fits where the following abbreviations are used: [H]--Scam or RSS [YYYYMMDD]--obsdate of the data or most common obsdate if multiple dates [DETNAM]--Detector Name Blue: B Red: R [BINNING]--CCD binning in XBINxYBIN [AMPS]--Number of Amps Bright: BR Faint: FA Parameters: x1: Place to start to extract obsdate x2: Place to stop to extract obsdate """ #setup the in the instrument #setup the obsdate--assumes fixed naming scheme obsdate=saltstring.makeobsdatestr(infiles, x1=x1, x2=x2) #if len(obsdate)<4: obsdate='' #set the mode string #mdstr=saltstring.makedetmodestr(biaskeys[2]) detstr='B' instr='H' ampstr='A2' if biaskeys[1]=='08443-03-01': detstr='R' instr='R' ampstr='A4' #set binning binstr=saltstring.makebinstr(biaskeys[3]) #set the AMP string biasname='%s%sBias%s%s%s.fits' % (instr, obsdate, detstr, binstr, ampstr) return biasname
def createmasterbiasname(infiles, biaskeys, x1=5, x2=13): """Create the name for the master bias file based on its parameters. The format for hte name is [S/P][YYYYMMDD]Bias[DETNAM][BINNING][GAINSET][ROSPEED].fits where the following abbreviations are used: [H]--Scam or RSS [YYYYMMDD]--obsdate of the data or most common obsdate if multiple dates [DETNAM]--Detector Name Blue: B Red: R [BINNING]--CCD binning in XBINxYBIN [AMPS]--Number of Amps Bright: BR Faint: FA Parameters: x1: Place to start to extract obsdate x2: Place to stop to extract obsdate """ #setup the in the instrument #setup the obsdate--assumes fixed naming scheme obsdate = saltstring.makeobsdatestr(infiles, x1=x1, x2=x2) #if len(obsdate)<4: obsdate='' #set the mode string #mdstr=saltstring.makedetmodestr(biaskeys[2]) detstr = 'B' instr = 'H' ampstr = 'A2' if biaskeys[1] == '08443-03-01': detstr = 'R' instr = 'R' ampstr = 'A4' #set binning binstr = saltstring.makebinstr(biaskeys[3]) #set the AMP string biasname = '%s%sBias%s%s%s.fits' % (instr, obsdate, detstr, binstr, ampstr) return biasname