Hermes DRS  6.0
reduction software
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
hermes.pipeline.run.nightDRS.nightDRS Class Reference
Inheritance diagram for hermes.pipeline.run.nightDRS.nightDRS:

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 = []
 No TH files ! We cannot reduce the night. More...
 
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 bkgf = self.globInput( False, "*.npy" )
 Build the background graphics from the npy files and remove the npy files ###########.
 
tuple a = load( tg )
 
tuple stop = localtime()
 finishing – give running time #######################
 
tuple dt = time()
 
tuple length = strftime( "nightJob executed in %H hours, %M minutes and %S seconds.", gmtime ( dt ) )
 

Member Function Documentation

def hermes.pipeline.run.nightDRS.nightDRS.globInput (   self,
  inputDir,
  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.

Member Data Documentation

string hermes.pipeline.run.nightDRS.nightDRS.argmt = "*"
static

Extraction of OBJ files ##############################################.

Different jobs depending on two-fiber or not.

now treat 2FIBER : invoke "twoFibDrift"

list hermes.pipeline.run.nightDRS.nightDRS.commandLineArguments = [ "absoluteDRS", "-ffall", "-e", "FF" ]
static

If there are NO files for the FF in output dir :

As this proceeds all the objects of the night, we force "computeRadialVelocity" to find the best mask.

specify flat fields

string hermes.pipeline.run.nightDRS.nightDRS.fiberTHext = "*"
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 in input dir for needed files to build it

hermes.pipeline.run.nightDRS.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)

tuple hermes.pipeline.run.nightDRS.nightDRS.indexTmp = unique( fn )
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

tuple hermes.pipeline.run.nightDRS.nightDRS.mfile = self.globInput( False, pattern )
static

specify shift, if any

specify Fiber make this object run rebuild the file list for modOrdPos files

tuple hermes.pipeline.run.nightDRS.nightDRS.nameTH = os.path.join( self.results [ "DataOutput" ], fiberTHext )
static

There are NO TWO NEXT files, so we do not check the blacklist and we will execute anyway.

string hermes.pipeline.run.nightDRS.nightDRS.pattern = "*"
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.nightDRS.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

looks like { ["HRF", 123456], ["WRF", 123496], ["LRF", 123477]} LOOP on fibers "HRF", "WRF", "LRF" (and in that order)

list hermes.pipeline.run.nightDRS.nightDRS.thliststring = []
static

No TH files ! We cannot reduce the night.

Stopping cleanly.


The documentation for this class was generated from the following file: