gwdetchar / gwdetchar

GW Detector Characterization python utilities
GNU General Public License v3.0
8 stars 26 forks source link

gwdetchar-omega fails with single primary channel #292

Closed duncanmmacleod closed 5 years ago

duncanmmacleod commented 5 years ago

The following scan fails:

$ cat omega.ini
[primary]
f-low = 4.0
resample = 4096
frametype = L1_HOFT_C00
duration = 64
fftlength = 8
matched-filter-length = 6
channel = L1:GDS-CALIB_STRAIN
$ gwdetchar-omega 1238040211.671875 --output-directory 1238040211.671875 --colormap viridis --ifo L1 --far-threshold 3.171e-08 --nproc 8 --ignore-state-flags -f omega.ini
gwdetchar-omega 2019-04-02 09:11 CDT     INFO: L1 Omega Scan 1238040211.67
gwdetchar-omega 2019-04-02 09:11 CDT    DEBUG: Parsing the following configuration files:
gwdetchar-omega 2019-04-02 09:11 CDT    DEBUG:  -- /home/duncan.macleod/public_html/tmp/omega.ini
gwdetchar-omega 2019-04-02 09:11 CDT    DEBUG: Output directory created as /home/duncan.macleod/public_html/tmp/1238040211.671875
gwdetchar-omega 2019-04-02 09:11 CDT    DEBUG: Setting up HTML at /home/duncan.macleod/public_html/tmp/1238040211.671875/index.html
gwdetchar-omega 2019-04-02 09:11 CDT     INFO: Launching omega scans
gwdetchar-omega 2019-04-02 09:11 CDT    DEBUG: Processing primary channel
              Reading primary: |████████████████████████████████████████████████████████████████| 1/1 (100%) ETA 00:00 /cvmfs/ligo-containers.opensciencegrid.org/lscsoft/conda/latest/envs/ligo-py37/lib/python3.7/site-packages/gwpy/types/series.py:921: UserWarning: TimeSeries.crop given end larger than current end, crop will end when the Series actually ends.
  % type(self).__name__)
gwdetchar-omega 2019-04-02 09:11 CDT    DEBUG: Finalizing HTML at /home/duncan.macleod/public_html/tmp/1238040211.671875/index.html
/cvmfs/ligo-containers.opensciencegrid.org/lscsoft/conda/latest/envs/ligo-py37/lib/python3.7/site-packages/gwdetchar/omega/html.py:510: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
  pind = numpy.nonzero(entries['Channel'] == primary)
Traceback (most recent call last):
  File "/cvmfs/ligo-containers.opensciencegrid.org/lscsoft/conda/latest/envs/ligo-py37/bin/gwdetchar-omega", line 299, in <module>
    html.write_null_page(ifo, gps, reason, **htmlv)
  File "/cvmfs/ligo-containers.opensciencegrid.org/lscsoft/conda/latest/envs/ligo-py37/lib/python3.7/site-packages/gwdetchar/omega/html.py", line 284, in decorated_func
    page.add(write_ranking(toc, primary))
  File "/cvmfs/ligo-containers.opensciencegrid.org/lscsoft/conda/latest/envs/ligo-py37/lib/python3.7/site-packages/gwdetchar/omega/html.py", line 513, in write_ranking
    if ind_sorted[0] != pind:
IndexError: index 0 is out of bounds for axis 0 with size 0
duncanmmacleod commented 5 years ago

I think I have just misunderstood the special usage of the [primary] INI section, right @alurban?

alurban commented 5 years ago

@duncanmmacleod, that's right, if you only want to scan a single channel then the section you actually want is something like this [GW] one:

[GW]
name = Gravitational-Wave Strain
q-range = 3.3166,150.0
frequency-range = 4.0,inf
resample = 4096
frametype = L1_HOFT_C00
state-flag = L1:DMT-GRD_ISC_LOCK_NOMINAL:1
duration = 64
fftlength = 8
max-mismatch = 0.2
snr-threshold = 5
always-plot = True
plot-time-durations = 1,4,16
channels = L1:GDS-CALIB_STRAIN

I would just remove the [primary] one, as it would only show an autocorrelation anyway.

alurban commented 5 years ago

@duncanmmacleod, are you satisfied that this is resolved?