mHistogram Function Call

Function Arguments

/*-*********************************************************************************************/
/*                                                                                             */
/*  mHistogram                                                                                 */
/*                                                                                             */
/*  This program is essentially a subset of mViewer containing the code that determines        */
/*  the stretch for an image.  With it we can generate stretch information for a whole         */
/*  file (or one reference file), then use it when we create a set of JPEG/PNG files           */
/*  from a set of other subsets/files.                                                         */
/*                                                                                             */
/*  Only one file is processed, so if we want color we need to run this program three          */
/*  times.  The only arguments needed are the image / stretch min / stretch max / mode.        */
/*                                                                                             */
/*   char *imgFile       Input FITS file.                                                      */
/*   char *histFile      Output histogram file.                                                */
/*   char *minString     Data range minimum as a string (to allow '%' and 's' suffix.          */
/*   char *maxString     Data range maximum as a string (to allow '%' and 's' suffix.          */
/*   char *stretchType   Stretch type (linear, power(log**N), sinh, gaussian or gaussian-log)  */
/*                                                                                             */
/*   int   grayLogPower  If the stretch type is log to a power, the power value.               */
/*   char *betaString    If the stretch type is asinh, the transition data value.              */
/*                                                                                             */
/*   int   debug         Debugging output level.                                               */
/*                                                                                             */
/***********************************************************************************************/

struct mHistogramReturn *mHistogram(char *grayfile, char *histfile, 
                                    char *grayminstr, char *graymaxstr, char *graytype, int graylogpower, char *graybetastr, int indebug)

Return Structure

struct mHistogramReturn
{
   int    status;        // Return status (0: OK, 1:ERROR)
   char   msg [1024];    // Return message (for error return)
   char   json[4096];    // Return parameters as JSON string
   double minval;        // Data value associated with histogram minimum.
   double minpercent;    // Percentile value of histogram minimum.
   double minsigma;      // "Sigma" level of histogram minimum.
   double maxval;        // Data value associated with histogram maximum.
   double maxpercent;    // Percentile value of histogram maximum.
   double maxsigma;      // "Sigma" level of histogram maximum.
   double datamin;       // Minimum data value in file.
   double datamax;       // Maximum data value in file.
};