========== Quickstart ========== Basic stuff =========== As a starter we will play with AVHRR L2P METOP product by OSI SAF. Initialize a product index -------------------------- We create first a quick index without any specific priorities. The index stores the spatial (shape) and temporal (time range) of each product granule. We use the ``naiad-create_index`` command line tool: .. code-block:: bash naiad-create-index --elasticsearch http://localhost:9200/ avhrr_sst_metop_a-osisaf-l2p-v1.0 Tile some granules ------------------ We have to extract the global shape and time frame from the granules and the tiles constituting these granules. We use the ``naiad-tile`` command line tool: .. code-block:: bash naiad-tile 20100123-EUR-L2P_GHRSST-SSTsubskin-AVHRR_METOP_A-eumetsat_sstmgr_metop02_20100123_000103-v01.7-fv01.0.nc GHRSSTNCFile --show --xstep=540 --ystep=540 For more information on this, refer to :doc:`naiad-tile`. Register the granules --------------------- Simply ingest the content of the tile files generated above with ``naiad-register`` command: .. code-block:: bash naiad-register avhrr_sst_metop_a-osisaf-l2p-v1.0 20100123-EUR-L2P_GHRSST-SSTsubskin-AVHRR_METOP_A-eumetsat_sstmgr_metop02_20100123_000103-v01.7-fv01.0.nc.tiles Get a granule description and display ------------------------------------- We can get the description of a previously registered granule and also display its shape on a map using ``naiad-granule-info`` command: .. code-block:: bash naiad-granule-info ascat_a ascat_20100820_080601_metopa_19899_eps_o_coa_1100_ovw.l2.nc --show Do a spatio-temporal search --------------------------- Naiad is mainly about spatio-temporal search, so let's search for some granules intersecting an area and period of interest. This is done with ``naiad-search`` command. Get everything! (be careful!): .. code-block:: bash naiad-search ascat_a --show Add a time frame restriction: .. code-block:: bash naiad-search ascat_a --start 2010-08-19 --end 2010-08-20 --show And now some area, defined as lonmin, latmin, lonmax, latmax: .. code-block:: bash naiad-search ascat_a --start 2010-08-19 --end 2010-12-20 --area='-20,-20,20,20' --show You can request several products at the same time using a coma-separated list: .. code-block:: bash naiad-search ascat_a,avhrr_sst_metop_a-osisaf-l2p-v1.0 --start 2010-08-19 --end 2010-12-20 --area='-20,-20,20,20' --show You can specify some constraints on the granule properties, if they have been registered in the product index. For instance, get all granules with a `file_quality_level` greater than 3 (if such a property was defined). .. code-block:: bash naiad-search amsr2 --granule_constraints=file_quality_level.ge.3 Multiple constraints can be combined, separating the different constraints by a ``;``: .. code-block:: bash naiad-search amsr2 --granule_constraints='file_quality_level.ge.3;file_quality_level.lt.3' Do a cross search (colocation) ------------------------------ We want to keep only the granules from different products that cross each other within a time window. One product, given by ``--cross`` argument is considered as the "reference" sensor, the one with which all other products, given by ``--versus`` argument must match within the time window given by ``--time_window``: .. code-block:: bash naiad-cross-search --cross amsr2 --versus srl_oprssha_2 --time_window=720 You can display the crossovers one by one with ``--show`` option: .. code-block:: bash naiad-cross-search --cross amsr2 --versus srl_oprssha_2 --time_window=720 --show .. image:: images/crossover.png Use ``--full_footprint`` option in addition to display the full footprint of the colocated granules(usefull for checking). .. code-block:: bash naiad-cross-search --cross amsr2 --versus srl_oprssha_2 --time_window=720 --full_footprint --show .. image:: images/crossover_fullprint.png Use filters in search --------------------- If some properties were indexed together with the granules or the tiles, they can be used as search filters, using either ``--granule_constraints`` to filter on granule properties. For instance let's assume we gave indexed the granules of *slstr* product with a property *version* specifying the algorithm version used for a specific granule. We can query the granules having *version* number equal to 2.3: .. code-block:: bash naiad-search slstr --granule_constraints='version eq 2.3' Note the available comparison operators: ``eq``, ``lt``, ``le``, ``gt``, ``ge``. Filters can be combined (logical AND) using ``;``: .. code-block:: bash naiad-search slstr --granule_constraints='version eq 2.3';'cloud_fraction le 0.5' It can be used also in a cross-over search, but the expressed constraint (for now) only applies to the reference dataset, defined by ``--cross argument``. In the following example, we request the cross-overs between *slstr* and *metop_a* datasets where the *version* property for *slstr* granules equals 2.3: .. code-block:: bash naiad-cross-search --cross slstr --versus metop_a --time_window=15--start 20160520T000000 --end 20160610T000000 --granule_constraints='version eq 2.3' Some more commands ================== Delete an index --------------- This will delete the index and all registered granules and tiles. Use with caution. .. code-block:: bash curl -XDELETE http://localhost:9200/avhrr_sst_metop_a-osisa-l2p-v1.0/