Skip to content

Frequency bundling introduced #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 34 commits into
base: chime
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4dcd598
Merge pull request #2 from smearedink/chime
demorest Jul 13, 2015
9865645
Merge pull request #2 from demorest/master
smearedink Jul 13, 2015
19f660e
Sets resolution based on nbit
smearedink Jul 14, 2015
11cbfa9
Unpacker for KAT7
ajameson Jul 23, 2015
9d2a32d
GPU square law
ajameson Jul 23, 2015
4d4e3cd
DMerge branch 'master' of ssh://git.code.sf.net/p/dspsr/code
ajameson Jul 23, 2015
406efe3
Remove FITSOutputFile from Makefile.am
demorest Jul 23, 2015
1f88b53
Many files changed to introduce bundles, some tabs also changed to sp…
smearedink Jul 24, 2015
59b22b0
Merge pull request #3 from demorest/master
smearedink Jul 24, 2015
4057f58
Merge pull request #4 from smearedink/master
smearedink Jul 24, 2015
b8e864d
short program to print meta-data to stdout
Jul 26, 2015
21a4203
ensure that Multiplex and MultiFile show up as separate File types
Jul 26, 2015
aa90bcd
ensure that Multiplex and MultiFile show up as separate File types
Jul 26, 2015
397d877
added nbit
Jul 26, 2015
12532aa
-Lepoch feature added: set the start time of the first sub-integration
Jul 26, 2015
ee86318
Merge branch 'master' of ssh://git.code.sf.net/p/dspsr/code
Jul 26, 2015
019c29f
put multiple cerr commands in if (verbose) {}
vkond Jul 27, 2015
03e4240
added different machine for LOFAR fits data
vkond Jul 27, 2015
3360394
changed LOFAR machine from 'LOFAR' to 'COBALT'
vkond Jul 27, 2015
f161ab6
fixed bug in reading filterbank header
vkond Jul 27, 2015
c01e0d7
changed order of checking for flip_band. Otherwise it
vkond Jul 27, 2015
a6d81e4
changed order of checking for flip_band. Otherwise it's resulted in t…
vkond Jul 27, 2015
bfe13ff
added LOFAR telescope and COBALT backends; added get_sigproc_machine_…
vkond Jul 27, 2015
080ec04
Fixed ndatblock so it is just number of samples, not channels etc
smearedink Jul 30, 2015
ff0fc20
Changed blockdat min back to 32 after last commit
smearedink Jul 30, 2015
9da9078
#include <unistd.h> for getopt
Aug 6, 2015
ffafbaa
Merge branch 'master' of ssh://git.code.sf.net/p/dspsr/code
Aug 6, 2015
a59107d
delete the Passband extension when computing on the GPU
straten Aug 14, 2015
cf26ee3
Convolution::passband is private
Aug 14, 2015
583bf93
resolve merge conflicts
smearedink Sep 8, 2015
43157f5
Merge branch 'demorest-master'
smearedink Sep 8, 2015
415f043
Merge pull request #6 from smearedink/master
smearedink Sep 8, 2015
b8dfb95
Revert "Many files changed to introduce bundles, some tabs also chang…
smearedink Dec 15, 2015
903d755
Keeping a few of the changes made in the big reverted commit
smearedink Dec 21, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Kernel/Applications/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

bin_PROGRAMS = load_bits
bin_PROGRAMS = load_bits digihdr

check_PROGRAMS = test_Input test_Unpack

load_bits_SOURCES = load_bits.C
test_Input_SOURCES = test_Input.C
test_Unpack_SOURCES = test_Unpack.C
digihdr_SOURCES = digihdr.C

if HAVE_sigproc
check_PROGRAMS += sigproc_header
Expand Down
1 change: 1 addition & 0 deletions Kernel/Applications/digihdr.C
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
***************************************************************************/

#include <iostream>
#include <unistd.h>

#include "dsp/File.h"
#include "TextInterface.h"
Expand Down
9 changes: 3 additions & 6 deletions Kernel/Classes/BitUnpacker.C
Original file line number Diff line number Diff line change
Expand Up @@ -59,33 +59,30 @@ void dsp::BitUnpacker::unpack ()

// Step through the array in small block sizes so that the matrix
// transpose (for nchan>1 case) remains cache-friendly.
const unsigned blockdat = npol*nchan*ndim > 32 ? npol*nchan*ndim : 32;
const unsigned blockdat = npol*nchan*ndim*8/nbit > 32 ? npol*nchan*ndim*8/nbit : 32;
const unsigned blockbytes = blockdat*nbit/8;

const unsigned char* iptr = input->get_rawptr();

for (uint64_t idat=0; idat<ndat; idat+=blockdat, iptr+=blockbytes)
{
unsigned offset = 0;
const unsigned ndatblock = (blockdat>(ndat-idat)) ? ndat-idat : blockdat;
const unsigned ndatblock = (blockdat>(ndat-idat)) ? ndat-idat : blockdat/nskip;
for (unsigned ichan=0; ichan<nchan; ichan++)
{
for (unsigned ipol=0; ipol<npol; ipol++)
{
for (unsigned idim=0; idim<ndim; idim++)
{
//offset = idim + ipol*ndim + ichan*npol*ndim;
//const unsigned char* from = input->get_rawptr() + offset;
const unsigned char* from = iptr + offset;
float* into = output->get_datptr (ichan, ipol) + ndim*idat + idim;
unsigned long* hist = get_histogram (offset);

#ifdef _DEBUG
cerr << "c=" << ichan << " p=" << ipol << " d=" << idim << endl;
#endif

unpack (ndatblock, from, nskip, into, fskip, hist);
//unpack (ndat, from, nskip, into, fskip, hist);
offset ++;
}
}
Expand Down
6 changes: 6 additions & 0 deletions Kernel/Classes/DummyFile.C
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ void dsp::DummyFile::open_file (const char* filename)

// Read obs info from ASCII file
info = new ASCIIObservation(header);

// cannot load less than a byte. set the time sample resolution accordingly
unsigned bits_per_byte = 8;
resolution = bits_per_byte / get_info()->get_nbit();
if (resolution == 0)
resolution = 1;
}

void dsp::DummyFile::close ()
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Classes/MultiFile.C
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

using namespace std;

dsp::MultiFile::MultiFile () : File ("MultiFile")
dsp::MultiFile::MultiFile (const char* name) : File (name)
{
test_contiguity = true;
current_index = 0;
Expand Down
4 changes: 2 additions & 2 deletions Kernel/Classes/Multiplex.C
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//-*-C++-*-
/***************************************************************************
*
* Copyright (C) 2009
* Copyright (C) 2009 by Jonathon Kocz
* Licensed under the Academic Free License version 2.1
*
***************************************************************************/
Expand All @@ -18,7 +18,7 @@

using namespace std;

dsp::Multiplex::Multiplex () : MultiFile ()
dsp::Multiplex::Multiplex () : MultiFile ( "Multiplex" )
{
//current_index = 0;
}
Expand Down
1 change: 1 addition & 0 deletions Kernel/Classes/ObservationInterface.C
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dsp::Observation::Interface::Interface( Observation *c )
add( &Observation::get_nchan, "nchan", "Number of frequency channels" );
add( &Observation::get_npol, "npol", "Number of polarizations" );
add( &Observation::get_ndim, "ndim", "Number of data dimensions" );
add( &Observation::get_nbit, "nbit", "Number of bits per datum" );

add( &Observation::get_type,
&Observation::set_type,
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Classes/dsp/MultiFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace dsp {
public:

//! Constructor
MultiFile ();
MultiFile (const char* name = "MultiFile");

//! Destructor
virtual ~MultiFile ();
Expand Down
8 changes: 2 additions & 6 deletions Kernel/Classes/dsp/Multiplex.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
//-*-C++-*-
/***************************************************************************
*
* Copyright (C) 2002 by Willem van Straten
* Copyright (C) 2002 by Jonathon Kocz
* Licensed under the Academic Free License version 2.1
*
***************************************************************************/

/* $Source: /cvsroot/dspsr/dspsr/Kernel/Classes/dsp/Multiplex.h,v $
$Revision: 1.1 $
$Date: 2009/09/10 01:02:34 $
$Author: tcaotiaafoc $ */

// dspsr/Kernel/Classes/dsp/Multiplex.h

#ifndef __Multiplex_h
#define __Multiplex_h
Expand Down
5 changes: 5 additions & 0 deletions Kernel/Formats/Unpacker_registry.C
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ static dsp::Unpacker::Register::Enter<dsp::GUPPIFourBit> guppi4;
static dsp::Unpacker::Register::Enter<dsp::GUPPITwoBitCorrection> guppi2;
#endif

#if HAVE_kat
#include "dsp/KAT7Unpacker.h"
static dsp::Unpacker::Register::Enter<dsp::KAT7Unpacker> kat7;
#endif

#if HAVE_lofar_dal
#include "dsp/LOFAR_DALUnpacker.h"
static dsp::Unpacker::Register::Enter<dsp::LOFAR_DALUnpacker> lofar_dal;
Expand Down
2 changes: 2 additions & 0 deletions Kernel/Formats/fits/FITSFile.C
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ void dsp::FITSFile::open_file(const char* filename)
std::string backend_name = archive->get<Pulsar::Backend>()->get_name();
if (backend_name == "GUPPI" || backend_name == "PUPPI")
get_info()->set_machine("GUPPIFITS");
else if (backend_name == "COBALT")
get_info()->set_machine("COBALT");
else
get_info()->set_machine("FITS");
get_info()->set_telescope(archive->get_telescope());
Expand Down
8 changes: 4 additions & 4 deletions Kernel/Formats/fits/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
noinst_LTLIBRARIES = libfits.la

nobase_include_HEADERS = dsp/FITSUnpacker.h dsp/FITSFile.h \
dsp/GUPPIFITSUnpacker.h dsp/FITSDigitizer.h \
dsp/FITSOutputFile.h
dsp/GUPPIFITSUnpacker.h dsp/FITSDigitizer.h
#dsp/FITSOutputFile.h

libfits_la_SOURCES = FITSUnpacker.C GUPPIFITSUnpacker.C \
FITSFile.C fits_params.h FITSDigitizer.C\
FITSOutputFile.C
FITSFile.C fits_params.h FITSDigitizer.C
#FITSOutputFile.C

#############################################################################
#
Expand Down
30 changes: 19 additions & 11 deletions Kernel/Formats/gmrt/GMRTFile.C
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,22 @@ void dsp::GMRTFile::open_file (const char* filename)

fd = open_read_header (filename, &header, &block);

cerr << "n_ds = " << header.n_ds << endl;
cerr << "n_chan = " << header.n_chan << endl;
cerr << "i_chan = " << block.FreqChanNo << endl;
if (verbose) {
cerr << "n_ds = " << header.n_ds << endl;
cerr << "n_chan = " << header.n_chan << endl;
cerr << "i_chan = " << block.FreqChanNo << endl;
}

get_info()->set_nbit (8);

double bw = header.ch_bw * header.band_dir;
get_info()->set_bandwidth (bw);
get_info()->set_centre_frequency (header.rf + (block.FreqChanNo + 0.5) * bw);

cerr << "cf = " << get_info()->get_centre_frequency() << endl;
cerr << "bw = " << bw << endl;
if (verbose) {
cerr << "cf = " << get_info()->get_centre_frequency() << endl;
cerr << "bw = " << bw << endl;
}

get_info()->set_npol(2);
get_info()->set_state (Signal::Analytic);
Expand All @@ -154,18 +158,22 @@ void dsp::GMRTFile::open_file (const char* filename)
epoch += block.ipts1 / get_info()->get_rate();

get_info()->set_start_time( epoch );
cerr << "MJD = " << get_info()->get_start_time() << endl;
cerr << "telescope = " << header.telescope << endl;
if (verbose) {
cerr << "MJD = " << get_info()->get_start_time() << endl;
cerr << "telescope = " << header.telescope << endl;
}
get_info()->set_telescope (header.telescope);

get_info()->set_source (header.psr_name);

header_bytes = sizeof(struct gmrt_params);

cerr << "totalsize=" << block.totalsize << endl;
cerr << "NPtsSend=" << block.NPtsSend << endl;
cerr << "overlap=" << header.overlap << endl;
cerr << "n_samp_dump=" << header.n_samp_dump << endl;
if (verbose) {
cerr << "totalsize=" << block.totalsize << endl;
cerr << "NPtsSend=" << block.NPtsSend << endl;
cerr << "overlap=" << header.overlap << endl;
cerr << "n_samp_dump=" << header.n_samp_dump << endl;
}

block_header_bytes = sizeof(struct data2rcv);
//block_tailer_bytes = header.overlap * 4;
Expand Down
Loading