1
0
Fork 0

Make Puritanical

qfits
Jeff Moe 2022-08-06 18:23:35 -06:00
parent 8963f3516d
commit dbe844ea0e
19 changed files with 94 additions and 94 deletions

View File

@ -1,5 +1,5 @@
NNW NNW
# Neural Network Weights for the SExtractor star/galaxy classifier (V1.3) # Neural Network Weights for the Source Extractor star/galaxy classifier (V1.3)
# inputs: 9 for profile parameters + 1 for seeing. # inputs: 9 for profile parameters + 1 for seeing.
# outputs: ``Stellarity index'' (0.0 to 1.0) # outputs: ``Stellarity index'' (0.0 to 1.0)
# Seeing FWHM range: from 0.025 to 5.5'' (images must have 1.5 < FWHM < 5 pixels) # Seeing FWHM range: from 0.025 to 5.5'' (images must have 1.5 < FWHM < 5 pixels)

View File

@ -1,4 +1,4 @@
# Default configuration file for SExtractor V1.2b14 - > 2.0 # Default configuration file for Source Extractor V1.2b14 - > 2.0
# EB 23/07/98 # EB 23/07/98
# (*) indicates parameters which can be omitted from this config file. # (*) indicates parameters which can be omitted from this config file.
@ -8,7 +8,7 @@ CATALOG_NAME test.cat # name of the output catalog
CATALOG_TYPE ASCII_HEAD # "NONE","ASCII_HEAD","ASCII","FITS_1.0" CATALOG_TYPE ASCII_HEAD # "NONE","ASCII_HEAD","ASCII","FITS_1.0"
# or "FITS_LDAC" # or "FITS_LDAC"
PARAMETERS_NAME $ST_DATADIR/sextractor/default.param # name of the file containing catalog contents PARAMETERS_NAME $ST_DATADIR/source-extractor/default.param # name of the file containing catalog contents
#------------------------------- Extraction ---------------------------------- #------------------------------- Extraction ----------------------------------
@ -19,7 +19,7 @@ DETECT_THRESH 3 # <sigmas> or <threshold>,<ZP> in mag.arcsec-2
ANALYSIS_THRESH 3 # <sigmas> or <threshold>,<ZP> in mag.arcsec-2 ANALYSIS_THRESH 3 # <sigmas> or <threshold>,<ZP> in mag.arcsec-2
FILTER Y # apply filter for detection ("Y" or "N")? FILTER Y # apply filter for detection ("Y" or "N")?
FILTER_NAME $ST_DATADIR/sextractor/default.conv # name of the file containing the filter FILTER_NAME $ST_DATADIR/source-extractor/default.conv # name of the file containing the filter
DEBLEND_NTHRESH 32 # Number of deblending sub-thresholds DEBLEND_NTHRESH 32 # Number of deblending sub-thresholds
DEBLEND_MINCONT 0.005 # Minimum contrast parameter for deblending DEBLEND_MINCONT 0.005 # Minimum contrast parameter for deblending
@ -45,7 +45,7 @@ PIXEL_SCALE 1.0 # size of pixel in arcsec (0=use FITS WCS info).
#------------------------- Star/Galaxy Separation ---------------------------- #------------------------- Star/Galaxy Separation ----------------------------
SEEING_FWHM 1.2 # stellar FWHM in arcsec SEEING_FWHM 1.2 # stellar FWHM in arcsec
STARNNW_NAME $ST_DATADIR/sextractor/default.nnw # Neural-Network_Weight table filename STARNNW_NAME $ST_DATADIR/source-extractor/default.nnw # Neural-Network_Weight table filename
#------------------------------ Background ----------------------------------- #------------------------------ Background -----------------------------------

View File

@ -1,4 +1,4 @@
# Default configuration file for SExtractor V1.2b14 - > 2.0 # Default configuration file for Source Extractor V1.2b14 - > 2.0
# EB 23/07/98 # EB 23/07/98
# (*) indicates parameters which can be omitted from this config file. # (*) indicates parameters which can be omitted from this config file.
@ -8,7 +8,7 @@ CATALOG_NAME test.cat # name of the output catalog
CATALOG_TYPE ASCII_HEAD # "NONE","ASCII_HEAD","ASCII","FITS_1.0" CATALOG_TYPE ASCII_HEAD # "NONE","ASCII_HEAD","ASCII","FITS_1.0"
# or "FITS_LDAC" # or "FITS_LDAC"
PARAMETERS_NAME $ST_DATADIR/sextractor/default.param # name of the file containing catalog contents PARAMETERS_NAME $ST_DATADIR/source-extractor/default.param # name of the file containing catalog contents
#------------------------------- Extraction ---------------------------------- #------------------------------- Extraction ----------------------------------
@ -19,7 +19,7 @@ DETECT_THRESH 10 # <sigmas> or <threshold>,<ZP> in mag.arcsec-2
ANALYSIS_THRESH 10 # <sigmas> or <threshold>,<ZP> in mag.arcsec-2 ANALYSIS_THRESH 10 # <sigmas> or <threshold>,<ZP> in mag.arcsec-2
FILTER Y # apply filter for detection ("Y" or "N")? FILTER Y # apply filter for detection ("Y" or "N")?
FILTER_NAME $ST_DATADIR/sextractor/default.conv # name of the file containing the filter FILTER_NAME $ST_DATADIR/source-extractor/default.conv # name of the file containing the filter
DEBLEND_NTHRESH 32 # Number of deblending sub-thresholds DEBLEND_NTHRESH 32 # Number of deblending sub-thresholds
DEBLEND_MINCONT 0.005 # Minimum contrast parameter for deblending DEBLEND_MINCONT 0.005 # Minimum contrast parameter for deblending
@ -45,7 +45,7 @@ PIXEL_SCALE 1.0 # size of pixel in arcsec (0=use FITS WCS info).
#------------------------- Star/Galaxy Separation ---------------------------- #------------------------- Star/Galaxy Separation ----------------------------
SEEING_FWHM 1.2 # stellar FWHM in arcsec SEEING_FWHM 1.2 # stellar FWHM in arcsec
STARNNW_NAME $ST_DATADIR/sextractor/default.nnw # Neural-Network_Weight table filename STARNNW_NAME $ST_DATADIR/source-extractor/default.nnw # Neural-Network_Weight table filename
#------------------------------ Background ----------------------------------- #------------------------------ Background -----------------------------------

View File

@ -9,10 +9,10 @@ CC = gcc
F77 = gfortran F77 = gfortran
all: all:
make addwcs angular calibrate dec2sex faketle fitsheader fitskey imgstat jpg2fits jpgstack measure pgm2fits plotfits pstrack rde2iod reduce residuals runsched satfit satid satmap satorbit sex2dec skymap tle2ole tleinfo uk2iod stviewer wcsfit deproject slewto waitfor pass detect launchtle propagate fakeiod csv2tle normal posmatch posvel xyz2tle mvtle confirm allnight make addwcs angular calibrate dec2s faketle fitsheader fitskey imgstat jpg2fits jpgstack measure pgm2fits plotfits pstrack rde2iod reduce residuals runsched satfit satid satmap satorbit s2dec skymap tle2ole tleinfo uk2iod stviewer wcsfit deproject slewto waitfor pass detect launchtle propagate fakeiod csv2tle normal posmatch posvel xyz2tle mvtle confirm allnight
# XXX Not proper # XXX Not proper
mkdir ../bin mkdir ../bin
mv addwcs angular calibrate dec2sex faketle fitsheader fitskey imgstat jpg2fits jpgstack measure pgm2fits plotfits pstrack rde2iod reduce residuals runsched satfit satid satmap satorbit sex2dec skymap tle2ole tleinfo uk2iod stviewer wcsfit deproject slewto waitfor pass detect launchtle propagate fakeiod csv2tle normal posmatch posvel xyz2tle mvtle confirm allnight ../bin/ mv addwcs angular calibrate dec2s faketle fitsheader fitskey imgstat jpg2fits jpgstack measure pgm2fits plotfits pstrack rde2iod reduce residuals runsched satfit satid satmap satorbit s2dec skymap tle2ole tleinfo uk2iod stviewer wcsfit deproject slewto waitfor pass detect launchtle propagate fakeiod csv2tle normal posmatch posvel xyz2tle mvtle confirm allnight ../bin/
cp tleupdate ../bin/ cp tleupdate ../bin/
lite: lite:
@ -90,11 +90,11 @@ jpgstack: jpgstack.o
angular: angular.o forward.o reverse.o angular: angular.o forward.o reverse.o
$(CC) -o angular angular.c forward.o reverse.o -lm -lwcs $(CC) -o angular angular.c forward.o reverse.o -lm -lwcs
dec2sex: dec2sex.o dec2s: dec2s.o
$(CC) -o dec2sex dec2sex.c -lm $(CC) -o dec2s dec2s.c -lm
sex2dec: sex2dec.o s2dec: s2dec.o
$(CC) -o sex2dec sex2dec.c -lm $(CC) -o s2dec s2dec.c -lm
calibrate: calibrate.o forward.o calibrate: calibrate.o forward.o
$(F77) -o calibrate calibrate.o forward.o $(LFLAGS) -lqfits $(F77) -o calibrate calibrate.o forward.o $(LFLAGS) -lqfits
@ -174,5 +174,5 @@ pgm2fits: pgm2fits.o
clean: clean:
rm -f *.o rm -f *.o
rm -f *~ rm -f *~
rm -f addwcs angular calibrate dec2sex faketle fitsheader fitskey imgstat jpg2fits jpgstack measure pgm2fits plotfits pstrack rde2iod reduce residuals runsched satfit satid satmap satorbit sex2dec skymap tle2ole tleinfo uk2iod stviewer wcsfit deproject slewto waitfor pass detect launchtle propagate fakeiod csv2tle normal posmatch posvel xyz2tle mvtle confirm allnight rm -f addwcs angular calibrate dec2s faketle fitsheader fitskey imgstat jpg2fits jpgstack measure pgm2fits plotfits pstrack rde2iod reduce residuals runsched satfit satid satmap satorbit s2dec skymap tle2ole tleinfo uk2iod stviewer wcsfit deproject slewto waitfor pass detect launchtle propagate fakeiod csv2tle normal posmatch posvel xyz2tle mvtle confirm allnight
rm -f ../addwcs ../angular ../calibrate ../dec2sex ../faketle ../fitsheader ../fitskey ../imgstat ../jpg2fits ../jpgstack ../measure ../pgm2fits ../plotfits ../pstrack ../rde2iod ../reduce ../residuals ../runsched ../satfit ../satid ../satmap ../satorbit ../sex2dec ../skymap ../tle2ole ../tleinfo ../uk2iod ../stviewer ../wcsfit ../deproject ../slewto ../waitfor ../pass ../detect ../launchtle ../propagate ../fakeiod ../csv2tle ../normal ../posmatch ../posvel ../xyz2tle ../mvtle ../confirm ../allnight rm -f ../addwcs ../angular ../calibrate ../dec2s ../faketle ../fitsheader ../fitskey ../imgstat ../jpg2fits ../jpgstack ../measure ../pgm2fits ../plotfits ../pstrack ../rde2iod ../reduce ../residuals ../runsched ../satfit ../satid ../satmap ../satorbit ../s2dec ../skymap ../tle2ole ../tleinfo ../uk2iod ../stviewer ../wcsfit ../deproject ../slewto ../waitfor ../pass ../detect ../launchtle ../propagate ../fakeiod ../csv2tle ../normal ../posmatch ../posvel ../xyz2tle ../mvtle ../confirm ../allnight

View File

@ -6,8 +6,8 @@
#define LIM 80 #define LIM 80
void dec2sex(double,char *,int,int); void dec2s(double,char *,int,int);
double sex2dec(char *); double s2dec(char *);
void reverse(double,double,double,double,double *,double *); void reverse(double,double,double,double,double *,double *);
void forward(double,double,double,double,double *,double *); void forward(double,double,double,double,double *,double *);
@ -32,11 +32,11 @@ int main(int argc,char *argv[])
if (strcmp(argv[1],"-d")==0) { if (strcmp(argv[1],"-d")==0) {
if (strchr(argv[2],':')!=NULL) if (strchr(argv[2],':')!=NULL)
ra1=15.*sex2dec(argv[2]); ra1=15.*s2dec(argv[2]);
else else
ra1=atof(argv[2]); ra1=atof(argv[2]);
if (strchr(argv[3],':')!=NULL) if (strchr(argv[3],':')!=NULL)
de1=sex2dec(argv[3]); de1=s2dec(argv[3]);
else else
de1=atof(argv[3]); de1=atof(argv[3]);
@ -45,25 +45,25 @@ int main(int argc,char *argv[])
reverse(ra1,de1,rx,ry,&ra2,&de2); reverse(ra1,de1,rx,ry,&ra2,&de2);
dec2sex(ra2/15.0,sra,0,7); dec2s(ra2/15.0,sra,0,7);
dec2sex(de2,sde,0,6); dec2s(de2,sde,0,6);
printf("%s %s\n",sra,sde); printf("%s %s\n",sra,sde);
} else if (strcmp(argv[1],"-x")==0) { } else if (strcmp(argv[1],"-x")==0) {
if (strchr(argv[2],':')!=NULL) if (strchr(argv[2],':')!=NULL)
ra1=15.*sex2dec(argv[2]); ra1=15.*s2dec(argv[2]);
else else
ra1=atof(argv[2]); ra1=atof(argv[2]);
if (strchr(argv[3],':')!=NULL) if (strchr(argv[3],':')!=NULL)
de1=sex2dec(argv[3]); de1=s2dec(argv[3]);
else else
de1=atof(argv[3]); de1=atof(argv[3]);
if (strchr(argv[4],':')!=NULL) if (strchr(argv[4],':')!=NULL)
ra2=15.*sex2dec(argv[4]); ra2=15.*s2dec(argv[4]);
else else
ra2=atof(argv[4]); ra2=atof(argv[4]);
if (strchr(argv[5],':')!=NULL) if (strchr(argv[5],':')!=NULL)
de2=sex2dec(argv[5]); de2=s2dec(argv[5]);
else else
de2=atof(argv[5]); de2=atof(argv[5]);
@ -72,19 +72,19 @@ int main(int argc,char *argv[])
printf("%8.3f\n",rx); printf("%8.3f\n",rx);
} else if (strcmp(argv[1],"-y")==0) { } else if (strcmp(argv[1],"-y")==0) {
if (strchr(argv[2],':')!=NULL) if (strchr(argv[2],':')!=NULL)
ra1=15.*sex2dec(argv[2]); ra1=15.*s2dec(argv[2]);
else else
ra1=atof(argv[2]); ra1=atof(argv[2]);
if (strchr(argv[3],':')!=NULL) if (strchr(argv[3],':')!=NULL)
de1=sex2dec(argv[3]); de1=s2dec(argv[3]);
else else
de1=atof(argv[3]); de1=atof(argv[3]);
if (strchr(argv[4],':')!=NULL) if (strchr(argv[4],':')!=NULL)
ra2=15.*sex2dec(argv[4]); ra2=15.*s2dec(argv[4]);
else else
ra2=atof(argv[4]); ra2=atof(argv[4]);
if (strchr(argv[5],':')!=NULL) if (strchr(argv[5],':')!=NULL)
de2=sex2dec(argv[5]); de2=s2dec(argv[5]);
else else
de2=atof(argv[5]); de2=atof(argv[5]);
@ -93,19 +93,19 @@ int main(int argc,char *argv[])
printf("%8.3f\n",ry); printf("%8.3f\n",ry);
} else { } else {
if (strchr(argv[1],':')!=NULL) if (strchr(argv[1],':')!=NULL)
ra1=15.*sex2dec(argv[1]); ra1=15.*s2dec(argv[1]);
else else
ra1=atof(argv[1]); ra1=atof(argv[1]);
if (strchr(argv[2],':')!=NULL) if (strchr(argv[2],':')!=NULL)
de1=sex2dec(argv[2]); de1=s2dec(argv[2]);
else else
de1=atof(argv[2]); de1=atof(argv[2]);
if (strchr(argv[3],':')!=NULL) if (strchr(argv[3],':')!=NULL)
ra2=15.*sex2dec(argv[3]); ra2=15.*s2dec(argv[3]);
else else
ra2=atof(argv[3]); ra2=atof(argv[3]);
if (strchr(argv[4],':')!=NULL) if (strchr(argv[4],':')!=NULL)
de2=sex2dec(argv[4]); de2=s2dec(argv[4]);
else else
de2=atof(argv[4]); de2=atof(argv[4]);
@ -118,7 +118,7 @@ int main(int argc,char *argv[])
} }
// Convert Decimal into Sexagesimal // Convert Decimal into Sexagesimal
void dec2sex(double x,char *s,int f,int len) void dec2s(double x,char *s,int f,int len)
{ {
int i; int i;
double sec,deg,min; double sec,deg,min;
@ -145,7 +145,7 @@ void dec2sex(double x,char *s,int f,int len)
} }
// Convert Sexagesimal into Decimal // Convert Sexagesimal into Decimal
double sex2dec(char *s) double s2dec(char *s)
{ {
double x; double x;
float deg,min,sec; float deg,min,sec;

View File

@ -43,7 +43,7 @@ void lfit2d(float *x,float *y,float *z,int n,float *a);
void fit_transformation(struct catalog cat,struct catalog ast,int nselect); void fit_transformation(struct catalog cat,struct catalog ast,int nselect);
struct catalog reread_astrometric_catalog(char *filename,float mmin); struct catalog reread_astrometric_catalog(char *filename,float mmin);
int match_catalogs(struct catalog *cat,struct catalog *ast,float rmax); int match_catalogs(struct catalog *cat,struct catalog *ast,float rmax);
double sex2dec(char *s); double s2dec(char *s);
void usage(void) void usage(void)
{ {
@ -97,7 +97,7 @@ int main(int argc,char *argv[])
case 'R': case 'R':
strcpy(sra,optarg); strcpy(sra,optarg);
if (strchr(sra,':')!=NULL) if (strchr(sra,':')!=NULL)
ra=15.0*sex2dec(sra); ra=15.0*s2dec(sra);
else else
ra=atof(sra); ra=atof(sra);
break; break;
@ -105,7 +105,7 @@ int main(int argc,char *argv[])
case 'D': case 'D':
strcpy(sde,optarg); strcpy(sde,optarg);
if (strchr(sde,':')!=NULL) if (strchr(sde,':')!=NULL)
de=sex2dec(sde); de=s2dec(sde);
else else
de=atof(sde); de=atof(sde);
break; break;
@ -240,7 +240,7 @@ int main(int argc,char *argv[])
printf("m Match stars using current calibration\n"); printf("m Match stars using current calibration\n");
printf("z/+ Zoom in on cursor\n"); printf("z/+ Zoom in on cursor\n");
printf("x/- Zoom out on cursor\n"); printf("x/- Zoom out on cursor\n");
printf("p Plot sextractor catalog\n"); printf("p Plot source-extractor catalog\n");
printf("r Reset zoom\n"); printf("r Reset zoom\n");
} }
@ -665,7 +665,7 @@ int match_catalogs(struct catalog *cat,struct catalog *ast,float rmax)
} }
// Convert Sexagesimal into Decimal // Convert Sexagesimal into Decimal
double sex2dec(char *s) double s2dec(char *s)
{ {
double x; double x;
float deg,min,sec; float deg,min,sec;

View File

@ -198,7 +198,7 @@ double mjd2doy(double mjd,int *yr)
} }
// Convert Decimal into Sexagesimal // Convert Decimal into Sexagesimal
void dec2sex(double x,char *s,int type) void dec2s(double x,char *s,int type)
{ {
int i; int i;
double sec,deg,min,fmin; double sec,deg,min,fmin;
@ -240,8 +240,8 @@ void reduce_point(struct observation *obs,struct fourframe img,float tmid,float
ry=img.b[0]+img.b[1]*dx+img.b[2]*dy; ry=img.b[0]+img.b[1]*dx+img.b[2]*dy;
reverse(img.ra0,img.de0,rx,ry,&ra,&de); reverse(img.ra0,img.de0,rx,ry,&ra,&de);
dec2sex(ra/15.0,sra,0); dec2s(ra/15.0,sra,0);
dec2sex(de,sde,1); dec2s(de,sde,1);
// Get time // Get time
k=(int) x + img.naxis1*(int) y; k=(int) x + img.naxis1*(int) y;

View File

@ -13,7 +13,7 @@ int main(int argc,char *argv[])
char s[14]; char s[14];
if (argc==1) { if (argc==1) {
printf("Usage: dec2sex [options] <x>\n\nCompute sexagesimal from decimal input x.\n"); printf("Usage: dec2s [options] <x>\n\nCompute sexagesimal from decimal input x.\n");
printf("Options: -r gives hours instead of degrees\n"); printf("Options: -r gives hours instead of degrees\n");
printf(" -d<a> uses character a as delimiter\n"); printf(" -d<a> uses character a as delimiter\n");
printf(" -h uses hms as delimiters\n"); printf(" -h uses hms as delimiters\n");

View File

@ -199,7 +199,7 @@ double mjd2doy(double mjd,int *yr)
} }
// Convert Decimal into Sexagesimal // Convert Decimal into Sexagesimal
void dec2sex(double x,char *s,int type) void dec2s(double x,char *s,int type)
{ {
int i; int i;
double sec,deg,min,fmin; double sec,deg,min,fmin;
@ -241,8 +241,8 @@ void reduce_point(struct observation *obs,struct fourframe img,float tmid,float
ry=img.b[0]+img.b[1]*dx+img.b[2]*dy; ry=img.b[0]+img.b[1]*dx+img.b[2]*dy;
reverse(img.ra0,img.de0,rx,ry,&ra,&de); reverse(img.ra0,img.de0,rx,ry,&ra,&de);
dec2sex(ra/15.0,sra,0); dec2s(ra/15.0,sra,0);
dec2sex(de,sde,1); dec2s(de,sde,1);
// Get time // Get time
k=(int) x + img.naxis1*(int) y; k=(int) x + img.naxis1*(int) y;

View File

@ -34,7 +34,7 @@ void precess(double mjd0,double ra0,double de0,double mjd,double *ra,double *de)
void obspos_xyz(double mjd,double lng,double lat,float alt,xyz_t *pos,xyz_t *vel); void obspos_xyz(double mjd,double lng,double lat,float alt,xyz_t *pos,xyz_t *vel);
void mjd2date(double mjd,char *date); void mjd2date(double mjd,char *date);
double nfd2mjd(char *date); double nfd2mjd(char *date);
void dec2sex(double x,char *s,int type); void dec2s(double x,char *s,int type);
double doy2mjd(int year,double doy); double doy2mjd(int year,double doy);
void compute_position(double mjd,xyz_t satpos,struct site s,int satno,char *desig,int precess_flag) void compute_position(double mjd,xyz_t satpos,struct site s,int satno,char *desig,int precess_flag)
@ -66,8 +66,8 @@ void compute_position(double mjd,xyz_t satpos,struct site s,int satno,char *desi
} }
// Angle format 2: RA/DEC = HHMMmmm+DDMMmm MX (MX in minutes of arc) // Angle format 2: RA/DEC = HHMMmmm+DDMMmm MX (MX in minutes of arc)
dec2sex(ra0/15.0,sra,0); dec2s(ra0/15.0,sra,0);
dec2sex(de0,sde,1); dec2s(de0,sde,1);
// Get date // Get date
mjd2date(mjd,nfd); mjd2date(mjd,nfd);
@ -471,7 +471,7 @@ double nfd2mjd(char *date)
} }
// Convert Decimal into Sexagesimal // Convert Decimal into Sexagesimal
void dec2sex(double x,char *s,int type) void dec2s(double x,char *s,int type)
{ {
int i; int i;
double sec,deg,min,fmin; double sec,deg,min,fmin;

View File

@ -214,7 +214,7 @@ void mjd2date(double mjd,char *date)
} }
// Convert Decimal into Sexagesimal // Convert Decimal into Sexagesimal
void dec2sex(double x,char *s,int type) void dec2s(double x,char *s,int type)
{ {
int i; int i;
double sec,deg,min,fmin; double sec,deg,min,fmin;
@ -445,8 +445,8 @@ void reduce_point(struct observation *obs,struct image img,float tmid,float x,fl
ra+=gmst(mjd2)-gmst(mjd1); ra+=gmst(mjd2)-gmst(mjd1);
} }
dec2sex(ra/15.0,sra,0); dec2s(ra/15.0,sra,0);
dec2sex(de,sde,1); dec2s(de,sde,1);
// Get time // Get time
mjd=img.mjd+(double) tmid/86400.0; mjd=img.mjd+(double) tmid/86400.0;

View File

@ -40,7 +40,7 @@ double modulo(double x,double y);
void equatorial2horizontal(double mjd,double ra,double de,double *azi,double *alt); void equatorial2horizontal(double mjd,double ra,double de,double *azi,double *alt);
void mjd2date(double mjd,char *date); void mjd2date(double mjd,char *date);
int properties(kep_t K,xyz_t obspos,xyz_t sunpos,float radius,float t,double *ra,double *de,double *r,float *mag); int properties(kep_t K,xyz_t obspos,xyz_t sunpos,float radius,float t,double *ra,double *de,double *r,float *mag);
void dec2sex(double x,char *s,int f,int len); void dec2s(double x,char *s,int f,int len);
float semimajoraxis(orbit_t orb) float semimajoraxis(orbit_t orb)
{ {
@ -296,8 +296,8 @@ int main(int argc,char *argv[])
equatorial2horizontal(mjd,ra,de,&azi,&alt); equatorial2horizontal(mjd,ra,de,&azi,&alt);
azi=modulo(azi+180.0,360.0); azi=modulo(azi+180.0,360.0);
mjd2date(mjd,nfd); mjd2date(mjd,nfd);
dec2sex(ra/15.0,sra,0,2); dec2s(ra/15.0,sra,0,2);
dec2sex(de,sde,0,2); dec2s(de,sde,0,2);
if (alt>altmin && salt<saltmin) if (alt>altmin && salt<saltmin)
printf("%s %s %s %6.2f %6.2f %7.1f %5.2f %6.2f %s\n",nfd,sra,sde,azi,alt,r,mag,salt,type); printf("%s %s %s %6.2f %6.2f %7.1f %5.2f %6.2f %s\n",nfd,sra,sde,azi,alt,r,mag,salt,type);
} }
@ -630,7 +630,7 @@ int properties(kep_t K,xyz_t obspos,xyz_t sunpos,float radius,float t,double *ra
} }
// Convert Decimal into Sexagesimal // Convert Decimal into Sexagesimal
void dec2sex(double x,char *s,int f,int len) void dec2s(double x,char *s,int f,int len)
{ {
int i; int i;
double sec,deg,min; double sec,deg,min;

View File

@ -49,7 +49,7 @@ struct catalog read_pixel_catalog(char *filename);
double gmst(double mjd); double gmst(double mjd);
double modulo(double x,double y); double modulo(double x,double y);
void precess(double mjd0,double ra0,double de0,double mjd,double *ra,double *de); void precess(double mjd0,double ra0,double de0,double mjd,double *ra,double *de);
double sex2dec(char *s); double s2dec(char *s);
// Read astrometric catalog // Read astrometric catalog
struct catalog read_astrometric_catalog(char *filename,float mmin,float sx,float sy,float angle) struct catalog read_astrometric_catalog(char *filename,float mmin,float sx,float sy,float angle)
@ -329,8 +329,8 @@ int main(int argc,char *argv[])
fclose(file); fclose(file);
// Get parameters // Get parameters
img.ra0=15.0*sex2dec(sra); img.ra0=15.0*s2dec(sra);
img.de0=sex2dec(sde); img.de0=s2dec(sde);
// Hour angle // Hour angle
h=gmst(img.mjd)+m.lng-img.ra0; h=gmst(img.mjd)+m.lng-img.ra0;
@ -643,7 +643,7 @@ void precess(double mjd0,double ra0,double de0,double mjd,double *ra,double *de)
} }
// Convert Sexagesimal into Decimal // Convert Sexagesimal into Decimal
double sex2dec(char *s) double s2dec(char *s)
{ {
double x; double x;
float deg,min,sec; float deg,min,sec;

View File

@ -55,7 +55,7 @@ void reverse(double ra0,double de0,double x,double y,double *ra,double *de);
double nfd2mjd(char *date); double nfd2mjd(char *date);
double date2mjd(int year,int month,double day); double date2mjd(int year,int month,double day);
void mjd2date(double mjd,char *date); void mjd2date(double mjd,char *date);
void dec2sex(double x,char *s,int type); void dec2s(double x,char *s,int type);
float linear_fit(float x[],float y[],int n,float a[],float sa[]); float linear_fit(float x[],float y[],int n,float a[],float sa[]);
int fgetline(FILE *file,char *s,int lim); int fgetline(FILE *file,char *s,int lim);
double gmst(double mjd); double gmst(double mjd);
@ -250,8 +250,8 @@ void reduce_point(struct observation *obs,struct image img,float tmid,float x,fl
ra+=dra; ra+=dra;
// Get RA/Dec // Get RA/Dec
dec2sex(ra/15.0,sra,0); dec2s(ra/15.0,sra,0);
dec2sex(de,sde,1); dec2s(de,sde,1);
obs->ra=ra; obs->ra=ra;
obs->de=de; obs->de=de;
@ -1384,7 +1384,7 @@ void mjd2date(double mjd,char *date)
} }
// Convert Decimal into Sexagesimal // Convert Decimal into Sexagesimal
void dec2sex(double x,char *s,int type) void dec2s(double x,char *s,int type)
{ {
int i; int i;
double sec,deg,min,fmin; double sec,deg,min,fmin;

View File

@ -4,7 +4,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
// Usage: sex2dec [options] hh:mm:ss.ss // Usage: s2dec [options] hh:mm:ss.ss
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
double x; double x;
@ -13,7 +13,7 @@ int main(int argc,char *argv[])
char t[20],c; char t[20],c;
if (argc==1) { if (argc==1) {
printf("Usage: sex2dec -r <hh:mm:ss.sss>\n -or- <ddd:mm:ss.sss>\nCompute sexagesimal from decimal input x.\n"); printf("Usage: s2dec -r <hh:mm:ss.sss>\n -or- <ddd:mm:ss.sss>\nCompute sexagesimal from decimal input x.\n");
printf("Options: -r Converts hours into degrees\n"); printf("Options: -r Converts hours into degrees\n");
return -1; return -1;

View File

@ -114,12 +114,12 @@ int plot_skymap (void);
void rotate (int, float, float *, float *, float *); void rotate (int, float, float *, float *, float *);
int print_tle (char *, int); int print_tle (char *, int);
void mjd2date (double mjd, char *date); void mjd2date (double mjd, char *date);
void dec2sex (double x, char *s, int f, int len); void dec2s (double x, char *s, int f, int len);
void precess (double mjd0, double ra0, double de0, double mjd, double *ra, void precess (double mjd0, double ra0, double de0, double mjd, double *ra,
double *de); double *de);
double nfd2mjd (char *date); double nfd2mjd (char *date);
void nfd_now (char *s); void nfd_now (char *s);
double sex2dec (char *s); double s2dec (char *s);
double doy2mjd (int year, double doy); double doy2mjd (int year, double doy);
struct observation decode_iod_observation (char *iod_line); struct observation decode_iod_observation (char *iod_line);
void plot_iod (char *filename); void plot_iod (char *filename);
@ -129,7 +129,7 @@ void ecliptical2equatorial (double l, double b, double *ra, double *de);
void skymap_plotsun (void); void skymap_plotsun (void);
void skymap_plotmoon (void); void skymap_plotmoon (void);
void mjd2date_iod (double mjd, char *date); void mjd2date_iod (double mjd, char *date);
void dec2sex_iod (double x, char *s, int type); void dec2s_iod (double x, char *s, int type);
int giza_open_device_size_float (const char *, const char *, float, float, int giza_open_device_size_float (const char *, const char *, float, float,
int); int);
@ -589,8 +589,8 @@ format_iod (double mjd, double ra, double de, int site)
// Precess position to J2000 // Precess position to J2000
mjd0 = 51544.5; mjd0 = 51544.5;
precess (mjd, ra, de, mjd0, &ra0, &de0); precess (mjd, ra, de, mjd0, &ra0, &de0);
dec2sex_iod (ra0 / 15.0, sra, 0); dec2s_iod (ra0 / 15.0, sra, 0);
dec2sex_iod (de0, sde, 1); dec2s_iod (de0, sde, 1);
// Print IOD line // Print IOD line
printf ("99999 99 999A %04d G %s 17 25 %s%s 37 S\n", site, nfd, sra, sde); printf ("99999 99 999A %04d G %s 17 25 %s%s 37 S\n", site, nfd, sra, sde);
@ -818,13 +818,13 @@ main (int argc, char *argv[])
break; break;
case 'R': case 'R':
m.ra0 = 15.0 * sex2dec (optarg); m.ra0 = 15.0 * s2dec (optarg);
strcpy (m.orientation, "equatorial"); strcpy (m.orientation, "equatorial");
m.level = 5; m.level = 5;
break; break;
case 'D': case 'D':
m.de0 = sex2dec (optarg); m.de0 = s2dec (optarg);
strcpy (m.orientation, "equatorial"); strcpy (m.orientation, "equatorial");
m.level = 5; m.level = 5;
break; break;
@ -1178,8 +1178,8 @@ schedule (char *nfd, double ra, double de, char *startstop)
char sra[16], sde[16]; char sra[16], sde[16];
// Compute strings // Compute strings
dec2sex (ra / 15.0, sra, 0, 5); dec2s (ra / 15.0, sra, 0, 5);
dec2sex (de, sde, 0, 4); dec2s (de, sde, 0, 4);
printf ("%s %s %s %s\n", nfd, sra, sde, startstop); printf ("%s %s %s %s\n", nfd, sra, sde, startstop);
@ -2695,16 +2695,16 @@ identify_satellite (char *filename, int satno, double mjd, float rx, float ry)
("x: %+12.4lf km; vx: %+8.5f km/s\ny: %+12.4lf km; vy: %+8.5f km/s\nz: %+12.4lf km; vz: %+8.5f km/s\nr: %10.2lf km; v: %6.3f km/s\nl: %6.2lf; b: %6.2lf; h: %10.2lf km\n\n", ("x: %+12.4lf km; vx: %+8.5f km/s\ny: %+12.4lf km; vy: %+8.5f km/s\nz: %+12.4lf km; vz: %+8.5f km/s\nr: %10.2lf km; v: %6.3f km/s\nl: %6.2lf; b: %6.2lf; h: %10.2lf km\n\n",
smin.x, smin.vx, smin.y, smin.vy, smin.z, smin.vz, smin.r, smin.v, lng, smin.x, smin.vx, smin.y, smin.vy, smin.z, smin.vz, smin.r, smin.v, lng,
lat, smin.h); lat, smin.h);
dec2sex (smin.ra / 15.0, sra, 0, 5); dec2s (smin.ra / 15.0, sra, 0, 5);
dec2sex (smin.de, sde, 0, 4); dec2s (smin.de, sde, 0, 4);
printf ("R.A.: %s Decl.: %s\n", sra, sde); printf ("R.A.: %s Decl.: %s\n", sra, sde);
// Precess position to J2000 // Precess position to J2000
mjd0 = 51544.5; mjd0 = 51544.5;
precess (mjd, smin.ra, smin.de, mjd0, &ra0, &de0); precess (mjd, smin.ra, smin.de, mjd0, &ra0, &de0);
dec2sex (ra0 / 15.0, sra, 0, 5); dec2s (ra0 / 15.0, sra, 0, 5);
dec2sex (de0, sde, 0, 4); dec2s (de0, sde, 0, 4);
printf ("R.A.: %s Decl.: %s (J2000)\n", sra, sde); printf ("R.A.: %s Decl.: %s (J2000)\n", sra, sde);
printf ("Azi.: %.1f Alt.: %.1f\n\n", modulo (smin.azi - 180.0, 360.0), printf ("Azi.: %.1f Alt.: %.1f\n\n", modulo (smin.azi - 180.0, 360.0),
smin.alt); smin.alt);
@ -2965,8 +2965,8 @@ plot_skymap (void)
cpgmtxt ("T", 0.6, 1.0, 1.0, text); cpgmtxt ("T", 0.6, 1.0, 1.0, text);
// Bottom string // Bottom string
dec2sex (m.ra0 / 15.0, sra, 0, 5); dec2s (m.ra0 / 15.0, sra, 0, 5);
dec2sex (m.de0, sde, 0, 4); dec2s (m.de0, sde, 0, 4);
sprintf (text, sprintf (text,
"R:%s; D:%s; A: %.1f; E: %.1f; q: %.2f; S: %.1fx%.1f deg; L: %d; O: %s; m < %.1f; C: %s; l: %.0f s", "R:%s; D:%s; A: %.1f; E: %.1f; q: %.2f; S: %.1fx%.1f deg; L: %d; O: %s; m < %.1f; C: %s; l: %.0f s",
sra, sde, modulo (m.azi0 - 180.0, 360.0), m.alt0, m.q, sra, sde, modulo (m.azi0 - 180.0, 360.0), m.alt0, m.q,
@ -3538,7 +3538,7 @@ mjd2date_iod (double mjd, char *date)
// Convert Decimal into Sexagesimal // Convert Decimal into Sexagesimal
void void
dec2sex (double x, char *s, int f, int len) dec2s (double x, char *s, int f, int len)
{ {
int i; int i;
double sec, deg, min; double sec, deg, min;
@ -3576,7 +3576,7 @@ dec2sex (double x, char *s, int f, int len)
// Convert Decimal into Sexagesimal // Convert Decimal into Sexagesimal
void void
dec2sex_iod (double x, char *s, int type) dec2s_iod (double x, char *s, int type)
{ {
int i; int i;
double sec, deg, min, fmin; double sec, deg, min, fmin;
@ -3660,7 +3660,7 @@ precess (double mjd0, double ra0, double de0, double mjd, double *ra,
// Convert Sexagesimal into Decimal // Convert Sexagesimal into Decimal
double double
sex2dec (char *s) s2dec (char *s)
{ {
double x; double x;
float deg, min, sec; float deg, min, sec;

View File

@ -238,7 +238,7 @@ double gmst(double mjd)
// Convert Sexagesimal into Decimal // Convert Sexagesimal into Decimal
double sex2dec(char *s) double s2dec(char *s)
{ {
double x; double x;
float deg,min,sec; float deg,min,sec;
@ -347,7 +347,7 @@ double parallactic_angle(double mjd,double ra,double de)
} }
// Convert Decimal into Sexagesimal // Convert Decimal into Sexagesimal
void dec2sex(double x,char *s,int f,int len) void dec2s(double x,char *s,int f,int len)
{ {
int i; int i;
double sec,deg,min; double sec,deg,min;
@ -413,12 +413,12 @@ int main(int argc,char *argv[])
break; break;
case 'R': case 'R':
m.ra0=15.0*sex2dec(optarg); m.ra0=15.0*s2dec(optarg);
strcpy(m.orientation,"equatorial"); strcpy(m.orientation,"equatorial");
break; break;
case 'D': case 'D':
m.de0=sex2dec(optarg); m.de0=s2dec(optarg);
strcpy(m.orientation,"equatorial"); strcpy(m.orientation,"equatorial");
break; break;
@ -461,8 +461,8 @@ int main(int argc,char *argv[])
m.q=parallactic_angle(m.mjd,m.ra0,m.de0); m.q=parallactic_angle(m.mjd,m.ra0,m.de0);
// Get sexagesimal // Get sexagesimal
dec2sex(m.ra0/15.0,sra,0,5); dec2s(m.ra0/15.0,sra,0,5);
dec2sex(m.de0,sde,0,4); dec2s(m.de0,sde,0,4);
// Print to screen // Print to screen
printf("%s R:%s D: %s H: %7.3f A: %6.3f E: %6.3f q: %5.2f\n",m.nfd,sra,sde,ha,modulo(m.azi0-180.0,360.0),m.alt0,m.q); printf("%s R:%s D: %s H: %7.3f A: %6.3f E: %6.3f q: %5.2f\n",m.nfd,sra,sde,ha,modulo(m.azi0-180.0,360.0),m.alt0,m.q);