IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42684


Ignore:
Timestamp:
Jun 1, 2024, 3:18:51 PM (2 years ago)
Author:
eugene
Message:

option to normalized gaussian to a specific total flux

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20230313/Ohana/src/opihi/cmd.astro/mkgauss.c

    r41341 r42684  
    1111  Buffer *buf;
    1212
     13  // if TRUE, integrated flux is Flux, else Io is Flux
    1314  int Normalize = FALSE;
    1415  if ((N = get_argument (argc, argv, "-norm"))) {
     
    1617    remove_argument (N, &argc, argv);
    1718  }   
     19
     20  // Io or integrated flux (depending on value of Normalize)
     21  float Flux = 1.0;
     22  if ((N = get_argument (argc, argv, "-flux"))) {
     23    remove_argument (N, &argc, argv);
     24    Flux = atof(argv[N]);
     25    remove_argument (N, &argc, argv);
     26  }   
     27
    1828
    1929  // this should be Nx/2, Ny/2 if not set
     
    2939  if ((argc < 3) || (argc > 5)) {
    3040    gprint (GP_ERR, "USAGE: mkgauss (buffer) (sigma) [[sy/sx] angle]\n");
     41    gprint (GP_ERR, " -flux flux : integral or peak is flux (default is 1.0)\n");
     42    gprint (GP_ERR, " -norm : integral is flux (else peak)\n");
     43    gprint (GP_ERR, " -c X Y : place center at X,Y\n");
    3144    return (FALSE);
    3245  }
     
    6679  /* f = exp (-r), r = (x^2 / 2Sx) + (y^2 / 2Sy) + Sxy*x*y */
    6780
    68   double Io = Normalize ? 1.0 / (2.0 * M_PI * Sig_x * Sig_y) : 1.0;
     81  double Io = Normalize ? Flux / (2.0 * M_PI * Sig_x * Sig_y) : Flux;
    6982
    7083  in = (float *) buf[0].matrix.buffer;
Note: See TracChangeset for help on using the changeset viewer.