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

automatic copying within generators #28

Open
mileslucas opened this issue Jun 30, 2020 · 0 comments
Open

automatic copying within generators #28

mileslucas opened this issue Jun 30, 2020 · 0 comments
Assignees
Labels

Comments

@mileslucas
Copy link
Member

A very common workflow for reducing data includes copying files after each operation to have a separate copy for each step of the reduction.

For example, I have 10 bias frames and I want to overscan subtract and trim them before saving to a new location. For each file, I want the new name to be <name>_oc_trim.<ext>. Or perhaps I want them to be saved in a new folder oc_trim/<name>.<ext> (or maybe both!).

We can automate this process using the generators from #27 with some new keyword arguments

  • save - save the files using the options below.
  • save_folder - new folder to save in
  • save_prefix - add to name like <prefix>_<name>.<ext>
  • save_suffix - add to end of name like <name>_<suffix>.<ext>
  • save_delim="_" - the thing to put before/after the prefix or suffix

The general idea is that if any of save_folder, save_prefix, save_suffix is given then the files are copied and saved (ie save=true), otherwise they are not (ie save=false). The user can manually write save=false, for example, to get filenames using the mechanics provided without actually copying data.

Now, in terms of implementation I don't have a perfect idea yet, but I would generally want the users to be able to avoid manually calling any write functions. In other words, if I set these keywords appropriately, there should be nothing different in my for-loop compared to a version that doesn't save. To do this, you'll have to find a way using ResumableFunctions to get a "return value". We can discuss further ideas to accomplish this.

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

No branches or pull requests

2 participants