Lv2_swift_lc.py
def barycorr(eventfile,outfile,refframe,orbit_file,output_folder):
    """
    General function to perform the barycenter corrections for a Swift event file

    eventfile - path to the event file. Will extract ObsID from this for the NICER files.
    outfile - path to the output event file with barycenter corrections applied
    refframe - reference frame for barycenter corrections (usually ICRS)
    orbit_file - path to the orbit file of the observation
    output_folder - path to the folder where the outfile will be
    """
    obsid = eventfile[2:13]

    logfile = output_folder + 'barycorr_notes.txt'
    ra,dec = get_ra_dec(eventfile)

    with open(logfile,'w') as logtextfile:
        output = subprocess.run(['barycorr',eventfile,'outfile='+outfile,'orbitfiles='+orbit_file,'ra='+str(ra),'dec='+str(dec),'refframe='+str(refframe),'clobber=YES'],capture_output=True,text=True)
        logtextfile.write(output.stdout)
        logtextfile.write('*------------------------------* \n')
        logtextfile.write(output.stderr)
        logtextfile.close()

    return

    General function to perform the barycenter corrections for a Swift event file

    eventfile - path to the event file. Will extract ObsID from this for the NICER files.
    outfile - path to the output event file with barycenter corrections applied
    refframe - reference frame for barycenter corrections (usually ICRS)
    orbit_file - path to the orbit file of the observation
    output_folder - path to the folder where the outfile will be
    
General function to perform the barycenter corrections for a Swift event file
eventfile - path to the event file. Will extract ObsID from this for the NICER files.
outfile - path to the output event file with barycenter corrections applied
refframe - reference frame for barycenter corrections (usually ICRS)
orbit_file - path to the orbit file of the observation
output_folder - path to the folder where the outfile will be
General function to perform the barycenter corrections for a Swift event file eventfile - path to the event file . Will extract ObsID from this for the NICER files . outfile - path to the output event file with barycenter corrections applied refframe - reference frame for barycenter corrections ( usually ICRS ) orbit_file - path to the orbit file of the observation output_folder - path to the folder where the outfile will be
def barycorr(eventfile,outfile,refframe,orbit_file,output_folder):
    obsid = eventfile[2:13]
    logfile = output_folder + 'barycorr_notes.txt'
    ra,dec = get_ra_dec(eventfile)
    with open(logfile,'w') as logtextfile:
        output = subprocess.run(['barycorr',eventfile,'outfile='+outfile,'orbitfiles='+orbit_file,'ra='+str(ra),'dec='+str(dec),'refframe='+str(refframe),'clobber=YES'],capture_output=True,text=True)
        logtextfile.write(output.stdout)
        logtextfile.write('*------------------------------* \n')
        logtextfile.write(output.stderr)
        logtextfile.close()
    return
def barycorr ( eventfile , outfile , refframe , orbit_file , output_folder ) : obsid = eventfile [ 2 : 13 ] logfile = output_folder + 'barycorr_notes.txt' ra , dec = get_ra_dec ( eventfile ) with open ( logfile , 'w' ) as logtextfile : output = subprocess . run ( [ 'barycorr' , eventfile , 'outfile=' + outfile , 'orbitfiles=' + orbit_file , 'ra=' + str ( ra ) , 'dec=' + str ( dec ) , 'refframe=' + str ( refframe ) , 'clobber=YES' ] , capture_output = True , text = True ) logtextfile . write ( output . stdout ) logtextfile . write ( '*------------------------------* \n' ) logtextfile . write ( output . stderr ) logtextfile . close ( ) return
General function to perform the barycenter corrections for a Swift event file
eventfile - path to the event file.
General function to perform the barycenter corrections for a Swift event file eventfile - path to the event file .
"""
    General function to perform the barycenter corrections for a Swift event file

    eventfile - path to the event file. Will extract ObsID from this for the NICER files.
    outfile - path to the output event file with barycenter corrections applied
    refframe - reference frame for barycenter corrections (usually ICRS)
    orbit_file - path to the orbit file of the observation
    output_folder - path to the folder where the outfile will be
    """
eventfile
outfile
refframe
orbit_file
output_folder