@@ -390,8 +390,9 @@ static char *which_facility(int serial_number)
390390 case 927 :
391391 return ("soleil" );
392392 break ;
393+ case 457 :
393394 case 928 :
394- return ("as " );
395+ return ("as_mx1 " );
395396 break ;
396397 case 929 :
397398 return ("pohang" );
@@ -496,7 +497,8 @@ int adscimg2cbf_sub2(char *header,
496497 const char * cliphighstr ,
497498 const char * rad_smoothstr ,
498499 int transpose ,
499- int interleave )
500+ int interleave ,
501+ int reverse )
500502{
501503 FILE * out ;
502504
@@ -1310,6 +1312,15 @@ int adscimg2cbf_sub2(char *header,
13101312 cbf_failnez (cbf_set_doublevalue (cbf , "%.2f" , 0.0 ));
13111313
13121314 /* Make the _axis category */
1315+
1316+ /* The default detector axis definitions assume that
1317+ the rotation axis points in the same direction as
1318+ ELEMENT_X. If reverse is set, the rotation axis points
1319+ in the opposite direction to ELEMENT_X which is
1320+ equivalent to a 180 degree rotation about the Z axis
1321+ and thus X-> -X and Y -> -Y compared to the default
1322+ axes.
1323+ */
13131324
13141325 cbf_failnez (cbf_require_category (cbf , "axis" ));
13151326
@@ -1408,11 +1419,11 @@ int adscimg2cbf_sub2(char *header,
14081419 cbf_failnez (cbf_next_row (cbf ));
14091420 cbf_failnez (cbf_set_value (cbf , "0" ));
14101421 cbf_failnez (cbf_next_row (cbf ));
1411- cbf_failnez (cbf_set_value (cbf , "1" ));
1422+ cbf_failnez (cbf_set_integervalue (cbf , reverse ));
14121423 cbf_failnez (cbf_next_row (cbf ));
14131424 cbf_failnez (cbf_set_value (cbf , "0" ));
14141425 cbf_failnez (cbf_next_row (cbf ));
1415- cbf_failnez (cbf_set_value (cbf , "1" ));
1426+ cbf_failnez (cbf_set_integervalue (cbf , reverse ));
14161427 cbf_failnez (cbf_next_row (cbf ));
14171428 cbf_failnez (cbf_set_value (cbf , "0" ));
14181429
@@ -1422,19 +1433,19 @@ int adscimg2cbf_sub2(char *header,
14221433 cbf_failnez (cbf_next_row (cbf ));
14231434 cbf_failnez (cbf_set_value (cbf , "0" ));
14241435 cbf_failnez (cbf_next_row (cbf ));
1425- cbf_failnez (cbf_set_value (cbf , "-1" ));
1436+ cbf_failnez (cbf_set_integervalue (cbf , -1 * reverse ));
14261437 cbf_failnez (cbf_next_row (cbf ));
14271438 cbf_failnez (cbf_set_value (cbf , "0" ));
14281439 cbf_failnez (cbf_next_row (cbf ));
1429- cbf_failnez (cbf_set_value (cbf , "1" ));
1440+ cbf_failnez (cbf_set_integervalue (cbf , reverse ));
14301441 cbf_failnez (cbf_next_row (cbf ));
14311442 cbf_failnez (cbf_set_value (cbf , "0" ));
14321443 cbf_failnez (cbf_next_row (cbf ));
1433- cbf_failnez (cbf_set_value (cbf , "1" ));
1444+ cbf_failnez (cbf_set_integervalue (cbf , reverse ));
14341445 cbf_failnez (cbf_next_row (cbf ));
14351446 cbf_failnez (cbf_set_value (cbf , "0" ));
14361447 cbf_failnez (cbf_next_row (cbf ));
1437- cbf_failnez (cbf_set_value (cbf , "1" ));
1448+ cbf_failnez (cbf_set_integervalue (cbf , -1 * reverse ));
14381449
14391450 cbf_failnez (cbf_require_column (cbf , "vector[3]" ));
14401451 cbf_failnez (cbf_rewind_row (cbf ));
@@ -1475,7 +1486,7 @@ int adscimg2cbf_sub2(char *header,
14751486 cbf_failnez (cbf_next_row (cbf ));
14761487 cbf_failnez (cbf_set_value (cbf , "0" ));
14771488 cbf_failnez (cbf_next_row (cbf ));
1478- cbf_failnez (cbf_set_doublevalue (cbf , "%.3f" , det_beam_center_to_origin_dist_x ));
1489+ cbf_failnez (cbf_set_doublevalue (cbf , "%.3f" , det_beam_center_to_origin_dist_x * reverse ));
14791490 cbf_failnez (cbf_next_row (cbf ));
14801491 cbf_failnez (cbf_set_value (cbf , "0" ));
14811492
@@ -1498,7 +1509,7 @@ int adscimg2cbf_sub2(char *header,
14981509 cbf_failnez (cbf_next_row (cbf ));
14991510 cbf_failnez (cbf_set_value (cbf , "0" ));
15001511 cbf_failnez (cbf_next_row (cbf ));
1501- cbf_failnez (cbf_set_doublevalue (cbf , "%.3f" , det_beam_center_to_origin_dist_y ));
1512+ cbf_failnez (cbf_set_doublevalue (cbf , "%.3f" , det_beam_center_to_origin_dist_y * reverse ));
15021513 cbf_failnez (cbf_next_row (cbf ));
15031514 cbf_failnez (cbf_set_value (cbf , "0" ));
15041515
@@ -1670,7 +1681,7 @@ int adscimg2cbf_sub2(char *header,
16701681 cbf_failnez (cbf_rewind_row (cbf ));
16711682 cbf_failnez (cbf_set_doublevalue (cbf , "%.6f" , pixel_size ));
16721683 cbf_failnez (cbf_next_row (cbf ));
1673- cbf_failnez (cbf_set_doublevalue (cbf , "%.6f" , - pixel_size ));
1684+ cbf_failnez (cbf_set_doublevalue (cbf , "%.6f" , pixel_size ));
16741685
16751686
16761687 /* Make the _array_intensities category */
@@ -2094,6 +2105,7 @@ int adscimg2cbf_sub(char *header,
20942105 NULL ,
20952106 NULL ,
20962107 0 ,
2097- 0 );
2108+ 0 ,
2109+ 1 );
20982110}
20992111
0 commit comments