Base class for all mongodb-based image logs.
The intent is for this base class to access the entire collection of image records for a given project. Subclasses can be used that cater to specific parts of the data set (such as one instrument or another; one observing mode or another). This specificity is created with the queryMask, which is a query that will always be appending to the user’s query to ensure that only the requested types of data are returned. For example, this can be a query to only accept ‘MegaPrime’ under the INSTRUME key.
Parameters: | dbname : str
cname : str
server : str
url : str
port : int
|
---|
Parameters: | alg – Compression algorithm. Any of: |
---|
Parameters: |
|
---|
Decompresses FITS files at pathKey.
Parameters: |
|
---|
Deletes a field from selected image records.
Parameters: |
|
---|
Deletes all files stored under pathKey, and the reference in the image log.
Parameters: |
|
---|
Return the set of distinct values a field takes over the selection.
Analogous to find(), but formats the returned cursor into a dictionary.
Get images keys that match the specified selector using MongoDB queries.
Get the set of unique values of data key for images that meet the specified selector.
Note
This doesn’t actually use the distinct aggregation commmand in PyMongo, since it doesn’t yet support queries itself.
Parameters: |
|
---|
Deprecated since version Use: distinct() instead.
Get a dictionary of image key: {data key: data value, ...} for images that match the search selector. The returned dictionary contains data only with the requested dataKeys (i.e., a subset of the data base and records for each image are returned.)
Parameters: |
|
---|
Deprecated since version Use: find_dict() instead.
Same as get(), but operates on a sequence of image keys, rather than a search selector.
Deprecated since version Use: find_dict() instead.
Returns a cursor to iterate through image records that meet the given selector. Each record is a dictionary, with the image key stored under _id.
Parameters: |
|
---|
Deprecated since version Use: find() instead.
Moves a file whose path is found under pathKey to the newDir directory. The directory is created if necessary. Old files are overwritten if necessary.
Parameters: |
|
---|
Renames a field for all image log records found with the optional selector.
Parameters: |
|
---|
Get images keys that match the specified selector using MongoDB queries.
Parameters: |
|
---|---|
Returns: | the list of image keys for images that match the selector |
dictionary.
Deprecated since version Use: find_images() instead.
Base class for importing MEF (multi-extension FITS) into an imagelog.
The user subclass that inherits MEFImporter should do several things:
Parameters: | dbname : str
cname : str
server : str
url : str
port : int
|
---|
Yield file paths matching a pattern.
Adapted from Python Cookbook, 2nd Ed. 2.16.
Create a Mongo-compatible polygon representing the chip footprint in equatorial cordinates. The polygon is a length-4 list, populated with length-2 lists of RA, Dec vertices.
Generate the object id for this image.
Should be implemented by user. Raises NotImplementedError otherwise.
Runs the import pipeline.
Parameters: | base_dir : str
suffix : str
recursive : bool
preview : bool
|
---|
Ingest a single FITS file at path.
Parameters: | path : str
preview : bool
|
---|