# read the literature value of the period and the dispersion measure period = pulsar.period DM = pulsar.DM # Time resolution of the telescope dt = (512 * 64) / (70e6) # Array with the bandwith frequencyarray = obs.freq # this part should be RFI flagging something like: # noflag = flagging(twodarray) print("Flagging bad data") flag = obs.data == 0 if args.skiprfi else flagData(twodarray) obs.flag = flag print("Folding") # calculate the folded array foldedarray = timeFolding(twodarray, args.nbins, period, flagged=flag, corrected_times=obs.times) # make a waterfall plot of the result waterfall(foldedarray) print("Dedispersing") # do the dedispersion pulse_profile = dedispersion(foldedarray,
import numpy as np from functools import lru_cache obsfilelist = [ "./data/obs-10-04-2018/B0125+25-04-2018.fits", "./data/obs-10-04-2018/B0329+54_10-04-2018.fits", "./data/obs-10-04-2018/B1946+35_10-04-2018.fits", "./data/obs-10-04-2018/B2111+46_10-04-2018.fits", "./data/obs-10-04-2018/B2154+40_10-04-2018.fits", "./data/obs-10-04-2018/B2217_10-04-2018.fits", "./data/obs-10-04-2018/B2310+42-04-2018.fits" ] print("loading data") obs = Observation("./data/obs-10-04-2018/B2310+42-04-2018.fits.gz") print("flagging") obs.flag = flagData(obs.data) time_fold_bins = 1000 freq_fold_bins = 100 @TaskGenerator def chisq(period, DM): folded = timeFolding(obs.data, time_fold_bins, period, flagged=obs.flag, corrected_times=obs.times) dedispersed = dedispersion(folded, obs, period,