Doubt in deco.c code

Anton Lundin glance at acc.umu.se
Fri Mar 21 03:32:24 PDT 2014


On 21 March, 2014 - Gopichand Paturi wrote:

> Also, another small help sir...
> This variable, period_in_seconds is a bit misleading my understanding.
> Please, let me know it's significance.
> 
> Regards,
> Gopichand.
> 
> 
> On Fri, Mar 21, 2014 at 3:35 PM, Gopichand Paturi <gopichandpaturi at gmail.com
> > wrote:
> 
> > Hi Robert (atdotde),
> >
> > I am currently trying to familiarize with the decompression code i.e
> > deco.c.
> > I have a small doubt. I see this array
> >
> > const double buehlmann_He_factor_expositon_one_second[]

Its precomputed constants for the he-exposure for one second.

The period_in_seconds is the exposure period on seconds, if its other
than one second we can't use our pre-computed constants, so we need to
compute them. We also cache these to minimize the computational costs.

//Anton


> >
> > in the code. I didn't understand what these constants exactly do.
> >
> > I see its usage in computation of factor for  specific gas
> >
> > double he_factor(int period_in_seconds, int ci)
> > {
> > static struct factor_cache cache[16];
> >
> > if (period_in_seconds == 1)
> > return buehlmann_He_factor_expositon_one_second[ci];
> >
> > if (period_in_seconds != cache[ci].last_period) {
> > cache[ci].last_period = period_in_seconds;
> >  cache[ci].last_factor = 1 - pow(2.0, -period_in_seconds /
> > (buehlmann_He_t_halflife[ci] * 60));
> > }
> >
> >  return cache[ci].last_factor;
> > }
> >
> >
> > I get that it's some kind of constant involved, but I'm not exactly
> > understanding the supporting theory.
> > Kindly, help me with this.
> >
> > Thanks & Regards,
> > Gopichand.
> >
> >
> >

> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface


-- 
Anton Lundin	+46702-161604


More information about the subsurface mailing list