<commit_before>/*=======================================================================*/
/*  q_sky_nlow                                                           */
/*     COMICS N ÄãÊ¬»¶€Îsky²èÁü€«€éÇÈÄ¹³ÓÀµŒ°€òµá€á€ë                    */
/*                                                        Version 3
   $Log$
                                                                         */
/*=======================================================================*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "q_lib.h"

#define  DETX   500    /* ž¡œÐŽïxŒŽÊýžþŒè°·ºÇÂçÃÍ */
#define  DEBUG     0       /* ¥Ç¥Ð¥Ã¥°ÍÑ€ÎÊÑ¿ô(Ÿò·ï¥³¥ó¥Ñ¥€¥ë€Ë»ÈÍÑ) */

#define  LOOPNUMA   100  /* 200 */
#define  LOOPNUMB   400  /* 500 */
#define  ABIN      0.000005
#define  BBIN      0.001
#define  DEFA      0.0199
#define  DEFB      7.650

/*=======================================================================*/
/*   ¹œÂ€ÂÎ€ÎÀëžÀ                                                             */
/*   ÇÈÄ¹³ÓÀµŒ°€Î¥Ñ¥é¥á¡Œ¥¿                                                   */
typedef struct {
   double a;   /* fit parameter a */
   double b;   /* fit parameter b */
   double cr;  /* correlation coefficient */
   int32_t slit;  /* slit width */
} WAVE_FIT_PAR;

/*=======================================================================*/
void print_usage(char *);
int check_command_line(int,char **,char **,SPECIFIED_DATA *,WAVE_FIT_PAR *);
int skyline_data_nlow(double *) ;
double correlate(int32_t,double *,double *) ;
int q_skyfit_nlow(int32_t *,double *,int32_t,WAVE_FIT_PAR *) ;
int check_call_list_stat(SPECIFIED_DATA *) ;
int q_call_list_1list(SPECIFIED_DATA *,int32_t *,double *,int32_t *);
int q_list_stat_1list_func(SPECIFIED_DATA *,int32_t *,double *,int32_t *);
/*=======================================================================*/
void print_usage(char *s)
{
char *ss;

  ss=strip_name(s);
  fprintf(stdout,
"NAME\n"
"       %s - COMICS N ÄãÊ¬»¶€Îsky²èÁü€«€éÇÈÄ¹³ÓÀµŒ°€òµá€á€ë\n\n"
"SYNOPSIS\n"
"       %s fits_file w x_region default  z slit\n"
"       %s fits_file w x_region y        z slit\n"
"       %s fits_file w x_region y_region z slit\n\n"
"       %s fits_file w x_region default  z slit init_a init_b\n"
"       %s fits_file w x_region y        z slit init_a init_b\n"
"       %s fits_file w x_region y_region z slit init_a init_b\n\n"
"DESCRIPTION\n"
"       %s €Ï fits_file €ÇÍ¿€š€é€ì€¿²èÁü¥Õ¥¡¥€¥ë€ò²£Êýžþ€ËÀÚ€Ã€Æ¡¢\n"
"       €œ€Î¥Ô¡Œ¥¯€òsky€ÎÊüŒÍµ±Àþ€ÈÈæ³Ó€·€ÆN ÄãÊ¬»¶€ÎÇÈÄ¹³ÓÀµŒ°€òµá€á€ë\n"
"       €¿€á€Î€â€Î€Ç€¹¡£€œ€Î€¿€á¡¢ÆþÎÏ²èÁüfits_file€Ïsky€Î²èÁü(Àž²èÁü€«€é\n"
"       ¥À¡Œ¥¯€ò°ú€­¡¢€µ€é€Ë€Ê€ë€Ù€¯€Ê€é¥Õ¥é¥Ã¥È€Ç³ä€Ã€¿€â€Î)€ò»È€Š€Ù€­\n"
"       €Ç€¹¡£€Þ€¿¡¢€³€Î¥×¥í¥°¥é¥à€Ç€Ï N ÃæÊ¬»¶¡¢N ¹âÊ¬»¶¡¢ Q ÃæÊ¬»¶€Ë€Ï\n"
"       ÂÐ±þ€·€Æ€€€Þ€»€ó¡£\n\n"
"       °ì€Ä€á€ÎœñŒ°(4€Ä€á€Î°ú¿ô(y€ÎÈÏ°Ï»ØÄê)€Ë'default'€È€¢€ëŸì¹ç)\n"
"       €Ç€Ï¡¢ÇÈÄ¹³ÓÀµŒ°€Ï¡¢¥Ç¥Õ¥©¥ë¥È€Îy€ÎÃÍ€Ë€Ä€€€ÆÀÚ€êœÐ€·\n"
"       €Æ¥Õ¥£¥Ã¥È€·€¿·ë²Ì€òœÐÎÏ€·€Þ€¹¡£žœºß€Î¥Ç¥Õ¥©¥ë¥ÈÃÍ€Ï¡¢\n"
"               y=30,40,50,60,70,80,90,100,110,120,130,140,150,160,\n"
"                 180,190,200,210,220 \n"
"       €Î20²Õœê€Ë€Ê€Ã€Æ€€€Þ€¹¡£\n\n"
"       €¢€ëÆÃÄê€Îy€Ë€Ä€€€ÆÀÚ€êœÐ€·€Æ¥Õ¥£¥Ã¥È€ò¹Ô€€€¿€€Ÿì¹ç€Ë€Ï¡¢2€Ä€á\n"
"       €Ê€€€·3€Ä€á€ÎœñŒ°€òÍÑ€€€Æ¡¢€œ€Îy(€¢€ë€€€Ïy€ÎÈÏ°Ï)€ò»ØÄê€·€Þ€¹¡£\n"
"       y€ÏÈÏ°Ï€Ç»ØÄê€¹€ë€³€È€¬µö€µ€ì€Æ€€€Þ€¹€¬¡¢ŒÂºÝ€Î¥Õ¥£¥Ã¥È€ÏSN€¬\n"
"       ÎÉ€€žÂ€ê¡¢€Ê€ë€Ù€¯Ÿ¯€Ê€€yÈÏ°Ï€Ë€Ä€€€Æ¹Ô€ï€Ê€€€È¡¢µ±Àþ€¬€Ê€Þ€Ã€Æ\n"
"       ¥Õ¥£¥Ã¥È€¬€Š€Þ€¯€€€«€Ê€¯€Ê€ë²ÄÇœÀ­€¬€¢€ê€Þ€¹¡£\n\n"
"       €€€º€ì€ÎœñŒ°€Ç€â¡¢ÈÏ°Ï»ØÄê€Î»ÅÊý€Ïq_list_stat€È€ª€Ê€žœñŒ°€ËœŸ€€\n"
"       €Þ€¹¡£€Ê€ªw,z€Ï°ìÅÀ¡¢x€ÏÈÏ°Ï(€·€«€âa-b€Î·ÁŒ°)€Ç€¢€ëÉ¬Í×€¬€¢€ê€Þ€¹¡£\n\n"
"       slit€Ï¡¢ŽÑÂ¬»þ€Ë»ÈÍÑ€·€¿¥¹¥ê¥Ã¥È€Î¥µ¥€¥º€Ç€¹¡£pixÁêÅöÃ±°Ì€Ç\n"
"       ÆþÎÏ€·¡¢N¥Ð¥ó¥ÉÄãÊ¬»¶€ÎŸì¹ç¡¢2,3,4,6€ÎÃæ€«€é°ì€ÄÁª€ó€ÇÆþÎÏ€·€Þ€¹¡£\n\n"
"       1-3€Ä€á€ÎœñŒ°€Ç€Ï¡¢¥Õ¥£¥Ã¥È€¹€ë¥Ñ¥é¥á¡Œ¥¿a€ª€è€Ób€ÎÈÏ°Ï€Ï¡¢\n"
"       ¥×¥í¥°¥é¥à€Î¥Ç¥Õ¥©¥ë¥ÈÃÍ€ò»È€€€Þ€¹¡£žœºß€Î¥Ç¥Õ¥©¥ë¥ÈÃÍ€Ï\n"
"            a .... %8.5e - %8.5e      b .... %8.5e - %8.5e\n"
"       €Ë€Ê€Ã€Æ€€€Þ€¹¡£\n"
"       a€ª€è€Ób€ÎÈÏ°Ï€òÀßÄê€·€¿€€Ÿì¹ç€Ë€Ï4-6€Ä€á€ÎœñŒ°€òÍÑ€€€Þ€¹¡£\n"
"       €³€ÎŸì¹ç¡¢ºÇÅ¬¥Ñ¥é¥á¡Œ¥¿€Ï\n"
"            a .... [ init_a - %f , init_a + %f ]\n"
"            b .... [ init_b - %f , init_b + %f ]\n"
"       €ÎÈÏ°Ï€ÇÃµ€µ€ì€Þ€¹¡£\n\n"
"       ÆþÎÏ²èÁü€ÎŒ¡žµ€Ï¡¢NAXIS=3€Þ€¿€Ï4€Î€ßÂÐ±þ€·€Þ€¹¡£NAXIS4€ÎÃÍ€Ï€€€¯€Ä€Ç€â\n"
"       €«€Þ€€€Þ€»€ó€¬¡¢±é»»€Ïw=w€ÎÉôÊ¬€Ë€Ä€€€Æ¹Ô€€€Þ€¹¡£€Þ€¿¡¢NAXIS3€ÎÃÍ€â\n"
"       €€€¯€Ä€Ç€â€«€Þ€€€Þ€»€ó€¬¡¢COMA²èÁü€ÎÊ£¿ô€Îz€¬»Ä€Ã€Æ€€€ë²èÁü€ËÂÐ€·€Æ\n"
"       ¹Ô€Š€Î€Ï¡¢ÄÌŸï¡¢»þŽÖ€¬ÌµÂÌ€Ë€Ê€ë€È»×€ï€ì€Þ€¹¡£(Ã»€€»þŽÖ€Ç€ÎÇÈÄ¹ÊÑ²œ\n"
"       €òž«€¿€€€È€­€Ï€â€Á€í€óŒÂ¹Ô€·€Æ°ÕÌ£€¬€¢€ê€Þ€¹€¬)\n"
"       NAXIS1€ª€è€ÓNAXIS2€Ï¡¢ž·Ì©€ËCOMICS€Îž¡œÐŽï€Îx,y¿ô€Ë°ìÃ×€·€Æ€€€ëÉ¬Í×\n"
"       €Ï€¢€ê€Þ€»€ó¡£€³€Î€¿€á¡¢²èÁü€Î€æ€¬€ßÊäÀµ€Ê€É€Ç¡¢x,y¿ô€¬ÊÑ²œ€·€¿²èÁü\n"
"       €Ë€âÂÐ±þ€Ç€­€Þ€¹€¬¡¢ÂçÉý€ËCOMICSž¡œÐŽï€Î¥Õ¥©¡Œ¥Þ¥Ã¥È€«€é€º€ì€ë€È¡¢\n"
"       Âçµ€µ±Àþ¥Õ¥£¥Ã¥È€¬€Ç€­€Ê€¯€Ê€ê€Þ€¹¡£€³€ì€Ï¡¢žœºß€³€Î¥×¥í¥°¥é¥à€Ç€Ï¡¢\n"
"       ¥Õ¥£¥Ã¥È¥Ñ¥é¥á¡Œ¥¿€ò€¢€ë°ìÄê€ÎÈÏ°ÏÆâ€ÇÊÑ²œ€µ€»€Ê€¬€é¡¢€â€Ã€È€âÁêŽØ\n"
"       ·ž¿ô€Î¹â€¯€Ê€ëŸìœê€òÃµ€·€Æ€€€ë€¿€á€Ç€¹¡£\n\n"
	  ,ss,ss,ss,ss,ss,ss,ss,ss,DEFA-ABIN*LOOPNUMA/2,DEFA+ABIN*LOOPNUMA/2,
	  DEFB-BBIN*LOOPNUMB/2,DEFB+BBIN*LOOPNUMB/2,
	  ABIN*LOOPNUMA/2,ABIN*LOOPNUMA/2,BBIN*LOOPNUMB/2,BBIN*LOOPNUMB/2);
}
/*=======================================================================*/
int main(int argc, char ** argv)
{
char *ifile;
SPECIFIED_DATA spd;
static int x[DETX];
int32_t data_num ;
static double v[DETX];
int32_t j;
char buf[WORD_LEN];
WAVE_FIT_PAR fitpar ;

/* Check command line */
  if(check_command_line(argc,argv,&ifile,&spd,&fitpar)!=0) {
    fprintf(stdout,"Error @ check_command_line\n");exit(1);}

/* Open input file and out put files */
  if((spd.data.fp=fopen(ifile,"r"))==NULL){
    fprintf(stdout,"Cannot open %s\n",ifile);exit(1);}

/* Check NAIXISs */
  if(read_head(&(spd.data))!=0){
     fprintf(stdout,"Error @ read_fits_data 1 \n");return(-1);}
  if(spd.data.nax==3) {
     if(atoi(argv[2])!=1) {
        fprintf(stdout,"NAXIS=3. Then w must be 1.\n") ;
        exit(1) ;
     }
  } else if (spd.data.nax!=4) {
     fprintf(stdout,"NAXIS must be 3 or 4.\n") ;
     exit(1) ;
  }

/* Operation */
  if(spd.yr!=-1) {  /* »ØÄêy(1²Õœê)€Ç¥Õ¥£¥Ã¥È */
     /* q_list_stat €ÎžÆœÐ€·Ÿò·ï€Î¥Á¥§¥Ã¥¯ */
     if(check_call_list_stat(&spd)!=0) {
        fprintf(stdout,"Error @ check_call_list_stat\n");exit(1);}
     if(q_call_list_1list(&spd,x,v,&data_num)!=0){
        fprintf(stdout,"Error @ q_call_list_1list \n");exit(1);
     }
/*   for(i=0;i<data_num;i++) { fprintf(stdout,"%d   %e\n",x[i],v[i]) ; } */
     if(q_skyfit_nlow(x,v,data_num,&fitpar)!=0){
         fprintf(stdout,"Error @ q_sky_nlow \n");exit(1);
     }
     fprintf(stdout,"%s  y= %s : a= %8.5e  b= %8.5e  corr= %8.5e\n",ifile,argv[4],fitpar.a,fitpar.b,fitpar.cr) ;
  } else {  /* ¥Ç¥Õ¥©¥ë¥È€Îy€Ç¥Õ¥£¥Ã¥È */
     for(j=30;j<=220;j+=10) {
        sprintf(buf,"%d",j) ;
        region_input(buf,&(spd.y0),&(spd.y1),&(spd.yr));
        /* q_list_stat €ÎžÆœÐ€·Ÿò·ï€Î¥Á¥§¥Ã¥¯ */
        if(check_call_list_stat(&spd)!=0) {
           fprintf(stdout,"Error @ check_call_list_stat\n");exit(1);}<commit_msg>Changing fitting start point to Y=40.<commit_after>/*=======================================================================*/
/*  q_sky_nlow                                                           */
/*     COMICS N ÄãÊ¬»¶€Îsky²èÁü€«€éÇÈÄ¹³ÓÀµŒ°€òµá€á€ë                    */
/*                                                        Version 3
   $Log$
                                                                         */
/*=======================================================================*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "q_lib.h"

#define  DETX   500    /* ž¡œÐŽïxŒŽÊýžþŒè°·ºÇÂçÃÍ */
#define  DEBUG     0       /* ¥Ç¥Ð¥Ã¥°ÍÑ€ÎÊÑ¿ô(Ÿò·ï¥³¥ó¥Ñ¥€¥ë€Ë»ÈÍÑ) */

#define  LOOPNUMA   100  /* 200 */
#define  LOOPNUMB   400  /* 500 */
#define  ABIN      0.000005
#define  BBIN      0.001
#define  DEFA      0.0199
#define  DEFB      7.650

/*=======================================================================*/
/*   ¹œÂ€ÂÎ€ÎÀëžÀ                                                             */
/*   ÇÈÄ¹³ÓÀµŒ°€Î¥Ñ¥é¥á¡Œ¥¿                                                   */
typedef struct {
   double a;   /* fit parameter a */
   double b;   /* fit parameter b */
   double cr;  /* correlation coefficient */
   int32_t slit;  /* slit width */
} WAVE_FIT_PAR;

/*=======================================================================*/
void print_usage(char *);
int check_command_line(int,char **,char **,SPECIFIED_DATA *,WAVE_FIT_PAR *);
int skyline_data_nlow(double *) ;
double correlate(int32_t,double *,double *) ;
int q_skyfit_nlow(int32_t *,double *,int32_t,WAVE_FIT_PAR *) ;
int check_call_list_stat(SPECIFIED_DATA *) ;
int q_call_list_1list(SPECIFIED_DATA *,int32_t *,double *,int32_t *);
int q_list_stat_1list_func(SPECIFIED_DATA *,int32_t *,double *,int32_t *);
/*=======================================================================*/
void print_usage(char *s)
{
char *ss;

  ss=strip_name(s);
  fprintf(stdout,
"NAME\n"
"       %s - COMICS N ÄãÊ¬»¶€Îsky²èÁü€«€éÇÈÄ¹³ÓÀµŒ°€òµá€á€ë\n\n"
"SYNOPSIS\n"
"       %s fits_file w x_region default  z slit\n"
"       %s fits_file w x_region y        z slit\n"
"       %s fits_file w x_region y_region z slit\n\n"
"       %s fits_file w x_region default  z slit init_a init_b\n"
"       %s fits_file w x_region y        z slit init_a init_b\n"
"       %s fits_file w x_region y_region z slit init_a init_b\n\n"
"DESCRIPTION\n"
"       %s €Ï fits_file €ÇÍ¿€š€é€ì€¿²èÁü¥Õ¥¡¥€¥ë€ò²£Êýžþ€ËÀÚ€Ã€Æ¡¢\n"
"       €œ€Î¥Ô¡Œ¥¯€òsky€ÎÊüŒÍµ±Àþ€ÈÈæ³Ó€·€ÆN ÄãÊ¬»¶€ÎÇÈÄ¹³ÓÀµŒ°€òµá€á€ë\n"
"       €¿€á€Î€â€Î€Ç€¹¡£€œ€Î€¿€á¡¢ÆþÎÏ²èÁüfits_file€Ïsky€Î²èÁü(Àž²èÁü€«€é\n"
"       ¥À¡Œ¥¯€ò°ú€­¡¢€µ€é€Ë€Ê€ë€Ù€¯€Ê€é¥Õ¥é¥Ã¥È€Ç³ä€Ã€¿€â€Î)€ò»È€Š€Ù€­\n"
"       €Ç€¹¡£€Þ€¿¡¢€³€Î¥×¥í¥°¥é¥à€Ç€Ï N ÃæÊ¬»¶¡¢N ¹âÊ¬»¶¡¢ Q ÃæÊ¬»¶€Ë€Ï\n"
"       ÂÐ±þ€·€Æ€€€Þ€»€ó¡£\n\n"
"       °ì€Ä€á€ÎœñŒ°(4€Ä€á€Î°ú¿ô(y€ÎÈÏ°Ï»ØÄê)€Ë'default'€È€¢€ëŸì¹ç)\n"
"       €Ç€Ï¡¢ÇÈÄ¹³ÓÀµŒ°€Ï¡¢¥Ç¥Õ¥©¥ë¥È€Îy€ÎÃÍ€Ë€Ä€€€ÆÀÚ€êœÐ€·\n"
"       €Æ¥Õ¥£¥Ã¥È€·€¿·ë²Ì€òœÐÎÏ€·€Þ€¹¡£žœºß€Î¥Ç¥Õ¥©¥ë¥ÈÃÍ€Ï¡¢\n"
"               y=30,40,50,60,70,80,90,100,110,120,130,140,150,160,\n"
"                 180,190,200,210,220 \n"
"       €Î20²Õœê€Ë€Ê€Ã€Æ€€€Þ€¹¡£\n\n"
"       €¢€ëÆÃÄê€Îy€Ë€Ä€€€ÆÀÚ€êœÐ€·€Æ¥Õ¥£¥Ã¥È€ò¹Ô€€€¿€€Ÿì¹ç€Ë€Ï¡¢2€Ä€á\n"
"       €Ê€€€·3€Ä€á€ÎœñŒ°€òÍÑ€€€Æ¡¢€œ€Îy(€¢€ë€€€Ïy€ÎÈÏ°Ï)€ò»ØÄê€·€Þ€¹¡£\n"
"       y€ÏÈÏ°Ï€Ç»ØÄê€¹€ë€³€È€¬µö€µ€ì€Æ€€€Þ€¹€¬¡¢ŒÂºÝ€Î¥Õ¥£¥Ã¥È€ÏSN€¬\n"
"       ÎÉ€€žÂ€ê¡¢€Ê€ë€Ù€¯Ÿ¯€Ê€€yÈÏ°Ï€Ë€Ä€€€Æ¹Ô€ï€Ê€€€È¡¢µ±Àþ€¬€Ê€Þ€Ã€Æ\n"
"       ¥Õ¥£¥Ã¥È€¬€Š€Þ€¯€€€«€Ê€¯€Ê€ë²ÄÇœÀ­€¬€¢€ê€Þ€¹¡£\n\n"
"       €€€º€ì€ÎœñŒ°€Ç€â¡¢ÈÏ°Ï»ØÄê€Î»ÅÊý€Ïq_list_stat€È€ª€Ê€žœñŒ°€ËœŸ€€\n"
"       €Þ€¹¡£€Ê€ªw,z€Ï°ìÅÀ¡¢x€ÏÈÏ°Ï(€·€«€âa-b€Î·ÁŒ°)€Ç€¢€ëÉ¬Í×€¬€¢€ê€Þ€¹¡£\n\n"
"       slit€Ï¡¢ŽÑÂ¬»þ€Ë»ÈÍÑ€·€¿¥¹¥ê¥Ã¥È€Î¥µ¥€¥º€Ç€¹¡£pixÁêÅöÃ±°Ì€Ç\n"
"       ÆþÎÏ€·¡¢N¥Ð¥ó¥ÉÄãÊ¬»¶€ÎŸì¹ç¡¢2,3,4,6€ÎÃæ€«€é°ì€ÄÁª€ó€ÇÆþÎÏ€·€Þ€¹¡£\n\n"
"       1-3€Ä€á€ÎœñŒ°€Ç€Ï¡¢¥Õ¥£¥Ã¥È€¹€ë¥Ñ¥é¥á¡Œ¥¿a€ª€è€Ób€ÎÈÏ°Ï€Ï¡¢\n"
"       ¥×¥í¥°¥é¥à€Î¥Ç¥Õ¥©¥ë¥ÈÃÍ€ò»È€€€Þ€¹¡£žœºß€Î¥Ç¥Õ¥©¥ë¥ÈÃÍ€Ï\n"
"            a .... %8.5e - %8.5e      b .... %8.5e - %8.5e\n"
"       €Ë€Ê€Ã€Æ€€€Þ€¹¡£\n"
"       a€ª€è€Ób€ÎÈÏ°Ï€òÀßÄê€·€¿€€Ÿì¹ç€Ë€Ï4-6€Ä€á€ÎœñŒ°€òÍÑ€€€Þ€¹¡£\n"
"       €³€ÎŸì¹ç¡¢ºÇÅ¬¥Ñ¥é¥á¡Œ¥¿€Ï\n"
"            a .... [ init_a - %f , init_a + %f ]\n"
"            b .... [ init_b - %f , init_b + %f ]\n"
"       €ÎÈÏ°Ï€ÇÃµ€µ€ì€Þ€¹¡£\n\n"
"       ÆþÎÏ²èÁü€ÎŒ¡žµ€Ï¡¢NAXIS=3€Þ€¿€Ï4€Î€ßÂÐ±þ€·€Þ€¹¡£NAXIS4€ÎÃÍ€Ï€€€¯€Ä€Ç€â\n"
"       €«€Þ€€€Þ€»€ó€¬¡¢±é»»€Ïw=w€ÎÉôÊ¬€Ë€Ä€€€Æ¹Ô€€€Þ€¹¡£€Þ€¿¡¢NAXIS3€ÎÃÍ€â\n"
"       €€€¯€Ä€Ç€â€«€Þ€€€Þ€»€ó€¬¡¢COMA²èÁü€ÎÊ£¿ô€Îz€¬»Ä€Ã€Æ€€€ë²èÁü€ËÂÐ€·€Æ\n"
"       ¹Ô€Š€Î€Ï¡¢ÄÌŸï¡¢»þŽÖ€¬ÌµÂÌ€Ë€Ê€ë€È»×€ï€ì€Þ€¹¡£(Ã»€€»þŽÖ€Ç€ÎÇÈÄ¹ÊÑ²œ\n"
"       €òž«€¿€€€È€­€Ï€â€Á€í€óŒÂ¹Ô€·€Æ°ÕÌ£€¬€¢€ê€Þ€¹€¬)\n"
"       NAXIS1€ª€è€ÓNAXIS2€Ï¡¢ž·Ì©€ËCOMICS€Îž¡œÐŽï€Îx,y¿ô€Ë°ìÃ×€·€Æ€€€ëÉ¬Í×\n"
"       €Ï€¢€ê€Þ€»€ó¡£€³€Î€¿€á¡¢²èÁü€Î€æ€¬€ßÊäÀµ€Ê€É€Ç¡¢x,y¿ô€¬ÊÑ²œ€·€¿²èÁü\n"
"       €Ë€âÂÐ±þ€Ç€­€Þ€¹€¬¡¢ÂçÉý€ËCOMICSž¡œÐŽï€Î¥Õ¥©¡Œ¥Þ¥Ã¥È€«€é€º€ì€ë€È¡¢\n"
"       Âçµ€µ±Àþ¥Õ¥£¥Ã¥È€¬€Ç€­€Ê€¯€Ê€ê€Þ€¹¡£€³€ì€Ï¡¢žœºß€³€Î¥×¥í¥°¥é¥à€Ç€Ï¡¢\n"
"       ¥Õ¥£¥Ã¥È¥Ñ¥é¥á¡Œ¥¿€ò€¢€ë°ìÄê€ÎÈÏ°ÏÆâ€ÇÊÑ²œ€µ€»€Ê€¬€é¡¢€â€Ã€È€âÁêŽØ\n"
"       ·ž¿ô€Î¹â€¯€Ê€ëŸìœê€òÃµ€·€Æ€€€ë€¿€á€Ç€¹¡£\n\n"
	  ,ss,ss,ss,ss,ss,ss,ss,ss,DEFA-ABIN*LOOPNUMA/2,DEFA+ABIN*LOOPNUMA/2,
	  DEFB-BBIN*LOOPNUMB/2,DEFB+BBIN*LOOPNUMB/2,
	  ABIN*LOOPNUMA/2,ABIN*LOOPNUMA/2,BBIN*LOOPNUMB/2,BBIN*LOOPNUMB/2);
}
/*=======================================================================*/
int main(int argc, char ** argv)
{
char *ifile;
SPECIFIED_DATA spd;
static int x[DETX];
int32_t data_num ;
static double v[DETX];
int32_t j;
char buf[WORD_LEN];
WAVE_FIT_PAR fitpar ;

/* Check command line */
  if(check_command_line(argc,argv,&ifile,&spd,&fitpar)!=0) {
    fprintf(stdout,"Error @ check_command_line\n");exit(1);}

/* Open input file and out put files */
  if((spd.data.fp=fopen(ifile,"r"))==NULL){
    fprintf(stdout,"Cannot open %s\n",ifile);exit(1);}

/* Check NAIXISs */
  if(read_head(&(spd.data))!=0){
     fprintf(stdout,"Error @ read_fits_data 1 \n");return(-1);}
  if(spd.data.nax==3) {
     if(atoi(argv[2])!=1) {
        fprintf(stdout,"NAXIS=3. Then w must be 1.\n") ;
        exit(1) ;
     }
  } else if (spd.data.nax!=4) {
     fprintf(stdout,"NAXIS must be 3 or 4.\n") ;
     exit(1) ;
  }

/* Operation */
  if(spd.yr!=-1) {  /* »ØÄêy(1²Õœê)€Ç¥Õ¥£¥Ã¥È */
     /* q_list_stat €ÎžÆœÐ€·Ÿò·ï€Î¥Á¥§¥Ã¥¯ */
     if(check_call_list_stat(&spd)!=0) {
        fprintf(stdout,"Error @ check_call_list_stat\n");exit(1);}
     if(q_call_list_1list(&spd,x,v,&data_num)!=0){
        fprintf(stdout,"Error @ q_call_list_1list \n");exit(1);
     }
/*   for(i=0;i<data_num;i++) { fprintf(stdout,"%d   %e\n",x[i],v[i]) ; } */
     if(q_skyfit_nlow(x,v,data_num,&fitpar)!=0){
         fprintf(stdout,"Error @ q_sky_nlow \n");exit(1);
     }
     fprintf(stdout,"%s  y= %s : a= %8.5e  b= %8.5e  corr= %8.5e\n",ifile,argv[4],fitpar.a,fitpar.b,fitpar.cr) ;
  } else {  /* ¥Ç¥Õ¥©¥ë¥È€Îy€Ç¥Õ¥£¥Ã¥È */
     for(j=40;j<=220;j+=10) { /* Setting j=40, since data are missing at pixels where Y > 40*/
        sprintf(buf,"%d",j) ;
        region_input(buf,&(spd.y0),&(spd.y1),&(spd.yr));
        /* q_list_stat €ÎžÆœÐ€·Ÿò·ï€Î¥Á¥§¥Ã¥¯ */
        if(check_call_list_stat(&spd)!=0) {
           fprintf(stdout,"Error @ check_call_list_stat\n");exit(1);}
{'fraction_non_alphanumeric': 0.3223026542571527, 'fraction_numerical': 0.026473629782833505, 'mean_word_length': 3.4171741778319125, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '290233', 'n_tokens_mistral': 8412, 'n_tokens_neox': 8882, 'n_words': 823}