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

additional figure errors in TISC #15

Closed
mberry28 opened this issue Oct 20, 2017 · 4 comments
Closed

additional figure errors in TISC #15

mberry28 opened this issue Oct 20, 2017 · 4 comments

Comments

@mberry28
Copy link
Collaborator

Hopefully, I can be clear about this issue:

Using I made some small adaptions to tisc.river_profile.gmt.job so that I could get a plot of the river profiles (there is still a few issues, but that's another story). I wanted to have TISC plot a new river profiles instead of the normal tisc.gmt.job.

Executing the file in the terminal command line ('./tisc.river_profile.gmt proj') it seemed to work how I expect it to (see good_profile.jpg). So I renamed tisc.river_profile.gmt.job to tisc.gmt.job. and for some reason, the GMT output goes crazy (see attachment bad_profile.jpg). I tried adding an additional line in the TISC commands to output both the standard tisc.gmt.job and tisc.gmt.river_profiles.gmt.job and the standard figures were working perfectly, just not the river profile image.

I am pretty sure that the system() call that was executing the shell is stepping over some environmental variables. I have tried other workarounds but haven't been successful. Again, it should be clear that if I execute the river profile script from the terminal, it works fine. It just seems to have the problem when it's executed within TISC.

bad_profile
good_profile

@danigeos
Copy link
Owner

danigeos commented Oct 20, 2017 via email

@mberry28
Copy link
Collaborator Author

Thanks for the reply.

Since I have adapted the GMT shell scripts, I usually have tisc.gmt.job in the working directory, and not have it called from the tisc/script/. So my tisc.c code section looks like this:

char command[300];
sprintf(command, "./tisc.gmt.job %s", projectname);
if (verbose_level>=3)
fprintf(stdout, "\nPostscript file '%s.ps' is going to be produced with command:", projectname) ;
if (verbose_level>=3)
fprintf(stdout, "\n%s\n", command) ;
system(command);

One test I did was I change the tisc.river_profile.gmt.job to tisc.gmt.job in my working directory and it produces the same perturbed figure as above. So I am pretty certain that TISC is correctly calling the right tisc.river_profile.gmt.job (the one in my working directory)

@danigeos
Copy link
Owner

danigeos commented Oct 20, 2017 via email

@mberry28
Copy link
Collaborator Author

mberry28 commented Dec 2, 2017

Addressing my solution for future researchers:

I am still not sure what exactly the problem was, it certainly was located in the environment not being preserved. I took all the segments from tisc.common.gmt.job that were needed for tisc.river_profile.gmt.job and inserted them all directly into tisc.river_profile.gmt.job and it worked. Like I said, I am still not sure why it would work fine in the command line, but have issues when executed in TISC.

@mberry28 mberry28 closed this as completed Dec 2, 2017
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