version 1.8, 2014/06/05 21:27:32
|
version 1.9, 2014/06/06 19:04:51
|
|
|
* -- DRMS SHARP CEA series | * -- DRMS SHARP CEA series |
* -- HARPNUM | * -- HARPNUM |
* -- comma separated list of keywords to recalculate | * -- comma separated list of keywords to recalculate |
|
* -- DEBUG flag (use like this debug=debug) |
* | * |
* AUTHOR : Monica Bobra | * AUTHOR : Monica Bobra |
* | * |
|
|
* | * |
* EXAMPLE : | * EXAMPLE : |
* update_sharp_keys sharpseriesin=hmi.sharp_720s sharpceaseriesin=hmi.sharp_cea_720s // | * update_sharp_keys sharpseriesin=hmi.sharp_720s sharpceaseriesin=hmi.sharp_cea_720s // |
* HARPNUM=1 sharpseriesout=hmi.sharp_720s sharpceaseriesout=hmi.sharp_cea_720s keylist=USFLUX,TOTPOT |
* HARPNUM=1 sharpseriesout=hmi.sharp_720s sharpceaseriesout=hmi.sharp_cea_720s keylist=USFLUX,TOTPOT debug=debug |
* | * |
*/ | */ |
| |
Line 71 ModuleArgs_t module_args[] = |
|
Line 72 ModuleArgs_t module_args[] = |
|
{ARG_STRING, "sharpceaseriesout", NULL, "Output Sharp CEA dataseries"}, | {ARG_STRING, "sharpceaseriesout", NULL, "Output Sharp CEA dataseries"}, |
{ARG_INT, "HARPNUM", NULL, "HARP number"}, | {ARG_INT, "HARPNUM", NULL, "HARP number"}, |
{ARG_STRING, "keylist", NULL, "comma separated list of keywords to update"}, | {ARG_STRING, "keylist", NULL, "comma separated list of keywords to update"}, |
|
{ARG_STRING, "debug", NULL, "debug mode functionality. use like this: debug=debug"}, |
{ARG_END} | {ARG_END} |
}; | }; |
| |
|
|
| |
char sharpquery[256]; | char sharpquery[256]; |
char sharpceaquery[256]; | char sharpceaquery[256]; |
printf("sameflag = %d\n", sameflag); |
|
printf("testflag = %d\n", testflag); |
|
sprintf(sharpceaquery, "%s[%d]\n", sharpceaseriesin,harpnum); | sprintf(sharpceaquery, "%s[%d]\n", sharpceaseriesin,harpnum); |
printf(sharpceaquery, "%s[%d]\n", sharpceaseriesin,harpnum); | printf(sharpceaquery, "%s[%d]\n", sharpceaseriesin,harpnum); |
| |
|
|
| |
| |
char *keylist = (char *) params_get_str(&cmdparams, "keylist"); | char *keylist = (char *) params_get_str(&cmdparams, "keylist"); |
|
char *debug = (char *) params_get_str(&cmdparams, "debug"); |
| |
// Flags to indicate which keyword will be recalculated | // Flags to indicate which keyword will be recalculated |
int meanvfflag = (strstr(keylist,"USFLUX") != NULL); // generalize so that lowercase is acceptable | int meanvfflag = (strstr(keylist,"USFLUX") != NULL); // generalize so that lowercase is acceptable |
|
|
int epsxflag = (strstr(keylist,"EPSX") != NULL); | int epsxflag = (strstr(keylist,"EPSX") != NULL); |
int epsyflag = (strstr(keylist,"EPSY") != NULL); | int epsyflag = (strstr(keylist,"EPSY") != NULL); |
int epszflag = (strstr(keylist,"EPSZ") != NULL); | int epszflag = (strstr(keylist,"EPSZ") != NULL); |
|
int debugflag = (strstr(debug,"debug") != NULL); |
| |
DRMS_Record_t *sharpinrec = sharpinrecset->records[0]; | DRMS_Record_t *sharpinrec = sharpinrecset->records[0]; |
DRMS_Record_t *sharpceainrec = sharpceainrecset->records[0]; | DRMS_Record_t *sharpceainrec = sharpceainrecset->records[0]; |
|
|
tnow = (double)time(NULL); | tnow = (double)time(NULL); |
tnow += UNIX_epoch; | tnow += UNIX_epoch; |
| |
|
if (debugflag) |
|
{ |
|
printf("i=%d\n",irec); |
|
} |
|
|
// set CODEVER7 and HISTORY and DATE | // set CODEVER7 and HISTORY and DATE |
drms_setkey_string(sharpoutrec, "CODEVER7", cvsinfoall); | drms_setkey_string(sharpoutrec, "CODEVER7", cvsinfoall); |
drms_setkey_string(sharpoutrec,"HISTORY",historyofthemodule); | drms_setkey_string(sharpoutrec,"HISTORY",historyofthemodule); |
|
|
| |
// free the arrays that are related to the lorentz calculation | // free the arrays that are related to the lorentz calculation |
free(fx); free(fy); free(fz); | free(fx); free(fy); free(fz); |
|
printf("Success=%d\n",sameflag); |
return 0; | return 0; |
} // DoIt | } // DoIt |