Within the Straylight Wrapper Example Notebook, event files are specified as by calling obs.evtfiles. Evtfiles appears to typically contain the list of *_cl.evt files within event_cl, and so a particular file can be specified (i.e. evf = obs.evtfiles['A'][0]).
This breaks if the user has run the NuSTAR pipeline with outdir set to something other than event_cl, even if the user has specified their alternative obs.evdir. As an example, I ran nupipeline with 'outdir=./out 'and then ran:
from nustar_gen import wrappers, info, utils
import os
here = os.getcwd()+'/'
obs = info.Observation(seqid='30361002002', path=here, evdir=here+'./30361002002/out', out_path='./30361002002/SL_products')
And found the following error:
evfA = obs.evtfiles['A'][0]
IndexError: list index out of range
In this case, trying to print obs.evtfiles returns an empty list.
I was able to work around this issue by changing the line 'evfA = obs.evtfiles['A'][0]' to define the desired event file explicitly:
evfA = here+'./30361002002/out/nu30361002002A01_cl.evt'
I also found that, if I reran the NuSTAR pipeline with 'outdir=./event_cl', the code ran as expected. For example:
from nustar_gen import wrappers, info, utils
import os
here = os.getcwd()+'/'
obs = info.Observation(seqid='30361002002', path=here, out_path='./30361002002/tstevcl_SL_products')
Within the Straylight Wrapper Example Notebook, event files are specified as by calling obs.evtfiles. Evtfiles appears to typically contain the list of *_cl.evt files within event_cl, and so a particular file can be specified (i.e. evf = obs.evtfiles['A'][0]).
This breaks if the user has run the NuSTAR pipeline with outdir set to something other than event_cl, even if the user has specified their alternative obs.evdir. As an example, I ran nupipeline with 'outdir=./out 'and then ran:
And found the following error: evfA = obs.evtfiles['A'][0] IndexError: list index out of range
In this case, trying to print obs.evtfiles returns an empty list.
I was able to work around this issue by changing the line 'evfA = obs.evtfiles['A'][0]' to define the desired event file explicitly: evfA = here+'./30361002002/out/nu30361002002A01_cl.evt'
I also found that, if I reran the NuSTAR pipeline with 'outdir=./event_cl', the code ran as expected. For example:
This ran with no errors, and printing obs.evtfiles produced a list of all *_cl.evt event files within event_cl.