[Kst] readField() in a datasource

Nicholas Chapman nchapman at u.northwestern.edu
Fri Jun 20 22:30:57 UTC 2014


Hi, I'm struggling with a bug with the FitsTable plugin.  I've
discovered that on my mac, some Fits tables can't be read (Kst
crashes), but those same files open fine on a different machine
running linux.  Both are 64-bit.  My theory is that very long tables
are causing the problem.  I would like some help understanding the
readField() function in a datasource.  For example, from FitsTable:
int FitsTableSource::readField(double *v, const QString& field, int s, int n) {

My understanding is that v is the array which needs to have values
added to it.  Kst will read v to then plot the data.  n is then the
length of v, which has already been allocated by Kst.

Is that correct?  If so, how does Kst know what the value of n should
be for a given field?  I thought it was from the function, e.g.

int FitsTableSource::frameCount(const QString& field) const {

which should return the size of a given field.  If so, then I don't
understand why the value of n passed to readField() is not the correct
value.  I wonder if this is an int versus long int thing.

Thanks,

Nicholas Chapman


More information about the Kst mailing list