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
Add new DESI-0347 throughput files #29
Conversation
OK on the other files, which describe the static optics model that applies to all exposures (IIUC). |
@sbailey wrote:
Its more complicated than that, but certainly some fraction of these "random" offsets will vary between exposures. I agree that the function which generates these random offsets should callable from other code, and optionally called by
In principle, these files are redundant if we have reproducible random seeds (which I believe we do for numpy.random) so I could be convinced to pare this down to a single random realization (which is still need to support the first item). |
@sbailey wrote:
|
OK to include some static realizations of the offsets for the reasons you describe, but please move the code for |
I guess you mean add this function to the existing |
The pre-existing focalplane.py / FocalPlane class was abandoned before it was fully vetted and used. Refactor and update as needed, but I think that is the conceptual place for this code to go. As an alternative, we might reserve desimodel for strictly describing the hardware, while using desisim as the place for throwing random numbers based upon that hardware description... |
I just completed the svn side of this as follows:
I believe the following commands are the simplest way to add these files to an existing desimodel git clone (can you confirm @weaverba137?)
|
This PR is now ready for final review and merge. |
As long as install_desimodel_data executable is the same as the one in $DESIMODEL, it should work. |
What might fail if you pick up the script from a different install of desimodel? Can we ensure that the correct script is called using:
I guess this could also fail if a different checkout of
Everyone running simulations will need to perform these steps to update their |
Unless I'm missing something, I think the instructions in the README.rst file cover the various install scenarios. |
Those instructions don't explicitly cover the scenario most relevant here, where you have already installed |
OK, but that only applies if you're working out of a git clone/svn checkout of desimodel. For tagged versions, this would never arise. Sounds like the correct answer is for the data directory to be an svn checkout, not an export. So you just |
Last call for feedback on this PR. @sbailey How do we close the loop with the engineering team? |
What's the format of the For the engineering team, we want them to take ownership of these files and put them in DESI-0347?
i.e. when there are further updates to those data, they should provide updates back to us via that format? I can talk to them about that to confirm it, but we could proceed with putting them in desimodel in the meantime. For the record, I remain nervous about column names like "r=0.15 deg", though I haven't found a case where that actually breaks (though I've only tested within python for astropy Table, numpy structured array, and pandas). We may need to revisit this if it does actually break something. |
A random offset file provides a uniform grid of centroid offsets over the focal plane, as in this example taken from the supporting notebook: The only FITS headers right now are:
but I can add anything else you think would be useful. I would only add |
Thanks. I was mis-interpreting which random offsets were being captured in the random offsets files. Agreed on engineering owning raytracing.txt and we own the format conversion and the other files. I'd suggest using the FITS header keywords CRPIXn, CRVALn, CTYPEn, and CDELTn to define what the range of 256x256 corresponds to in degrees on the focal plane instead of being effectively hardcoded in the |
@sbailey Can you recommend a good reference for defining a basic linear WCS? All the references I am finding make it sound very complicated. The file currently has two images (dx, dy) in HDUs 1, 2. Should the WCS header appear (1) only in HDU0 (2) only in HDUs 1 and 2 or (3) all three HDUs? |
This is what I have so far, but I am just guessing at a lot of this:
How do I specify the units of CDELTn (degrees)? Are there predefined values for CTYPEn that I should be using to indicate "field angle" ? |
Using the CRPIXn, CRVALn, CTYPEn, and CDELTn header keywords is much simpler than full WCS when just specifying a 2D cartesian grid without any distortions, tangent plane projections, etc. See http://heasarc.gsfc.nasa.gov/docs/fcg/standard_dict.html In this case I think you would want:
|
Typing on top of each other. I think your solution is approximately right too, using a reference pixel in the middle rather than the corner. However, CRPIXn is 1 indexed (alas) and refers to the middle of the pixel. Since you have even-sized arrays your origin=(0,0) is on the boundary between pixels, so I think you want CRPIXn = npix/2. + 0.5 . |
I updated the notebook to write and read the new offset FITS files. The reader uses wcslib to interpret the header keywords and build the plot axes, so I am reasonably confident that things are kosher now. If this looks good, I will go ahead and update the FITS files in the SVN desimodel. |
Looks good. Thanks. Go ahead and update the files in svn and merge this when you are ready. |
I just updated the 3 files in svn and will now merge this PR. |
The new files are needed to support more realistic simulations and future pipeline development.
Since data files are maintained in svn, this github PR only shows the associated code and docs, which are contained within a jupyter notebook that you can browse here (this link will break after the merge).
I will also be adding the following new data files under
$DESIMODEL/data
via svn updates:inputs/throughput/raytracing.txt
: original file from Mike Sholl used to calculate the new files.throughput/DESI-0347_blur.ecsv
: spot size as a function of wavelength and field angle.throughput/DESI-0347_offset.ecsv
: nominal radial centroid offset as a function of wavelength and field angle.throughput/DESI-0347_random_offset_<n>.ecsv
: random (x,y) centroid offsets generated with random seeds n=1,2,3.Let me know if you have any questions or concerns before I add these 6 files to the desimodel svn repo.