Commit e8d53f7c authored by Johan Richard's avatar Johan Richard
Browse files

Add warning to ignor empty lines in input catalogs

parent d53bb21f
......@@ -139,44 +139,49 @@ void f_shape( long int *istart,
if( n_scan != 8 ) e_scan = 1;
}
if( e_scan == 1 )
{
int ncol = 8; // valid for default and flag=3
if ( flag == 2 ) ncol = 10;
fprintf(stderr, "ERROR: reading catalog %s. %d/%d columns found for line %ld\n", name, n_scan, ncol, i + 1);
exit(-1);
}
// convert input to absolute coordinates
convertXY( &liste[i].C.x, &liste[i].C.y, iref, ra, dec);
// convert to output relative coordinates
if ( M.iref == 1 || M.iref == 3 )
{
// Relative coordinates between -180 and 180
liste[i].C.x -= M.ref_ra;
if ( liste[i].C.x > 180. ) liste[i].C.x -= 360.;
if ( liste[i].C.x < -180. ) liste[i].C.x += 360.;
liste[i].C.x *= -3600 * cos(M.ref_dec * DTR);
liste[i].C.y -= M.ref_dec;
liste[i].C.y *= 3600;
}
else if ( M.iref == 2 )
{
liste[i].C.x -= M.ref_ra;
liste[i].C.x -= M.ref_dec;
}
liste[i].E.theta *= DTR;
if ( liste[i].E.a == 0. || liste[i].E.b == 0. )
liste[i].c = 's';
else
liste[i].c = 'g';
if (n_scan == -1) fprintf(stderr, "WARNING: ignoring empty line while reading catalog %s.\n", name);
else
{
if( e_scan == 1 )
{
int ncol = 8; // valid for default and flag=3
if ( flag == 2 ) ncol = 10;
fprintf(stderr, "ERROR: reading catalog %s. %d/%d columns found for line %ld\n", name, n_scan, ncol, i + 1);
exit(-1);
}
// convert input to absolute coordinates
convertXY( &liste[i].C.x, &liste[i].C.y, iref, ra, dec);
// convert to output relative coordinates
if ( M.iref == 1 || M.iref == 3 )
{
// Relative coordinates between -180 and 180
liste[i].C.x -= M.ref_ra;
if ( liste[i].C.x > 180. ) liste[i].C.x -= 360.;
if ( liste[i].C.x < -180. ) liste[i].C.x += 360.;
liste[i].C.x *= -3600 * cos(M.ref_dec * DTR);
liste[i].C.y -= M.ref_dec;
liste[i].C.y *= 3600;
}
else if ( M.iref == 2 )
{
liste[i].C.x -= M.ref_ra;
liste[i].C.x -= M.ref_dec;
}
liste[i].E.theta *= DTR;
if ( liste[i].E.a == 0. || liste[i].E.b == 0. )
liste[i].c = 's';
else
liste[i].c = 'g';
if ( liste[i].I0 == 0. )
liste[i].I0 = 50.;
if ( liste[i].I0 == 0. )
liste[i].I0 = 50.;
i++;
i++;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment