Skip to content

Commit

Permalink
GENNOISESPEC: Solved bug when I2RFITTED, runEnergy (TASKSSIRENA): Sol…
Browse files Browse the repository at this point in the history
…ved bug when 0-padding and library with a large filter
  • Loading branch information
bcobo committed Dec 15, 2020
1 parent a8a61b3 commit aa67288
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
8 changes: 4 additions & 4 deletions libsixt/integraSIRENA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
* - LbT: Baseline averaging length for the RS raw energy estimation (seconds)
* - noise_file: Noise file
* - filter_domain: Filtering Domain: Time(T) or Frequency(F)
* - filter_method: Filtering Method: F0 (deleting the zero frequency bin) or F0 (deleting the baseline)
* - filter_method: Filtering Method: F0 (deleting the zero frequency bin) or B0 (deleting the baseline)
* - energy_method: Energy calculation Method: OPTFILT, WEIGHT, WEIGHTN, I2R, I2RFITTED or PCA
* - filtEeV: Energy of the filters of the library to be used to calculate energy (only for OPTFILT, I2R and I2RFITTED)
* - Ifit: Constant to apply the I2RFITTED conversion
Expand Down Expand Up @@ -196,8 +196,8 @@
EP_EXIT_ERROR((char*)"Error in getLibraryCollection",EPFAIL);
}

double double_oflength = (double) oflength;
double log2_double_oflength = log2(double_oflength);
//double double_oflength = (double) oflength;
//double log2_double_oflength = log2(double_oflength);
/*if ((opmode == 1) && (oflib == 1) && (strcmp(oflength_strategy,"FIXED") == 0) && ((log2_double_oflength - (int) log2_double_oflength) != 0))
{
EP_EXIT_ERROR("If OFLib=yes, OFLength must be a power of 2",EPFAIL);
Expand Down Expand Up @@ -1057,7 +1057,7 @@
* - pulse_length: Pulse length
* - energy_method: Energy calculation Method: OPTFILT, WEIGHT, WEIGHTN, I2R, I2RFITTED or PCA
* - ofnoise: For optimal filtering, NSD or WEIGHTM
* - filter_method: Filtering Method: F0 (deleting the zero frequency bin) or F0 (deleting the baseline)
* - filter_method: Filtering Method: F0 (deleting the zero frequency bin) or B0 (deleting the baseline)
* - oflib: Work or not with a library with optimal filters (1/0)
* - ofinterp: Optimal Filter by using the Matched Filter or the DAB as matched filter (MF/DAB)
* It has been fixed in 'tesreconstruction' as 'DAB' (but it would be possible to work with 'MF')
Expand Down
10 changes: 8 additions & 2 deletions libsixt/tasksSIRENA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8084,7 +8084,10 @@ resize_mf_lowres = 4;

if ((strcmp((*reconstruct_init)->FilterDomain,"T") == 0) && ((*reconstruct_init)->pulse_length < (*reconstruct_init)->OFLength)) // 0-padding
{
filtergsl = gsl_vector_alloc((*reconstruct_init)->library_collection->pulse_templates[0].template_duration);
if ((*reconstruct_init)->library_collection->pulse_templates[0].template_duration < (*reconstruct_init)->library_collection->pulse_templatesMaxLengthFixedFilter[0].template_duration)
filtergsl = gsl_vector_alloc((*reconstruct_init)->library_collection->pulse_templatesMaxLengthFixedFilter[0].template_duration);
else
filtergsl = gsl_vector_alloc((*reconstruct_init)->library_collection->pulse_templates[0].template_duration);
}

Pab = gsl_vector_alloc(resize_mf);
Expand Down Expand Up @@ -9053,7 +9056,10 @@ resize_mf_lowres = 4;

if ((strcmp((*reconstruct_init)->FilterDomain,"T") == 0) && ((*reconstruct_init)->pulse_length < (*reconstruct_init)->OFLength)) // 0-padding
{
filtergsl = gsl_vector_alloc((*reconstruct_init)->library_collection->pulse_templates[0].template_duration);
if ((*reconstruct_init)->library_collection->pulse_templates[0].template_duration < (*reconstruct_init)->library_collection->pulse_templatesMaxLengthFixedFilter[0].template_duration)
filtergsl = gsl_vector_alloc((*reconstruct_init)->library_collection->pulse_templatesMaxLengthFixedFilter[0].template_duration);
else
filtergsl = gsl_vector_alloc((*reconstruct_init)->library_collection->pulse_templates[0].template_duration);
}

Pab = gsl_vector_alloc(resize_mf);
Expand Down
2 changes: 1 addition & 1 deletion libsixt/versionSIRENA.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
#ifndef SIRENA_VERSION_H
#define SIRENA_VERSION_H

#define SIRENA_VERSION "3.7.0"
#define SIRENA_VERSION "3.7.1"

#endif
1 change: 1 addition & 0 deletions tools/gennoisespec/gennoisespec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,7 @@
message = "Cannot run routine convertI2R";
EP_EXIT_ERROR(message,EPFAIL);
}
gsl_vector_scale(ioutgsl,aducnv);
}
else
{
Expand Down

0 comments on commit aa67288

Please sign in to comment.