Public Member Functions | |
def | __init__ |
Make a Hermes component and initialize variables. | |
def | mkdir_p |
def | globInput |
If you have a better name, do not hesitate to improve. More... | |
def | validateArguments |
check all options | |
def | __call__ |
run from here | |
def | processObj |
def | processApplyDRS |
Public Attributes | |
doWcfExtraction | |
isDebug | |
Add the used args in the resultDict. | |
doTextFiles | |
start | |
deb | |
logger | |
results | |
keep a copy of the initial results, to restart with for each fiber. More... | |
ConsoleLogSeverity | |
orderOffset | |
If the user specified a separate output folder, use it. | |
fsafe | |
manage the "-o" output options (for output folder) this overrides the output folder fixed in the "night" folder from self.results["DataOutput"] More... | |
fcrit | |
removeCosmics | |
maxnFile | |
"m" limits the stack of files in memory | |
Static Public Attributes | |
string | pattern = "*" |
Extraction of the FF. More... | |
tuple | mfile = self.globInput(False, pattern) |
specify shift, if any More... | |
list | commandLineArguments = ["absoluteDRS", "-ffall", "-e", "FF"] |
If there are NO files for the FF in output dir : More... | |
string | fiberTHext = "*" |
Extraction of the wavelength calibration lamp : TH files. More... | |
string | fibTHin = "*_" |
tuple | thlist = self.globInput(True, fibTHin) |
list | thliststring = [] |
list | thlistinteger = [] |
tuple | thlistsequence = zeros([len(thliststring)], int) |
int | j = 0 |
isWcfOk = False | |
tuple | nameTH = os.path.join(self.results["DataOutput"], fiberTHext) |
There are NO TWO NEXT files, so we do not check the blacklist and we will execute anyway. More... | |
tuple | nth = len(self.globInput(False, fiberTHext)) |
tuple | nameth = self.globInput( False, fiberTHext ) |
Wavelength Dispersion on TH files #######################################. | |
tuple | orderpositionth = unique(fileTH) |
string | wf = orderpositionth+"_" |
tuple | wave = os.path.join(self.results["DataOutput"], wf) |
string | argmt = "*" |
Extraction of OBJ files ##############################################. More... | |
tuple | files = self.globInput(True, argmt) |
Do this only on reduced files : we look in the OUTPUT dir. | |
list | fileObjIdx = [] |
Apply wavelength dispersion or 2fibdrift to OBJ spectra #######################. | |
list | fileObjIdxToWC = [] |
tuple | indexTmp = unique(fn) |
Set the caller in the results. More... | |
tuple | fileName = os.path.join(self.results["DataOutput"], str(indexTmp) + "_" + currentFiber + "_OBJ_ext.fits") |
tuple | threads = cpu_count() |
Launch the threads to reduce OBJ files. | |
tuple | nodeName = platform.node() |
int | threads = 4 |
tuple | manager = Manager() |
This runs applyDRS in threads. | |
list | all_processes = [] |
tuple | l = len( fileObjIdx ) |
int | n = 0 |
tuple | p = Process(target=processObj, args=(fileObjIdx[n], modOrdPosFF[currentFiber], currentFiber, self.fsafe, self.fcrit)) |
tuple | optioncontainer = OptionDict() |
tuple | wsfil = self.globInput( False, argmt ) |
tuple | unq = unique(os.path.basename(objfile)) |
tuple | wsf = unique(os.path.basename(wsfil[0])) |
tuple | stop = localtime() |
Build the background graphics from the npy files and remove the npy files ###########. More... | |
tuple | dt = time() |
tuple | length = strftime("nightJob executed in %H hours, %M minutes and %S seconds.", gmtime(dt)) |
def hermes.pipeline.run.quickReduce.nightDRS.globInput | ( | self, | |
inOut, | |||
template | |||
) |
If you have a better name, do not hesitate to improve.
USAGE : globInput (True, "*.fits") # True to look in input dir, False for output dir. use this to get a list of all files in the in or out dir with path correctly joined and normalized for any OS.
|
static |
Extraction of OBJ files ##############################################.
Different jobs depending on two-fiber or not.
now treat 2FIBER : invoke "twoFibDrift"
|
static |
If there are NO files for the FF in output dir :
specify flat fields
|
static |
Extraction of the wavelength calibration lamp : TH files.
all sequences of concatenated THARNE spectra are reduced.
thliststring: list with string entries of the unique numbers of all TH raw datafiles thlistinteger: list with integer entries of the unique numbers of all TH raw datafiles thlistsequence: list with the number of concatenated ThArNe exposures for every entry of the previous lists Do the files exist in output dir ? When not found in output dir, look for needed files to build it in input dir
hermes.pipeline.run.quickReduce.nightDRS.fsafe |
manage the "-o" output options (for output folder) this overrides the output folder fixed in the "night" folder from self.results["DataOutput"]
absolute path This argument holds a path or a filename (or both) to the wanted log file This argument holds an alternate filename for the user's blacklist. (always situated in the users homedir) This argument let the user pass other values for FSAFE and FCRIT, for cormic removal in extractOrders.
First set default values ("None" will further be replaced by default values from instrumentmodel)
|
static |
Set the caller in the results.
error ! WRF_TH_ext_wavelengthScale file must exist##
This will tell absoluteDRS to produce the bck.npy files. We later rely on those files to produce graphs. First, build the list of files to be processed : fiber + OBJ
|
static |
specify shift, if any
specify Fiber make this object run rebuild the file list for modOrdPos files
|
static |
There are NO TWO NEXT files, so we do not check the blacklist and we will execute anyway.
|
static |
Extraction of the FF.
memorize the unique number for the FF file we build or found, or stop if there is no file.
Check if extracted FF already exists for that fiber ; do not do it twice.
hermes.pipeline.run.quickReduce.nightDRS.results |
keep a copy of the initial results, to restart with for each fiber.
instances of programs we must run List of accepted fibermodes We do the LRF LAST because in the two fiber modes we need input from WRF to successfully extract the twoFib mode. dict with uniquenumbers of the "_FF_modOrdpos" per fiber LOOP on fibers "HRF", "LRF", "WRF"
|
static |
Build the background graphics from the npy files and remove the npy files ###########.
finishing – give running time #######################