Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

constellations.c fails #1

Open
rkhan2022 opened this issue Apr 30, 2024 · 3 comments
Open

constellations.c fails #1

rkhan2022 opened this issue Apr 30, 2024 · 3 comments

Comments

@rkhan2022
Copy link

In the diretory structure in Linux Mint,
/home/rana/mapplot/ephemeris-compute-de430/src/ephemCalc/
/home/rana/mapplot/ephemeris-compute-de430/src/constellations/bound_20.dat
but,
(astroconda) rana@rana-VirtualBox:$ cd mapplot/star-charter/examples/
(astroconda) rana@rana-VirtualBox:
/mapplot/star-charter/examples$ ../bin/starchart.bin venus_ephemeris.sch
Error: Fatal Error encountered in src/ephemCalc/constellations.c at line 118:
Error: Could not open constellation boundary data
Error: Fatal Error encounted in src/astroGraphics/ephemeris.c at line 169:
Error: ephemeris-compute-de430 returned no data
(astroconda) rana@rana-VirtualBox:~/mapplot/star-charter/examples$

in the file ~/mapplot/ephemeris-compute-de430/src/ephemCalc/constellation.c line 118 fails


//! constellations_init - Initialise the constellations module. Load the constellation boundaries from disk.
void constellations_init() {
FILE *file;
int i;
char line[FNAME_LENGTH], *scan, constellation[6] = "@@@";

Nconstel = 0;

// Scan through catalogue of bound
file = fopen(SCRDIR "../constellations/bound_20.dat", "r");
if (file == NULL) ephem_fatal(__FILE__, __LINE__, "Could not open constellation boundary data");   <-- line 118

@dcf21
Copy link
Owner

dcf21 commented Apr 30, 2024

Did you move the code to a different file path after running setup.sh?

That is the most likely cause of this error: the file path to the binary data files is stored at compile time. If you move the code, you should run make clean and re-run setup.sh to ensure all the C code is recompiled.

@rkhan2022
Copy link
Author

Thanks for your valuable suggestion. I am going to reinstall both star charter and ephemeris-compute-430 again directly under my home folder, after that I will report you about the development.

@rkhan2022
Copy link
Author

No I have not move the directory anywhere.
Now I have tried as follows and gets error1
(astroconda) rana@rana-VirtualBox:/mapplot/ephemeris-compute-de430$ sudo make clean
[sudo] password for rana:
rm -vfR obj bin
removed directory 'obj/settings'
removed directory 'obj/ephemCalc'
removed directory 'obj/mathsTools'
removed directory 'obj/listTools'
removed 'obj/argparse/argparse.o'
removed directory 'obj/argparse'
removed 'obj/coreUtils/makeRasters.o'
removed 'obj/coreUtils/errorReport.o'
removed 'obj/coreUtils/asciiDouble.o'
removed directory 'obj/coreUtils'
removed directory 'obj'
(astroconda) rana@rana-VirtualBox:
/mapplot/ephemeris-compute-de430$ sh setup.sh
Downloading required data files
[02/05/2024 22:40:56] INFO:dataFetch.py:Automatically download all of the required data files from the internet.
[02/05/2024 22:40:56] INFO:dataFetch.py:Fetching <data/astorb.dat>
[02/05/2024 22:40:56] INFO:dataFetch.py:File already exists, but downloading fresh copy.
[02/05/2024 22:40:56] INFO:dataFetch.py:Downloading https://ftp.lowell.edu/pub/elgb/astorb.dat.gz to <data/astorb.dat.gz>
--2024-05-02 22:40:56-- https://ftp.lowell.edu/pub/elgb/astorb.dat.gz
Resolving ftp.lowell.edu (ftp.lowell.edu)... 207.192.243.73
Connecting to ftp.lowell.edu (ftp.lowell.edu)|207.192.243.73|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 99628587 (95M) [application/octet-stream]
Saving to: ‘data/astorb.dat.gz’

data/astorb.dat.gz 100%[==============================================>] 95.01M 537KB/s in 21m 29s

2024-05-02 23:02:27 (75.5 KB/s) - ‘data/astorb.dat.gz’ saved [99628587/99628587]

[02/05/2024 23:02:27] INFO:dataFetch.py:Uncompressing to <data/astorb.dat>
[02/05/2024 23:02:29] INFO:dataFetch.py:Fetching <data/Soft00Cmt.txt>
[02/05/2024 23:02:29] INFO:dataFetch.py:File already exists, but downloading fresh copy.
[02/05/2024 23:02:29] INFO:dataFetch.py:Downloading https://www.minorplanetcenter.net/iau/MPCORB/CometEls.txt to <data/Soft00Cmt.txt>
--2024-05-02 23:02:29-- https://www.minorplanetcenter.net/iau/MPCORB/CometEls.txt
Resolving www.minorplanetcenter.net (www.minorplanetcenter.net)... 160.111.215.26
Connecting to www.minorplanetcenter.net (www.minorplanetcenter.net)|160.111.215.26|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 192106 (188K) [text/plain]
Saving to: ‘data/Soft00Cmt.txt’

data/Soft00Cmt.txt 100%[==============================================>] 187.60K 100KB/s in 1.9s

2024-05-02 23:02:37 (100 KB/s) - ‘data/Soft00Cmt.txt’ saved [192106/192106]

[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/header.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <constellations/bound_20.dat>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <constellations/ReadMe>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1600.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1620.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1640.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1660.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1680.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1700.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1720.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1740.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1760.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1780.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1800.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1820.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1840.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1860.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1880.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1900.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1920.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1940.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1960.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp1980.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp2000.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp2020.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp2040.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp2060.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp2080.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp2100.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp2120.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp2140.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp2160.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp2180.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
[02/05/2024 23:02:37] INFO:dataFetch.py:Fetching <data/ascp2200.405>
[02/05/2024 23:02:37] INFO:dataFetch.py:File already exists. Not downloading fresh copy.
Compiling code
mkdir -p obj obj/argparse obj/coreUtils obj/ephemCalc obj/listTools obj/mathsTools obj/settings
cc -Wall -Wno-format-truncation -Wno-unknown-pragmas -g -c -I /home/rana/mapplot/ephemeris-compute-de430/src -O3 -D DEBUG=0 -D MEMDEBUG1=0 -D MEMDEBUG2=0 -fopenmp -D DCFVERSION="2.0" -D DATE="09/06/2019" -D PATHLINK="/" -D SRCDIR="/home/rana/mapplot/ephemeris-compute-de430/src/" src/argparse/argparse.c -o obj/argparse/argparse.o
mkdir -p obj obj/argparse obj/coreUtils obj/ephemCalc obj/listTools obj/mathsTools obj/settings
cc -Wall -Wno-format-truncation -Wno-unknown-pragmas -g -c -I /home/rana/mapplot/ephemeris-compute-de430/src -O3 -D DEBUG=0 -D MEMDEBUG1=0 -D MEMDEBUG2=0 -fopenmp -D DCFVERSION="2.0" -D DATE="09/06/2019" -D PATHLINK="/" -D SRCDIR="/home/rana/mapplot/ephemeris-compute-de430/src/" src/coreUtils/asciiDouble.c -o obj/coreUtils/asciiDouble.o
mkdir -p obj obj/argparse obj/coreUtils obj/ephemCalc obj/listTools obj/mathsTools obj/settings
cc -Wall -Wno-format-truncation -Wno-unknown-pragmas -g -c -I /home/rana/mapplot/ephemeris-compute-de430/src -O3 -D DEBUG=0 -D MEMDEBUG1=0 -D MEMDEBUG2=0 -fopenmp -D DCFVERSION="2.0" -D DATE="09/06/2019" -D PATHLINK="/" -D SRCDIR="/home/rana/mapplot/ephemeris-compute-de430/src/" src/coreUtils/errorReport.c -o obj/coreUtils/errorReport.o
mkdir -p obj obj/argparse obj/coreUtils obj/ephemCalc obj/listTools obj/mathsTools obj/settings
cc -Wall -Wno-format-truncation -Wno-unknown-pragmas -g -c -I /home/rana/mapplot/ephemeris-compute-de430/src -O3 -D DEBUG=0 -D MEMDEBUG1=0 -D MEMDEBUG2=0 -fopenmp -D DCFVERSION="2.0" -D DATE="09/06/2019" -D PATHLINK="/" -D SRCDIR="/home/rana/mapplot/ephemeris-compute-de430/src/" src/coreUtils/makeRasters.c -o obj/coreUtils/makeRasters.o
mkdir -p obj obj/argparse obj/coreUtils obj/ephemCalc obj/listTools obj/mathsTools obj/settings
cc -Wall -Wno-format-truncation -Wno-unknown-pragmas -g -c -I /home/rana/mapplot/ephemeris-compute-de430/src -O3 -D DEBUG=0 -D MEMDEBUG1=0 -D MEMDEBUG2=0 -fopenmp -D DCFVERSION="2.0" -D DATE="09/06/2019" -D PATHLINK="/" -D SRCDIR="/home/rana/mapplot/ephemeris-compute-de430/src/" src/ephemCalc/constellations.c -o obj/ephemCalc/constellations.o
In file included from src/ephemCalc/constellations.c:44:
src/ephemCalc/bound_20.dat:1:1: error: expected identifier or ‘(’ before numeric constant
1 | 23.5357132 +35.1897736 AND I
| ^~~~~~~~~~
src/ephemCalc/constellations.c:50:3: warning: data definition has no type or storage class
50 | } constel_point;
| ^~~~~~~~~~~~~
src/ephemCalc/constellations.c:50:3: warning: type defaults to ‘int’ in declaration of ‘constel_point’ [-Wimplicit-int]
src/ephemCalc/constellations.c:56:5: error: expected specifier-qualifier-list before ‘constel_point’
56 | constel_point point[1024];
| ^~~~~~~~~~~~~
src/ephemCalc/constellations.c: In function ‘constellations_init’:
src/ephemCalc/constellations.c:117:18: error: ‘SCRDIR’ undeclared (first use in this function); did you mean ‘SRCDIR’?
117 | file = fopen(SCRDIR "../constellations/bound_20.dat", "r");
| ^~~~~~
| SRCDIR
src/ephemCalc/constellations.c:117:18: note: each undeclared identifier is reported only once for each function it appears in
src/ephemCalc/constellations.c:117:24: error: expected ‘)’ before string constant
117 | file = fopen(SCRDIR "../constellations/bound_20.dat", "r");
| ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| )
src/ephemCalc/constellations.c:117:12: error: too few arguments to function ‘fopen’
117 | file = fopen(SCRDIR "../constellations/bound_20.dat", "r");
| ^~~~~
In file included from src/ephemCalc/constellations.c:28:
/usr/include/stdio.h:258:14: note: declared here
258 | extern FILE *fopen (const char *__restrict __filename,
| ^~~~~
src/ephemCalc/constellations.c:134:39: error: ‘constel_desc’ has no member named ‘ShortNameSet’
134 | constel_data[Nconstel - 1].ShortNameSet = 1;
| ^
src/ephemCalc/constellations.c:135:39: error: ‘constel_desc’ has no member named ‘LongNameSet’
135 | constel_data[Nconstel - 1].LongNameSet = 0;
| ^
src/ephemCalc/constellations.c:136:39: error: ‘constel_desc’ has no member named ‘Npoints’
136 | constel_data[Nconstel - 1].Npoints = 0;
| ^
src/ephemCalc/constellations.c:137:47: error: ‘constel_desc’ has no member named ‘ShortName’
137 | strncpy(constel_data[Nconstel - 1].ShortName, line + 23, 4);
| ^
src/ephemCalc/constellations.c:138:39: error: ‘constel_desc’ has no member named ‘ShortName’
138 | constel_data[Nconstel - 1].ShortName[5] = '\0';
| ^
src/ephemCalc/constellations.c:143:35: error: ‘constel_desc’ has no member named ‘point’
143 | constel_data[Nconstel - 1].point[constel_data[Nconstel - 1].Npoints].RA = ra / 12. * M_PI;
| ^
src/ephemCalc/constellations.c:143:68: error: ‘constel_desc’ has no member named ‘Npoints’
143 | constel_data[Nconstel - 1].point[constel_data[Nconstel - 1].Npoints].RA = ra / 12. * M_PI;
| ^
src/ephemCalc/constellations.c:144:35: error: ‘constel_desc’ has no member named ‘point’
144 | constel_data[Nconstel - 1].point[constel_data[Nconstel - 1].Npoints].Dec = dec / 180. * M_PI;
| ^
src/ephemCalc/constellations.c:144:68: error: ‘constel_desc’ has no member named ‘Npoints’
144 | constel_data[Nconstel - 1].point[constel_data[Nconstel - 1].Npoints].Dec = dec / 180. * M_PI;
| ^
src/ephemCalc/constellations.c:145:35: error: ‘constel_desc’ has no member named ‘Npoints’
145 | constel_data[Nconstel - 1].Npoints++;
| ^
src/ephemCalc/constellations.c:175:33: error: ‘constel_desc’ has no member named ‘ShortNameSet’
175 | if (!constel_data[i].ShortNameSet) ephem_fatal(FILE, LINE, "ShortName of constellation not set");
| ^
src/ephemCalc/constellations.c:176:50: error: ‘constel_desc’ has no member named ‘ShortName’
176 | if (strcmp(ShortName, constel_data[i].ShortName) == 0) {
| ^
src/ephemCalc/constellations.c:177:39: error: ‘constel_desc’ has no member named ‘LongName’
177 | strcpy(constel_data[i].LongName, LongName);
| ^
src/ephemCalc/constellations.c:178:32: error: ‘constel_desc’ has no member named ‘LongNameSet’
178 | constel_data[i].LongNameSet = 1;
| ^
src/ephemCalc/constellations.c:190:29: error: ‘constel_desc’ has no member named ‘LongNameSet’
190 | if (!constel_data[i].LongNameSet) {
| ^
src/ephemCalc/constellations.c:191:103: error: ‘constel_desc’ has no member named ‘ShortName’
191 | sprintf(temp_err_string, "Could not find long name for constellation'%s'", constel_data[i].ShortName);
| ^
src/ephemCalc/constellations.c: In function ‘constellations_fetch’:
src/ephemCalc/constellations.c:210:64: error: ‘constel_desc’ has no member named ‘point’
210 | double ang_sep = angDist_RADec(ra, dec, constel_data[i].point[0].RA, constel_data[i].point[0].Dec);
| ^
src/ephemCalc/constellations.c:210:93: error: ‘constel_desc’ has no member named ‘point’
210 | double ang_sep = angDist_RADec(ra, dec, constel_data[i].point[0].RA, constel_data[i].point[0].Dec);
| ^
src/ephemCalc/constellations.c:219:40: error: ‘constel_desc’ has no member named ‘Npoints’
219 | for (j = 0; j < constel_data[i].Npoints; j++) {
| ^
src/ephemCalc/constellations.c:220:46: error: ‘constel_desc’ has no member named ‘Npoints’
220 | int k = (j + 1) % constel_data[i].Npoints;
| ^
src/ephemCalc/constellations.c:221:54: error: ‘constel_desc’ has no member named ‘point’
221 | winding += dWind(ra, dec, constel_data[i].point[j].RA, constel_data[i].point[j].Dec,
| ^
src/ephemCalc/constellations.c:221:83: error: ‘constel_desc’ has no member named ‘point’
221 | winding += dWind(ra, dec, constel_data[i].point[j].RA, constel_data[i].point[j].Dec,
| ^
src/ephemCalc/constellations.c:222:45: error: ‘constel_desc’ has no member named ‘point’
222 | constel_data[i].point[k].RA, constel_data[i].point[k].Dec);
| ^
src/ephemCalc/constellations.c:222:74: error: ‘constel_desc’ has no member named ‘point’
222 | constel_data[i].point[k].RA, constel_data[i].point[k].Dec);
| ^
src/ephemCalc/constellations.c:220:17: warning: variable ‘k’ set but not used [-Wunused-but-set-variable]
220 | int k = (j + 1) % constel_data[i].Npoints;
| ^
src/ephemCalc/constellations.c:234:47: error: ‘constel_desc’ has no member named ‘LongName’
234 | if (outcome[i]) return constel_data[i].LongName;
| ^
make: *** [Makefile:87: obj/ephemCalc/constellations.o] Error 1
(astroconda) rana@rana-VirtualBox:~/mapplot/ephemeris-compute-de430$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants