Lv0_nicerl2.py
def nicerl2(obsdir,nicerl2_flags):
    """
    Running nicerl2 to do initial filtering of the ufa file!

    obsdir - NICER data directory containing all the data files (e.g., path_to_NICER_dir/1034070101)
    nicerl2_flags - a LIST of input flags for nicerl2
    """
    if type(nicerl2_flags) != list:
        raise TypeError("flags should be a list! Not even an array.")

    logfile = obsdir + '/nicerl2.log'
    with open(logfile,'w') as logtextfile:
        output = subprocess.run(['nicerl2',obsdir]+nicerl2_flags,capture_output=True,text=True)
        logtextfile.write(output.stdout)
        logtextfile.write('*------------------------------* \n')
        logtextfile.write(output.stderr)
        logtextfile.close()

    return

    Running nicerl2 to do initial filtering of the ufa file!

    obsdir - NICER data directory containing all the data files (e.g., path_to_NICER_dir/1034070101)
    nicerl2_flags - a LIST of input flags for nicerl2
    
Running nicerl2 to do initial filtering of the ufa file.
obsdir - NICER data directory containing all the data files
nicerl2_flags - a LIST of input flags for nicerl2
Running nicerl2 to do initial filtering of the ufa file . obsdir - NICER data directory containing all the data files nicerl2_flags - a LIST of input flags for nicerl2
def nicerl2(obsdir,nicerl2_flags):
    if type(nicerl2_flags) != list:
        raise TypeError("flags should be a list! Not even an array.")
    logfile = obsdir + '/nicerl2.log'
    with open(logfile,'w') as logtextfile:
        output = subprocess.run(['nicerl2',obsdir]+nicerl2_flags,capture_output=True,text=True)
        logtextfile.write(output.stdout)
        logtextfile.write('*------------------------------* \n')
        logtextfile.write(output.stderr)
        logtextfile.close()
    return
def nicerl2 ( obsdir , nicerl2_flags ) : if type ( nicerl2_flags ) != list : raise TypeError ( "flags should be a list! Not even an array." ) logfile = obsdir + '/nicerl2.log' with open ( logfile , 'w' ) as logtextfile : output = subprocess . run ( [ 'nicerl2' , obsdir ] + nicerl2_flags , capture_output = True , text = True ) logtextfile . write ( output . stdout ) logtextfile . write ( '*------------------------------* \n' ) logtextfile . write ( output . stderr ) logtextfile . close ( ) return
Running nicerl2 to do initial filtering of the ufa file!
Running nicerl2 to do initial filtering of the ufa file!
"""
    Running nicerl2 to do initial filtering of the ufa file!

    obsdir - NICER data directory containing all the data files (e.g., path_to_NICER_dir/1034070101)
    nicerl2_flags - a LIST of input flags for nicerl2
    """
obsdir
nicerl2_flags