ICRAR / ngas

The NGAS storage system
GNU Lesser General Public License v3.0
23 stars 13 forks source link

Querying FITS files by header values #25

Open danjampro opened 4 years ago

danjampro commented 4 years ago

Hi, I am wondering if it is possible to query NGAS for FITS files with matching key/value pairs in their headers? Or should this info be encoded into the filename?

Thanks!

awicenec commented 4 years ago

Hi, this is not directly possible, but you can write a retrieval plugin to do it. Would be pretty hefty on a big archive, because it would essentially open and scan every single file. We have done this before. I guess I do have the plugin code still somewhere, if you are interested.

danjampro commented 4 years ago

Hi, this is not directly possible, but you can write a retrieval plugin to do it. Would be pretty hefty on a big archive, because it would essentially open and scan every single file. We have done this before. I guess I do have the plugin code still somewhere, if you are interested.

Hi @awicenec , thanks for getting back so quickly. Maybe this won't be necessary if I can use files_like parameter to query instead. However, I'm not sure how to correctly format this parameter and I can't see much in the documentation about it. I am also not sure how I should format the start and end parameters used by files_between. Can this be clarified?

awicenec commented 4 years ago

The start and end parameters are in SQL format, i.e. if the query would work on a SQL DB it will also work with NGAS. Do you have direct access to the NGAS DB? In general that is the easier way to get such information. The NGAS QUERY command really is just a workaround, useful in some situations, but not really implemented well enough to support actual operations.