lacros-tropos / polly4cloudnet

Here you can find some python scripts which will be used on cloudnet.
GNU General Public License v3.0
0 stars 0 forks source link

Usage of concat_pollyxt_files.py #1

Closed ulysses78 closed 2 years ago

ulysses78 commented 2 years ago

I think the script will not work correctly in this way: "python3 -c "from concat_pollyxt_files import ...." from the shell, if in the script itself the parameters are set to i.e. 20210912 and in the shell i.e. the date 20210828 is set. The script will always generate what is set in the script itself - or it will generate the files for both dates. So we have to decide in which way the script will be used: from command line like it's written in the usage section here, where the arguments are set in the command line itself (than the arguments in the script have to be commented out and the call of the main function as well).

OR

Use it just from the command line in this way: "python 3 concat_pollyxt_files.py", where the script accepts the parameters set within the Python script as it is written at the moment.

ulysses78 commented 2 years ago

Sorry, I can't check that at the moment. But on Tuesday I encountered exactly this problem.

ulysses78 commented 2 years ago

Yes, I checked it a few minutes ago. It is like I wrote here https://github.com/lacros-tropos/polly4cloudnet/issues/1#issuecomment-925607266 ... Finally we have to decide, wether we let the user set the arguments via the shell:

python3 -c "from concat_pollyxt_files import concat_pollyxt_files; concat_pollyxt_files('20210628','Mindelo','.')"

OR via the python script itself in the "user section" like:

## start of user defined area***
# set date of measurement here:***

date_of_measurement = "20210912"

# set location/site of the PollyXT here:
location = "Mindelo"

# set output path
output_path = "/lacroshome/cloudnetpy/data/playground"

## end of user defined area

What do you suggest?

martin-rdz commented 2 years ago

I guess on the long run a command line interface based on argparse or something similar will be the best option. https://docs.python.org/3/library/argparse.html Ideally modeled after the cloudnet runscripts.

But for now, as long as Simo checks the output format, the current state should be fine.

ulysses78 commented 2 years ago

Ok. I just changed the python script in this way, that the script will work fine from the shell commandline by setting the args directly in the shell commandline, like it is written in the usage section of the README.md file ;-) So this issue can be closed by now, right?