IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 8, 2006, 1:38:54 AM (20 years ago)
Author:
magnier
Message:
  • moved psHistogram functions to psHistogram.c,h (pslib_strict.h, MAkefile.am, psMemory.c)
  • changed psVectorStats return value to bool (psImageGeomManip.c, psImagePixelExtract.c, psImageStats.c, psMinPoly.c,
  • added FITTED_MEAN,STDEV_V2 (quadratic fit to log-peak)
  • added stats->results
  • set stats->results when stats are measured
  • return stats calculated even if not requested
  • moved vectorFittedStats call out of vectorRobustStats to psVectorStats
  • internal calls to private stats function XXX now tests stats->results for the corresponding flag, NOT if value of stats->XXX == NAN.
  • dropped unused function NonEmpty (commented out)
  • rolled up vectorSampleMedian with if tests in the loop
  • rolled up vectorSampleStdev with if tests in the loop
  • call psError on failure for any internal stats call (the user should call psErrorClear if they ignore errors from psVectorStats)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/math/tap_psStats_Sample_01.c

    r10395 r10550  
    215215                         };
    216216
     217static float yraw_03[] = {
     218                             183.6000061, 171.3600006, 182.5800018, 178.5, 176.4600067,
     219                             176.4600067, 171.3600006, 178.5, 183.6000061, 175.4400024,
     220                             159.1199951, 180.5399933, 183.6000061, 187.6799927, 175.4400024,
     221                             181.5599976, 174.4199982, 179.5200043, 180.5399933, 187.6799927,
     222                             183.6000061, 171.3600006, 177.4799957, 192.7799988, 184.6199951,
     223                             176.4600067, 178.5, 182.5800018, 173.3999939, 191.7599945,
     224                             202.9799957, 167.2799988, 181.5599976, 185.6399994, 173.3999939,
     225                             159.1199951, 178.5, 188.6999969, 179.5200043, 178.5,
     226                             184.6199951, 175.4400024, 186.6600037, 179.5200043, 183.6000061,
     227                             182.5800018, 173.3999939, 181.5599976, 184.6199951, 177.4799957,
     228                             162.1799927, 186.6600037, 163.1999969, 199.9199982, 173.3999939,
     229                             170.3399963, 184.6199951, 190.7400055, 173.3999939, 178.5,
     230                             189.7200012, 192.7799988, 166.2599945, 187.6799927, 174.4199982,
     231                             176.4600067, 181.5599976, 199.9199982, 193.8000031, 170.3399963,
     232                             182.5800018, 199.9199982, 183.6000061, 160.1399994, 184.6199951,
     233                             195.8399963, 173.3999939, 189.7200012, 192.7799988, 162.1799927,
     234                             174.4199982, 190.7400055, 175.4400024, 192.7799988, 181.5599976,
     235                             185.6399994, 184.6199951, 166.2599945, 189.7200012, 192.7799988,
     236                             183.6000061, 190.7400055, 188.6999969, 174.4199982, 184.6199951,
     237                             186.6600037, 182.5800018, 173.3999939, 171.3600006, 166.2599945,
     238                             166.2599945, 176.4600067, 147.8999939, 187.6799927, 166.2599945,
     239                             173.3999939, 179.5200043, 166.2599945, 169.3200073, 172.3800049,
     240                             174.4199982, 195.8399963, 192.7799988, 177.4799957, 181.5599976,
     241                             163.1999969, 171.3600006, 194.8200073, 159.1199951, 173.3999939,
     242                             182.5800018, 178.5, 179.5200043, 184.6199951, 179.5200043,
     243                             164.2200012, 191.7599945, 177.4799957, 186.6600037, 168.3000031,
     244                             168.3000031, 168.3000031, 180.5399933, 179.5200043, 175.4400024,
     245                             174.4199982, 184.6199951, 186.6600037, 164.2200012, 169.3200073,
     246                             187.6799927, 189.7200012, 166.2599945, 169.3200073, 187.6799927,
     247                             172.3800049, 204, 194.8200073, 177.4799957, 188.6999969,
     248                             171.3600006, 184.6199951, 182.5800018, 184.6199951, 176.4600067,
     249                             186.6600037, 170.3399963, 170.3399963, 182.5800018, 184.6199951,
     250                             168.3000031, 175.4400024, 176.4600067, 164.2200012, 183.6000061,
     251                             161.1600037, 175.4400024, 167.2799988, 179.5200043, 176.4600067,
     252                             175.4400024, 179.5200043, 158.1000061, 168.3000031, 168.3000031,
     253                             179.5200043, 192.7799988, 190.7400055, 178.5, 173.3999939,
     254                             180.5399933, 179.5200043, 191.7599945, 184.6199951, 177.4799957,
     255                             182.5800018, 188.6999969, 169.3200073, 162.1799927, 172.3800049,
     256                             160.1399994, 177.4799957, 176.4600067, 180.5399933, 170.3399963,
     257                             168.3000031, 171.3600006, 180.5399933, 162.1799927, 163.1999969,
     258                             170.3399963, 180.5399933, 164.2200012, 183.6000061, 178.5,
     259                             193.8000031, 177.4799957, 178.5, 183.6000061, 192.7799988,
     260                             157.0800018, 176.4600067, 190.7400055, 179.5200043, 157.0800018,
     261                             178.5, 165.2400055, 195.8399963, 177.4799957, 166.2599945,
     262                             172.3800049, 182.5800018, 175.4400024, 187.6799927, 164.2200012,
     263                             178.5, 173.3999939, 173.3999939, 173.3999939, 172.3800049,
     264                             183.6000061, 181.5599976, 163.1999969, 179.5200043, 193.8000031,
     265                             172.3800049, 158.1000061, 171.3600006, 165.2400055, 183.6000061,
     266                             187.6799927, 158.1000061, 171.3600006, 168.3000031, 166.2599945,
     267                             166.2599945, 178.5, 179.5200043, 165.2400055, 176.4600067,
     268                             160.1399994, 193.8000031, 170.3399963, 162.1799927, 180.5399933,
     269                             159.1199951, 189.7200012, 160.1399994, 196.8600006, 173.3999939,
     270                             170.3399963, 165.2400055, 193.8000031, 192.7799988, 184.6199951,
     271                             151.9799957, 167.2799988, 162.1799927, 183.6000061, 166.2599945,
     272                             177.4799957, 168.3000031, 191.7599945, 181.5599976, 166.2599945,
     273                             171.3600006, 188.6999969, 172.3800049, 195.8399963, 189.7200012,
     274                             177.4799957, 167.2799988, 191.7599945, 169.3200073, 181.5599976,
     275                             180.5399933, 162.1799927, 171.3600006, 162.1799927, 171.3600006,
     276                             177.4799957, 167.2799988, 180.5399933, 182.5800018, 187.6799927,
     277                             175.4400024, 193.8000031, 174.4199982, 183.6000061, 179.5200043,
     278                             164.2200012, 162.1799927, 186.6600037, 189.7200012, 186.6600037,
     279                             171.3600006, 187.6799927, 189.7200012, 175.4400024, 184.6199951,
     280                             172.3800049, 177.4799957, 183.6000061, 176.4600067, 171.3600006,
     281                             172.3800049, 181.5599976, 175.4400024, 170.3399963, 196.8600006,
     282                             201.9600067, 180.5399933, 176.4600067, 183.6000061, 175.4400024,
     283                             184.6199951, 163.1999969, 177.4799957, 176.4600067, 175.4400024,
     284                             192.7799988, 167.2799988, 176.4600067, 184.6199951, 184.6199951,
     285                             177.4799957, 185.6399994, 196.8600006, 186.6600037, 184.6199951,
     286                             169.3200073, 164.2200012, 185.6399994, 168.3000031, 186.6600037,
     287                             180.5399933, 177.4799957, 177.4799957, 186.6600037, 191.7599945,
     288                             177.4799957, 181.5599976, 166.2599945, 179.5200043, 184.6199951,
     289                             178.5, 171.3600006, 184.6199951, 192.7799988, 182.5800018,
     290                             186.6600037, 175.4400024, 182.5800018, 173.3999939, 186.6600037,
     291                             162.1799927, 175.4400024, 196.8600006, 166.2599945, 189.7200012,
     292                             189.7200012, 182.5800018, 172.3800049, 165.2400055, 191.7599945,
     293                             174.4199982, 173.3999939, 178.5, 171.3600006, 157.0800018,
     294                             182.5800018, 161.1600037, 195.8399963, 186.6600037, 167.2799988,
     295                             166.2599945, 182.5800018, 178.5, 176.4600067, 181.5599976,
     296                             184.6199951, 183.6000061, 179.5200043, 174.4199982, 167.2799988,
     297                             187.6799927, 176.4600067, 165.2400055, 179.5200043, 157.0800018,
     298                             171.3600006, 170.3399963, 175.4400024, 161.1600037, 185.6399994,
     299                             169.3200073, 192.7799988, 175.4400024, 172.3800049, 180.5399933,
     300                             183.6000061, 174.4199982, 176.4600067, 164.2200012, 183.6000061,
     301                             179.5200043, 165.2400055, 169.3200073, 172.3800049, 149.9400024,
     302                             175.4400024, 188.6999969, 190.7400055, 171.3600006, 172.3800049,
     303                             183.6000061, 178.5, 165.2400055, 176.4600067, 177.4799957,
     304                             188.6999969, 192.7799988, 183.6000061, 163.1999969, 186.6600037,
     305                             183.6000061, 160.1399994, 167.2799988, 172.3800049, 179.5200043,
     306                             189.7200012, 172.3800049, 177.4799957, 161.1600037, 174.4199982,
     307                             190.7400055, 181.5599976, 187.6799927, 176.4600067, 176.4600067,
     308                             183.6000061, 176.4600067, 188.6999969, 174.4199982, 170.3399963,
     309                             185.6399994, 177.4799957, 172.3800049, 179.5200043, 175.4400024,
     310                             170.3399963, 169.3200073, 176.4600067, 177.4799957, 169.3200073,
     311                             199.9199982, 171.3600006, 194.8200073, 188.6999969, 193.8000031,
     312                             182.5800018, 171.3600006, 177.4799957, 175.4400024, 172.3800049,
     313                             166.2599945, 183.6000061, 157.0800018, 177.4799957, 193.8000031,
     314                             168.3000031, 175.4400024, 175.4400024, 170.3399963, 191.7599945,
     315                             189.7200012, 182.5800018, 177.4799957, 157.0800018, 174.4199982,
     316                             189.7200012, 162.1799927, 184.6199951, 164.2200012, 157.0800018,
     317                             197.8800049, 175.4400024, 184.6199951, 202.9799957, 190.7400055,
     318                             171.3600006, 160.1399994, 162.1799927, 176.4600067, 180.5399933,
     319                             206.0399933, 189.7200012, 170.3399963, 175.4400024, 175.4400024,
     320                             185.6399994, 187.6799927, 168.3000031, 176.4600067, 177.4799957,
     321                             185.6399994, 167.2799988, 178.5, 182.5800018, 179.5200043,
     322                             173.3999939, 185.6399994, 196.8600006, 183.6000061, 162.1799927,
     323                             176.4600067, 189.7200012, 208.0800018, 177.4799957, 163.1999969,
     324                             187.6799927, 196.8600006, 180.5399933, 188.6999969, 163.1999969,
     325                             187.6799927, 168.3000031, 182.5800018, 181.5599976, 174.4199982,
     326                             181.5599976, 161.1600037, 163.1999969, 184.6199951, 190.7400055,
     327                             181.5599976, 185.6399994, 186.6600037, 173.3999939, 172.3800049,
     328                             179.5200043, 187.6799927, 191.7599945, 190.7400055, 183.6000061,
     329                             166.2599945, 196.8600006, 172.3800049, 174.4199982, 181.5599976,
     330                             177.4799957, 176.4600067, 188.6999969, 184.6199951, 169.3200073,
     331                             178.5, 186.6600037, 174.4199982, 185.6399994, 201.9600067,
     332                             171.3600006, 177.4799957, 183.6000061, 165.2400055, 189.7200012,
     333                             188.6999969, 178.5, 163.1999969, 169.3200073, 178.5,
     334                             182.5800018, 173.3999939, 177.4799957, 165.2400055, 163.1999969,
     335                             175.4400024, 184.6199951, 189.7200012, 186.6600037, 188.6999969,
     336                             163.1999969, 158.1000061, 172.3800049, 186.6600037, 173.3999939,
     337                             157.0800018, 158.1000061, 172.3800049, 197.8800049, 171.3600006,
     338                             172.3800049, 184.6199951, 173.3999939, 174.4199982, 175.4400024,
     339                             166.2599945, 166.2599945, 172.3800049, 171.3600006, 181.5599976,
     340                             181.5599976, 187.6799927, 180.5399933, 169.3200073, 182.5800018,
     341                             178.5, 179.5200043, 184.6199951, 175.4400024, 175.4400024,
     342                             158.1000061, 182.5800018, 196.8600006, 167.2799988, 178.5,
     343                             174.4199982, 180.5399933, 195.8399963, 183.6000061, 200.9400024,
     344                             189.7200012, 186.6600037, 173.3999939, 173.3999939, 180.5399933,
     345                             172.3800049, 157.0800018, 163.1999969, 171.3600006, 190.7400055,
     346                             196.8600006, 179.5200043, 175.4400024, 169.3200073, 158.1000061,
     347                             157.0800018, 180.5399933, 173.3999939, 170.3399963, 175.4400024,
     348                             193.8000031, 170.3399963, 164.2200012, 174.4199982, 185.6399994,
     349                             178.5, 176.4600067, 176.4600067, 179.5200043, 176.4600067,
     350                             171.3600006, 205.0200043, 184.6199951, 180.5399933, 165.2400055,
     351                             167.2799988, 162.1799927, 165.2400055, 180.5399933, 169.3200073,
     352                             176.4600067, 182.5800018, 182.5800018, 175.4400024, 186.6600037,
     353                             182.5800018, 183.6000061, 163.1999969, 161.1600037, 189.7200012,
     354                             181.5599976, 187.6799927, 173.3999939, 173.3999939, 177.4799957,
     355                             179.5200043, 198.8999939, 177.4799957, 183.6000061, 154.0200043,
     356                             188.6999969, 181.5599976, 177.4799957, 174.4199982, 202.9799957,
     357                             168.3000031, 164.2200012, 187.6799927, 171.3600006, 189.7200012,
     358                             185.6399994, 187.6799927, 157.0800018, 193.8000031, 160.1399994,
     359                             166.2599945, 193.8000031, 166.2599945, 168.3000031, 179.5200043,
     360                             181.5599976, 172.3800049, 183.6000061, 184.6199951, 180.5399933,
     361                             177.4799957, 192.7799988, 171.3600006, 197.8800049, 190.7400055,
     362                             182.5800018, 178.5, 189.7200012, 172.3800049, 199.9199982,
     363                             183.6000061, 179.5200043, 170.3399963, 179.5200043, 181.5599976,
     364                             178.5, 186.6600037, 177.4799957, 160.1399994, 176.4600067,
     365                             173.3999939, 168.3000031, 180.5399933, 179.5200043, 175.4400024,
     366                             188.6999969, 175.4400024, 178.5, 161.1600037, 181.5599976,
     367                             184.6199951, 169.3200073, 187.6799927, 164.2200012, 176.4600067,
     368                             176.4600067, 174.4199982, 189.7200012, 192.7799988, 181.5599976,
     369                             165.2400055, 173.3999939, 184.6199951, 164.2200012, 181.5599976,
     370                             167.2799988, 157.0800018, 175.4400024, 172.3800049, 172.3800049,
     371                             170.3399963, 166.2599945, 185.6399994, 175.4400024, 184.6199951,
     372                             179.5200043, 198.8999939, 189.7200012, 164.2200012, 198.8999939,
     373                             169.3200073, 183.6000061, 191.7599945, 168.3000031, 178.5,
     374                             172.3800049, 169.3200073, 196.8600006, 170.3399963, 192.7799988,
     375                             183.6000061, 186.6600037, 181.5599976, 187.6799927, 198.8999939,
     376                             167.2799988, 177.4799957, 165.2400055, 173.3999939, 182.5800018,
     377                             190.7400055, 167.2799988, 184.6199951, 180.5399933, 165.2400055,
     378                             166.2599945, 162.1799927, 175.4400024, 169.3200073, 187.6799927,
     379                             155.0399933, 173.3999939, 165.2400055, 174.4199982, 183.6000061,
     380                             167.2799988, 186.6600037, 175.4400024, 173.3999939, 177.4799957,
     381                             192.7799988, 180.5399933, 191.7599945, 185.6399994, 194.8200073,
     382                             201.9600067, 166.2599945, 171.3600006, 177.4799957, 194.8200073,
     383                             191.7599945, 177.4799957, 167.2799988, 188.6999969, 172.3800049,
     384                             162.1799927, 169.3200073, 198.8999939, 183.6000061, 170.3399963,
     385                             190.7400055, 170.3399963, 169.3200073, 185.6399994, 181.5599976,
     386                             166.2599945, 187.6799927, 169.3200073, 157.0800018, 165.2400055,
     387                             176.4600067, 174.4199982, 166.2599945, 177.4799957, 195.8399963,
     388                             187.6799927, 186.6600037, 194.8200073, 181.5599976, 172.3800049,
     389                             166.2599945, 168.3000031, 183.6000061, 168.3000031, 174.4199982,
     390                             185.6399994, 180.5399933, 181.5599976, 189.7200012, 172.3800049,
     391                             183.6000061, 187.6799927, 183.6000061, 200.9400024, 184.6199951,
     392                             173.3999939, 176.4600067, 172.3800049, 169.3200073, 166.2599945,
     393                             186.6600037, 181.5599976, 161.1600037, 182.5800018, 179.5200043,
     394                             178.5, 174.4199982, 170.3399963, 179.5200043, 193.8000031,
     395                             188.6999969, 146.8800049, 192.7799988, 171.3600006, 178.5,
     396                             177.4799957, 184.6199951, 180.5399933, 163.1999969, 159.1199951,
     397                             160.1399994, 178.5, 176.4600067, 176.4600067, 192.7799988,
     398                             161.1600037, 166.2599945, 162.1799927, 172.3800049, 175.4400024,
     399                             168.3000031, 201.9600067, 188.6999969, 185.6399994, 175.4400024,
     400                             175.4400024, 182.5800018, 182.5800018, 172.3800049, 175.4400024,
     401                             179.5200043, 184.6199951, 163.1999969, 195.8399963, 180.5399933,
     402                             170.3399963, 212.1600037, 166.2599945, 187.6799927, 179.5200043,
     403                             178.5, 176.4600067, 172.3800049, 183.6000061, 179.5200043,
     404                             176.4600067, 185.6399994, 161.1600037, 187.6799927, 167.2799988,
     405                             187.6799927, 199.9199982, 187.6799927, 169.3200073, 158.1000061,
     406                             200.9400024, 191.7599945, 179.5200043, 170.3399963, 186.6600037,
     407                             170.3399963, 184.6199951, 189.7200012, 197.8800049, 186.6600037,
     408                             171.3600006, 164.2200012, 183.6000061, 180.5399933, 165.2400055,
     409                             160.1399994, 183.6000061, 166.2599945, 183.6000061, 196.8600006,
     410                             175.4400024, 172.3800049, 172.3800049, 181.5599976, 177.4799957,
     411                             173.3999939, 176.4600067, 180.5399933, 176.4600067, 178.5,
     412                             163.1999969, 189.7200012, 175.4400024, 174.4199982, 185.6399994,
     413                             182.5800018, 169.3200073, 194.8200073, 192.7799988, 188.6999969,
     414                             193.8000031, 175.4400024, 165.2400055, 180.5399933, 184.6199951,
     415                             176.4600067, 171.3600006, 188.6999969, 199.9199982, 183.6000061,
     416                             169.3200073, 175.4400024, 180.5399933, 174.4199982, 167.2799988,
     417                             184.6199951, 177.4799957, 180.5399933, 180.5399933, 184.6199951,
     418                             178.5, 186.6600037, 161.1600037, 183.6000061, 168.3000031,
     419                             188.6999969, 184.6199951, 171.3600006, 185.6399994, 167.2799988,
     420                             162.1799927, 186.6600037, 175.4400024, 166.2599945, 182.5800018,
     421                             171.3600006, 176.4600067, 192.7799988, 178.5, 168.3000031,
     422                             182.5800018, 184.6199951, 148.9199982, 172.3800049, 168.3000031,
     423                             181.5599976, 154.0200043, 166.2599945, 174.4199982, 166.2599945,
     424                             178.5, 184.6199951, 176.4600067, 171.3600006, 188.6999969,
     425                             177.4799957, 172.3800049, 176.4600067, 179.5200043, 176.4600067,
     426                             161.1600037, 166.2599945, 181.5599976, 170.3399963, 176.4600067,
     427                             163.1999969, 183.6000061, 206.0399933, 171.3600006, 186.6600037,
     428                             176.4600067, 163.1999969, 179.5200043, 176.4600067, 182.5800018,
     429                             167.2799988, 174.4199982, 188.6999969, 177.4799957, 190.7400055,
     430                             176.4600067, 175.4400024, 174.4199982, 179.5200043, 182.5800018,
     431                             182.5800018, 175.4400024, 165.2400055, 180.5399933, 178.5,
     432                             176.4600067, 191.7599945, 173.3999939, 186.6600037, 165.2400055,
     433                             173.3999939, 188.6999969, 172.3800049, 168.3000031, 193.8000031,
     434                             180.5399933, 172.3800049, 180.5399933, 189.7200012, 170.3399963,
     435                             170.3399963, 195.8399963, 173.3999939, 187.6799927, 165.2400055,
     436                             147.8999939, 173.3999939, 184.6199951, 171.3600006, 178.5,
     437                             163.1999969, 171.3600006, 190.7400055, 180.5399933, 156.0599976,
     438                             164.2200012, 172.3800049, 202.9799957, 201.9600067, 175.4400024,
     439                             193.8000031, 176.4600067, 182.5800018, 184.6199951, 178.5,
     440                             169.3200073, 166.2599945, 173.3999939, 182.5800018, 171.3600006,
     441                             167.2799988, 185.6399994, 179.5200043, 188.6999969, 194.8200073,
     442                             177.4799957, 177.4799957, 164.2200012, 189.7200012, 193.8000031,
     443                             173.3999939, 178.5, 184.6199951, 191.7599945, 191.7599945,
     444                             162.1799927, 171.3600006, 165.2400055, 197.8800049, 169.3200073,
     445                             178.5, 174.4199982, 183.6000061, 189.7200012, 181.5599976,
     446                             185.6399994, 179.5200043, 181.5599976, 161.1600037, 173.3999939,
     447                             187.6799927, 177.4799957, 182.5800018, 171.3600006, 188.6999969,
     448                             194.8200073, 176.4600067, 182.5800018, 157.0800018, 169.3200073,
     449                             170.3399963, 168.3000031, 190.7400055, 170.3399963, 185.6399994,
     450                             195.8399963, 172.3800049, 213.1799927, 187.6799927, 187.6799927,
     451                             178.5, 181.5599976, 183.6000061, 163.1999969, 169.3200073,
     452                             180.5399933, 204, 175.4400024, 158.1000061, 174.4199982,
     453                             183.6000061, 181.5599976, 181.5599976, 180.5399933, 172.3800049,
     454                             188.6999969, 166.2599945, 196.8600006, 187.6799927, 196.8600006,
     455                             164.2200012, 160.1399994, 165.2400055, 172.3800049, 177.4799957,
     456                             173.3999939, 168.3000031, 181.5599976, 164.2200012, 177.4799957,
     457                             182.5800018, 162.1799927, 168.3000031, 181.5599976, 179.5200043,
     458                             171.3600006, 173.3999939, 176.4600067, 197.8800049, 172.3800049,
     459                             189.7200012, 172.3800049, 161.1600037, 183.6000061, 173.3999939,
     460                             188.6999969, 161.1600037, 180.5399933, 160.1399994, 166.2599945,
     461                             164.2200012, 182.5800018, 169.3200073, 176.4600067, 186.6600037,
     462                             192.7799988, 163.1999969, 153, 182.5800018, 184.6199951,
     463                             166.2599945, 167.2799988, 186.6600037, 177.4799957, 174.4199982,
     464                             175.4400024, 164.2200012, 180.5399933, 178.5, 176.4600067,
     465                             164.2200012, 160.1399994, 178.5, 176.4600067, 180.5399933,
     466                             182.5800018, 179.5200043, 169.3200073, 178.5, 172.3800049,
     467                             171.3600006, 178.5, 166.2599945, 171.3600006, 181.5599976,
     468                             162.1799927, 157.0800018, 189.7200012, 177.4799957, 164.2200012,
     469                             179.5200043, 187.6799927, 172.3800049, 158.1000061, 164.2200012,
     470                             177.4799957, 165.2400055, 185.6399994, 174.4199982, 188.6999969,
     471                             173.3999939, 168.3000031, 164.2200012, 187.6799927, 209.1000061,
     472                             172.3800049, 177.4799957, 170.3399963, 172.3800049, 164.2200012,
     473                             190.7400055, 177.4799957, 165.2400055, 168.3000031, 173.3999939,
     474                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     475                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     476                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     477                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     478                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     479                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     480                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     481                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     482                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     483                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     484                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     485                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     486                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
     487                         };
     488
    217489int main (void)
    218490{
    219491    plan_tests(26);
    220492
    221     diag("psStats Tests with sample SDSS data from RHL");
     493    diag("psStats Tests with sample SDSS data from RHL and Megacam from EAM");
    222494    diag("this file does not yet define a specific test");
    223     diag ("the fitted mean is currently wrong for these two data sets");
     495    diag("the fitted mean is currently wrong for these two data sets");
    224496
    225497    {
     
    243515
    244516        psVectorStats (stats, y, NULL, NULL, 1);
    245         ok (1, "fitted  mean   %f, stdev %f", stats->fittedMean,   stats->fittedStdev);
    246         ok (1, "robust  median %f, stdev %f", stats->robustMedian, stats->robustStdev);
    247         ok (1, "clipped mean   %f, stdev %f", stats->clippedMean,  stats->clippedStdev);
    248         ok (1, "sample  mean   %f, stdev %f", stats->sampleMean,   stats->sampleStdev);
    249         ok (1, "sample  median %f, stdev %f", stats->sampleMedian, stats->sampleStdev);
     517        ok (1, "sample  mean    %f, stdev %f", stats->sampleMean,   stats->sampleStdev);
     518        ok (1, "sample  median  %f, stdev %f", stats->sampleMedian, stats->sampleStdev);
     519        ok (1, "clipped mean    %f, stdev %f", stats->clippedMean,  stats->clippedStdev);
     520        ok (1, "robust  median  %f, stdev %f", stats->robustMedian, stats->robustStdev);
     521        ok (1, "fitted  mean    %f, stdev %f", stats->fittedMean,   stats->fittedStdev);
     522        psFree (stats);
     523
     524        stats = psStatsAlloc (PS_STAT_FITTED_MEAN_V2 | PS_STAT_FITTED_STDEV_V2 | PS_STAT_USE_BINSIZE);
     525        stats->binsize = 1.0;
     526        psVectorStats (stats, y, NULL, NULL, 1);
     527        ok (1, "fitted  mean v2 %f, stdev %f", stats->fittedMean,   stats->fittedStdev);
     528        psFree (stats);
    250529
    251530        psFree (y);
    252         psFree (stats);
    253531        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    254532    }
     
    273551
    274552        psVectorStats (stats, y, NULL, NULL, 1);
    275         ok (1, "fitted  mean   %f, stdev %f", stats->fittedMean,   stats->fittedStdev);
    276         ok (1, "robust  median %f, stdev %f", stats->robustMedian, stats->robustStdev);
    277         ok (1, "clipped mean   %f, stdev %f", stats->clippedMean,  stats->clippedStdev);
    278553        ok (1, "sample  mean   %f, stdev %f", stats->sampleMean,   stats->sampleStdev);
    279554        ok (1, "sample  median %f, stdev %f", stats->sampleMedian, stats->sampleStdev);
     555        ok (1, "clipped mean   %f, stdev %f", stats->clippedMean,  stats->clippedStdev);
     556        ok (1, "robust  median %f, stdev %f", stats->robustMedian, stats->robustStdev);
     557        ok (1, "fitted  mean   %f, stdev %f", stats->fittedMean,   stats->fittedStdev);
     558        psFree (stats);
     559
     560        stats = psStatsAlloc (PS_STAT_FITTED_MEAN_V2 | PS_STAT_FITTED_STDEV_V2 | PS_STAT_USE_BINSIZE);
     561        stats->binsize = 1.0;
     562        psVectorStats (stats, y, NULL, NULL, 1);
     563        ok (1, "fitted  mean v2 %f, stdev %f", stats->fittedMean,   stats->fittedStdev);
     564        psFree (stats);
    280565
    281566        psFree (y);
    282         psFree (stats);
    283567        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    284568    }
    285569
     570    {
     571        psMemId id = psMemGetId();
     572
     573        diag("sample 3");
     574        psStats *stats = psStatsAlloc (PS_STAT_FITTED_MEAN | PS_STAT_FITTED_STDEV |
     575                                       PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV |
     576                                       PS_STAT_CLIPPED_MEAN | PS_STAT_CLIPPED_STDEV |
     577                                       PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_MEDIAN |
     578                                       PS_STAT_SAMPLE_STDEV | PS_STAT_USE_BINSIZE);
     579        stats->binsize = 1.0;
     580
     581
     582        // copy data in static array
     583        int nPts = sizeof(yraw_03) / sizeof (float);
     584        psVector *y = psVectorAlloc (nPts, PS_TYPE_F32);
     585        for (int i = 0; i < y->n; i++) {
     586            y->data.F32[i] = yraw_03[i];
     587        }
     588
     589        psVectorStats (stats, y, NULL, NULL, 1);
     590        ok (1, "sample  mean   %f, stdev %f", stats->sampleMean,   stats->sampleStdev);
     591        ok (1, "sample  median %f, stdev %f", stats->sampleMedian, stats->sampleStdev);
     592        ok (1, "clipped mean   %f, stdev %f", stats->clippedMean,  stats->clippedStdev);
     593        ok (1, "robust  median %f, stdev %f", stats->robustMedian, stats->robustStdev);
     594        ok (1, "fitted  mean   %f, stdev %f", stats->fittedMean,   stats->fittedStdev);
     595        psFree (stats);
     596
     597        stats = psStatsAlloc (PS_STAT_FITTED_MEAN_V2 | PS_STAT_FITTED_STDEV_V2 | PS_STAT_USE_BINSIZE);
     598        stats->binsize = 1.0;
     599        psVectorStats (stats, y, NULL, NULL, 1);
     600        ok (1, "fitted  mean v2 %f, stdev %f", stats->fittedMean,   stats->fittedStdev);
     601        psFree (stats);
     602
     603        psFree (y);
     604        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     605    }
     606
    286607    return exit_status();
    287608}
Note: See TracChangeset for help on using the changeset viewer.