Skip to content

Commit 0445552

Browse files
committed
allow incidence angle to be in a column
1 parent f4946eb commit 0445552

File tree

7 files changed

+27
-3
lines changed

7 files changed

+27
-3
lines changed

docs/manual.pdf

0 Bytes
Binary file not shown.

src/cache.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ typedef struct {
1111
typedef struct Cache Cache;
1212

1313
int cache_init(Cache * c);
14+
1415
void cache_free(Cache * c);
1516

1617
int cache_get(const Cache * c, double a, double b, double g, double *ur1, double *ut1, double *uru, double *utu);
1718

1819
void cache_put(Cache * c, double a, double b, double g, double ur1, double ut1, double uru, double utu);
1920

2021
size_t cache_size(const Cache * c);
22+
2123
int cache_get_by_index(const Cache * c, size_t i,
2224
double *a, double *b, double *g, double *ur1, double *ut1, double *uru, double *utu);
2325

src/iad_io.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,17 @@ int Read_Data_Line_Per_Labels(FILE *fp, struct measure_type *m, struct invert_ty
206206
case 'g':
207207
r->default_g = x;
208208
break;
209+
case 'i':
210+
m->slab_cos_angle = cos(x * M_PI / 180.0);
211+
if (x < 0 || x > 90) {
212+
fprintf(stderr, "Error\n");
213+
fprintf(stderr, " incident angle '%8.4f'\n", x);
214+
fprintf(stderr, " must be between 0 and 90 degrees\n");
215+
exit(EXIT_FAILURE);
216+
}
217+
if (r->method.quad_pts % 12 != 0)
218+
r->method.quad_pts = ((r->method.quad_pts + 11) / 12) * 12;
219+
break;
209220
case 'L':
210221
m->lambda = x;
211222
break;

src/iad_io.w

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,17 @@ int Read_Data_Line_Per_Labels(FILE *fp, struct measure_type *m, struct invert_ty
247247
case 'g':
248248
r->default_g = x;
249249
break;
250+
case 'i':
251+
m->slab_cos_angle = cos(x*M_PI/180.0);
252+
if (x<0 || x>90) {
253+
fprintf(stderr, "Error\n");
254+
fprintf(stderr, " incident angle '%8.4f'\n", x);
255+
fprintf(stderr, " must be between 0 and 90 degrees\n");
256+
exit(EXIT_FAILURE);
257+
}
258+
if (r->method.quad_pts % 12 != 0)
259+
r->method.quad_pts = ((r->method.quad_pts + 11) / 12) * 12;
260+
break;
250261
case 'L':
251262
m->lambda = x;
252263
break;

src/iad_type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#define BIG_A_CALC_VALUE 999999.0
2828
#define SMALL_A_CALC_VALUE 0.00001
2929
#define MAX_ABS_G 0.999999
30-
#define GRID_SIZE 41 \
30+
#define GRID_SIZE 101 \
3131

3232
#define IAD_NO_ERROR 0 \
3333

src/iad_type.w

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ the header file \.{iad\_type.h} and nothing else.
3636
@d BIG_A_CALC_VALUE 999999.0
3737
@d SMALL_A_CALC_VALUE 0.00001
3838
@d MAX_ABS_G 0.999999
39-
@d GRID_SIZE 41
39+
@d GRID_SIZE 101
4040

4141
@ Need error codes for this silly program
4242

src/version.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Autogenerated v3-16-3 from https://github.com/scottprahl/iad */
22

33
The version number obtained from <.. / Makefile >
4-
The date is the last change to < version.h > */char *Version = "3-16-3 (19 Jun 2025)";
4+
The date is the last change to < version.h > */char *Version = "3-16-3 (18 Jul 2025)";
55
char *VersionShort = "3-16-3";

0 commit comments

Comments
 (0)