IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 18, 2009, 6:24:53 AM (17 years ago)
Author:
eugene
Message:

updates for petrosian analysis study

Location:
branches/eam_branches/20090715/psphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/psphot/src

    • Property svn:ignore
      •  

        old new  
        1818psphotVersionDefinitions.h
        1919psphotMomentsStudy
         20psphotPetrosianStudy
  • branches/eam_branches/20090715/psphot/src/pmPetrosian.c

    r25032 r25105  
    1111# include "psphotInternal.h"
    1212
    13 static void pmPetrosianFree(pmPetrosian *petro)
     13static void pmPetrosianFree(pmPetrosian *petrosian)
    1414{
    15    if (!petro) {
     15    if (!petrosian) {
    1616        return;
    17    }
    18    psFree(petrosian->radii);
    19    psFree(petrosian->fluxes);
    20    psFree(petrosian->theta);
    21    psFree(petrosian->isophotalRadii);
     17    }
     18    psFree(petrosian->radii);
     19    psFree(petrosian->fluxes);
     20    psFree(petrosian->theta);
     21    psFree(petrosian->isophotalRadii);
     22
     23    psFree(petrosian->radiusElliptical);
     24    psFree(petrosian->fluxElliptical);
     25
     26    psFree(petrosian->binnedFlux);
     27    psFree(petrosian->radialBins);
     28    psFree(petrosian->area);
    2229}
    2330
     
    3239    petrosian->isophotalRadii = NULL;
    3340
    34     petrosian->axes = {0.0, 0.0, 0.0};
     41    petrosian->radiusElliptical = NULL;
     42    petrosian->fluxElliptical = NULL;
    3543
    36     return(petrosian);
     44    petrosian->radialBins = NULL;
     45    petrosian->area = NULL;
     46    petrosian->binnedFlux = NULL;
     47
     48    petrosian->petrosianRadius = NAN;
     49    petrosian->petrosianFlux = NAN;
     50
     51    // petrosian->axes = {0.0, 0.0, 0.0};
     52
     53    return petrosian;
    3754}
    3855
     56bool psphotPetrosianFreeVectors(pmPetrosian *petrosian) {
     57
     58    psFree(petrosian->radii);
     59    psFree(petrosian->fluxes);
     60    psFree(petrosian->theta);
     61    psFree(petrosian->isophotalRadii);
     62
     63    psFree(petrosian->radiusElliptical);
     64    psFree(petrosian->fluxElliptical);
     65
     66    psFree(petrosian->binnedFlux);
     67    psFree(petrosian->radialBins);
     68    psFree(petrosian->area);
     69
     70    petrosian->radii = NULL;
     71    petrosian->fluxes = NULL;
     72    petrosian->theta = NULL;
     73    petrosian->isophotalRadii = NULL;
     74
     75    petrosian->radiusElliptical = NULL;
     76    petrosian->fluxElliptical = NULL;
     77
     78    petrosian->radialBins = NULL;
     79    petrosian->area = NULL;
     80    petrosian->binnedFlux = NULL;
     81   
     82    return true;
     83}
     84
     85# define COMPARE_INDEX(A,B) (index->data.F32[A] < index->data.F32[B])
     86# define SWAP_INDEX(TYPE,A,B) { \
     87  float tmp; \
     88  if (A != B) { \
     89    tmp = index->data.F32[A]; \
     90    index->data.F32[A] = index->data.F32[B]; \
     91    index->data.F32[B] = tmp; \
     92    tmp = extra->data.F32[A]; \
     93    extra->data.F32[A] = extra->data.F32[B]; \
     94    extra->data.F32[B] = tmp; \
     95  } \
     96}
     97
     98bool psphotPetrosianSortPair (psVector *index, psVector *extra) {
     99
     100    // sort the vector set by the radius
     101    PSSORT (index->n, COMPARE_INDEX, SWAP_INDEX, NONE);
     102    return true;
     103}
Note: See TracChangeset for help on using the changeset viewer.