⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 skdchk.c

📁 实现ipvlbi数据记录
💻 C
字号:
/**************************************************************//*                                                            *//*   Program Name :  skdchk                                   *//*                                                            *//*      Version:  0.00  2002-06-02                            *//*                                                            *//*      Copyright (c) 2002 T.Kondo/CRL All Right Reserved     *//*                                                            *//**************************************************************//*  Schedule File Read and Check              2002-06-02             by T. Kondo    憱傜偣曽 skdchk sked_file        偙偙偱 sked_file ---- 僗働僕儏乕儖僼傽僀儖柤*/#ifndef WIN32#include <unistd.h>#endif#include <stdio.h>#include <errno.h>#include <fcntl.h>#include <string.h>#include <math.h>#include <stdlib.h>#include <sys/stat.h>#ifdef linux#include <sys/time.h>#else#include <time.h>#endif#include "libipvlbi.h"  // IP-VLBI梡娭悢孮(by T.Kondo)int main(int argc, char *argv[]){	  //char* fname="ge154.skd";      char skdname[80];      sked_data_t skd;      //struct schedule skd;      double totsec, a, b, c;      int i, imax;	  if(argc == 1){          printf("\n");          printf("Usage: skdchk sked_file\n");          printf("\n");          printf("         where  sked_file ---- schedule file name\n");          exit(0);      }       strcpy(skdname,argv[1]);         printf("Schedule file is  %s\n",skdname);	   readskd(skdname, &skd);       printf("\n");       printf("*** SCHEDULE FILE (%s) INFORMATION ***\n",skdname);       printf("Experiment code    : %s\n",skd.expcode);       printf("Number of stations : %d\n",skd.nstation);       for(i=0; i < skd.nstation; i++)       {           printf("  %3d %2s %10s %10f %10f %10f\n",i+1,skd.statid[i],skd.statnam[i],                         skd.xyz[i][0],skd.xyz[i][1],skd.xyz[i][2]);       }       printf("Number of stars : %d\n",skd.nstar);       if(skd.nstar > 20) {          imax=20;          printf("   (only 20 stars are listed here)\n");       } else {          imax=skd.nstar;       }       for(i=0; i < imax; i++)       {           printf("  %3d %10s %10s %10f %10f %10f\n",i+1,skd.starnam1[i],skd.starnam2[i],                         skd.ra[i],skd.dec[i],skd.epo[i]);       }       printf("Number of observations : %d\n",skd.nobs);       printf("   First 5 observations are as follows:\n");       for (i=0; i < 5; i++)       {          printf("    %4d %10s %2d/%03d %02d:%02d:%02d  %3d %s\n",i+1,skd.obsstar[i],                   skd.start[i][0],skd.start[i][1],skd.start[i][2],                   skd.start[i][3],skd.start[i][4],skd.dura[i],skd.obsid[i]);          //printf(" %d\n",strlen(skd.obsid[i]));       }       printf("   Last 5 observations are as follows:\n");       for (i=skd.nobs-5; i < skd.nobs; i++)       {          printf("    %4d %10s %2d/%03d %02d:%02d:%02d  %3d %s\n",i+1,skd.obsstar[i],                 skd.start[i][0],skd.start[i][1],skd.start[i][2],                 skd.start[i][3],skd.start[i][4],skd.dura[i],skd.obsid[i]);       }       /* Disk requirement check */       totsec=0.0;       for(i=0; i< skd.nobs; i++)       {          totsec += (float)skd.dura[i];       }       a=totsec*32.0e6;  // total bit  in case of 32Mbps       b=totsec*64.0e6;  // total bit  in case of 64Mbps       c=totsec*128.0e6;  // total bit  in case of 128Mbps       a /= 8.0e9;   // in Gbytes       b /= 8.0e9;   // in Gbytes       c /= 8.0e9;   // in Gbytes       printf("Total observation time (sec)  = %d\n",(long int)totsec);       printf("    Disk requirements\n");       printf("          %10f GBytes for  32Mbps rate \n",a);       printf("          %10f GBytes for  64Mbps rate \n",b);       printf("          %10f GBytes for 128Mbps rate \n",c);              if(!system(NULL)) {  // command processor not implemwnted          return 0;       }#ifndef WIN32       /* Display Disk avilable size */       printf("\n");       printf("Disk mounted on your system is as follows:\n");       printf("\n");       system("df");       printf("\n");#endif	return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -