00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include <stdio.h>
00011 #include <stdlib.h>
00012 #include <time.h>
00013 #include <sys/time.h>
00014 #include <math.h>
00015 #include <string.h>
00016 #include <unistd.h>
00017 #include "jsoc_main.h"
00018 #include "astro.h"
00019
00020
00021
00022 #define PI (M_PI)
00023 #define RADSINDEG (PI/180.)
00024 #define RAD2ARCSEC (648000./M_PI)
00025 #define SECINDAY (86400.)
00026 #define FOURK (4096)
00027 #define FOURK2 (16777216)
00028
00029 #define DIE(msg) {fflush(stdout); fprintf(stderr,"%s, status=%d\n", msg, status); return(status);}
00030 #define SHOW(msg) {printf("%s", msg); fflush(stdout);}
00031
00032 #define kNotSpecified "Not Specified"
00033
00034
00035
00036 extern void pdfi_wrapper4jsoc_ss_(int *m, int *n, double *a, double *b, double *c, double *d,
00037 double *bloncoe0, double *blatcoe0, double *brllcoe0,
00038 double *bloncoe1, double *blatcoe1, double *brllcoe1,
00039 double *vloncoe0, double *vlatcoe0, double *vrllcoe0,
00040 double *vloncoe1, double *vlatcoe1, double *vrllcoe1,
00041 double *lloncoe0, double *llatcoe0, double *lrllcoe0,
00042 double *lloncoe1, double *llatcoe1, double *lrllcoe1,
00043 double *t0, double *t1,
00044 double *blon0, double *blat0, double *brll0,
00045 double *blon1, double *blat1, double *brll1,
00046 double *elonpdfi, double *elatpdfi, double *erllpdfi);
00047
00048
00049
00050 char *module_name = "cgem_pdfi_test";
00051
00052 ModuleArgs_t module_args[] =
00053 {
00054
00055
00056 {ARG_END}
00057 };
00058
00059 int DoIt(void)
00060 {
00061
00062 int status = DRMS_SUCCESS;
00063
00064
00065
00066 int n, m;
00067 double a, b, c, d;
00068 double t0, t1;
00069
00070 double *bloncoe0, *blatcoe0, *brllcoe0;
00071 double *bloncoe1, *blatcoe1, *brllcoe1;
00072
00073 double *vloncoe0, *vlatcoe0, *vrllcoe0;
00074 double *vloncoe1, *vlatcoe1, *vrllcoe1;
00075
00076 double *lloncoe0, *llatcoe0, *lrllcoe0;
00077 double *lloncoe1, *llatcoe1, *lrllcoe1;
00078
00079
00080
00081 n = 554;
00082 m = 532;
00083 a = 1.444096088409;
00084 b = 1.720951676369;
00085 c = 0.000000000000;
00086 d = 0.288267821074;
00087 t0 = 2455607.5582638895139098 * 3600. * 24.;
00088 t1 = 2455607.5749305561184883 * 3600. * 24.;
00089
00090
00091 bloncoe0 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00092 blatcoe0 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00093 brllcoe0 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00094 bloncoe1 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00095 blatcoe1 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00096 brllcoe1 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00097
00098 vloncoe0 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00099 vlatcoe0 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00100 vrllcoe0 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00101 vloncoe1 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00102 vlatcoe1 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00103 vrllcoe1 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00104
00105 lloncoe0 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00106 llatcoe0 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00107 lrllcoe0 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00108 lloncoe1 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00109 llatcoe1 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00110 lrllcoe1 = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00111
00112
00113
00114 double *blon0, *blat0, *brll0;
00115 double *blon1, *blat1, *brll1;
00116
00117 double *elonpdfi, *elatpdfi, *erllpdfi;
00118
00119
00120
00121 blon0 = (double *) (malloc((n + 1) * m * sizeof(double)));
00122 blat0 = (double *) (malloc(n * (m + 1) * sizeof(double)));
00123 brll0 = (double *) (malloc(n * m * sizeof(double)));
00124 blon1 = (double *) (malloc((n + 1) * m * sizeof(double)));
00125 blat1 = (double *) (malloc(n * (m + 1) * sizeof(double)));
00126 brll1 = (double *) (malloc(n * m * sizeof(double)));
00127
00128 elonpdfi = (double *) (malloc(n * (m + 1) * sizeof(double)));
00129 elatpdfi = (double *) (malloc((n + 1) * m * sizeof(double)));
00130 erllpdfi = (double *) (malloc((n + 1) * (m + 1) * sizeof(double)));
00131
00132
00133
00134 pdfi_wrapper4jsoc_ss_(&m, &n, &a, &b, &c, &d,
00135 bloncoe0, blatcoe0, brllcoe0, bloncoe1, blatcoe1, brllcoe1,
00136 vloncoe0, vlatcoe0, vrllcoe0, vloncoe1, vlatcoe1, vrllcoe1,
00137 lloncoe0, llatcoe0, lrllcoe0, lloncoe1, llatcoe1, lrllcoe1,
00138 &t0, &t1,
00139 blon0, blat0, brll0, blon1, blat1, brll1,
00140 elonpdfi, elatpdfi, erllpdfi);
00141
00142
00143
00144
00145
00146
00147
00148 free(bloncoe0); free(blatcoe0); free(brllcoe0);
00149 free(bloncoe1); free(blatcoe1); free(brllcoe1);
00150 free(vloncoe0); free(vlatcoe0); free(vrllcoe0);
00151 free(vloncoe1); free(vlatcoe1); free(vrllcoe1);
00152 free(lloncoe0); free(llatcoe0); free(lrllcoe0);
00153 free(lloncoe1); free(llatcoe1); free(lrllcoe1);
00154
00155 free(blon0); free(blat0); free(brll0);
00156 free(blon1); free(blat1); free(brll1);
00157 free(elonpdfi); free(elatpdfi); free(erllpdfi);
00158
00159
00160
00161 return DRMS_SUCCESS;
00162 }