Lv2_create_time_res_spec.py
def xspec_read_all(eventfile):
    """
    To read all the spectral files (with rmf,arf already set!) and ignore 0.0-0.3, 12-higher keV

    eventfile - path to the event file. Will extract ObsID from this for the NICER files.
    """
    parent_folder = str(pathlib.Path(eventfile).parent)
    niextract_folder = parent_folder + '/accelsearch_GTIs/spectra/'

    spectrafiles = sorted(glob.glob(niextract_folder+'/*.pha'))

    readspectra = open(niextract_folder + 'readspectra.xcm','w')
    data_string = 'data ' + ' '.join([str(i+1)+':'+str(i+1) + ' ' + spectrafiles[i] for i in range(len(spectrafiles))])
    readspectra.write(data_string + '\n')
    readspectra.write('ignore **:0.0-0.485,12.01-**' + '\n')
    readspectra.write('abund wilm' + '\n')
    readspectra.close()

    return

    To read all the spectral files (with rmf,arf already set!) and ignore 0.0-0.3, 12-higher keV

    eventfile - path to the event file. Will extract ObsID from this for the NICER files.
    
To read all the spectral files (with rmf,arf already set!) and ignore 0.0-0.3, 12-higher keV
eventfile - path to the event file. Will extract ObsID from this for the NICER files.
To read all the spectral files ( with rmf arf already set! ) and ignore 0 . 0 - 0 . 3 12 - higher keV eventfile - path to the event file . Will extract ObsID from this for the NICER files .
def xspec_read_all(eventfile):
    parent_folder = str(pathlib.Path(eventfile).parent)
    niextract_folder = parent_folder + '/accelsearch_GTIs/spectra/'
    spectrafiles = sorted(glob.glob(niextract_folder+'/*.pha'))
    readspectra = open(niextract_folder + 'readspectra.xcm','w')
    data_string = 'data ' + ' '.join([str(i+1)+':'+str(i+1) + ' ' + spectrafiles[i] for i in range(len(spectrafiles))])
    readspectra.write(data_string + '\n')
    readspectra.write('ignore **:0.0-0.485,12.01-**' + '\n')
    readspectra.write('abund wilm' + '\n')
    readspectra.close()
    return
def xspec_read_all ( eventfile ) : parent_folder = str ( pathlib . Path ( eventfile ) . parent ) niextract_folder = parent_folder + '/accelsearch_GTIs/spectra/' spectrafiles = sorted ( glob . glob ( niextract_folder + '/*.pha' ) ) readspectra = open ( niextract_folder + 'readspectra.xcm' , 'w' ) data_string = 'data ' + ' ' . join ( [ str ( i + 1 ) + ':' + str ( i + 1 ) + ' ' + spectrafiles [ i ] for i in range ( len ( spectrafiles ) ) ] ) readspectra . write ( data_string + '\n' ) readspectra . write ( 'ignore **:0.0-0.485,12.01-**' + '\n' ) readspectra . write ( 'abund wilm' + '\n' ) readspectra . close ( ) return
To read all the spectral files (with rmf,arf already set!)
To read all the spectral files ( with rmf arf already set! )
"""
    To read all the spectral files (with rmf,arf already set!) and ignore 0.0-0.3, 12-higher keV

    eventfile - path to the event file. Will extract ObsID from this for the NICER files.
    """
eventfile