fitschan.c | fitschan.c | |||
---|---|---|---|---|
skipping to change at line 1214 | skipping to change at line 1214 | |||
#include "frameset.h" | #include "frameset.h" | |||
#include "grismmap.h" | #include "grismmap.h" | |||
#include "lutmap.h" | #include "lutmap.h" | |||
#include "mathmap.h" | #include "mathmap.h" | |||
#include "matrixmap.h" | #include "matrixmap.h" | |||
#include "memory.h" | #include "memory.h" | |||
#include "object.h" | #include "object.h" | |||
#include "permmap.h" | #include "permmap.h" | |||
#include "pointset.h" | #include "pointset.h" | |||
#include "shiftmap.h" | #include "shiftmap.h" | |||
#include "skyaxis.h" | ||||
#include "skyframe.h" | #include "skyframe.h" | |||
#include "timeframe.h" | #include "timeframe.h" | |||
#include "keymap.h" | #include "keymap.h" | |||
#include "pal.h" | #include "pal.h" | |||
#include "sofa.h" | #include "sofa.h" | |||
#include "slamap.h" | #include "slamap.h" | |||
#include "specframe.h" | #include "specframe.h" | |||
#include "dsbspecframe.h" | #include "dsbspecframe.h" | |||
#include "specmap.h" | #include "specmap.h" | |||
#include "sphmap.h" | #include "sphmap.h" | |||
skipping to change at line 3018 | skipping to change at line 3019 | |||
} else { | } else { | |||
rho_a = atan2( -cdlat_lon, -cdelt[ axrot1 ] ); | rho_a = atan2( -cdlat_lon, -cdelt[ axrot1 ] ); | |||
} | } | |||
if( cdlon_lat > 0.0 ) { | if( cdlon_lat > 0.0 ) { | |||
rho_b = atan2( cdlon_lat, -cdelt[ axrot2 ] ); | rho_b = atan2( cdlon_lat, -cdelt[ axrot2 ] ); | |||
} else if( cdlon_lat == 0.0 ) { | } else if( cdlon_lat == 0.0 ) { | |||
rho_b = 0.0; | rho_b = 0.0; | |||
} else { | } else { | |||
rho_b = atan2( -cdlon_lat, cdelt[ axrot2 ] ); | rho_b = atan2( -cdlon_lat, cdelt[ axrot2 ] ); | |||
} | } | |||
if( fabs( palDrange( rho_a - rho_b ) ) < 1.0E-2 ){ | if( fabs( astDrange( rho_a - rho_b ) ) < 1.0E-2 ){ | |||
crota = 0.5*( palDranrm( rho_a ) + palDranrm( rho_b ) ); | crota = 0.5*( palDranrm( rho_a ) + palDranrm( rho_b ) ); | |||
coscro = cos( crota ); | coscro = cos( crota ); | |||
sincro = sin( crota ); | sincro = sin( crota ); | |||
if( fabs( coscro ) > fabs( sincro ) ){ | if( fabs( coscro ) > fabs( sincro ) ){ | |||
cdelt[ axrot2 ] /= coscro; | cdelt[ axrot2 ] /= coscro; | |||
cdelt[ axrot1 ] /= coscro; | cdelt[ axrot1 ] /= coscro; | |||
} else { | } else { | |||
cdelt[ axrot2 ] = -cdlon_lat/sincro; | cdelt[ axrot2 ] = -cdlon_lat/sincro; | |||
cdelt[ axrot1 ] = cdlat_lon/sincro; | cdelt[ axrot1 ] = cdlat_lon/sincro; | |||
} | } | |||
skipping to change at line 3520 | skipping to change at line 3521 | |||
} else { | } else { | |||
rho_a = atan2( -cdlat_lon, -cdelt[ axrot1 ] ); | rho_a = atan2( -cdlat_lon, -cdelt[ axrot1 ] ); | |||
} | } | |||
if( cdlon_lat > 0.0 ) { | if( cdlon_lat > 0.0 ) { | |||
rho_b = atan2( cdlon_lat, -cdelt[ axrot2 ] ); | rho_b = atan2( cdlon_lat, -cdelt[ axrot2 ] ); | |||
} else if( cdlon_lat == 0.0 ) { | } else if( cdlon_lat == 0.0 ) { | |||
rho_b = 0.0; | rho_b = 0.0; | |||
} else { | } else { | |||
rho_b = atan2( -cdlon_lat, cdelt[ axrot2 ] ); | rho_b = atan2( -cdlon_lat, cdelt[ axrot2 ] ); | |||
} | } | |||
if( fabs( palDrange( rho_a - rho_b ) ) < 1.0E-2 ){ | if( fabs( astDrange( rho_a - rho_b ) ) < 1.0E-2 ){ | |||
crota = 0.5*( palDranrm( rho_a ) + palDranrm( rho_b ) ); | crota = 0.5*( palDranrm( rho_a ) + palDranrm( rho_b ) ); | |||
coscro = cos( crota ); | coscro = cos( crota ); | |||
sincro = sin( crota ); | sincro = sin( crota ); | |||
if( fabs( coscro ) > fabs( sincro ) ){ | if( fabs( coscro ) > fabs( sincro ) ){ | |||
cdelt[ axrot2 ] /= coscro; | cdelt[ axrot2 ] /= coscro; | |||
cdelt[ axrot1 ] /= coscro; | cdelt[ axrot1 ] /= coscro; | |||
} else { | } else { | |||
cdelt[ axrot2 ] = -cdlon_lat/sincro; | cdelt[ axrot2 ] = -cdlon_lat/sincro; | |||
cdelt[ axrot1 ] = cdlat_lon/sincro; | cdelt[ axrot1 ] = cdlat_lon/sincro; | |||
} | } | |||
skipping to change at line 28666 | skipping to change at line 28667 | |||
valid native longitude. The CAR projection has valid projection plane | valid native longitude. The CAR projection has valid projection plane | |||
points only for native longitudes in the range [-180,+180, so we | points only for native longitudes in the range [-180,+180, so we | |||
modify the CRPIX value if necessary by the number of pixels correspondin g | modify the CRPIX value if necessary by the number of pixels correspondin g | |||
to 360 degres of longitude in order to bring the refernce pixel into | to 360 degres of longitude in order to bring the refernce pixel into | |||
the valid domain of the projection. */ | the valid domain of the projection. */ | |||
if( GetValue2( ret, this, FormatKey( "CDELT", axlon + 1, -1, s, st atus ), | if( GetValue2( ret, this, FormatKey( "CDELT", axlon + 1, -1, s, st atus ), | |||
AST__FLOAT, (void *) &cdelti, 1, method, class, sta tus ) && | AST__FLOAT, (void *) &cdelti, 1, method, class, sta tus ) && | |||
GetValue2( ret, this, FormatKey( "CRPIX", axlon + 1, -1, s, st atus ), | GetValue2( ret, this, FormatKey( "CRPIX", axlon + 1, -1, s, st atus ), | |||
AST__FLOAT, (void *) &dval, 0, method, class, statu s ) ) { | AST__FLOAT, (void *) &dval, 0, method, class, statu s ) ) { | |||
if( cdelti != 0.0 ) { | if( cdelti != 0.0 ) { | |||
dval = 0.5 + AST__DR2D*palDrange( AST__DD2R*( dval - 0.5 )*c delti )/cdelti; | dval = 0.5 + AST__DR2D*astDrange( AST__DD2R*( dval - 0.5 )*c delti )/cdelti; | |||
SetValue( ret, FormatKey( "CRPIX", axlon + 1, -1, s, status ), | SetValue( ret, FormatKey( "CRPIX", axlon + 1, -1, s, status ), | |||
(void *) &dval, AST__FLOAT, CardComm( this, status ), status ); | (void *) &dval, AST__FLOAT, CardComm( this, status ), status ); | |||
} | } | |||
} | } | |||
} | } | |||
/* Replace RESTFREQ by RESTFRQ. | /* Replace RESTFREQ by RESTFRQ. | |||
---------------------------- */ | ---------------------------- */ | |||
/* Get any RESTFREQ card, marking it as read. */ | /* Get any RESTFREQ card, marking it as read. */ | |||
skipping to change at line 31441 | skipping to change at line 31442 | |||
/* Check the inherited status, warning text, FitsChan and Clean attribute. */ | /* Check the inherited status, warning text, FitsChan and Clean attribute. */ | |||
if( !astOK || !text || !text[0] || !this || astGetClean( this ) ) return ; | if( !astOK || !text || !text[0] || !this || astGetClean( this ) ) return ; | |||
/* Ignore the warning if the supplied condition is not contained within | /* Ignore the warning if the supplied condition is not contained within | |||
the list of conditions to be reported in this way (given by the | the list of conditions to be reported in this way (given by the | |||
Warnings attribute). */ | Warnings attribute). */ | |||
if( FullForm( astGetWarnings( this ), condition, 0, status ) >= 0 ){ | if( FullForm( astGetWarnings( this ), condition, 0, status ) >= 0 ){ | |||
/* If found, store the warning in the parent Channel structure. */ | /* If found, store the warning in the parent Channel structure. */ | |||
astAddWarning( this, 1, text, method, status ); | astAddWarning( this, 1, "%s", method, status, text ); | |||
/* For historical reasons, warnings are also stored in the FitsChan as a | /* For historical reasons, warnings are also stored in the FitsChan as a | |||
set of FITS cards... First save the current card index, and rewind the | set of FITS cards... First save the current card index, and rewind the | |||
FitsChan. */ | FitsChan. */ | |||
icard = astGetCard( this ); | icard = astGetCard( this ); | |||
astClearCard( this ); | astClearCard( this ); | |||
/* Break the supplied text into lines and check the FitsChan to see if | /* Break the supplied text into lines and check the FitsChan to see if | |||
a block of adjacent ASTWARN cards with these lines already exist | a block of adjacent ASTWARN cards with these lines already exist | |||
within the FitsChan. Assume they do until proven otherwise. */ | within the FitsChan. Assume they do until proven otherwise. */ | |||
skipping to change at line 34413 | skipping to change at line 34414 | |||
delta0 = GetItem( &(store->crval), fits_ilat, 0, s, NULL, method, cla ss, status ); | delta0 = GetItem( &(store->crval), fits_ilat, 0, s, NULL, method, cla ss, status ); | |||
if( delta0 == AST__BAD ) delta0 = 0.0; | if( delta0 == AST__BAD ) delta0 = 0.0; | |||
delta0 *= AST__DD2R; | delta0 *= AST__DD2R; | |||
alpha0 = GetItem( &(store->crval), fits_ilon, 0, s, NULL, method, cla ss, status ); | alpha0 = GetItem( &(store->crval), fits_ilon, 0, s, NULL, method, cla ss, status ); | |||
if( alpha0 == AST__BAD ) alpha0 = 0.0; | if( alpha0 == AST__BAD ) alpha0 = 0.0; | |||
alpha0 *= AST__DD2R; | alpha0 *= AST__DD2R; | |||
/* Limit the latitude to the range +/- PI/2, issuing a warning if the | /* Limit the latitude to the range +/- PI/2, issuing a warning if the | |||
supplied CRVAL value is outside this range. The "alphap" variable is use d | supplied CRVAL value is outside this range. The "alphap" variable is use d | |||
as workspace here. */ | as workspace here. */ | |||
alphap = palDrange( delta0 ); | alphap = astDrange( delta0 ); | |||
delta0 = alphap; | delta0 = alphap; | |||
if ( delta0 > AST__DPIBY2 ){ | if ( delta0 > AST__DPIBY2 ){ | |||
delta0 = AST__DPIBY2; | delta0 = AST__DPIBY2; | |||
} else if ( delta0 < -AST__DPIBY2 ){ | } else if ( delta0 < -AST__DPIBY2 ){ | |||
delta0 = -AST__DPIBY2; | delta0 = -AST__DPIBY2; | |||
} | } | |||
if( alphap != delta0 ) { | if( alphap != delta0 ) { | |||
sprintf( buf, "The original FITS header specified a fiducial " | sprintf( buf, "The original FITS header specified a fiducial " | |||
"point with latitude %.*g. A value of %.*g is being used " | "point with latitude %.*g. A value of %.*g is being used " | |||
"instead. ", DBL_DIG, alphap*AST__DR2D, DBL_DIG, | "instead. ", DBL_DIG, alphap*AST__DR2D, DBL_DIG, | |||
skipping to change at line 34777 | skipping to change at line 34778 | |||
if( fabs( t3 ) > 1.0 + TOL1 ){ | if( fabs( t3 ) > 1.0 + TOL1 ){ | |||
return 0; | return 0; | |||
} else { | } else { | |||
if( t3 < -1.0 ){ | if( t3 < -1.0 ){ | |||
t4 = AST__DPI; | t4 = AST__DPI; | |||
} else if( t3 > 1.0 ){ | } else if( t3 > 1.0 ){ | |||
t4 = 0.0; | t4 = 0.0; | |||
} else { | } else { | |||
t4 = acos( t3 ); | t4 = acos( t3 ); | |||
} | } | |||
deltap_1 = palDrange( t1 + t4 ); | deltap_1 = astDrange( t1 + t4 ); | |||
deltap_2 = palDrange( t1 - t4 ); | deltap_2 = astDrange( t1 - t4 ); | |||
/* Select which of these two values of deltap to use. Values outside the | /* Select which of these two values of deltap to use. Values outside the | |||
range +/- PI/2 cannot be used. If both values are within this range | range +/- PI/2 cannot be used. If both values are within this range | |||
use the value which is closest to the supplied value of latpole (or | use the value which is closest to the supplied value of latpole (or | |||
use the northern most value if the LATPOLE keyword was not supplied. */ | use the northern most value if the LATPOLE keyword was not supplied. */ | |||
if( fabs( deltap_1 ) > AST__DPIBY2 + TOL2 ){ | if( fabs( deltap_1 ) > AST__DPIBY2 + TOL2 ){ | |||
*deltap = deltap_2; | *deltap = deltap_2; | |||
} else if( fabs( deltap_2 ) > AST__DPIBY2 + TOL2 ){ | } else if( fabs( deltap_2 ) > AST__DPIBY2 + TOL2 ){ | |||
*deltap = deltap_1; | *deltap = deltap_1; | |||
} else { | } else { | |||
End of changes. 7 change blocks. | ||||
7 lines changed or deleted | 8 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |