scottransom / presto

Open source pulsar search and analysis toolkit
http://www.cv.nrao.edu/~sransom/presto/
GNU General Public License v2.0
239 stars 177 forks source link

Bug? In `DDplan.py`, not actually using user imputed `--loDM` & `--hiDM` Or maybe I am not using the arg correctly? #201

Closed afinemax closed 4 months ago

afinemax commented 4 months ago

Greetings!

When running DDplan.py, I think the script is only using the default --loDM & --hiDM values.

Running (astron_research_2024) afinemax@khazad-dum:~/afinemax/khazad-dum/research/astron_2024/ddplan$ DDplan.py FRB20240209A_L2_Band_2024_07_11_14_33_31.fil --loDM=2000 --hiDM=30000 gives the following output. While running DDplan.py FRB20240209A_L2_Band_2024_07_11_14_33_31.fil --loDM 627 --hiDM 1200 gives the same output despite setting a different --loDM & --hiDM setting.

If I edit the default args for --loDM & --hiDM values in DDplan.py itself, the printed output of low and high dm does change to match the new defaults, but the optimal ddm remains the same. The dt, numchan, blocklen, BW, fctr is all correct for the .fil file

Example:

Running (astron_research_2024) afinemax@khazad-dum:~/afinemax/khazad-dum/research/astron_2024/ddplan$ DDplan.py FRB20240209A_L2_Band_2024_07_11_14_33_31.fil --loDM=2000 --hiDM=30000

Using:
        dt = 0.0001984 s
   numchan = 320
  blocklen = 2400
        BW = 100 MHz
      fctr = 1350.16 MHz
from 'FRB20240209A_L2_Band_2024_07_11_14_33_31.fil'

Minimum total smearing     : 0.281 ms
--------------------------------------------
Minimum channel smearing   : 0 ms
Minimum smearing across BW : 0.00169 ms
Minimum sample time        : 0.198 ms

Setting the new 'best' resolution to : 0.198 ms
Best guess for optimal initial dDM is 1.177

  Low DM    High DM     dDM  DownSamp   #DMs  WorkFract
    0.000    622.000    1.00       1     622   0.8681
  622.000   1000.000    2.00       2     189   0.1319

running DDplan.py FRB20240209A_L2_Band_2024_07_11_14_33_31.fil --loDM 627 --hiDM 1200

Using:
        dt = 0.0001984 s
   numchan = 320
  blocklen = 2400
        BW = 100 MHz
      fctr = 1350.16 MHz
from 'FRB20240209A_L2_Band_2024_07_11_14_33_31.fil'

Minimum total smearing     : 0.281 ms
--------------------------------------------
Minimum channel smearing   : 0 ms
Minimum smearing across BW : 0.00169 ms
Minimum sample time        : 0.198 ms

Setting the new 'best' resolution to : 0.198 ms
Best guess for optimal initial dDM is 1.177

  Low DM    High DM     dDM  DownSamp   #DMs  WorkFract
    0.000    622.000    1.00       1     622   0.8681
  622.000   1000.000    2.00       2     189   0.1319

Minimum total smearing     : 0.281 ms
--------------------------------------------
Minimum channel smearing   : 0 ms
Minimum smearing across BW : 0.00169 ms
Minimum sample time        : 0.198 ms

Setting the new 'best' resolution to : 0.198 ms
Best guess for optimal initial dDM is 1.177

  Low DM    High DM     dDM  DownSamp   #DMs  WorkFract
    0.000    622.000    1.00       1     622   0.8681
  622.000   1000.000    2.00       2     189   0.1319
afinemax commented 4 months ago

Ah! Running DDplan.py without specifying a .fil file works! I think the bug only happens if you want to do `DDplan.py fil'

IE DDplan.py -d 500 -l 100 -n 320 -b 100.0 -t 0.0001984 -f 1350.15625 -w Setting nsub to 32 since writing a dedisp.py file

Gives

Minimum total smearing     : 0.3 ms
--------------------------------------------
Minimum channel smearing   : 0.105 ms
Minimum smearing across BW : 0.00169 ms
Minimum sample time        : 0.198 ms

Setting the new 'best' resolution to : 0.198 ms
Best guess for optimal initial dDM is 1.177

  Low DM    High DM     dDM  DownSamp  dsubDM   #DMs  DMs/call  calls  WorkFract
  100.000    508.000    1.00       1   24.00     408      24      17    1
scottransom commented 4 months ago

I just tested this and the short and long options both work if you specify a filterbank or psrfits input file. However, as mentioned in the usage note, the input file has to be the last thing on the command line.

afinemax commented 4 months ago

ah my bad for not reading the usage note