{"id":17113045,"url":"https://github.com/emmt/yoifits","last_synced_at":"2025-03-23T22:28:08.596Z","repository":{"id":33247463,"uuid":"36891838","full_name":"emmt/YOIFITS","owner":"emmt","description":"Yorick support to OI-FITS (optical interferometry data format)","archived":false,"fork":false,"pushed_at":"2022-03-16T10:39:55.000Z","size":98,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-29T05:41:39.766Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emmt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-04T19:48:41.000Z","updated_at":"2022-03-16T10:39:59.000Z","dependencies_parsed_at":"2022-08-17T21:40:21.378Z","dependency_job_id":null,"html_url":"https://github.com/emmt/YOIFITS","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FYOIFITS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FYOIFITS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FYOIFITS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FYOIFITS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmt","download_url":"https://codeload.github.com/emmt/YOIFITS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245177266,"owners_count":20573072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T17:02:32.388Z","updated_at":"2025-03-23T22:28:08.578Z","avatar_url":"https://github.com/emmt.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YOIFITS\n\nThis project provides support for OI-FITS (optical interferometry data format) in\n[Yorick](http://github.com/LLNL/yorick/).\n\n[Installation](#installation) is explained below.\n\n\n## Usage\n\nIf properly installed, the software exploits the *auto-load* facility of Yorick\nso that there are no needs to `#include \"oifits.i\"`.\n\n\n### Dealing with an existing OI-FITS file\n\nFirst, load OI-FITS data from a file:\n\n```c\nws = oifits_load(filename);\n```\n\nwhere `ws` is the *handle* to manipulate the contents of the OI-FITS file and\n`filename` is the name of the OI-FITS file.\n\nOI-FITS data is stored in a collection of FITS header data units (HDU).  This\nstructure is reproduced by the plugin where a data-block correspond to a FITS\nHDU.  In order to access the OI-FITS contents, you have to select a specific\ndata-block.  For instance, you can loop over all the data-blocks of the handle\n`ws` with:\n\n```c\nfor (db = oifits_first(ws); db; db = oifits_next(ws, db)) {\n    ...;\n}\n```\n\nwhere `db` is another kind of handle but to a specific data-block this time.\n\nIn the loop, the function `oifits_is_data` can be used to check whether a given\ndata-block contains interferometric data (true for `OI_VIS`, `OI_VIS2` and\n`OI_T3` data-blocks).\n\nThere are many functions to access the contents of a given data-block.  Again,\nthe OI-FITS structure of a HDU is reproduced and the general syntax to query a\nspecific field is:\n\n```c\noifits_get_FIELDNAME(ws, db);\n```\n\nwhere `FIELDNAME` is the name of the OI-FITS field which is the same as the\ncorresponding FITS keyword or column in lowercase letters and with non\nalphanumerical characters replaced by an underscore `_`.  For instance, to\nquery the effective wavelength, just do:\n\n```c\noifits_get_eff_wave(ws, db);\n```\n\nwhere `db` is an `OI_WAVELENGTH`, `OI_VIS`, `OI_VIS2` or `OI_T3` data-block of\nOI-FITS instance `ws`.  The reasons that you have to provide both `ws` and `db`\nare that some information (as the effective wavelength) of the data-block `db`\nmay be stored in an other data-block of the same OI-FITS instance `ws` and\nYorick does not allow circular references.\n\nThe following is applicable to all data-blocks:\n* `oifits_get_revn`: get revision number of the table definition\n\nTo query the fields of `OI_VIS`, `OI_VIS2` or `OI_T3` data-blocks:\n* `oifits_get_date_obs`: get UTC start date of observations\n* `oifits_get_time`: get UTC time of observation (s)\n* `oifits_get_mjd`: get Modified Julian Date\n* `oifits_get_int_time`: get integration time (s)\n* `oifits_get_sta_index`: get station numbers contributing to the data\n* `oifits_get_flag`: get flags\n* `oifits_get_visamp`: get visibility amplitude\n* `oifits_get_visamperr`: get error in visibility amplitude\n* `oifits_get_visphi`: get visibility phase (deg)\n* `oifits_get_visphierr`: get error in visibility phase (deg)\n* `oifits_get_vis2data`: get squared visibility\n* `oifits_get_vis2err`: get error in squared visibility\n* `oifits_get_t3amp`: get triple-product amplitude\n* `oifits_get_t3amperr`: get error in triple product amplitude\n* `oifits_get_t3phi`: get triple-product phase (deg)\n* `oifits_get_t3phierr`: get error in triple product phase (deg)\n* `oifits_get_ucoord`: get u coordinate of the data (m)\n* `oifits_get_vcoord`: get v coordinate of the data (m)\n* `oifits_get_u1coord`: get u coordinate of baseline AB of the triangle (m)\n* `oifits_get_v1coord`: get v coordinate of baseline AB of the triangle (m)\n* `oifits_get_u2coord`: get u coordinate of baseline BC of the triangle (m)\n* `oifits_get_v2coord`: get v coordinate of baseline BC of the triangle (m)\n\nTo query fields of `OI_ARRAY` data block:\n* `oifits_get_arrname`: get identifier of corresponding OI_ARRAY\n* `oifits_get_frame`: get coordinate frame\n* `oifits_get_arrayx`: get X coordinate of array center (m)\n* `oifits_get_arrayy`: get Y coordinate of array center (m)\n* `oifits_get_arrayz`: get Z coordinate of array center (m)\n* `oifits_get_tel_name`: get telescope name\n* `oifits_get_sta_name`: get station name\n* `oifits_get_sta_index`: get station number\n* `oifits_get_diameter`: get element diameter (m)\n* `oifits_get_staxyz`: get station coordinate relative to array center (m)\n\nTo query fields of `OI_TARGET` data block:\n* `oifits_get_target_id`: get index number of target(s)\n* `oifits_get_target`: get target names(s)\n* `oifits_get_raep0`: get R.A. at mean equinox (deg)\n* `oifits_get_decep0`: get decl. at mean equinox (deg)\n* `oifits_get_equinox`: get equinox\n* `oifits_get_ra_err`: get error in R.A. at mean equinox (deg)\n* `oifits_get_dec_err`: get error in decl. at mean equinox (deg)\n* `oifits_get_sysvel`: get Systemic radial velocity (m/s)\n* `oifits_get_veltyp`: get reference for radial velocity (\"LSR\", \"GEOCENTR\",\n  etc.)\n* `oifits_get_veldef`: get definition of radial velocity (\"OPTICAL\", \"RADIO\")\n* `oifits_get_pmra`: get proper motion in R.A. (deg/yr)\n* `oifits_get_pmdec`: get proper motion in decl. (deg/yr)\n* `oifits_get_pmra_err`: get error of proper motion in R.A. (deg/yr)\n* `oifits_get_pmdec_err`: get error of proper motion in decl. (deg/yr)\n* `oifits_get_parallax`: get parallax (deg)\n* `oifits_get_para_err`: get error in parallax (deg)\n* `oifits_get_spectyp`: get spectral type\n\nTo query fields of `OI_WAVELENGTH` data block:\n* `oifits_get_insname`: get identifier of corresponding OI_WAVELENGTH\n* `oifits_get_eff_wave`: get effective wavelength of channel (m)\n* `oifits_get_eff_band`: get effective bandpass of channel (m)\n\n\n### Creating a new OI-FITS file\n\nIn order to create a new OI-FITS file, you first create a new OI-FITS handle in\nYorick, then you populate it with data-blocks and, finally, you save it to the\ndisk.\n\nTo create a new OI-FITS instance:\n\n```c\nws = oifits_new();\n```\n\nTo add data-blocks:\n\n```c\noifits_insert, ws, db1, db2, ...;\n```\n\nwhere `db1`, `db2`, *etc.* are OI-FITS data-blocks which have been freshly\ncreated (see below) or which are borrowed from another OI-FITS instance.\n\nTo create a new data-block, the general syntax is:\n\n```c\ndb = oifits_new_DBTYPE(key1=val1, key2=val2, ...);\n```\n\nwhere `DBTYPE` is the data-block type (`target`, `array`, `wavelength`,\n`spectrum`, `vis`, `vis2` or `t3`) and all fields of the data-block are passed\nby keyword.  Note that all fields must be specified.  See the individual\ndocumentation of the data-block constructors to figure out which fields are\nrequired.  For instance:\n\n```c\nhelp, oifits_new_vis2;\n```\n\nOptionally, the OI-FITS instance to which insert the new data-block can be\nspecified in a data-block constructor:\n\n```c\noifits_new_DBTYPE, ws, key1=val1, key2=val2, ...;\n```\n\nis the same as:\n\n```c\noifits_insert, ws, oifits_new_DBTYPE(key1=val1, key2=val2, ...);\n```\n\nThere may be any number of data-blocks in an OI-FITS instance and they may be\ninserted at any time and in any order.  After inserting the data-blocks, it is\nnecessary to make sure that the internals of the OI-FITS instance are consistent\n(otherwise some functionalities may not work as expected).  Updating internal\ninformation is done by:\n\n```c\noifits_update, ws;\n```\n\nSaving an OI-FITS instance to a file is as simple as:\n\n```c\noifits_save, ws, filename;\n```\n\nwhere `filename` is the name of the OI-FITS file.  The `oifits_save` subroutine\nhas a number of keywords to add comments, history records or to allow\noverwritting an existing file (which is forbidden by default).\n\n\n### Simulated Data\n\nIf the contents of an OI-FITS data-block correspond to model data, you may\nsimulate additive noise with:\n\n```c\nout = oifits_add_noise(ws, method, level);\n```\n\nwhich has the effect of adding noise to all `OI_VIS`, `OI_VIS2` or `OI_T3`\ndata-blocks of the OI-FITS instance `ws` and returns a new OI-FITS instance.\nThe other arguments are as follows:\n\n* `method = 1` or `\"generate\"` to add noise to noiseless data; the standard\n  deviation of the noise is taken from the contents of `ws`; in this case,\n  the `level` argument must be undefined or omitted.\n\n* `method = 2` or `\"snr\"` to add noise to noiseless data; the standard\n  deviation of noise is computed to achieve a signal-to-noise ratio equal to\n  the value of `level`.\n\n* `method = 3` or `\"amplify\"` to add noise to noisy data so that the standard\n  deviation of total noise (existing one plus added one) is multiplied by the\n  value of `level` which must be greater or equal one.  The standard deviation\n  of the noise prior to the amplification is taken from the contents of `ws`.\n\nThe operation can also be carried out *in-place* by calling `oifits_add_noise`\nas a subroutine:\n\n```c\noifits_add_noise, ws, method, level;\n```\n\n\n## Installation\n\n### Installation with EasyYorick\n\nInstallation of YOIFITS by [EasyYorick](https://github.com/emmt/EasyYorick) is\nfully supported.  Assuming you have installed EasyYorick, you just have to\nexecute:\n\n```sh\nypkg install yorick yeti yoifits\n```\n\nwhich should install Yorick, Yeti (if not yet installed) and YOIFITS.\n\nTo upgrade to the last master version:\n\n```sh\nypkg upgrade yoifits\n```\n\n\n### Manual installation\n\n1. You must have [Yorick](http://github.com/LLNL/yorick/) and\n   [Yeti](https://github.com/emmt/Yeti) installed on your machine.\n\n2. Unpack the [software code](https://github.com/emmt/YOIFITS/archive/master.zip)\n   somewhere or clone the Git repository:\n\n   ```sh\n   git clone https://github.com/emmt/YOIFITS.git yoifits\n   ```\n\n   if you want/prefer to use HTTPS, or:\n\n   ```sh\n   git clone git@github.com:emmt/YOIFITS.git yoifits\n   ```\n\n   if you want/prefer to use SSH.  Any of these commands creates a local GIT\n   repository named `yoifits`.\n\n\n3. Configure for compilation.  There are two possibilities (the first one is\n   recommended):\n\n   - For an **out-of-place build**, create a dedicated build directory, say\n     `$BUILD_DIR`, go to the build directory and run the configuration script:\n\n     ```sh\n     mkdir -p $BUILD_DIR\n     cd $BUILD_DIR\n     $SRC_DIR/configure\n     ```\n\n     where `$SRC_DIR` is the path to the source directory of the plug-in code.\n     To see the configuration options, type:\n\n     ```sh\n     $SRC_DIR/configure --help\n     ```\n\n   - For an **in-place build**, go to the source directory, say `$SRC_DIR`, of\n     the plug-in code and run the configuration script:\n\n     ```sh\n     cd $SRC_DIR\n     ./configure\n     ```\n\n     To see the configuration options, type:\n\n     ```sh\n     ./configure --help\n     ```\n\n4. Compile the code:\n\n   ```sh\n   make clean\n   make\n   ```\n\n5. Install YOIFITS (you must have write access granted to Yorick directories):\n\n   ```sh\n   make install\n   ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmt%2Fyoifits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmt%2Fyoifits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmt%2Fyoifits/lists"}