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

added first iteration of focus_diverse_epsfs #180

Closed
wants to merge 9 commits into from

Conversation

gsanand
Copy link
Contributor

@gsanand gsanand commented Sep 28, 2023

added first iteration of a new module called focus_diverse_epsfs

@gsanand gsanand requested review from pllim and jryon September 28, 2023 17:04
@gsanand gsanand self-assigned this Sep 28, 2023
Copy link
Collaborator

@pllim pllim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the deadline for this, so I can prioritize among my other work?

Some general comments from initial quick glance:

  • You need to hook up the API doc to package documentation, if it is not getting picked up already.
  • Avoid referring to your own directory in docs. Use things others can access like astroquery.mast calls if the file is available from MAST.
  • Do you plan to add unit tests?
  • Is that gateway URL static? What about the auth info? Should it be public like that (is it guarded against DDoS attacks)? Does it take additional auth tokens that are private? Do not put anything private here.
  • Are you handling network issues gracefully? What if your query returns a HTTP Error 500 and so on?
  • Is it appropriate to use print instead of throwing proper exception in a function?
  • Do you really have to roll your own interpolation algorithm or can you use an existing one from photutils, scikit-image, scipy, numpy, and so on?
  • dask is an undeclared dependency
  • scipy is only an optional dependency
  • Please arrange imports in the order of stdlib, blankline, third-party (and each block, do the import first before from, and then alphabetically)

@gsanand
Copy link
Contributor Author

gsanand commented Sep 28, 2023

Hi @pllim, in terms of deadline, we don't have a strict timeline, but ~2 to 3 weeks out from now is fine.

I'll take a look at addressing some of your comments. regarding the DDoS protection/auth info, that is the public API ID and Key we have generated, and we have quotas in place to prevent excessive usage on the AWS API Gateway end of things.

@gsanand
Copy link
Contributor Author

gsanand commented Sep 28, 2023

also we tried several existing interpolation algorithms but found we needed to write our own

Copy link
Contributor

@jryon jryon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far. I'll test out functionality after I return from vacation (Oct 11).

# select if either choosing to provide inputs via a text file or list
if fromTextFile == True:
with open(input_list) as file:
lines = [line.rstrip() for line in file]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something @pllim may have more to say about, but I think you'll need some smart handling/errors for poorly-formatted input files.

Downloads the ePSF FITS file to download_location. The explicit return is
the name of the downloaded FITS file.

"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check docstrings of other acstools modules for preferred format/content.

if y > 2048:
y = y-2048
chip = "WFC1"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it very clear in the docstring/docs that the expected coordinates here are for the whole 4096x4096 frame, not per chip. I'm not 100% sure I agree with this choice, since I'd imagine most people will be choosing their desired PSF location in an FLT/FLC, which has separate arrays for each chip. Maybe there's a way to enable both full-frame and per chip coordinates?

@pllim
Copy link
Collaborator

pllim commented Oct 5, 2023

@gsanand , can you please rebase? I just overhauled the CI stuff. Thanks!

git fetch upstream master
git rebase upstream/master

You might have to resolve conflicts or not. Then when you are sure things went well:

git push -f origin master


Examples
--------

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought I commented on this earlier, but maybe it was in the ISR. The examples below need import statements, and ePSFs in the interpolation examples is not defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it was in the ISR, but I should have made the changes to the module as well. will do along with the next commit.

@jryon
Copy link
Contributor

jryon commented Oct 16, 2023

I did some basic functionality testing and things are working well. I have a few comments:

  • The trailing forwardslash '/' appears to be relevant for the download location. I accidentally left it off at first and wondered where my download went. The filename had the intended directory as a prefix. I'd suggest you add a forwardslash to whatever directory the user inputs.
  • The progress bar seems a little clunky. In one test, it behaved about as expected, but in another it stayed at 0% for several seconds, then went straight to 100%.
  • Forgive me if this is discussed in your ISR and I forgot - are subarrays not supported, then, since this module requires an FLC? Could we use an FLT instead or Is there some other reason for not supporting subarrays?

@gsanand
Copy link
Contributor Author

gsanand commented Oct 17, 2023

Hey @jryon, thanks for the comments!

  • I implemented a fix for this so hopefully it should not be an issue anymore.

  • yes the progress bar is not great sometimes (slow to update). I looked into it and it just seems to be an issue with the underlying code, which I can't fix. I can take out the progress bar if you think that might be the better option.

  • subarrays are indeed not supported (because of the support only for FLCs). I actually did not state this in the ISR before, so I just added a line saying as much.

@jryon
Copy link
Contributor

jryon commented Oct 17, 2023

  • yes the progress bar is not great sometimes (slow to update). I looked into it and it just seems to be an issue with the underlying code, which I can't fix. I can take out the progress bar if you think that might be the better option.

In this case, I'm fine with leaving it, since it is useful at least some of the time.

setting subpixel_x and subpixel_y between 0.00 and 0.99.

We strongly recommend you read ACS ISR 2018-08 by A. Bellini et al. and
ACS ISR 2023-XY by G. Anand et al. (LINK WHEN LIVE) for more details
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsanand , is this ISR published yet?

Copy link
Contributor Author

@gsanand gsanand Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pllim we are waiting to post the ISR (until the module is live). once the ISR is up, then we can update the module with a link (easier to update the module, than the ISR).

>>> P = interp_epsf(ePSFs, x, y, pixel_space = True, subpixel_x = 0.77, subpixel_y = 0.33)


More details for these examples are provided in a Jupyter notebook, which can be found at LINK.
Copy link
Collaborator

@pllim pllim Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to delete this because this package isn't responsible for keeping any notebook elsewhere up-to-date (in fact, notebooks tend to quickly break and become unmaintained). So you can mention it in your ISR but you do not have to mention it here.

@pllim pllim mentioned this pull request Oct 30, 2023
2 tasks
@pllim
Copy link
Collaborator

pllim commented Oct 30, 2023

Sorry, I had to create #183 because of reasons... should we continue there?

@pllim
Copy link
Collaborator

pllim commented Nov 7, 2023

Closing in favor of #183. Thanks for your patience with me!

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

Successfully merging this pull request may close these issues.

3 participants