shaonghosh / sky_tiling

The various codes for sky tiling can be found here
5 stars 5 forks source link

No such file or directory: '/home/deep/github/sky_tiling/tile_pixel_maps/preComputed_ZTF_pixel_indices_512.dat' #2

Closed deepchatterjeeligo closed 7 years ago

deepchatterjeeligo commented 7 years ago

Another one @shaonghosh This is also a minor issue and can be fixed easily. Let me mention how I instantiated the object and called the methods of RankedTileGenerator

In [1]: from rankedTilesGenerator import RankedTileGenerator In [2]: RT_obj = RankedTileGenerator('../utilities/bayestar.fits.gz','/home/deep/work/sky_tiling_workdir/config.ini') In [3]: tile_and_prob = RT_obj.getRankedTiles() IOError Traceback (most recent call last)

in () ----\> 1 tile_and_prob = RT_obj.getRankedTiles() /home/deep/github/sky_tiling/bin/rankedTilesGenerator.pyc in getRankedTiles(self, resolution, verbose) 188 filename = self.preCompDictFiles[resolution] 189 if verbose: print filename --> 190 File = open(filename, 'rb') 191 data = pickle.load(File) 192 tile_index = np.arange(len(data)) IOError: [Errno 2] No such file or directory: '/home/deep/github/sky_tiling/tile_pixel_maps/preComputed_ZTF_pixel_indices_512.dat'

So the issue is the following that the config file just has the nside = 256, but if I don't supply the resolution it tries to read the 512 version which is the default resolution of the skymap. If I explicitly supply the resolution=256 argument, it will work fine.

In [4]: tile_and_prob = RT_obj.getRankedTiles(resolution=256) In [5]:

I guess it's to read the resolution from the config file if resolution is not supplied rather than taking the default resolution of the skymap, that way result will be according to the config file all the time.

shaonghosh commented 7 years ago

This is a known issue. I actually do not want to have the other resolutions in the repo because they are bulky. The idea is to have them created by the user (like) for the other telescopes. Currently these can be downloaded from the NEMO cluster.

shaonghosh commented 7 years ago

This issue should now be mitigated. If the setup script is run using a standard telescope i.e., ['Atlas', 'BlackGEM', 'PS1', 'ZTF’] it skips the tile building step since the tile-pixel maps are already present in the repo. However, if you use the optional argument --nside to specify a resolution other than 256, then the setup will build the tiles and create the tile-pixel maps. However, if you use the --nside option then you will have to use the --tilefile option to specify the tile center files. Of course in this case the tile center files are already present in the ‘tile_center_files’ directory, and do not need to be created. IMPORTANT Always use full paths to the tile_center_files directory.