Comments (9)
The intended usage if you want to force it to get a local copy is:
tiles_data = desimodel.io.load_tiles(tilesfile='./tiles_skysub.fits', cache=False)
In particular we don't want cases like
tiles_data = desimodel.io.load_tiles(tilesfile='desi-tiles.fits', cache=False)
to be ambiguous about whether a local copy is overriding the standard copy or not.
i.e.
- no path = get it from $DESIMODEL/data/footprint
- with path = get it from the location specified by the path
Would that meet your needs?
from desimodel.
I guess that behavior was quite surprising to me. The docstring says:
tilesfile : (str)
Name of tiles file to load; or None for default.
Without path, look in $DESIMODEL/data/footprint, otherwise load file.
I passed in the name of a file to load and it raised an exception because it was looking in the package data directory. If this behavior is intended, then we should at least change the docstring, and I will do additional checks in fiberassign to warn the user what is happening if they pass the name of a tile file that exists in the current working directory.
from desimodel.
I think the docstring reflects the intended usage (which I agree is not what was actually implemented). A key detail is that without a path, $DESIMODEL/data/footprint/filename.fits
still trumps local ./filename.fits
. I think PR #98 does the opposite of that (local copy trumps $DESIMODEL copy).
I'm ok with falling back to checking for a local copy if a $DESIMODEL copy doesn't exist, but I don't think we want the reverse.
from desimodel.
I'm ok with falling back to checking for a local copy if a $DESIMODEL copy doesn't exist, but I don't think we want the reverse.
I think I disagree with this statement. Presumably, all tile files kept in $DESIMODEL will have fixed names and a well-established provenance (and any missing files are presumably due to a borked installation of desi software, but if that happens then that's probably the least of the user's worries), and all file names can be generated via a small number of keywords (e.g., bright=True).
Alternatively, anyone explicitly using the tilesfile
argument presumably wants to use that specific file, whether it's a local copy (without the absolute path) or a non-standard file in a non-standard location. (I explicitly ran into this issue working on survey simulations for the SV data challenge, using a non-standard and not-final tile file, and had to do some trickery to get everything working with "my" file.)
On the other hand, if $DESIMODEL will have N different official tile files (where N>>1) then perhaps my proposal is not a good one.
My $0.02.
from desimodel.
At minimum we should expect $DESIMODEL to have tiles files for commissioning, sv, and the main survey. Beyond that, I'm not sure, but I would like to be able to retain the ability to specify a specific filename in $DESIMODEL without making special case options for each one, and without risking having a local file by the same name silently (and perhaps accidentally) override it.
@moustakas did you have to do "trickery" beyond just "./my-tiles-files.fits" instead of "my-tiles-file.fits"? Having to add "./" doesn't seem so bad to me. Updating the code to match what the docstring says it does also seems good. But if some chain of code is stripping off the "./" and then borking io.load_tiles and causing you to resort to things like temporarily resetting $DESIMODEL, then that would indeed be bad.
from desimodel.
There needs to be some disambiguation between a file in the current working directory and a file with the same name in desimodel footprint.
What about raising an exception in the case tilesfile="blah.fits" and blah.fits exists both locally and in desimodel. This would force the user to either move their local file out of the way (if they did not want to use it) or be more explicit by specifying "./blah.fits".
from desimodel.
I just pushed a change to the PR:
- Check if the local file exists
- Check if the file in $DESIMODEL/data exits
- If neither exists, raise an exception
- If one exists, read it
- If both exist, print a warning and choose the one from $DESIMODEL
Does that sound reasonable?
from desimodel.
@tskisner sounds good. Thanks.
from desimodel.
implemented in #98. Closing.
from desimodel.
Related Issues (20)
- update xy2radec and radec2xy to support airmass field compression terms
- Add focalplane model support for stuck / broken position
- Add support for CANbus failures in focalplane model HOT 1
- Use instrument database for generating focalplane model HOT 2
- update/deprecate fiberpos.fits HOT 6
- DESIMODEL SVN data? HOT 2
- Update platescale to as-built design from DESI-4037 HOT 2
- Mechanism for getting current "nominal" focalplane HOT 1
- Convert focalplane model times to UTC
- Update throughput model to include dip between 4300 and 4500A HOT 3
- Add information about fibers with low transmission
- Outdated desimodel test branches. HOT 1
- astropy 5 not compatible with focalplane calibration ecsv HOT 13
- desiInstall desimodel branches/main fails
- Remove fix-tiles branch? HOT 1
- update psf-quicksim HOT 3
- Update api.rst
- Problem with new version of numpy HOT 5
- io.load_tiles defaults to old tile list $DESIMODEL/data/footprint/desi-tiles.fits HOT 6
- Error with get_tile_radius_deg when loading platescale HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from desimodel.